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

fix

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