拆分列表

This commit is contained in:
caoyang
2022-02-21 18:10:32 +08:00
parent 08393165b1
commit 8c92e28fc3
5 changed files with 455 additions and 11 deletions
@@ -59,8 +59,8 @@
<a-form-model-item ref="file" label="文件" prop="attId">
<a-button type="primary" class="button-text"
@click="fileUpload()">
{{ (file === 'null' || file === '' ||
file == null) ? '点击上传' : '查看已上传文件'
{{ (form.file === 'null' || form.file === '' ||
form.file == null) ? '点击上传' : '查看已上传文件'
}}
</a-button>
@@ -20,6 +20,8 @@
@returnBack="returnBack"
/>
</div>
<split v-if="splitVisible" :splitVisible="splitVisible" @visible="sVisible"></split>
<imports v-if="importsVisible" :importsVisible="importsVisible" @visible="iVisible"></imports>
</a-card>
</div>
</template>
@@ -28,17 +30,24 @@
import search from '@/components/search/index'
import tableData from '@/components/tableDate/index'
import frameAssembly from '@/components/frameAssembly/index'
import split from './modules/split'
import imports from './modules/imports'
import { getAction, postAction, deleteAction } from '@/api/manage'
import eventBUs from '../../../common/event'
export default {
name: 'splitting',
components: {
search,
tableData,
frameAssembly
frameAssembly,
split,
imports
},
data(){
return{
splitVisible:false,
importsVisible:false,
OperationList: [
{
text: '回传至文档库',
@@ -77,27 +86,46 @@
methods:{
//拆分已入库文本
handleModule(){
this.splitVisible=true
},
//导入拆分结果
handleExport(){
this.importsVisible=true
},
//批量删除
handleDel(){
},
//回传至文档库
returnBack(){
returnBack(val){
console.log('val',val)
},
//查看
seeTable(){
},
//删除
deleteTable(){
deleteTable(val){
let _this = this
this.$confirm({
content: '确认删除?',
onOk() {
deleteAction(_this.url.deleteBatch, { ids: val.id }).then((res) => {
if (res.success) {
_this.$message.success(res.message)
eventBUs.$emit('searchReset')
} else {
this.$message.warning(res.message)
}
})
}
})
},
sVisible(val){
this.splitVisible=val
},
iVisible(val){
this.importsVisible=val
}
}
}
@@ -0,0 +1,236 @@
<template>
<div class="imports">
<a-drawer
class="imports-table-drawer"
title="拆分已入库文本"
placement="right"
:visible="visible"
:after-visible-change="afterVisibleChange"
@close="onClose"
width="1100"
>
<div class="imports-table-content">
<div class="imports-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="imports-table-detail">
<a-table bordered :data-source="tableSource" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="tag-con-table" :pagination="false" >
</a-table>
<div class="page" v-if="tableSource.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 class="imports-files">
<a-form-model
class="imports-content"
ref="ruleForm"
:model="form"
:rules="rules"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-form-model-item ref="file" label="拆分文件" prop="file">
<a-button type="primary" class="button-text"
@click="fileUpload()">
{{ (form.file === 'null' || form.file === '' ||
form.file == null) ? '上传' : '查看已上传文件'
}}
</a-button>
</a-form-model-item>
</a-form-model>
<a-button class="file-down" type="primary">模板下载</a-button>
</div>
<div class="imports-footer">
<div class="imports-footer-wrap">
<a-button class="imports-btn imports-chai" type="primary">保存</a-button>
<a-button class="imports-btn" type="primary" @click="cancleImports">取消</a-button>
</div>
</div>
<ocr-upload ref="uploadFile" :disabled="disabled" @uploadSuccess="uploadSuccess"></ocr-upload>
</a-drawer>
</div>
</template>
<script>
import { getAction, postAction, deleteAction } from '@/api/manage'
import ocrUpload from '@/components/ocrUpload/index'
export default {
name: 'import',
components:{
ocrUpload
},
data(){
return{
labelCol: { span:4 },
wrapperCol: { span: 18 },
visible:false,
contentVisible:true,
disabled:false,
tableSource:[], //列表数据
selectedRowKeys:[],
queryParams:{
pageNo:1,
pageSize:10
}, //搜索条件
total:0,
columns: [
{
title:'编号',
key: 'standNumber',
align:"center",
dataIndex: 'standNumber',
ellipsis: true,
},
{
title:'标题',
key: 'standName',
align:"center",
dataIndex: 'standName',
ellipsis: true,
},
{
title:'文件名称',
key: 'fileName',
align:"center",
dataIndex: 'fileName',
ellipsis: true,
},
{
title:'文本状态',
key: 'fileType_dictText',
align:"center",
dataIndex: 'fileType_dictText',
ellipsis: true,
},
],
file:'',
form:{},
rules:{
file:[
{ required: true, message: '请选择文件', trigger: 'change' },
],
},
}
},
props:{
importsVisible:Boolean
},
mounted() {
this.visible=this.importsVisible
// console.log('visibleSplit',this.visible)
},
methods:{
//获取列表数据
loadData(){
},
afterVisibleChange(val) {
console.log('visible', val);
},
onClose() {
this.visible = false;
this.$emit('visible',false)
},
onSelectChange(){
},
//搜索
searchQuery(){
},
//清空
searchReset(){
},
//点击页数
onChangePage(page,pageSize){
this.queryParams.pageNo = page
this.loadData()
},
//一页显示条数
SizeChange(page,pageSize){
this.queryParams.pageSize = pageSize
this.loadData()
},
cancleImports(){
this.$emit('visible',false)
},
fileUpload(){
this.$refs.uploadFile.visible=true
},
//上传文件
uploadSuccess(data) {
console.log('updata',data)
let attIdList = []
data.map(item => {
attIdList.push(item.id || data.name)
})
// /** 赋值给当前对应的表单文件 */
this.form.file = attIdList.join(',')
},
}
}
</script>
<style lang="less" scoped>
.imports-table-content{
.imports-header{
margin-bottom: 20px;
}
}
.imports-table-detail{
.page{
margin: 20px 0;
text-align: right;
}
}
.imports-files{
position: relative;
margin:20px 0;
.file-down{
position: absolute;
left: 260px;
top: 5px;
}
}
.imports-footer{
.imports-footer-wrap{
margin:20px 0;
text-align: center;
.imports-chai{
margin-right: 20px;
}
}
}
</style>
@@ -0,0 +1,180 @@
<template>
<div class="split">
<a-drawer
class="split-table-drawer"
title="拆分已入库文本"
placement="right"
:visible="visible"
:after-visible-change="afterVisibleChange"
@close="onClose"
width="1100"
>
<div class="split-table-content">
<div class="split-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="split-table-detail">
<a-table bordered :data-source="tableSource" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="tag-con-table" :pagination="false" >
</a-table>
<div class="page" v-if="tableSource.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 class="split-footer">
<div class="split-footer-wrap">
<a-button class="split-btn split-chai" type="primary">拆分</a-button>
<a-button class="split-btn" type="primary" @click="cancelSplit">取消</a-button>
</div>
</div>
</a-drawer>
</div>
</template>
<script>
export default {
name: 'split',
data(){
return{
visible:false,
tableSource:[], //列表数据
selectedRowKeys:[],
queryParams:{
pageNo:1,
pageSize:10
}, //搜索条件
total:0,
columns: [
{
title:'编号',
key: 'standNumber',
align:"center",
dataIndex: 'standNumber',
ellipsis: true,
},
{
title:'标题',
key: 'standName',
align:"center",
dataIndex: 'standName',
ellipsis: true,
},
{
title:'文件名称',
key: 'fileName',
align:"center",
dataIndex: 'fileName',
ellipsis: true,
},
{
title:'文本状态',
key: 'fileType_dictText',
align:"center",
dataIndex: 'fileType_dictText',
ellipsis: true,
},
]
}
},
props:{
splitVisible:Boolean
},
mounted() {
this.visible=this.splitVisible
// console.log('visibleSplit',this.visible)
},
methods:{
//获取列表数据
loadData(){
},
afterVisibleChange(val) {
console.log('visible', val);
},
onClose() {
this.visible = false;
this.$emit('visible',false)
},
onSelectChange(){
},
//搜索
searchQuery(){
},
//清空
searchReset(){
},
//点击页数
onChangePage(page,pageSize){
this.queryParams.pageNo = page
this.loadData()
},
//一页显示条数
SizeChange(page,pageSize){
this.queryParams.pageSize = pageSize
this.loadData()
},
cancelSplit(){
this.$emit('visible',false)
}
}
}
</script>
<style lang="less" scoped>
.split-table-content{
.split-header{
margin-bottom: 20px;
}
}
.split-table-detail{
.page{
margin: 20px 0;
text-align: right;
}
}
.split-footer{
.split-footer-wrap{
margin:20px 0;
text-align: center;
.split-chai{
margin-right: 20px;
}
}
}
</style>
@@ -1,6 +1,6 @@
<template>
<div class="tags" :bordered="false">
<a-card>
<div class="tags">
<a-card :bordered="false">
<div class="tag-tab">
<a-tabs type="card" @change="callback">
<a-tab-pane key="1" tab="标签项管理">