Commit 0c655a17 authored by liwei's avatar liwei

修改了一键确认bug以及loadingbug

parent 9841c5c0
...@@ -370,19 +370,6 @@ export default { ...@@ -370,19 +370,6 @@ export default {
const values = rowData.dictValue.split(',') const values = rowData.dictValue.split(',')
const remarksValues = rowData.remarks.split(',') const remarksValues = rowData.remarks.split(',')
this.fixedColumnCount = values.length this.fixedColumnCount = values.length
// 往table表格里放值,但排除row1表头
if (rowData.dictLabel !== 'row1') {
const result = {}
for (let j = 0; j < values.length; j++) {
result[j] = values[j]
}
this.tableData.push(result)
const remarks = {}
for (let j = 0; j < remarksValues.length; j++) {
remarks[j] = remarksValues[j]
}
this.tableRemarks.push(remarks)
}
if (rowData.dictLabel === 'row1') { if (rowData.dictLabel === 'row1') {
// 获取表头数据 循环values // 获取表头数据 循环values
for (let i = 0; i < values.length; i++) { for (let i = 0; i < values.length; i++) {
...@@ -394,6 +381,45 @@ export default { ...@@ -394,6 +381,45 @@ export default {
} }
this.tableHeaderLength = this.tableHeader.length this.tableHeaderLength = this.tableHeader.length
} }
// 往table表格里放值,但排除row1表头
if (rowData.dictLabel !== 'row1') {
const result = {}
for (let j = 0; j < this.tableHeader.length; j++) {
// i !== templateData.length - 1 代表着不是最后一行
if (i !== templateData.length - 1) {
// 处理固定列之外的列值 赋成空字符串
if (j < values.length) {
result[j] = values[j]
} else {
result[j] = ''
}
} else {
// 最后一行需要单独给固定列的后一个赋值
if (j < values.length) {
result[j] = values[j]
} else {
result[this.fixedColumnCount] = ''
}
}
}
this.tableData.push(result)
// 重新排序
this.tableData = this.tableData.map(row => {
// 获取对象的键,并按升序排序
const sortedKeys = Object.keys(row).map(Number).sort((a, b) => a - b)
// 创建一个新对象,重新映射键
const newRow = {}
sortedKeys.forEach((key, index) => {
newRow[index] = row[key] // 从 0 开始映射
})
return newRow
})
const remarks = {}
for (let j = 0; j < remarksValues.length; j++) {
remarks[j] = remarksValues[j]
}
this.tableRemarks.push(remarks)
}
} }
this.loading = false this.loading = false
} else { } else {
......
...@@ -709,12 +709,6 @@ export default { ...@@ -709,12 +709,6 @@ export default {
this.updateFlag = false this.updateFlag = false
// 将一键确认标志改为false // 将一键确认标志改为false
this.oneKeyFlag = false this.oneKeyFlag = false
// 生成的是每一行的结果列是否需要验证 false为不需要验证 true为需要验证
const result = {}
for (let i = 0; i < this.tableData1.length; i++) {
result[i] = true
}
this.verifyResultFlag = result
this.ocr() this.ocr()
}, },
cancel() { cancel() {
...@@ -757,9 +751,17 @@ export default { ...@@ -757,9 +751,17 @@ export default {
chStype: this.form.chStype chStype: this.form.chStype
} }
getOcrData(params).then(res => { getOcrData(params).then(res => {
// 生成的是每一行的结果列是否需要验证 false为不需要验证 true为需要验证
const result = {}
for (let i = 0; i < this.tableData1.length; i++) {
result[i] = true
}
this.verifyResultFlag = result
this.ocrArray = res.data.resultList this.ocrArray = res.data.resultList
this.lot = res.data.lot this.lot = res.data.lot
this.dialogLoading = false this.dialogLoading = false
}).catch(() => {
this.dialogLoading = false
}) })
}, },
// 选择主类型模版 // 选择主类型模版
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment