JQ数组筛选
var list = this.selArr.filter(x => x.checkedList.length > 0).map(x => ({
county: x.name,
liner: x.checkedList,
checkAll: x.checkAll,
condition,
count
}))
split :分割
// 对象数组求和
var sum = arr.reduce(function(prev, cur) {
return cur.字段+ prev
}, 0)
//数组去重
$.unique(SelectIds.sort());
//对象数组去重
uniqueFun(arr, type) {
const res = new Map();
return arr.filter((a) => !res.has(a[type]) && res.set(a[type], 1));
},
//关键词多选
handlekeyChange(e) {
for (var row of e) {
this.checkedKeyword.push({ checked: true, keyWord: row.keyWord });
}
this.checkedKeyword = this.uniqueFun(this.checkedKeyword, "keyWord");;
},