ocr下载修改

This commit is contained in:
caoyang
2022-03-24 17:50:44 +08:00
parent bf33cfedf5
commit daf079fe0b
8 changed files with 100 additions and 32 deletions
+79 -15
View File
@@ -301,20 +301,84 @@
},
methods: {
handleChange(info) {
if (info.file.status !== 'uploading') {
// console.log(info.file, info.fileList)
}
if (info.file.status === 'done') {
console.log('info', info)
this.fileList = []
this.myfileList = info.fileList
this.formInline.attId = info.file.response.result.id
this.$message.success(`${info.file.name}上传成功`)
}else if (info.file.status === 'error') {
this.$message.error(`${info.file.name}上传失败`)
} else if (info.file.status === 'uploading') {
this.myfileList = info.fileList
// console.log(info.file, info.fileList)
let { file } = info;
const status = info.file.status;
info.fileList.forEach((val,index)=>{
if(val.response && !val.response.result){
this.$message.error(val.response.message);
info.fileList.splice(index,1)
}
})
if (this.fileTypeSatus) {
if (file.size > 100000000) {
this.$message.error(this.errorMessage)
return
}else {
if (status === 'error') {
// this.$emit('uploadSuccess', this.fileList)
this.$message.destroy()
this.$message.error(`${info.file.name} 文件上传失败。`);
} else if (status === 'removed') {
this.myfileList = info.fileList;
this.fileList = []
this.myfileList.forEach((res) => {
if (res.response) {
this.fileList.push(res.response.result)
} else {
this.fileList.push(res)
}
})
// console.log('remove',this.fileList)
// this.$emit('uploadSuccess', this.fileList)
this.$message.destroy()
this.$message.success(`${info.file.name} 删除成功。`);
} else if (status === 'done') {
this.fileList = []
this.myfileList = info.fileList;
// console.log('file3333',info.fileList)
if (info.fileList.length > 1) {
info.fileList.splice(1)
// this.myfileList = info.fileList;
this.myfileList.forEach((res) => {
if (res.response) {
this.fileList.push(res.response.result)
} else {
this.fileList.push(res)
}
})
// console.log('file1111',this.fileList)
// this.$emit('uploadSuccess', this.fileList)
this.$message.destroy()
this.$message.error('最多只能上传一个文件');
return
}
// console.log('my222',this.myfileList)
this.myfileList.forEach((res) => {
if (res.response) {
this.fileList.push(res.response.result)
// console.log('flist',res.response)
} else {
this.fileList.push(res)
}
})
if(this.myfileList.length > 0){
// this.$emit('uploadSuccess', this.fileList)
// console.log('fileList111',this.fileList)
this.formInline.attId=this.myfileList[0].response.result.id
this.$message.destroy()
this.$message.success(`${info.file.name} 文件上传成功。`);
}
} else if (status === 'uploading') {
this.myfileList = info.fileList;
// this.$emit('uploadSuccess')
// this.$message.success(`${info.file.name} 文件上传成功。`);
}
}
}else{
this.$message.warning('不支持上传该类型的文件!')
}
},
@@ -404,7 +468,7 @@
rule.push({
required: true,
message: res.db_field_txt + '不能为空',
trigger: 'blur'
trigger: 'change'
})
if (res.db_field_name == 'standNumber') {
rule.push(
+4 -4
View File
@@ -15,16 +15,16 @@
<span slot="operation" slot-scope="record">
<a class="text" v-for="(ol,index) in OperationList"
@click="OperationClick(ol,record)">
<span v-if="ol.text==$t('SyncLibrary')">
<span v-if="ol.text==$t('SyncLibrary')" v-has="'ocr:ocrRecord:syncToDocument'">
{{record.resultContent=='转换成功'&&record.syncState=='未同步'&&record.fileSource=='1'?ol.text:''}}
</span>
<span v-if="ol.text==$t('check')">
<span v-if="ol.text==$t('check')" v-has="''">
{{record.resultContent=='转换成功'&&record.syncState=='未同步'?ol.text:''}}
</span>
<span v-if="ol.text==$t('download')">
<span v-if="ol.text==$t('download')" v-has="'ocr:ocrRestful:downFile'">
{{record.resultContent=='转换成功'?ol.text:''}}
</span>
<span v-if="ol.text==$t('delete')">
<span v-if="ol.text==$t('delete')" v-has="'ocr:ocrRecord:delete'">
{{ol.text}}
</span>
</a>