提交 d8641917 authored 作者: JaxBBLL's avatar JaxBBLL

fix

上级 6909d900
......@@ -113,18 +113,16 @@ export default {
* 读取上一次打包的文件, 复制到 [ history ] 文件夹中
*/
clickHandle() {
if(this.loading) return;
if (this.loading) return;
const directoryPath = `${SYNCHRONIZE_DATA_PAD}/发送数据`;
const targetDirectoryPath = `${SYNCHRONIZE_DATA_PAD}/history`;
checkAndCreateDirectory(directoryPath).then(() => {
copyDirectory(directoryPath, targetDirectoryPath)
.then(() => {
return deleteAllFilesInDirectory(directoryPath);
})
.then(() => {
this.coverData();
})
.catch((error) => {
......@@ -142,7 +140,6 @@ export default {
const notSynchronizationList = this.notSynchronizationList;
const allList = this.allList;
let timeStr = moment().format("yyyy_MM_DD_hh_mm_ss");
const JFXJ_DATA = notSynchronizationList
......@@ -160,19 +157,17 @@ export default {
return item[item.inspectionCode];
}); // 井道数据类型是 2
this.loading = true;
const tmepList = [];
if (JFXJ_DATA.length) {
let JFXJ_DATA_FILE_NAME = `${userName}_JFXJ_${timeStr}.txt`;
tmepList.push(this.packedData(JFXJ_DATA, JFXJ_DATA_FILE_NAME));
tmepList.push(this.packedData(JDXJ_DATA, JFXJ_DATA_FILE_NAME));
}
if (JDXJ_DATA.length) {
let JDXJ_DATA_FILE_NAME = `${userName}_JDXJ_${timeStr}.txt`;
tmepList.push(this.packedData(JDXJ_DATA, JDXJ_DATA_FILE_NAME));
}
JDXJ_DATA.forEach((item, index) => {
let JDXJ_DATA_FILE_NAME = `${userName}_JDXJ_${timeStr}_${index}.txt`;
tmepList.push(this.packedData(item, JDXJ_DATA_FILE_NAME));
});
Promise.all(tmepList)
.then(() => {
......@@ -223,8 +218,7 @@ export default {
const log_list = this.$store.state.log_list;
log_list.push(logContent);
this.$store.commit("SET_LOG_LIST", log_list);
addLog(log_list).then((res) => {
});
addLog(log_list).then((res) => {});
// 更新同步时间
this.updateSysTime();
......@@ -290,12 +284,13 @@ export default {
console.log("APP.vue 存储数据失败", error);
},
});
createFileWithPlusIO(SYNCHRONIZE_DATA_PAD, USER_FILE_NAME, fileContent).then(() => {
console.log("---用户数据更新成功")
}).catch(error => {
console.log("---用户数据更新失败", error)
})
createFileWithPlusIO(SYNCHRONIZE_DATA_PAD, USER_FILE_NAME, fileContent)
.then(() => {
console.log("---用户数据更新成功");
})
.catch((error) => {
console.log("---用户数据更新失败", error);
});
});
},
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论