修改一直问题

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
@@ -27,6 +27,7 @@
placeholder: String,
triggerChange: Boolean,
disabled: Boolean,
db_field_name:String,
value: [String, Number],
type: String,
getPopupContainer:{
@@ -94,11 +95,17 @@
}else{
val = e
}
console.log(val)
let content = ''
this.dictOptions.forEach(res=>{
if (res.value == e){
content = res.text || res.label
}
})
if(this.triggerChange){
this.$emit('change', val);
}else{
this.$emit('input', val);
this.$emit('changeQuery', content,this.db_field_name);
}
},
setCurrentDictOptions(dictOptions){
@@ -36,6 +36,7 @@
placeholder: String,
disabled: Boolean,
value: String,
db_field_name:String,
type: String,
options:Array,
spliter:{
@@ -104,7 +105,16 @@
},
onChange (selectedValue) {
let content = []
this.dictOptions.forEach(res=>{
selectedValue.forEach(val=>{
if (res.value == val){
content.push(res.text || res.label)
}
})
})
this.$emit('change', selectedValue.join(this.spliter));
this.$emit('changeQuery', content.join(this.spliter),this.db_field_name);
},
setCurrentDictOptions(dictOptions){
this.dictOptions = dictOptions
@@ -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,
@@ -11,7 +11,7 @@
<div class="text-text-right"
:class="{ 'null-input':item.checked }">
<div class="text-header">
<span :title="item.module_type">{{item.module_type}}</span>
<span :title="item.module_type" v-html="item.module_type"></span>
<span style="cursor: pointer" :title="item.serial_number"
@click="titleClick(item)" v-html="item.serial_number"></span>
<span style="cursor: pointer" :title="item.title" v-html="item.title" @click="titleClick(item)"></span>
@@ -39,6 +39,7 @@
<div class="noData" v-else>
暂无数据
</div>
<div class="page" v-if="conList.length > 0">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
@@ -101,6 +102,7 @@
} else {
this.checkboxText.push(item.id)
}
console.log(this.checkboxText)
},
pageOnChange(page, pageSize) {
this.pageNo = page
@@ -125,9 +127,13 @@
queryParam[val] = queryParam[val].join(',')
}
})
this.loading = true
console.log(this.checkboxText)
let checkboxText = JSON.parse(JSON.stringify(this.checkboxText))
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
ids: checkboxText.join(','),
...queryParam
}
postAction(this.url.getInfoList, query).then((res) => {