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: { methods: {
handleChange(info) { handleChange(info) {
if (info.file.status !== 'uploading') { let { file } = info;
// console.log(info.file, info.fileList) const status = info.file.status;
} info.fileList.forEach((val,index)=>{
if (info.file.status === 'done') { if(val.response && !val.response.result){
console.log('info', info) this.$message.error(val.response.message);
this.fileList = [] info.fileList.splice(index,1)
this.myfileList = info.fileList }
this.formInline.attId = info.file.response.result.id })
this.$message.success(`${info.file.name}上传成功`) if (this.fileTypeSatus) {
}else if (info.file.status === 'error') { if (file.size > 100000000) {
this.$message.error(`${info.file.name}上传失败`) this.$message.error(this.errorMessage)
} else if (info.file.status === 'uploading') { return
this.myfileList = info.fileList }else {
// console.log(info.file, info.fileList) 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({ rule.push({
required: true, required: true,
message: res.db_field_txt + '不能为空', message: res.db_field_txt + '不能为空',
trigger: 'blur' trigger: 'change'
}) })
if (res.db_field_name == 'standNumber') { if (res.db_field_name == 'standNumber') {
rule.push( rule.push(
+4 -4
View File
@@ -15,16 +15,16 @@
<span slot="operation" slot-scope="record"> <span slot="operation" slot-scope="record">
<a class="text" v-for="(ol,index) in OperationList" <a class="text" v-for="(ol,index) in OperationList"
@click="OperationClick(ol,record)"> @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:''}} {{record.resultContent=='转换成功'&&record.syncState=='未同步'&&record.fileSource=='1'?ol.text:''}}
</span> </span>
<span v-if="ol.text==$t('check')"> <span v-if="ol.text==$t('check')" v-has="''">
{{record.resultContent=='转换成功'&&record.syncState=='未同步'?ol.text:''}} {{record.resultContent=='转换成功'&&record.syncState=='未同步'?ol.text:''}}
</span> </span>
<span v-if="ol.text==$t('download')"> <span v-if="ol.text==$t('download')" v-has="'ocr:ocrRestful:downFile'">
{{record.resultContent=='转换成功'?ol.text:''}} {{record.resultContent=='转换成功'?ol.text:''}}
</span> </span>
<span v-if="ol.text==$t('delete')"> <span v-if="ol.text==$t('delete')" v-has="'ocr:ocrRecord:delete'">
{{ol.text}} {{ol.text}}
</span> </span>
</a> </a>
@@ -5,15 +5,15 @@
<search :flag="'2'" :url="url"/> <search :flag="'2'" :url="url"/>
</div> </div>
<div class="table-operator"> <div class="table-operator">
<div class="operator-text" @click="handleUpload"> <div class="operator-text" @click="handleUpload" v-has="'ocr:ocrRestful:addOcrRecord'">
<a-icon type="plus" /> <a-icon type="plus" />
{{ $t('upload1') }} {{ $t('upload1') }}
</div> </div>
<div class="operator-text" @click="handleFileExport"> <div class="operator-text" @click="handleFileExport" v-has="'document:ocrPageInfo'">
<a-icon type="export" /> <a-icon type="export" />
{{ $t('RetrieveFiles') }} {{ $t('RetrieveFiles') }}
</div> </div>
<div class="operator-text" @click="handleDel"> <div class="operator-text" @click="handleDel" v-has="'ocr:ocrRecord:deleteBatch'">
<a-icon type="delete" /> <a-icon type="delete" />
{{ $t('BatchDelete') }} {{ $t('BatchDelete') }}
</div> </div>
@@ -311,8 +311,11 @@
}, },
//下载 //下载
actionDown(val){ actionDown(val){
let fileName=val.docRealName.split('_') let fileNames=val.docRealName.split('_')
fileName=fileName[fileName.length-1] let name = fileNames.shift()
let fileName=fileNames.join('_')
// let fileName=val.fileName.split('.')[0]
downloadFile('ocr/OcrRestful/downFile', fileName, { fileName: val.docRealName }) downloadFile('ocr/OcrRestful/downFile', fileName, { fileName: val.docRealName })
}, },
//删除 //删除
@@ -17,7 +17,7 @@
<a-icon type="plus" /> <a-icon type="plus" />
{{$t('add')}} {{$t('add')}}
</div> </div>
<div class="operator-text" @click="batDelete"> <div class="operator-text" @click="batDelete" v-has="dictVal=='list'?'dictItem:logicDeleteBatch':'sys:category:logicDeleteBatch'">
<a-icon type="delete" /> <a-icon type="delete" />
{{$t('BatchDelete')}} {{$t('BatchDelete')}}
</div> </div>
@@ -245,6 +245,7 @@
}else if(this.dictVal='tree'){ }else if(this.dictVal='tree'){
this.parentVisible=true this.parentVisible=true
this.editPId=''
} }
}, },
//保存 //保存
@@ -401,7 +402,7 @@
//树形选中行 //树形选中行
selectedKeys(val){ selectedKeys(val){
this.selectedIds=val this.selectedIds=val
console.log('seleVal',val) // console.log('seleVal',val)
}, },
//批量删除 //批量删除
batDelete(){ batDelete(){
@@ -4,7 +4,7 @@
<template slot="action" slot-scope="text, record"> <template slot="action" slot-scope="text, record">
<a class="action-edit" href="javascript:;" @click="actionEdit(record)">{{$t('edit')}}</a> <a class="action-edit" href="javascript:;" @click="actionEdit(record)">{{$t('edit')}}</a>
<a class="action-delete" href="javascript:;" @click="onDelete(record)">{{$t('delete')}}</a> <a class="action-delete" href="javascript:;" @click="onDelete(record)" v-has="'dictItem:logicDelete'">{{$t('delete')}}</a>
</template> </template>
</a-table> </a-table>
<div class="page" v-if="tableData.length > 0"> <div class="page" v-if="tableData.length > 0">
@@ -13,7 +13,7 @@
> >
<template slot="action" slot-scope="text, record"> <template slot="action" slot-scope="text, record">
<a class="action-edit" href="javascript:;" @click="actionEdit(record)">{{$t('edit')}}</a> <a class="action-edit" href="javascript:;" @click="actionEdit(record)">{{$t('edit')}}</a>
<a class="action-delete" href="javascript:;" @click="onDelete(record)">{{$t('delete')}}</a> <a class="action-delete" href="javascript:;" @click="onDelete(record)" v-has="'sys:category:logicDelete'">{{$t('delete')}}</a>
</template> </template>
</a-table> </a-table>
<div class="page" v-if="tabData.length > 0"> <div class="page" v-if="tabData.length > 0">
@@ -39,7 +39,7 @@
props:{ props:{
tabletreeData:Array, tabletreeData:Array,
record:Object, record:Object,
total:String, total:Number,
queryParams:Object queryParams:Object
}, },
data(){ data(){
@@ -18,11 +18,11 @@
</a-form> </a-form>
</div> </div>
<div class="table-operator"> <div class="table-operator">
<div class="operator-text" @click="handleAdd"> <div class="operator-text" @click="handleAdd" v-has="'dict:add'">
<a-icon type="plus" /> <a-icon type="plus" />
{{$t('add')}} {{$t('add')}}
</div> </div>
<div class="operator-text" @click="batDelete"> <div class="operator-text" @click="batDelete" v-has="'dict:logicDeleteBatch'">
<a-icon type="delete" /> <a-icon type="delete" />
{{$t('BatchDelete')}} {{$t('BatchDelete')}}
</div> </div>
@@ -33,7 +33,7 @@
<a-icon type="rocket" :rotate="45" /> <a-icon type="rocket" :rotate="45" />
{{$t('ExhibitionAreaManagement')}} {{$t('ExhibitionAreaManagement')}}
</div> </div>
<div class="operator-text" @click="batDelete"> <div class="operator-text" @click="batDelete" v-has="'tag:logicDeleteBatch'">
<a-icon type="delete" /> <a-icon type="delete" />
{{$t('BatchDelete')}} {{$t('BatchDelete')}}
</div> </div>