ocr上传文件

This commit is contained in:
caoyang
2022-02-25 13:12:05 +08:00
parent 916eda240f
commit 7e78f62be2
3 changed files with 520 additions and 62 deletions
+18 -56
View File
@@ -18,54 +18,26 @@
批量删除
</div>
</div>
<!-- <addForm></addForm>-->
<!-- 上传弹框-->
<a-modal
class="show-content"
title="上传文件"
:visible="fileVisible"
:confirm-loading="confirmLoading"
@ok="handleOk"
@ok="modalOk"
@cancel="handleCancel"
>
<a-form-model
class="tag-content"
<addForm
ref="fileForm"
@addFormClick="addFormClick"
:flag="'2'"
:accept="accept"
v-if="fileVisible"
:model="form"
:rules="rules"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-form-model-item ref="file" label="文件" prop="attId">
<a-button type="primary" class="button-text"
@click="fileUpload()">
{{ (form.file === 'null' || form.file === '' ||
form.file == null) ? '点击上传' : '查看已上传文件'
}}
</a-button>
<!-- <a-button @click="fileUpload" type="primary">点击上传</a-button>-->
</a-form-model-item>
<a-form-model-item ref="standNumber" label="编号" prop="standNumber">
<a-input
v-model="form.standNumber"
placeholder="请输入编号"
/>
</a-form-model-item>
<a-form-model-item ref="standName" label="名称" prop="standName">
<a-input
v-model="form.standName"
placeholder="请输入名称"
/>
</a-form-model-item>
<a-form-model-item label="文本状态" prop="fileType">
<j-dict-select-tag type="list" v-model="form.fileType" dictCode="file_type" placeholder="请选择文本状态" />
</a-form-model-item>
</a-form-model>
:url="url">
</addForm>
</a-modal>
<!-- 同步弹框-->
<a-modal
class="show-content"
@@ -117,7 +89,7 @@
import { getAction, postAction, deleteAction } from '@/api/manage'
import search from '@/components/search/index'
import tableData from '@/components/tableDate/index'
import addForm from '@/components/tableDate/index'
import addForm from '@/components/ocrAddForm/index'
import docTable from './modules/docTable'
import ocrUpload from '@/components/ocrUpload/index'
import { ACCESS_TOKEN } from "@/store/mutation-types"
@@ -179,6 +151,8 @@
tableHeader: 'ocr/ocrRecord/getHeader', //表格头部字段
seachList: 'ocr/ocrRecord/queryCondition', //搜索字段
tableList: 'ocr/ocrRecord/page', //表格数据
getAddForm: 'ocr/ocrRecord/getForm', // 表单的字段
addInfo: 'ocr/OcrRestful/addOcrRecord', //新增
},
queryParams:{}, //搜索条件
//列表数据
@@ -279,23 +253,8 @@
},
//上传确定按钮
handleOk(){
this.$refs.fileForm.validate((valid)=>{
let params={ ...this.form }
if(valid) {
postAction(`ocr/OcrRestful/addOcrRecord`,params).then(res=>{
if(res.success){
this.$message.success(res.result)
eventBUs.$emit('searchReset')
this.fileVisible=false
this.form={}
// this.$emit('ok')
}else{
this.$message.warning(res.message)
}
})
}
})
modalOk(){
this.$refs.fileForm.sumber()
},
handleCancel(){
this.fileVisible=false
@@ -350,7 +309,10 @@
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + val.id))
},
exportVisible(val){
this.fileVisible=val
// this.fileVisible=val
},
addFormClick() {
this.fileVisible = false
}
}
}