ocr删除

This commit is contained in:
caoyang
2022-02-17 13:47:22 +08:00
parent a95e95c3e4
commit 6eebe0a223
2 changed files with 415 additions and 266 deletions
+142 -144
View File
@@ -1,7 +1,8 @@
<template>
<div class="ocr">
<a-card>
<div class="table-page-search-wrapper">
<!-- <search :flag="'1'" :url="url"/>-->
<!-- <search :flag="'1'" :url="url"/>-->
<div class="ocr-search-header">
<a-form layout="inline" @keyup.enter.native="searchQuery(queryParams)">
<a-row :gutter="24">
@@ -37,7 +38,7 @@
<a-button @click="handleFileExport()" type="primary">调取已入库文件</a-button>
<a-button @click="handleDel()" type="primary">批量删除</a-button>
</div>
<!-- 上传弹框-->
<!-- 上传弹框-->
<a-modal
class="show-content"
title="上传文件"
@@ -63,7 +64,7 @@
}}
</a-button>
<!-- <a-button @click="fileUpload" type="primary">点击上传</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
@@ -84,7 +85,7 @@
</a-form-model>
</a-modal>
<!-- 同步弹框-->
<!-- 同步弹框-->
<a-modal
class="show-content"
title="同步至文档库"
@@ -96,7 +97,7 @@
>
<p style="text-align: center">该文件未进行校验,确定要同步至文档库?</p>
</a-modal>
<!-- 校核弹框-->
<!-- 校核弹框-->
<a-modal
class="show-content"
title="校核"
@@ -109,21 +110,32 @@
<p style="text-align: center">确定对该文件未进行校验?</p>
</a-modal>
<div class="table-detail">
<a-table bordered :data-source="tableSorce" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="tag-con-table" :pagination="ipagination" >
<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="tableSorce.length"
v-if="dataSource.length"
title="Sure to delete?"
@confirm="() => onDelete(record)"
@confirm="() => actionDelete(record)"
>
<a class="action action-delete" href="javascript:;" @click="actionDelete(record)">删除</a>
<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"
@@ -134,16 +146,19 @@
: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>-->
<!-- <uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile>-->
</a-card>
</div>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
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 docTable from './modules/docTable'
import frameAssembly from '@/components/frameAssembly/index'
import ocrUpload from '@/components/ocrUpload/index'
// import uploadFile from '@/components/uploadFile/file'
@@ -154,13 +169,16 @@
tableData,
addForm,
frameAssembly,
ocrUpload
ocrUpload,
docTable
},
data(){
return{
pageSize:10,
labelCol: { span:4 },
wrapperCol: { span: 18 },
disabled:false,
drawVisible:false,
toVisible:false, //同步弹框
checkVisible:false, //校核弹框
file:'',
@@ -204,128 +222,7 @@
}
],
//列表数据
tableSorce:[
{
id: '1',
standNumber: 'sfsf1',
standName:'下拉单选',
fileType_dictText:'单选',
fileName:'123.pdf',
resultContent:'1',
createTime:'2020-1-1',
resultStatus:1
},
{
id: '2',
standNumber: 'sfsdfd2222',
standName:'aaaa选',
fileType_dictText:'sdf选',
fileName:'sss.word',
resultContent:'2',
createTime:'2020-1-1',
resultStatus:2
},
{
id: '3',
standNumber: 'sfsf1',
standName:'下拉单选',
fileType_dictText:'单选',
fileName:'123.pdf',
resultContent:'1',
createTime:'2020-1-1',
resultStatus:1
},
{
id: '4',
standNumber: 'sfsdfd2222',
standName:'aaaa选',
fileType_dictText:'sdf选',
fileName:'sss.word',
resultContent:'2',
createTime:'2020-1-1',
resultStatus:2
},
{
id: '5',
standNumber: 'sfsf1',
standName:'下拉单选',
fileType_dictText:'单选',
fileName:'123.pdf',
resultContent:'1',
createTime:'2020-1-1',
resultStatus:1
},
{
id: '6',
standNumber: 'sfsdfd2222',
standName:'aaaa选',
fileType_dictText:'sdf选',
fileName:'sss.word',
resultContent:'2',
createTime:'2020-1-1',
resultStatus:2
},
{
id: '7',
standNumber: 'sfsf1',
standName:'下拉单选',
fileType_dictText:'单选',
fileName:'123.pdf',
resultContent:'1',
createTime:'2020-2-12',
resultStatus:1
},
{
id: '8',
standNumber: 'sfsdfd2222',
standName:'aaaa选',
fileType_dictText:'sdf选',
fileName:'sss.word',
resultContent:'2',
createTime:'2020-1-19',
resultStatus:2
},
{
id: '9',
standNumber: 'sfsf1',
standName:'下拉单选',
fileType_dictText:'单选',
fileName:'123.pdf',
resultContent:'1',
createTime:'2020-1-1',
resultStatus:1
},
{
id: '10',
standNumber: 'sfsdfd2222',
standName:'aaaa选',
fileType_dictText:'sdf选',
fileName:'sss.word',
resultContent:'2',
createTime:'2020-2-12',
resultStatus:2
},
{
id: '11',
standNumber: 'sfsf1',
standName:'下拉单选',
fileType_dictText:'单选',
fileName:'123.pdf',
resultContent:'1',
createTime:'2020-2-1',
resultStatus:1
},
{
id: '12',
standNumber: 'sfsdfd2222',
standName:'aaaa选',
fileType_dictText:'sdf选',
fileName:'sss.word',
resultContent:'2',
createTime:'2020-1-13',
resultStatus:2
},
],
dataSource:[],
columns: [
{
title:'标准编号',
@@ -349,7 +246,9 @@
title:'文件名称',
key: 'fileName',
align:"center",
dataIndex: 'fileName'
dataIndex: 'fileName',
slots: { title: 'customTitle' },
scopedSlots: { customRender: 'fileName' },
},
{
title:'转换结果',
@@ -366,10 +265,10 @@
},
{
title:'同步情况',
key: 'resultStatus',
key: 'syncState',
align:"center",
sorter: true,
dataIndex: 'resultStatus'
dataIndex: 'syncState'
},
{
title: this.$t('operation'),
@@ -379,27 +278,62 @@
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) => `显示 ${range[0]} ~ ${range[1]} 条记录,共 ${total} 条记录`
showTotal: (total, range) => `共 ${total} 条`
},
total:0,
selectedRowKeys:[],
fileVisible:false,
confirmLoading: false,
queryParams:{
pageNo:1,
pageSize:10
},
selectedIds:'', //选择行id
}
},
props:{
},
mounted() {
this.loadData()
},
methods:{
//获取列表数据
loadData(){
console.log('22222')
let params = this.queryParams
console.log('33333')
getAction(`ocr/ocrRecord/page`,params).then(res=> {
if(res.success){
this.total=res.result.total
this.dataSource= [ ...res.result.records ]
}
})
},
//搜索
searchQuery(){
@@ -416,10 +350,37 @@
},
//调取已入库文件
handleFileExport(){
this.drawVisible=true
},
//批量删除
handleDel(){
let param={
ids:this.selectedIds
}
if(this.selectedIds){
this.$confirm({
title: '确认要批量删除?',
content: '',
onOk:
async () => {
deleteAction(`ocr/ocrRecord/deleteBatch`, param).then(res => {
if (res.success) {
this.loadData()
this.selectedRowKeys=[]
}
})
},
onCancel() {},
});
}else{
this.$notification['warning']({
message: '请选择至少一条数据!',
description:'',
});
}
},
//同步
@@ -435,13 +396,29 @@
},
//删除
actionDelete(){
actionDelete(record){
let params={
id:record.id
}
deleteAction(`ocr/ocrRecord/delete`,params).then(res=> {
if(res.success){
this.loadData()
// console.log('res',res)
}
})
},
onDelete(){
},
onSelectChange(){
onSelectChange(selectedRowKeys,selectedRows){
this.selectedRowKeys = selectedRowKeys;
// console.log('selectedRows',selectedRowKeys,selectedRows)
let ids=[]
selectedRows.forEach(item=>{
ids.push(item.id)
})
this.selectedIds=ids.join(',')
// console.log('seIds',this.selectedIds)
},
//上传确定按钮
@@ -484,6 +461,23 @@
handleCancelCheck(){
this.checkVisible=false
},
docVisible(val){
this.drawVisible=val
},
//点击页数
onChangePage(page,pageSize){
this.queryParams.pageNo = page
this.loadData()
},
//一页显示条数
SizeChange(page,pageSize){
this.queryParams.pageSize = pageSize
this.loadData()
},
//文件详情跳转
fileDetail(val){
console.log('valtext',val)
}
}
}
</script>
@@ -497,6 +491,10 @@
.action-delete{
color:red;
}
.page{
text-align:right ;
margin-top:20px;
}
}
}
</style>
@@ -0,0 +1,151 @@
<template>
<div class="doc-table">
<a-drawer
class="doc-table-drawer"
title="调取已入库文件"
placement="right"
:visible="visible"
:after-visible-change="afterVisibleChange"
@close="onClose"
width="1100"
>
<div class="doc-table-content">
<div class="doc-header">
<a-form layout="inline" @keyup.enter.native="searchQuery(queryParams)">
<a-row :gutter="24">
<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="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="doc-table-detail">
<a-table bordered :data-source="tableSource" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="tag-con-table" :pagination="ipagination" >
<span slot="num" slot-scope="text,records,index">
{{ (ipagination.currentPage-1)*ipagination.pageSize+Number(index)+1 }}
</span>
</a-table>
</div>
</a-drawer>
</div>
</template>
<script>
export default {
name: 'docTable',
props:{
drawVisible:Boolean,
drawTableSorce:Array,
},
data(){
return{
visible:false,
queryParams:{
pageNo:1,
pageSize:10
},
currentPage:1,
ipagination: {
defaultPageSize: 10,
defaultCurrent: 1,
currentPage:1,
pageSizeOptions: ['10', '20', '30', '40', '100'],
showQuickJumper: true,
showSizeChanger: true,
showTotal: (total, range) => `显示 ${range[0]} ~ ${range[1]} 条记录,共 ${total} 条记录`
},
total:0,
selectedRowKeys:[],
tableSource:[],
//表头
columns: [
{
title: '序号',
key: 'num',
align:"center",
scopedSlots: { customRender: 'num' },
width:80
},
{
title:'标准编号',
key: 'standNumber',
align:"center",
dataIndex: 'standNumber'
},
{
title:'标题',
key: 'standName',
align:"center",
dataIndex: 'standName'
},
{
title:'文本状态',
key: 'fileType_dictText',
align:"center",
dataIndex: 'fileType_dictText'
},
{
title:'文件名称',
key: 'fileName',
align:"center",
dataIndex: 'fileName'
},
{
title:'文件信息',
key: 'fileInfo',
align:"center",
dataIndex: 'fileInfo'
},
]
}
},
mounted() {
this.visible=this.drawVisible
this.tableSource= [...this.drawTableSorce]
},
methods: {
afterVisibleChange(val) {
console.log('visible', val);
},
onClose() {
this.visible = false;
this.$emit('visible',false)
},
//搜索
searchQuery(){
},
//清空
searchReset(){
},
onSelectChange(){
}
},
}
</script>
<style lang="less" scoped>
.doc-table-drawer{
.ant-drawer-content-wrapper{
}
}
</style>