Merge remote-tracking branch 'origin/master'

This commit is contained in:
liyawei
2022-02-25 11:36:46 +08:00
3 changed files with 88 additions and 255 deletions
+20 -8
View File
@@ -1,8 +1,8 @@
<template> <template>
<div class="ocr-upload"> <div class="ocr-upload">
<a-modal v-model="visible" :maskClosable="false" :footer="[]" :title="title"> <a-modal v-model="visible" :maskClosable="false" :footer="[]" :title="title" class="ocr-upload-modal">
<a-upload-dragger <a-upload-dragger
accept='*.*' :accept='accept'
:disabled="disabled" :disabled="disabled"
class="ant-upload-list" class="ant-upload-list"
name="file" name="file"
@@ -25,7 +25,7 @@
import { ACCESS_TOKEN } from "@/store/mutation-types" import { ACCESS_TOKEN } from "@/store/mutation-types"
export default { export default {
name: 'ocrUpload', name: 'ocrUpload',
props:['disableds','disabled','thisFileUploadUrl','readonly','thisFileType'], props:['disableds','disabled','thisFileUploadUrl','readonly','thisFileType','accept'],
data(){ data(){
return{ return{
visible:false, visible:false,
@@ -50,10 +50,12 @@
beforeUpload(file) { beforeUpload(file) {
console.log(file) console.log(file)
// let thisFileType = this.thisFileType.replace(/\s+/g, ""); // let thisFileType = this.thisFileType.replace(/\s+/g, "");
this.fileTypeSatus = true; if(file.type==this.accept){
this.$message.destroy() this.fileTypeSatus = true;
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量! this.$message.destroy()
this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!"; // 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!";
}
}, },
remove(){ remove(){
@@ -143,6 +145,16 @@
} }
</script> </script>
<style scoped> <style lang="less" scoped>
</style>
<style lang="less">
.ocr-upload-modal{
.ant-modal-wrap{
z-index: 1002;
}
}
</style> </style>
+51 -245
View File
@@ -3,35 +3,6 @@
<a-card :bordered="false"> <a-card :bordered="false">
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<search :flag="'2'" :url="url"/> <search :flag="'2'" :url="url"/>
<!-- <div class="ocr-search-header">-->
<!-- <a-form layout="inline" @keyup.enter.native="searchQuery(queryParams)">-->
<!-- <a-row :gutter="44">-->
<!-- <a-col :md="6" :sm="12">-->
<!-- <a-form-item :label="'编号'">-->
<!-- <j-input :placeholder="'请输入编号'" v-model="queryParams.standNumber"></j-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :md="6" :sm="12">-->
<!-- <a-form-item :label="'标题'">-->
<!-- <j-input :placeholder="'请输入标题'" v-model="queryParams.standName"></j-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :md="6" :sm="12">-->
<!-- <a-form-item :label="'转换结果'">-->
<!-- <a-select v-model="queryParams.transformation" :placeholder="$t('pleaseSelect')">-->
<!-- <a-select-option :value="item.value" v-for="(item) in transOptions">{{item.label}}</a-select-option>-->
<!-- </a-select>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :md="6" :sm="8">-->
<!-- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">-->
<!-- <a-button type="primary" @click="searchQuery" icon="search">{{$t('query')}}</a-button>-->
<!-- <a-button @click="searchReset" icon="reload" style="margin-left: 8px">清空</a-button>-->
<!-- </span>-->
<!-- </a-col>-->
<!-- </a-row>-->
<!-- </a-form>-->
<!-- </div>-->
</div> </div>
<div class="table-operator"> <div class="table-operator">
<div class="operator-text" @click="handleUpload"> <div class="operator-text" @click="handleUpload">
@@ -47,6 +18,7 @@
批量删除 批量删除
</div> </div>
</div> </div>
<addForm></addForm>
<!-- 上传弹框--> <!-- 上传弹框-->
<a-modal <a-modal
class="show-content" class="show-content"
@@ -55,11 +27,11 @@
:confirm-loading="confirmLoading" :confirm-loading="confirmLoading"
@ok="handleOk" @ok="handleOk"
@cancel="handleCancel" @cancel="handleCancel"
v-if="fileVisible"
> >
<a-form-model <a-form-model
class="tag-content" class="tag-content"
ref="fileForm" ref="fileForm"
v-if="fileVisible"
:model="form" :model="form"
:rules="rules" :rules="rules"
:label-col="labelCol" :label-col="labelCol"
@@ -131,46 +103,10 @@
@actionDelete="actionDelete" @actionDelete="actionDelete"
@detailClick="detailClick" @detailClick="detailClick"
/> />
<!-- <a-table bordered :data-source="dataSource" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="tag-con-table" :pagination="false" >-->
<!-- <a slot="fileName" slot-scope="text, record" @click="fileDetail(record)">{{ text }}</a>-->
<!-- <template slot="action" slot-scope="text, record">-->
<!-- <a class="action action-syn" href="javascript:;" @click="actionSynchron(record)">同步至文档库</a>-->
<!-- <a class="action action-check" href="javascript:;" @click="actionCheck(record)">校核</a>-->
<!-- <a class="action action-down" href="javascript:;" @click="actionDown(record)">下载</a>-->
<!-- <a-popconfirm-->
<!-- v-if="dataSource.length"-->
<!-- title="Sure to delete?"-->
<!-- @confirm="() => actionDelete(record)"-->
<!-- >-->
<!-- <a class="action action-delete" href="javascript:;">删除</a>-->
<!-- </a-popconfirm>-->
<!-- </template>-->
<!-- </a-table>-->
<!-- <div class="page" v-if="dataSource.length > 0">-->
<!-- <a-pagination-->
<!-- :show-total="total => `共 ${total} 条`"-->
<!-- show-quick-jumper-->
<!-- show-size-changer-->
<!-- :page-size.sync="queryParams.pageSize"-->
<!-- :total="total"-->
<!-- @change="onChangePage"-->
<!-- @showSizeChange="SizeChange"-->
<!-- />-->
<!-- </div>-->
</div> </div>
<addForm
ref="addFormRef" <doc-table v-if="drawVisible" :drawVisible="drawVisible" :drawTableSorce="drawTableSorce" @visible="docVisible" @exportVisible="exportVisible"></doc-table>
:url="url" <ocr-upload ref="uploadFile1" :disabled="disabled" :accept="accept" @uploadSuccess="uploadSuccess"></ocr-upload>
:flag="'1'"
/>
<frameAssembly
:url="url"
ref="frameAssemblyRef"
/>
<doc-table v-if="drawVisible" :drawVisible="drawVisible" :drawTableSorce="drawTableSorce" @visible="docVisible"></doc-table>
<ocr-upload ref="uploadFile" :disabled="disabled" @uploadSuccess="uploadSuccess"></ocr-upload>
<!-- <uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile>-->
</a-card> </a-card>
</div> </div>
@@ -181,20 +117,18 @@
import { getAction, postAction, deleteAction } from '@/api/manage' import { getAction, postAction, deleteAction } from '@/api/manage'
import search from '@/components/search/index' import search from '@/components/search/index'
import tableData from '@/components/tableDate/index' import tableData from '@/components/tableDate/index'
import addForm from './modules/addForm' import addForm from '@/components/tableDate/index'
import docTable from './modules/docTable' import docTable from './modules/docTable'
import frameAssembly from '@/components/frameAssembly/index'
import ocrUpload from '@/components/ocrUpload/index' import ocrUpload from '@/components/ocrUpload/index'
import { ACCESS_TOKEN } from "@/store/mutation-types" import { ACCESS_TOKEN } from "@/store/mutation-types"
import Vue from 'vue' import Vue from 'vue'
// import uploadFile from '@/components/uploadFile/file' import eventBUs from '../../../common/event'
export default { export default {
name: 'ocr', name: 'ocr',
components:{ components:{
search, search,
tableData, tableData,
addForm, addForm,
frameAssembly,
ocrUpload, ocrUpload,
docTable docTable
}, },
@@ -245,159 +179,30 @@
tableHeader: 'ocr/ocrRecord/getHeader', //表格头部字段 tableHeader: 'ocr/ocrRecord/getHeader', //表格头部字段
seachList: 'ocr/ocrRecord/queryCondition', //搜索字段 seachList: 'ocr/ocrRecord/queryCondition', //搜索字段
tableList: 'ocr/ocrRecord/page', //表格数据 tableList: 'ocr/ocrRecord/page', //表格数据
// getAddForm: 'document/bussDocumentLibraryEO/getAddForm', // 表单的字段
// addInfo: 'document/bussDocumentLibraryEO/addInfo', //新增
// updateInfo: 'document/bussDocumentLibraryEO/updateInfo', //编辑
// getDocumentInfo: 'document/bussDocumentLibraryEO/getDocumentInfoById', //查看
// deleteBatch: 'document/bussDocumentLibraryEO/deleteBatch' //删除
}, },
queryParams:{}, //搜索条件 queryParams:{}, //搜索条件
transOptions:[
{
value:1,
label:'转换中',
},
{
value:2,
label:'转换完成',
},
{
value:3,
label:'转换失败',
}
],
//列表数据 //列表数据
dataSource:[], dataSource:[],
columns: [ drawTableSorce:[],
{
title:'标准编号',
key: 'standNumber',
align:"center",
dataIndex: 'standNumber',
ellipsis: true,
},
{
title:'标准名称',
key: 'standName',
align:"center",
dataIndex: 'standName',
ellipsis: true,
},
{
title:'文本状态',
key: 'fileType_dictText',
align:"center",
dataIndex: 'fileType_dictText',
ellipsis: true,
},
{
title:'文件名称',
key: 'fileName',
align:"center",
dataIndex: 'fileName',
slots: { title: 'customTitle' },
scopedSlots: { customRender: 'fileName' },
ellipsis: true,
},
{
title:'转换结果',
key: 'resultContent',
align:"center",
dataIndex: 'resultContent',
ellipsis: true,
},
{
title:'转换时间',
key: 'createTime',
align:"center",
sorter: true,
dataIndex: 'createTime',
ellipsis: true,
},
{
title:'同步情况',
key: 'syncState',
align:"center",
sorter: true,
dataIndex: 'syncState',
ellipsis: true,
},
{
title: this.$t('operation'),
dataIndex: 'action',
scopedSlots: {customRender: 'action'},
align: "center",
width: 260
}
],
drawTableSorce:[
{
id: '1',
standNumber: 'sfsf1',
standName:'下拉单选',
fileType_dictText:'单选',
fileName:'123.pdf',
fileInfo:'1',
},
{
id: '2',
standNumber: 'sfsdfd2222',
standName:'aaaa选',
fileType_dictText:'sdf选',
fileName:'sss.word',
fileInfo:'2',
},
],
ipagination: {
defaultPageSize: 10,
defaultCurrent: 1,
pageSizeOptions: ['10', '20', '30', '40', '100'],
showQuickJumper: true,
showSizeChanger: true,
showTotal: (total, range) => `共 ${total} 条`
},
total:0, total:0,
selectedRowKeys:[], selectedRowKeys:[],
fileVisible:false, fileVisible:false,
confirmLoading: false, confirmLoading: false,
queryParams:{
pageNo:1,
pageSize:10
},
selectedIds:'', //选择行id selectedIds:'', //选择行id
record:{} record:{},
accept:'application/pdf'
} }
}, },
props:{ props:{
}, },
mounted() { mounted() {
this.loadData() // this.loadData()
}, },
methods:{ methods:{
//获取列表数据
loadData(){
let params = this.queryParams
getAction(`ocr/ocrRecord/page`,params).then(res=> {
if(res.success){
this.total=res.result.total
this.dataSource= [ ...res.result.records ]
}
})
},
//搜索
searchQuery(){
},
//清空搜索
searchReset(){
},
//上传 //上传
handleUpload(){ handleUpload(){
this.fileVisible=true this.fileVisible=true
}, },
//调取已入库文件 //调取已入库文件
handleFileExport(){ handleFileExport(){
@@ -416,11 +221,12 @@
async () => { async () => {
deleteAction(`ocr/ocrRecord/deleteBatch`, param).then(res => { deleteAction(`ocr/ocrRecord/deleteBatch`, param).then(res => {
if (res.success) { if (res.success) {
this.loadData() this.$message.success(res.result)
this.selectedRowKeys=[] eventBUs.$emit('searchReset')
}else{
this.$message.warning(res.message)
} }
}) })
}, },
onCancel() {}, onCancel() {},
}); });
@@ -446,24 +252,29 @@
let params={ let params={
id:record.id id:record.id
} }
deleteAction(`ocr/ocrRecord/delete`,params).then(res=> { this.$confirm({
if(res.success){ title: '确认删除?',
this.loadData() content: '',
// console.log('res',res) onOk:
} async () => {
}) deleteAction(`ocr/ocrRecord/delete`,params).then(res=> {
if(res.success){
this.$message.success(res.result)
eventBUs.$emit('searchReset')
}else{
this.$message.warning(res.message)
}
})
},
onCancel() {},
});
}, },
onDelete(){ onDelete(){
}, },
onSelectChange(selectedRowKeys,selectedRows){ onSelectChange(selectedRowKeys,selectedRows){
this.selectedRowKeys = selectedRowKeys; this.selectedIds=selectedRowKeys.join(',')
// console.log('selectedRows',selectedRowKeys,selectedRows)
let ids=[]
selectedRows.forEach(item=>{
ids.push(item.id)
})
this.selectedIds=ids.join(',')
// console.log('seIds',this.selectedIds) // console.log('seIds',this.selectedIds)
}, },
@@ -472,11 +283,15 @@
this.$refs.fileForm.validate((valid)=>{ this.$refs.fileForm.validate((valid)=>{
let params={ ...this.form } let params={ ...this.form }
if(valid) { if(valid) {
postAction(`ocr/ocrRecord/add`,params).then(res=>{ postAction(`ocr/OcrRestful/addOcrRecord`,params).then(res=>{
if(res.success){ if(res.success){
this.$message.success(res.result) this.$message.success(res.result)
this.$emit('ok') eventBUs.$emit('searchReset')
this.loadData() this.fileVisible=false
this.form={}
// this.$emit('ok')
}else{
this.$message.warning(res.message)
} }
}) })
} }
@@ -487,17 +302,17 @@
}, },
//上传文件 //上传文件
uploadSuccess(data) { uploadSuccess(data) {
console.log('updata',data)
let attIdList = [] let attIdList = []
data.map(item => { if(data && data.length > 0){
attIdList.push(item.id || data.name) data.forEach(item => {
}) attIdList.push(item.id || data.name)
// /** 赋值给当前对应的表单文件 */ })
this.form.attId = attIdList.join(',') this.form.attId = attIdList.join(',')
console.log('form1111',this.form) }
}, },
fileUpload(){ fileUpload(){
this.$refs.uploadFile.visible=true
this.$refs.uploadFile1.visible=true
}, },
//同步至文档库确认 //同步至文档库确认
handleOkTo(){ handleOkTo(){
@@ -521,8 +336,6 @@
this.$router.push({ this.$router.push({
path:'/ocr/ocrSplit' path:'/ocr/ocrSplit'
}) })
// const token = Vue.ls.get(ACCESS_TOKEN);
// window.open('http://10.0.1.31:8080/jero-boot/ocr/pageOffice/word?token='+token)
this.checkVisible=false this.checkVisible=false
}, },
//校核取消 //校核取消
@@ -532,19 +345,12 @@
docVisible(val){ docVisible(val){
this.drawVisible=val this.drawVisible=val
}, },
//点击页数
onChangePage(page,pageSize){
this.queryParams.pageNo = page
this.loadData()
},
//一页显示条数
SizeChange(page,pageSize){
this.queryParams.pageSize = pageSize
this.loadData()
},
//文件详情跳转 //文件详情跳转
detailClick(val){ detailClick(val){
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + val.id)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + val.id))
},
exportVisible(val){
this.fileVisible=val
} }
} }
} }
@@ -51,6 +51,10 @@
/> />
</div> </div>
</div> </div>
<div class="doc-table-footer">
<a-button type="primary" class="btn-export" @click="tableExport">导入</a-button>
<a-button type="primary" @click="onClose">取消</a-button>
</div>
</a-drawer> </a-drawer>
</div> </div>
</template> </template>
@@ -151,8 +155,8 @@
searchReset(){ searchReset(){
}, },
onSelectChange(){ onSelectChange(rowKeys){
console.log('key',rowKeys)
}, },
//点击页数 //点击页数
onChangePage(page,pageSize){ onChangePage(page,pageSize){
@@ -164,6 +168,10 @@
this.queryParams.pageSize = pageSize this.queryParams.pageSize = pageSize
this.loadData() this.loadData()
}, },
//导入按钮
tableExport(){
// this.$emit('exportVisible',true)
}
}, },
} }
</script> </script>
@@ -181,4 +189,11 @@
margin-top: 20px; margin-top: 20px;
} }
} }
.doc-table-footer{
margin-top: 20px;
text-align: center;
.btn-export{
margin-right: 20px;
}
}
</style> </style>