work.uts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // #ifdef APP-ANDROID
  2. import {selectTableData, insertTableData} from '@/utils/sqlite'
  3. // #endif
  4. export type Download = {
  5. pdid : number,
  6. workorder : string,
  7. invname : string,
  8. productno : string,
  9. graphid : string,
  10. cardno : string,
  11. processno : string,
  12. ver : string,
  13. updatetime : string,
  14. progress : string,
  15. status : number
  16. }
  17. export type Record = {
  18. sxid : number,
  19. senum : number,
  20. photoitem : string,
  21. productno : string,
  22. part : string,
  23. descb : string,
  24. date : string,
  25. partno : string,
  26. num : number,
  27. status : string,
  28. urlspl : string
  29. imgname : string[],
  30. urlpdt : string[]
  31. }
  32. export type TaskProcess = {
  33. id : number
  34. name : string
  35. num : number
  36. step : number
  37. status : number
  38. }
  39. export function offlineData(data:UTSJSONObject):Promise<UTSJSONObject> {
  40. return new Promise((resolve, reject) => {
  41. let result = JSON.parseObject(JSON.stringify(data)) as UTSJSONObject
  42. resolve(result)
  43. });
  44. }
  45. export async function getList(tableName:string, condition?:string|null, value?:string|null, initData?:UTSJSONObject|null):Promise<UTSJSONObject> {
  46. // #ifdef APP-ANDROID
  47. const result = await selectTableData(tableName, condition, value, null, null);
  48. console.log(result);
  49. return result;
  50. // #endif
  51. // #ifdef H5
  52. return offlineData(initData)
  53. // #endif
  54. }
  55. /*
  56. export const onload=():Promise<UTSJSONObject>=> {
  57. return new Promise((resolve, reject) => {
  58. getInfo().then((res:UTSJSONObject) => {
  59. })
  60. })
  61. } */