提交 6b8010dd authored 作者: zs's avatar zs

区分批量同步与单独同步

上级 7e20ba05
...@@ -102,6 +102,7 @@ export default { ...@@ -102,6 +102,7 @@ export default {
'_documents', '_documents',
'_documents/data', '_documents/data',
'_documents/data/asmzx', '_documents/data/asmzx',
'_documents/data/photos',
'_documents/data/asmzx/pad' '_documents/data/asmzx/pad'
]; ];
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</template> </template>
<script> <script>
import { import {
SYNCHRONIZE_DATA_PAD, SYNCHRONIZE_DATA_PAD,
checkAndCreateDirectory, checkAndCreateDirectory,
createFileWithPlusIO, createFileWithPlusIO,
...@@ -46,24 +46,32 @@ import { ...@@ -46,24 +46,32 @@ import {
USER_FILE_NAME, USER_FILE_NAME,
getUserList, getUserList,
zipCompress, zipCompress,
} from "@/utils/systemCofig"; } from "@/utils/systemCofig";
import { findPhotosUrls } from "@/utils/index.js"; import {
import { copySelectedFiles } from "@/utils/plus.js"; findPhotosUrls
} from "@/utils/index.js";
import { import {
copySelectedFiles
} from "@/utils/plus.js";
import {
writeInspectionData, writeInspectionData,
copyDirectory, copyDirectory,
deleteAllFilesInDirectory, deleteAllFilesInDirectory,
addLog, addLog,
getLogContent, getLogContent,
LOG_TYPE_ENUM, LOG_TYPE_ENUM,
} from "@/utils/IoReadingAndWriting.js"; } from "@/utils/IoReadingAndWriting.js";
import moment from "moment"; import moment from "moment";
import { getAllInspections } from "@/request/index.js"; import {
import { Base64 } from "js-base64"; getAllInspections
import inspectApi from "@/api/inspect"; } from "@/request/index.js";
import inspect from "@/api/inspect"; import {
export default { Base64
} from "js-base64";
import inspectApi from "@/api/inspect";
import inspect from "@/api/inspect";
export default {
props: { props: {
list: { list: {
type: Array, type: Array,
...@@ -185,10 +193,13 @@ export default { ...@@ -185,10 +193,13 @@ export default {
return item; return item;
}); // 井道数据类型是 2 }); // 井道数据类型是 2
console.log(5151, JFXJ_DATA, JDXJ_DATA); console.log(5151, JFXJ_DATA, JDXJ_DATA);
const batchData = [...JFXJ_DATA, ...JDXJ_DATA]
this.loading = true; this.loading = true;
const tmepList = []; const tmepList = [];
if (notSynchronizationList.length > 1) {
let JFXJ_DATA_FILE_NAME = `${userName}_XJ_${timeStr}.txt`;
tmepList.push(this.packedData(batchData, JFXJ_DATA_FILE_NAME));
} else {
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(JFXJ_DATA, JFXJ_DATA_FILE_NAME));
...@@ -198,6 +209,8 @@ export default { ...@@ -198,6 +209,8 @@ export default {
let JDXJ_DATA_FILE_NAME = `${userName}_JDXJ_${timeStr}.txt`; let JDXJ_DATA_FILE_NAME = `${userName}_JDXJ_${timeStr}.txt`;
tmepList.push(this.packedData(JDXJ_DATA, JDXJ_DATA_FILE_NAME)); tmepList.push(this.packedData(JDXJ_DATA, JDXJ_DATA_FILE_NAME));
} }
}
console.log("同步窗口"); console.log("同步窗口");
console.log("同步窗口", tmepList); console.log("同步窗口", tmepList);
...@@ -221,7 +234,7 @@ export default { ...@@ -221,7 +234,7 @@ export default {
userData[item.createByName] = [item]; userData[item.createByName] = [item];
} }
}); });
this.$store.commit("SET_ALL_DATA", allList); // this.$store.commit("SET_ALL_DATA", allList);
const keys = Object.keys(userData); const keys = Object.keys(userData);
const promiseArr = keys.map((key) => { const promiseArr = keys.map((key) => {
...@@ -242,7 +255,7 @@ export default { ...@@ -242,7 +255,7 @@ export default {
await this.copyPhotos(); await this.copyPhotos();
zipCompress( zipCompress(
`${SYNCHRONIZE_DATA_PAD}/发送数据`, `${SYNCHRONIZE_DATA_PAD}/发送数据`,
`${SYNCHRONIZE_DATA_PAD}/fssj/${userName}_JFXJ_${timeStr}.zip` `${SYNCHRONIZE_DATA_PAD}/fssj/${userName}_XJ_${timeStr}.zip`
); );
// zip // zip
await inspectApi.updateSyncData(ids); await inspectApi.updateSyncData(ids);
...@@ -338,10 +351,10 @@ export default { ...@@ -338,10 +351,10 @@ export default {
}); });
}, },
}, },
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.synchronous-dialog { .synchronous-dialog {
position: fixed; position: fixed;
z-index: 999; z-index: 999;
top: 0; top: 0;
...@@ -358,13 +371,11 @@ export default { ...@@ -358,13 +371,11 @@ export default {
width: 400px; width: 400px;
height: 60%; height: 60%;
box-sizing: border-box; box-sizing: border-box;
background-image: linear-gradient( background-image: linear-gradient(-6deg,
-6deg,
#f9ffe7 0%, #f9ffe7 0%,
#ffffff 12%, #ffffff 12%,
#fcfeff 73%, #fcfeff 73%,
#ccf1ff 100% #ccf1ff 100%);
);
border: 0.4px solid rgba(224, 224, 224, 1); border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 12px; border-radius: 12px;
position: relative; position: relative;
...@@ -449,5 +460,5 @@ export default { ...@@ -449,5 +460,5 @@ export default {
} }
} }
} }
} }
</style> </style>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论