标签项搜索

This commit is contained in:
caoyang
2022-02-18 10:33:32 +08:00
parent 3c0587076c
commit 92bf9c9b84
2 changed files with 109 additions and 58 deletions
@@ -7,7 +7,7 @@
rowKey="id" rowKey="id"
:columns="columns" :columns="columns"
:dataSource="tableData" :dataSource="tableData"
:pagination="ipagination" :pagination="false"
:loading="loading" :loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange"> @change="handleTableChange">
@@ -15,7 +15,7 @@
<span slot="customTitle">属性名称</span> <span slot="customTitle">属性名称</span>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="editVisible(record.id)" v-if="record.isReadOnly==0">编辑</a> <a @click="editVisible(record.id)" v-if="record.isReadOnly==0">编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical" v-if="record.isReadOnly==0" />
<a-popconfirm <a-popconfirm
v-if="tableData.length&&record.isReadOnly==0" v-if="tableData.length&&record.isReadOnly==0"
title="Sure to delete?" title="Sure to delete?"
@@ -26,6 +26,17 @@
<!-- <a class="table-del" @click="deleteVisible(record.id)">删除</a>--> <!-- <a class="table-del" @click="deleteVisible(record.id)">删除</a>-->
</span> </span>
</a-table> </a-table>
<div class="page" v-if="tableData.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>
</template> </template>
@@ -34,6 +45,11 @@
name: 'tabTable', name: 'tabTable',
data(){ data(){
return{ return{
queryParams:{
pageNo:1,
pageSize:10
},
selectedRowKeys: [], selectedRowKeys: [],
loading: false, loading: false,
ipagination:true, ipagination:true,
@@ -42,7 +58,8 @@
}, },
props:{ props:{
tableData:Array, tableData:Array,
columns:Array columns:Array,
total:Number
}, },
mounted() { mounted() {
// console.log('colum',this.tableData,this.columns) // console.log('colum',this.tableData,this.columns)
@@ -60,7 +77,17 @@
}, },
deleteVisible(id){ deleteVisible(id){
this.$emit('visibleDelete',id) this.$emit('visibleDelete',id)
} },
//点击页数
onChangePage(page,pageSize){
this.queryParams.pageNo = page
this.$emit('queryParams',this.queryParams)
},
//一页显示条数
SizeChange(page,pageSize){
this.queryParams.pageSize = pageSize
this.$emit('queryParams',this.queryParams)
},
} }
} }
</script> </script>
@@ -70,5 +97,8 @@
.table-del{ .table-del{
color: red; color: red;
} }
.page{
margin-top: 20px;
}
} }
</style> </style>
@@ -1,58 +1,60 @@
<template> <template>
<div class="tag-item"> <div class="tag-item">
<div class="table-page-search-wrapper"> <a-card>
<a-form layout="inline" @keyup.enter.native="searchQuery"> <div class="table-page-search-wrapper">
<a-row :gutter="24"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-col :md="6" :sm="12"> <a-row :gutter="24">
<a-form-item :label="'标签项名称'"> <a-col :md="6" :sm="12">
<j-input :placeholder="'请输入标签名称'" v-model="queryParam.tagName"></j-input> <a-form-item :label="'标签名称'">
</a-form-item> <j-input :placeholder="'请输入标签名称'" v-model="queryParam.dbFieldName"></j-input>
</a-col> </a-form-item>
<a-col :md="6" :sm="8"> </a-col>
<a-form-item :label="'显示区域'"> <a-col :md="6" :sm="8">
<a-select v-model="queryParam.area" :placeholder="$t('pleaseSelect')"> <a-form-item :label="'显示区域'">
<a-select-option :value="item.value" v-for="item in areas">{{item.label}}</a-select-option> <a-select v-model="queryParam.area" :placeholder="$t('pleaseSelect')">
</a-select> <a-select-option :value="item.value" v-for="item in areas">{{item.label}}</a-select-option>
</a-form-item> </a-select>
</a-col> </a-form-item>
<a-col :md="6" :sm="8"> </a-col>
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <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 type="primary" @click="searchQuery" icon="search">{{$t('query')}}</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">{{$t('reset')}}</a-button> <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">{{$t('reset')}}</a-button>
</span> </span>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
<div class="table-operator" style="border-top: 5px"> <div class="table-operator" style="border-top: 5px">
<a-popover placement="right" v-model="typeVisible" trigger="click"> <a-popover placement="right" v-model="typeVisible" trigger="click">
<template slot="content" class="type-popover-content"> <template slot="content" class="type-popover-content">
<div class="type-popover"> <div class="type-popover">
<p class="type type-input" @click="handleAddPop('input')">输入框类型</p> <p class="type type-input" @click="handleAddPop('input')">输入框类型</p>
<p class="type type-select" @click="handleAddPop('select')">下拉选类型</p> <p class="type type-select" @click="handleAddPop('select')">下拉选类型</p>
</div> </div>
</template> </template>
<a-button type="primary">{{$t('add')}}</a-button> <a-button type="primary">{{$t('add')}}</a-button>
</a-popover> </a-popover>
<a-button type="primary" @click="handleShow">展示区域管理</a-button> <a-button type="primary" @click="handleShow">展示区域管理</a-button>
</div> </div>
<a-drawer class="show-drawer" :title="titleTag" placement="right" width="1000px" @close="close" :visible="drawerVisible" :after-visible-change="afterVisibleChange" > <a-drawer class="show-drawer" :title="titleTag" placement="right" width="1000px" @close="close" :visible="drawerVisible" :after-visible-change="afterVisibleChange" >
<new-drawer v-if="drawerVisible&&editFlag" :drawerVisible="drawerVisible" :isTagContent="isTagContent" :editData="editData" :editId="editId" :submitEdit="submitEdit" @closeTag="closeTag" ></new-drawer> <new-drawer v-if="drawerVisible&&editFlag" :drawerVisible="drawerVisible" :isTagContent="isTagContent" :editData="editData" :editId="editId" :submitEdit="submitEdit" @closeTag="closeTag" ></new-drawer>
</a-drawer> </a-drawer>
<a-modal class="show-area" v-model="areaVisible" title="展示区域管理" :footer="null" @cancel="hideModal"> <a-modal class="show-area" v-model="areaVisible" title="展示区域管理" :footer="null" @cancel="hideModal">
<area-manage v-if="areaVisible" @diaHide="diaHide" :areaTable="areaTable" @submitOk="submitOk" @deleteOk="deleteOk" @updateOk="updateOk"></area-manage> <area-manage v-if="areaVisible" @diaHide="diaHide" :areaTable="areaTable" @submitOk="submitOk" @deleteOk="deleteOk" @updateOk="updateOk"></area-manage>
</a-modal> </a-modal>
<div class="tag-doc-tab"> <div class="tag-doc-tab">
<a-tabs default-active-key="1" @change="callbackTab"> <a-tabs default-active-key="1" @change="callbackTab">
<a-tab-pane key="1" tab="文档库"> <a-tab-pane key="1" tab="文档库">
<tabTable :tableData="tableData" :columns="taglabColumns" @visibleEd="visibleEd" @visibleDelete="visibleDelete" ></tabTable> <tabTable :tableData="tableData" :columns="taglabColumns" @visibleEd="visibleEd" @visibleDelete="visibleDelete" @queryParams="queryParams" :total="total"></tabTable>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="文档拆分" force-render> <a-tab-pane key="2" tab="文档拆分" force-render>
<tabTable :tableData="tableData" :columns="tagSplit" @visibleEd="visibleEd" @visibleDelete="visibleDelete"></tabTable> <tabTable :tableData="tableData" :columns="tagSplit" @visibleEd="visibleEd" @visibleDelete="visibleDelete" @queryParams="queryParams" :total="total"></tabTable>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</div> </div>
</a-card>
</div> </div>
</template> </template>
@@ -73,8 +75,6 @@
data(){ data(){
return{ return{
queryParam:{ queryParam:{
area:'', //显示区域
tagName:'', //标签项名称
page:1, page:1,
pageSize:10, pageSize:10,
}, },
@@ -86,11 +86,11 @@
areas:[ areas:[
{ {
value: 1, value: 1,
label:'文档库' label:'基本信息'
}, },
{ {
value:2, value:2,
label:'文档条款' label:'文本信息'
} }
], ],
tableData:[], tableData:[],
@@ -201,6 +201,7 @@
editId:'', editId:'',
submitEdit:'add', submitEdit:'add',
key:1, key:1,
total:0
} }
}, },
mounted() { mounted() {
@@ -208,10 +209,18 @@
}, },
methods:{ methods:{
searchQuery(){ searchQuery(){
if(this.key==1){
this.loadData(1)
}else if(this.key==2){
this.loadData(0)
}
}, },
searchReset(){ searchReset(){
this.queryParam={
pageNo:0,
pageSize: 10
}
this.searchQuery()
}, },
handleAdd(){ handleAdd(){
this.drawerVisible=true this.drawerVisible=true
@@ -230,6 +239,7 @@
//标签项管理文档库初始数据 //标签项管理文档库初始数据
loadData(val){ loadData(val){
let params={ let params={
...this.queryParam,
isModel:1 isModel:1
} }
if(val==1){ if(val==1){
@@ -239,6 +249,7 @@
} }
getAction(`tag/onlCgformTag/page`,params).then(res=>{ getAction(`tag/onlCgformTag/page`,params).then(res=>{
if(res.success){ if(res.success){
this.total=res.result.total
this.tableData= [ ...res.result.records] this.tableData= [ ...res.result.records]
} }
}) })
@@ -345,6 +356,16 @@
} }
}) })
},
//接收查询条件
queryParams(val){
this.queryParam=val
if(this.key==1){
this.loadData(1)
}else if(this.key==2){
this.loadData(0)
}
} }
} }
} }