筛选条件是按照类型分开渲染的,
这样写的
多条件筛选,这个怎么处理?
这是我的筛选条件
let conditionMapping = {
coalName: this.coalList.filter(v => v.active == true).map(item => item.condition),
orderType: this.typeList.filter(v => v.active == true).map(item => item.condition),
customerName: this.customerList.filter(v => v.active == true).map(item => item.condition),
xsUser2Name: this.forwarderList.filter(v => v.active == true).map(item => item.condition),
fleetName: this.fleetList.filter(v => v.active == true).map(item => item.condition),
filedName: this.filedList.filter(v => v.active == true).map(item => item.condition)
};
const mapping = {
coalName: validateFn('coalName'),
orderType: validateFn('orderType'),
customerName: validateFn('customerName'),
xsUser2Name: validateFn('xsUser2Name'),
fleetName: validateFn('fleetName'),
filedName: validateFn('filedName')
};
let list = this.taskList.map(val => val.taskCoalList.filter(v => Reflect.ownKeys(conditionMapping).every(key => mapping[key](v, conditionMapping[key]))));
console.log(conditionMapping, '过滤条件');
console.log(list, '过滤之后的数据');