字典列表搜索

This commit is contained in:
caoyang
2022-02-18 13:11:42 +08:00
parent f10e9ad4d3
commit 7e784c280c
3 changed files with 37 additions and 36 deletions
@@ -65,7 +65,7 @@
</a-col>
<a-col :span="24">
<a-form-model-item label="展示区域" prop="showArea">
<a-select placeholder="请选择展示区域" @change="handleChange">
<a-select placeholder="请选择展示区域" v-model="form.showArea" @change="handleChange">
<a-select-option v-for="(item,index) in areaOptions" :key="item.id" :value="item.id">
{{item.showArea}}
</a-select-option>
@@ -191,7 +191,7 @@
{ required: true, message: '请选择是否显示文档库列表',trigger: 'change'},
],
showArea: [
// { required: true, message: '请输入展示区域!',trigger: 'change'},
{ required: true, message: '请输入展示区域!',trigger: 'change'},
],
isQuery: [
{ required: true, message: '请输入是否查询条件',trigger: 'change'},
@@ -214,22 +214,7 @@
}
},
watch:{
// 'form.fieldShowType'(val){
// console.log('valDb',val)
// console.log(val==3)
// if(val==3||val==4||val==9||val==10){
// this.isTagContent=true
// console.log('isTag',this.isTagContent)
// }else{
// this.isTagContent=false
// console.log('isTag',this.isTagContent)
//
// }
//
// },
// 'form.dbLength'(val){
// console.log('val')
// }
},
computed: {
changeType(val){
@@ -259,7 +244,6 @@
},
mounted() {
this.loadShowArea()
console.log('edit3333',this.editData)
this.form={...this.editData}
// console.log('drawerVisible',this.drawerVisible)
},
@@ -2,11 +2,11 @@
<div class="dic-list">
<div class="dic-list-content">
<div class="dic-list-header">
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form-model-item label="名称">
<a-input v-model="form.tagName" placeholder="请输入名称" />
</a-form-model-item>
</a-form-model>
<a-form :model="queryParams" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form-item label="名称">
<j-input v-model="queryParams.itemText" placeholder="请输入名称" />
</a-form-item>
</a-form>
<div class="form-btn">
<a-button class="form-btn-search" type="primary" @click="search">查询</a-button>
<a-button class="form-btn-reset" @click="reset">重置</a-button>
@@ -16,8 +16,8 @@
<a-button type="primary" class="dic-list-add" @click="dicAdd">{{$t('add')}}</a-button>
</div>
<div class="dic-list-table">
<list-table v-if="dictVal=='list'" :tableData="tableData" @editDict="editDict" @deleteDict="deleteDict"></list-table>
<tree-table v-if="dictVal=='tree'" :tabletreeData="tabletreeData" @editDict="editTreeDict"></tree-table>
<list-table v-if="dictVal=='list'&&dataFlag" :tableData="tableData" @editDict="editDict" @deleteDict="deleteDict" :total="total"></list-table>
<tree-table v-if="dictVal=='tree'" :tabletreeData="tabletreeData" @editDict="editTreeDict" :total="total"></tree-table>
</div>
<a-modal class="dict-module" v-model="newVisible" title="新增" ok-text="保存" cancel-text="取消" @ok="hideModal" @cancel="cancelModel" v-if="newVisible">
<a-form-model
@@ -79,6 +79,10 @@
return{
labelCol: { span: 4 },
wrapperCol: { span: 18 },
queryParams:{
pageNo:1,
pageSize:10
},//查询条件
form:{},
newVisible:false,
rules:{
@@ -137,7 +141,8 @@
},
],
parentVisible:false,
dataFlag:false,
total:0
}
},
watch: {
@@ -146,17 +151,22 @@
},
},
mounted() {
// this.loadData()
this.loadData()
},
methods:{
//获取列表数据
loadData(){
this.dataFlag=false
let params={
...this.queryParams,
dictId:this.record.id
}
getAction(`sys/dictItem/page`,params).then(res=>{
if(res.success){
this.dataFlag=true
this.total=res.result.total
if(this.dictVal=='list'){
this.tableData=[...res.result.records]
}
}
@@ -164,11 +174,15 @@
},
//搜索
search(){
this.loadData()
},
//重置
reset(){
this.queryParams={
pageNo: 1,
pageSize: 10
}
this.loadData()
},
//新增
dicAdd(){
@@ -31,14 +31,14 @@
export default {
name: 'listTable',
props:{
// tableData:Array,
tableData:Array,
total:Number
},
data(){
return{
tableData:[],
// tableData:[],
selectedRowKeys:[],
total:0,
// total:0,
queryParams:{
pageNo:1,
pageSize:10
@@ -71,21 +71,24 @@
width: 170
}
],
dataFlag:false
}
},
mounted() {
this.loadData()
// this.loadData()
},
methods:{
//获取列表数据
loadData(){
this.dataFlag=false
let params={
...this.queryParams,
dictId:this.record.id
}
getAction(`sys/dictItem/page`,params).then(res=>{
if(res.success){
this.tableData=[...res.result.records]
this.tableData=[...res.result.records]
this.dataFlag=true
}
})
},