|
|
@ -20,7 +20,7 @@ |
|
|
|
<span>清空</span> |
|
|
|
</el-button> |
|
|
|
<div class="inputClass uploadClass"> |
|
|
|
<el-upload :show-file-list="false" v-model="fileOriData" :before-upload="beforeAvatarUpload" |
|
|
|
<el-upload multiple :show-file-list="false" v-model="fileOriData" :before-upload="beforeAvatarUpload" |
|
|
|
:http-request="successSubmit" accept=".png, .jpg ,jpeg"> |
|
|
|
<el-button type="success"> |
|
|
|
<el-icon> |
|
|
@ -101,7 +101,8 @@ export default { |
|
|
|
formHeader: [], |
|
|
|
formData: {} |
|
|
|
}, |
|
|
|
fileOriData: [] |
|
|
|
fileOriData: [], |
|
|
|
displayedMessages: [],//消息提示句柄 |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
@ -120,16 +121,28 @@ export default { |
|
|
|
} |
|
|
|
return true |
|
|
|
}, |
|
|
|
//表格增加数据 |
|
|
|
//识别图片后续处理 |
|
|
|
async successSubmit(opts) { |
|
|
|
if (!this.displayedMessages.includes("识别中...")) { |
|
|
|
this.displayedMessages.push("识别中...") |
|
|
|
ElMessage.info({ |
|
|
|
message: '识别中...', |
|
|
|
duration: 0 |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.displayedMessages.push("识别中...") |
|
|
|
} |
|
|
|
let that = this |
|
|
|
let file = opts.file |
|
|
|
this.fileDealData = [] |
|
|
|
let fileReader = new FileReader() |
|
|
|
fileReader.onload = async function () { |
|
|
|
let base64Data = fileReader.result; |
|
|
|
window.electron.ipcRenderer.send('ocrIdentify', { base64Str: base64Data }) |
|
|
|
console.log(9999, base64Data) |
|
|
|
let params = { |
|
|
|
base64Str: base64Data, |
|
|
|
ocrType: "complex",//识别类型:complex_复杂模型比较慢,simple_简单模型识别速度更快 |
|
|
|
} |
|
|
|
window.electron.ipcRenderer.send('ocrIdentify', params) |
|
|
|
} |
|
|
|
fileReader.onerror = function (error) { |
|
|
|
console.error('Error reading file:', error) |
|
|
@ -141,11 +154,16 @@ export default { |
|
|
|
let that = this |
|
|
|
window.electron.ipcRenderer.on('ocrResult', (eve, res) => { |
|
|
|
console.log(97111, res) |
|
|
|
if (that.displayedMessages.includes("识别中...")) { |
|
|
|
that.displayedMessages.splice(that.displayedMessages.indexOf("识别中..."), 1) |
|
|
|
} else { |
|
|
|
ElMessage.closeAll() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
//更新数据 |
|
|
|
async updateSeach(params = {}) { |
|
|
|
console.log(777, params) |
|
|
|
// console.log(777, params) |
|
|
|
}, |
|
|
|
//搜索数据 |
|
|
|
async searchData() { |
|
|
|