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 = {}
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)
}