work.uts 822 B

1234567891011121314151617181920212223242526272829303132
  1. // #ifdef APP-ANDROID
  2. import {selectTableData, insertTableData} from '@/utils/sqlite'
  3. // #endif
  4. export function offlineData(data:UTSJSONObject):Promise<UTSJSONObject> {
  5. return new Promise((resolve, reject) => {
  6. let result = JSON.parseObject(JSON.stringify(data)) as UTSJSONObject
  7. resolve(result)
  8. });
  9. }
  10. export async function getList(tableName:string, condition?:string|null, initData?:UTSJSONObject|null):Promise<UTSJSONObject> {
  11. // #ifdef APP-ANDROID
  12. const result = await selectTableData(tableName, null, null, null, null);
  13. console.log(result);
  14. return result;
  15. // #endif
  16. // #ifdef H5
  17. return offlineData(initData)
  18. // #endif
  19. }
  20. /*
  21. export const onload=():Promise<UTSJSONObject>=> {
  22. return new Promise((resolve, reject) => {
  23. getInfo().then((res:UTSJSONObject) => {
  24. })
  25. })
  26. } */