修改一直问题

This commit is contained in:
qq787203167
2022-03-24 18:36:45 +08:00
parent 920190e305
commit 7b691a7378
4 changed files with 57 additions and 5 deletions
@@ -11,6 +11,8 @@
:maxTagCount="1"
:tree-data="item.tree"
tree-checkable
@click="treeClick(item.db_field_name)"
@change="treeChange"
:placeholder="$t('PleaseSelect')+item.db_field_txt"
/>
</div>
@@ -31,12 +33,15 @@
<j-dict-select-tag class="text-select" v-model="queryParam[item.db_field_name]"
:placeholder="$t('PleaseSelect')+item.db_field_txt"
:type="'select'"
:db_field_name="item.db_field_name"
@changeQuery="changeQuery"
:triggerChange="false" :dictCode="item.dict_field"/>
</div>
<div class="text-left-select" v-if="item.field_show_type == '4'">
<span class="text-sel">{{item.db_field_txt}}</span>
<j-multi-select-tag class="text-select" v-model="queryParam[item.db_field_name]"
:db_field_name="item.db_field_name"
@changeQuery="changeQuery"
:placeholder="$t('PleaseSelect')+item.db_field_txt" :type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
</div>
@@ -182,6 +187,7 @@
queryParam: {},
visible: false,
dataSource: [],
db_field_name: '',
url: {
queryCondition: 'search/document/queryCondition',
getInfoList: 'search/document/getInfoList',
@@ -397,11 +403,13 @@
},
dateChange(item) {
this.queryParam[item] = moment(this.queryParam[item]).format('YYYY-MM-DD')
this.queryParam[item + '_name'] = moment(this.queryParam[item]).format('YYYY-MM-DD')
},
onChange(item) {
let dateOne = moment(this.queryParam[item][0]).format('YYYY-MM-DD')
let dateTwo = moment(this.queryParam[item][1]).format('YYYY-MM-DD')
this.queryParam[item] = [dateOne, dateTwo]
this.queryParam[item + '_name'] = [dateOne, dateTwo]
},
getCondition() {
let query = {
@@ -419,12 +427,30 @@
searchReset() {
this.pageNo = 1
this.queryParam = {}
this.queryParamSeach = ''
this.getInfoList()
},
searchQuery() {
let queryParam = JSON.parse(JSON.stringify(this.queryParam))
this.queryParamSeach = ''
Object.keys(queryParam).forEach(val => {
if (queryParam[val] instanceof Array) {
queryParam[val] = queryParam[val].join(',')
}
if (val.includes('_name')) {
this.queryParamSeach = this.queryParamSeach + queryParam[val] + ','
}
})
this.queryParamSeach = this.queryParamSeach.substr(0, this.queryParamSeach.length - 1)
this.pageNo = 1
this.getInfoList()
},
treeChange(value, text) {
this.queryParam[this.db_field_name + '_name'] = text
},
treeClick(db_field_name) {
this.db_field_name = db_field_name
},
searchData(data, selectModel) {
this.queryParam = { ...this.queryParam, ...data }
this.selectModel = selectModel
@@ -434,16 +460,19 @@
this.queryParam.selectValueTwo = value
this.getInfoList()
},
changeQuery(val, name) {
this.queryParam[name + '_name'] = val
},
getInfoList() {
let queryParam = JSON.parse(JSON.stringify(this.queryParam))
this.queryParamSeach = ''
Object.keys(queryParam).forEach(val => {
if (queryParam[val] instanceof Array) {
queryParam[val] = queryParam[val].join(',')
}
this.queryParamSeach = this.queryParamSeach + queryParam[val] + ','
if (val.includes('_name')) {
delete queryParam[val]
}
})
this.queryParamSeach = this.queryParamSeach.substr(0, this.queryParamSeach.length - 1)
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,