Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<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
|
||||
accept='*.*'
|
||||
:accept='accept'
|
||||
:disabled="disabled"
|
||||
class="ant-upload-list"
|
||||
name="file"
|
||||
@@ -25,7 +25,7 @@
|
||||
import { ACCESS_TOKEN } from "@/store/mutation-types"
|
||||
export default {
|
||||
name: 'ocrUpload',
|
||||
props:['disableds','disabled','thisFileUploadUrl','readonly','thisFileType'],
|
||||
props:['disableds','disabled','thisFileUploadUrl','readonly','thisFileType','accept'],
|
||||
data(){
|
||||
return{
|
||||
visible:false,
|
||||
@@ -50,10 +50,12 @@
|
||||
beforeUpload(file) {
|
||||
console.log(file)
|
||||
// let thisFileType = this.thisFileType.replace(/\s+/g, "");
|
||||
this.fileTypeSatus = true;
|
||||
this.$message.destroy()
|
||||
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
|
||||
this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!";
|
||||
if(file.type==this.accept){
|
||||
this.fileTypeSatus = true;
|
||||
this.$message.destroy()
|
||||
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
|
||||
this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!";
|
||||
}
|
||||
|
||||
},
|
||||
remove(){
|
||||
@@ -143,6 +145,16 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style lang="less" scoped>
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<style lang="less">
|
||||
.ocr-upload-modal{
|
||||
.ant-modal-wrap{
|
||||
z-index: 1002;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -3,35 +3,6 @@
|
||||
<a-card :bordered="false">
|
||||
<div class="table-page-search-wrapper">
|
||||
<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 class="table-operator">
|
||||
<div class="operator-text" @click="handleUpload">
|
||||
@@ -47,6 +18,7 @@
|
||||
批量删除
|
||||
</div>
|
||||
</div>
|
||||
<addForm></addForm>
|
||||
<!-- 上传弹框-->
|
||||
<a-modal
|
||||
class="show-content"
|
||||
@@ -55,11 +27,11 @@
|
||||
:confirm-loading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
v-if="fileVisible"
|
||||
>
|
||||
<a-form-model
|
||||
class="tag-content"
|
||||
ref="fileForm"
|
||||
v-if="fileVisible"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="labelCol"
|
||||
@@ -131,46 +103,10 @@
|
||||
@actionDelete="actionDelete"
|
||||
@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>
|
||||
<addForm
|
||||
ref="addFormRef"
|
||||
:url="url"
|
||||
: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>-->
|
||||
|
||||
<doc-table v-if="drawVisible" :drawVisible="drawVisible" :drawTableSorce="drawTableSorce" @visible="docVisible" @exportVisible="exportVisible"></doc-table>
|
||||
<ocr-upload ref="uploadFile1" :disabled="disabled" :accept="accept" @uploadSuccess="uploadSuccess"></ocr-upload>
|
||||
</a-card>
|
||||
</div>
|
||||
|
||||
@@ -181,20 +117,18 @@
|
||||
import { getAction, postAction, deleteAction } from '@/api/manage'
|
||||
import search from '@/components/search/index'
|
||||
import tableData from '@/components/tableDate/index'
|
||||
import addForm from './modules/addForm'
|
||||
import addForm from '@/components/tableDate/index'
|
||||
import docTable from './modules/docTable'
|
||||
import frameAssembly from '@/components/frameAssembly/index'
|
||||
import ocrUpload from '@/components/ocrUpload/index'
|
||||
import { ACCESS_TOKEN } from "@/store/mutation-types"
|
||||
import Vue from 'vue'
|
||||
// import uploadFile from '@/components/uploadFile/file'
|
||||
import eventBUs from '../../../common/event'
|
||||
export default {
|
||||
name: 'ocr',
|
||||
components:{
|
||||
search,
|
||||
tableData,
|
||||
addForm,
|
||||
frameAssembly,
|
||||
ocrUpload,
|
||||
docTable
|
||||
},
|
||||
@@ -245,159 +179,30 @@
|
||||
tableHeader: 'ocr/ocrRecord/getHeader', //表格头部字段
|
||||
seachList: 'ocr/ocrRecord/queryCondition', //搜索字段
|
||||
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:{}, //搜索条件
|
||||
transOptions:[
|
||||
{
|
||||
value:1,
|
||||
label:'转换中',
|
||||
},
|
||||
{
|
||||
value:2,
|
||||
label:'转换完成',
|
||||
},
|
||||
{
|
||||
value:3,
|
||||
label:'转换失败',
|
||||
}
|
||||
],
|
||||
//列表数据
|
||||
dataSource:[],
|
||||
columns: [
|
||||
{
|
||||
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} 条`
|
||||
},
|
||||
drawTableSorce:[],
|
||||
total:0,
|
||||
selectedRowKeys:[],
|
||||
fileVisible:false,
|
||||
confirmLoading: false,
|
||||
queryParams:{
|
||||
pageNo:1,
|
||||
pageSize:10
|
||||
},
|
||||
selectedIds:'', //选择行id
|
||||
record:{}
|
||||
record:{},
|
||||
accept:'application/pdf'
|
||||
}
|
||||
},
|
||||
props:{
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.loadData()
|
||||
// this.loadData()
|
||||
},
|
||||
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(){
|
||||
|
||||
this.fileVisible=true
|
||||
|
||||
},
|
||||
//调取已入库文件
|
||||
handleFileExport(){
|
||||
@@ -416,11 +221,12 @@
|
||||
async () => {
|
||||
deleteAction(`ocr/ocrRecord/deleteBatch`, param).then(res => {
|
||||
if (res.success) {
|
||||
this.loadData()
|
||||
this.selectedRowKeys=[]
|
||||
this.$message.success(res.result)
|
||||
eventBUs.$emit('searchReset')
|
||||
}else{
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
@@ -446,24 +252,29 @@
|
||||
let params={
|
||||
id:record.id
|
||||
}
|
||||
deleteAction(`ocr/ocrRecord/delete`,params).then(res=> {
|
||||
if(res.success){
|
||||
this.loadData()
|
||||
// console.log('res',res)
|
||||
}
|
||||
})
|
||||
this.$confirm({
|
||||
title: '确认删除?',
|
||||
content: '',
|
||||
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(){
|
||||
|
||||
},
|
||||
onSelectChange(selectedRowKeys,selectedRows){
|
||||
this.selectedRowKeys = selectedRowKeys;
|
||||
// console.log('selectedRows',selectedRowKeys,selectedRows)
|
||||
let ids=[]
|
||||
selectedRows.forEach(item=>{
|
||||
ids.push(item.id)
|
||||
})
|
||||
this.selectedIds=ids.join(',')
|
||||
this.selectedIds=selectedRowKeys.join(',')
|
||||
// console.log('seIds',this.selectedIds)
|
||||
|
||||
},
|
||||
@@ -472,11 +283,15 @@
|
||||
this.$refs.fileForm.validate((valid)=>{
|
||||
let params={ ...this.form }
|
||||
if(valid) {
|
||||
postAction(`ocr/ocrRecord/add`,params).then(res=>{
|
||||
postAction(`ocr/OcrRestful/addOcrRecord`,params).then(res=>{
|
||||
if(res.success){
|
||||
this.$message.success(res.result)
|
||||
this.$emit('ok')
|
||||
this.loadData()
|
||||
eventBUs.$emit('searchReset')
|
||||
this.fileVisible=false
|
||||
this.form={}
|
||||
// this.$emit('ok')
|
||||
}else{
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -487,17 +302,17 @@
|
||||
},
|
||||
//上传文件
|
||||
uploadSuccess(data) {
|
||||
console.log('updata',data)
|
||||
let attIdList = []
|
||||
data.map(item => {
|
||||
attIdList.push(item.id || data.name)
|
||||
})
|
||||
// /** 赋值给当前对应的表单文件 */
|
||||
this.form.attId = attIdList.join(',')
|
||||
console.log('form1111',this.form)
|
||||
if(data && data.length > 0){
|
||||
data.forEach(item => {
|
||||
attIdList.push(item.id || data.name)
|
||||
})
|
||||
this.form.attId = attIdList.join(',')
|
||||
}
|
||||
},
|
||||
fileUpload(){
|
||||
this.$refs.uploadFile.visible=true
|
||||
|
||||
this.$refs.uploadFile1.visible=true
|
||||
},
|
||||
//同步至文档库确认
|
||||
handleOkTo(){
|
||||
@@ -521,8 +336,6 @@
|
||||
this.$router.push({
|
||||
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
|
||||
},
|
||||
//校核取消
|
||||
@@ -532,19 +345,12 @@
|
||||
docVisible(val){
|
||||
this.drawVisible=val
|
||||
},
|
||||
//点击页数
|
||||
onChangePage(page,pageSize){
|
||||
this.queryParams.pageNo = page
|
||||
this.loadData()
|
||||
},
|
||||
//一页显示条数
|
||||
SizeChange(page,pageSize){
|
||||
this.queryParams.pageSize = pageSize
|
||||
this.loadData()
|
||||
},
|
||||
//文件详情跳转
|
||||
detailClick(val){
|
||||
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 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>
|
||||
</div>
|
||||
</template>
|
||||
@@ -151,8 +155,8 @@
|
||||
searchReset(){
|
||||
|
||||
},
|
||||
onSelectChange(){
|
||||
|
||||
onSelectChange(rowKeys){
|
||||
console.log('key',rowKeys)
|
||||
},
|
||||
//点击页数
|
||||
onChangePage(page,pageSize){
|
||||
@@ -164,6 +168,10 @@
|
||||
this.queryParams.pageSize = pageSize
|
||||
this.loadData()
|
||||
},
|
||||
//导入按钮
|
||||
tableExport(){
|
||||
// this.$emit('exportVisible',true)
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -181,4 +189,11 @@
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
.doc-table-footer{
|
||||
margin-top: 20px;
|
||||
text-align: center;
|
||||
.btn-export{
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user