no message
This commit is contained in:
parent
c6731f7c0a
commit
a00af5b380
@ -151,11 +151,16 @@
|
||||
const obj = {}
|
||||
this.filter.forEach((item) => {
|
||||
|
||||
if (this.data[item.field.name]!==null && this.data[item.field.name]!=='') {
|
||||
obj[item.field.name] = item.operator ? this.data[item.field.name]+`${config.separator}${item.operator}` : this.data[item.field.name]
|
||||
if (!this.data[item.field.name] || this.data[item.field.name] === '') {
|
||||
return; // 跳过当前迭代,继续下一次迭代
|
||||
}
|
||||
|
||||
obj[item.field.name] = item.operator ? this.data[item.field.name]+`${config.separator}${item.operator}` : this.data[item.field.name]
|
||||
|
||||
})
|
||||
|
||||
console.log(obj, this.filter)
|
||||
|
||||
return obj
|
||||
}
|
||||
},
|
||||
@ -311,8 +316,15 @@
|
||||
//清空过滤
|
||||
clear(){
|
||||
|
||||
this.data = Object.assign({}, this.defaultValue);
|
||||
this.filter = []
|
||||
Object.keys(this.data).forEach(key => {
|
||||
if (this.data[key] === this.defaultValue[key]) {
|
||||
this.data[key] = this.defaultValue[key];
|
||||
} else {
|
||||
this.data[key] = '';
|
||||
}
|
||||
});
|
||||
|
||||
// this.filter = []
|
||||
this.filterObjLength = 0
|
||||
this.$emit('filterChange',this.filterObj)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user