|
@@ -1,5 +1,8 @@
|
|
|
<template>
|
|
|
- <div class="image-check part-box">
|
|
|
+ <div
|
|
|
+ class="image-check paper-export part-box"
|
|
|
+ style="border-radius:0;height:100vh;"
|
|
|
+ >
|
|
|
<div class="part-head">
|
|
|
<h2>图片检查</h2>
|
|
|
</div>
|
|
@@ -93,18 +96,21 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
seleteInputpath() {
|
|
|
- remote.dialog.showOpenDialog(
|
|
|
- {
|
|
|
- title: "选择文件",
|
|
|
- filters: [{ name: "excel", extensions: ["xls", "xlsx"] }],
|
|
|
- properties: ["openFile"]
|
|
|
- },
|
|
|
- folderPaths => {
|
|
|
- if (folderPaths && folderPaths[0]) {
|
|
|
- this.inputFile = folderPaths[0];
|
|
|
+ remote.dialog
|
|
|
+ .showOpenDialog(
|
|
|
+ {
|
|
|
+ title: "选择文件",
|
|
|
+ filters: [{ name: "excel", extensions: ["xls", "xlsx"] }],
|
|
|
+ properties: ["openFile"]
|
|
|
+ },
|
|
|
+ folderPaths => {}
|
|
|
+ )
|
|
|
+ .then(({ canceled, filePaths }) => {
|
|
|
+ if (canceled) return;
|
|
|
+ if (filePaths && filePaths[0]) {
|
|
|
+ this.inputFile = filePaths[0];
|
|
|
}
|
|
|
- }
|
|
|
- );
|
|
|
+ });
|
|
|
},
|
|
|
confirm() {
|
|
|
if (!fs.existsSync(this.inputFile)) {
|
|
@@ -125,7 +131,7 @@ export default {
|
|
|
this.tasks = validColumns.map(item => {
|
|
|
return {
|
|
|
url: item[0],
|
|
|
- oldval: item[1],
|
|
|
+ oldval: item[1] + "",
|
|
|
newVal: ""
|
|
|
};
|
|
|
});
|
|
@@ -138,12 +144,14 @@ export default {
|
|
|
try {
|
|
|
await this.runTask();
|
|
|
} catch (error) {
|
|
|
- this.taskRunning = false;
|
|
|
+ console.dir(error);
|
|
|
this.$Notice.error({
|
|
|
title: "错误提示",
|
|
|
desc: "任务执行失败,请重新尝试!",
|
|
|
duration: 5
|
|
|
});
|
|
|
+ } finally {
|
|
|
+ this.taskRunning = false;
|
|
|
}
|
|
|
},
|
|
|
async runTask() {
|
|
@@ -152,9 +160,9 @@ export default {
|
|
|
|
|
|
for (let i = 0, len = this.tasks.length; i < len; i++) {
|
|
|
const task = this.tasks[i];
|
|
|
- const newVal = await decodeImageCode(this.task.url, codeArea).catch(
|
|
|
+ const newVal = await decodeImageCode(task.url, codeArea).catch(
|
|
|
error => {
|
|
|
- const content = `图像:${this.task.url},解析错误,错误信息:${error}`;
|
|
|
+ const content = `图像:${task.url},解析错误,错误信息:${error}`;
|
|
|
this.$Notice.error({
|
|
|
title: "错误提示",
|
|
|
desc: content,
|