123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- // #ifdef APP-ANDROID
- import {selectTableData, insertTableData, updateTableData, selectJoinTableData, selectRecordData} from '@/utils/sqlite'
- // #endif
- export type Download = {
- pdid : number,
- workorder : string,
- invname : string,
- productno : string,
- graphid : string,
- cardno : string,
- processno : string,
- ver : string,
- updatetime : string,
- progress : string,
- status : number
- }
- export type Record = {
- sxid : number,
- senum : number,
- photoitem : string,
- productno : string,
- part : string,
- descb : string,
- date : string,
- partno : string,
- num : number,
- status : number,
- urlspl : string
- imgname : string[],
- urlpdt : string[]
- }
- export type TaskProcess = {
- id : number
- name : string
- num : number
- step : number
- status : number
- }
-
- export type JoinRecord = {
- sxid : number,
- senum : number,
- photoitem : string,
- productno : string,
- part : string,
- descb : string,
- date : string,
- partno : string,
- num : number,
- status : string,
- urlspl : string
- imgname : string,
- urlpdt : string
- workorder: string
- invname: string
- }
- export type RecordCalculate = {
- photoitem: string,
- pid: number,
- step: number,
- total: number,
- status: number
- }
- export function offlineData(data:UTSJSONObject):Promise<UTSJSONObject> {
- return new Promise((resolve, reject) => {
- let result = JSON.parseObject(JSON.stringify(data)) as UTSJSONObject
- resolve(result)
- });
- }
- export const statusDict = {'1':'未执行','2':'执行中','3':'已执行','4':'执行错误','5':'已取消'}
- export const recordStatusDict = {'1':'未拍照','2':'拍照中','3':'拍照完成','4':'检验不清晰','5':'拍照取消'}
- export async function getList(tableName:string, condition?:string|null, value?:string|null,condition2?:string|null, value2?:string|null, initData?:UTSJSONObject|null):Promise<UTSJSONObject> {
-
- // #ifdef APP-ANDROID
- const result = await selectTableData(tableName, condition, value, condition2, value2);
- console.log(result);
- return result;
- // #endif
-
- // #ifdef H5
- return offlineData(initData)
- // #endif
- }
- export async function getJoinList(dbTable:string, joinTable:string, labels:string, joinCondition:string, lname?:string, lvalue?:string, others?:string):Promise<UTSJSONObject> {
-
- // #ifdef APP-ANDROID
- const result = await selectJoinTableData(dbTable, joinTable, labels, joinCondition, lname, lvalue, others);
- console.log(result);
- return result;
- // #endif
- }
- export async function updateData(tableName: string, data: string, lname?: string, lvalue?: string):Promise<UTSJSONObject>{
- // #ifdef APP-ANDROID
- const result = await updateTableData(tableName, data, lname, lvalue);
- console.log(result);
- return result;
- // #endif
- }
- export async function getRecordCalculate(tableName: string, value?:string|null, initData?:UTSJSONObject|null):Promise<UTSJSONObject> {
-
- // #ifdef APP-ANDROID
- const result = await selectRecordData(tableName, value);
- console.log(result);
- return result;
- // #endif
-
- // #ifdef H5
- return offlineData(initData)
- // #endif
- }
|