提交 d191c3fa authored 作者: zs's avatar zs

edit

上级 0892dbfe
...@@ -45,7 +45,7 @@ export default { ...@@ -45,7 +45,7 @@ export default {
,inspectionTime ,inspectionTime
,isException ,isException
,synFlag ,synFlag
,createTime,delFlag ,createTime,delFlag,inspectionData
FROM ${table.inspectionRecordName} FROM ${table.inspectionRecordName}
where 1=1 where 1=1
${data.inspectionType ? `AND inspectionType = '${data.inspectionType}'` : ''} ${data.inspectionType ? `AND inspectionType = '${data.inspectionType}'` : ''}
......
...@@ -13,7 +13,7 @@ export default { ...@@ -13,7 +13,7 @@ export default {
// app初始化 // app初始化
async init() { async init() {
const BASE_PATH = "_documents/data/asmzx/pad"; // 基础路径
// uni.showLoading({ // uni.showLoading({
// title: '正在初始化...', // title: '正在初始化...',
// }) // })
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
await this.initSqlLite(sqllitedb); // 确保表被创建 await this.initSqlLite(sqllitedb); // 确保表被创建
console.log('Tables created.'); console.log('Tables created.');
await ioUtil.createDir(BASE_PATH, '发送数据')
let isInit = await SqlliteDbUtil.checkIfDataImported(sqllitedb); // 确保表存在后再查询 let isInit = await SqlliteDbUtil.checkIfDataImported(sqllitedb); // 确保表存在后再查询
console.log('Data imported:', isInit); console.log('Data imported:', isInit);
if (!isInit) { if (!isInit) {
...@@ -94,20 +94,14 @@ export default { ...@@ -94,20 +94,14 @@ export default {
// 初始化目录 // 初始化目录
async initDir() { async initDir() {
try { try {
const _www = _Path.getPrivateWWW() const downloadEntry = await ioUtil.getFileEntry()
const _doc = _Path.getPrivateDOC()
const _download = _Path.getDownloads()
const _temp = _Path.getTempPath()
const wwwEntry = await ioUtil.getFileEntry(_www)
const docEntry = await ioUtil.getFileEntry(_doc)
const downloadEntry = await ioUtil.getFileEntry(_download)
if (downloadEntry) { if (downloadEntry) {
await ioUtil.createDir(downloadEntry.fullPath, 'base') await ioUtil.createDir(BASE_PATH, 'base')
await ioUtil.createDir(downloadEntry.fullPath, 'export') await ioUtil.createDir(BASE_PATH, 'export')
await ioUtil.createDir(downloadEntry.fullPath, 'import') await ioUtil.createDir(BASE_PATH, 'import')
await ioUtil.createDir(downloadEntry.fullPath, 'doc') await ioUtil.createDir(BASE_PATH, 'doc')
await ioUtil.createDir(downloadEntry.fullPath, 'error') await ioUtil.createDir(BASE_PATH, 'error')
} }
// 获取设备名称 // 获取设备名称
...@@ -118,7 +112,7 @@ export default { ...@@ -118,7 +112,7 @@ export default {
brand: e.deviceBrand, brand: e.deviceBrand,
deviceModel: e.deviceModel, deviceModel: e.deviceModel,
} }
const deviceFilePath = downloadEntry.fullPath + 'name.txt' const deviceFilePath = BASE_PATH + 'name.txt'
await ioUtil.removeExistFile(deviceFilePath) await ioUtil.removeExistFile(deviceFilePath)
await ioUtil.writeFile('name.txt', downloadEntry, JSON.stringify(deviceData)) await ioUtil.writeFile('name.txt', downloadEntry, JSON.stringify(deviceData))
}, },
......
...@@ -471,25 +471,17 @@ export function getUserList() { ...@@ -471,25 +471,17 @@ export function getUserList() {
}); });
} }
export function zipCompress(name) { export function zipCompress(sourceDir, zipPath) {
const BASE_PATH = "_documents/data"; return new Promise((resolve, reject) => {
const targetPath = plus.io.convertLocalFileSystemURL(BASE_PATH + '/photos'); plus.zip.compress(
const zipfile = plus.io.convertLocalFileSystemURL(BASE_PATH + `/${name}.zip`); plus.io.convertLocalFileSystemURL(sourceDir),
plus.zip.compress( plus.io.convertLocalFileSystemURL(zipPath),
targetPath, {
zipfile, { recursive: true,
recursive: true, overwrite: true,
overwrite: true },
}, () => resolve(zipPath),
function() { (error) => reject(`压缩失败: ${error.message}`)
plus.io.resolveLocalFileSystemURL(zipfile, function(zipEntry) { );
zipEntry.file(function(file) { });
console.log("ZIP 文件大小: " + file.size + " 字节");
});
});
},
function(error) {
alert("压缩失败: " + error.message);
}
);
} }
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论