no message

This commit is contained in:
小陌 2023-07-03 07:23:44 +08:00
parent c6731f7c0a
commit a00af5b380

View File

@ -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)
} }