no message
This commit is contained in:
parent
c6731f7c0a
commit
a00af5b380
@ -151,11 +151,16 @@
|
|||||||
const obj = {}
|
const obj = {}
|
||||||
this.filter.forEach((item) => {
|
this.filter.forEach((item) => {
|
||||||
|
|
||||||
if (this.data[item.field.name]!==null && this.data[item.field.name]!=='') {
|
if (!this.data[item.field.name] || 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]
|
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
|
return obj
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -311,8 +316,15 @@
|
|||||||
//清空过滤
|
//清空过滤
|
||||||
clear(){
|
clear(){
|
||||||
|
|
||||||
this.data = Object.assign({}, this.defaultValue);
|
Object.keys(this.data).forEach(key => {
|
||||||
this.filter = []
|
if (this.data[key] === this.defaultValue[key]) {
|
||||||
|
this.data[key] = this.defaultValue[key];
|
||||||
|
} else {
|
||||||
|
this.data[key] = '';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// this.filter = []
|
||||||
this.filterObjLength = 0
|
this.filterObjLength = 0
|
||||||
this.$emit('filterChange',this.filterObj)
|
this.$emit('filterChange',this.filterObj)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user