Commit 9ae2078f by 胡悦

优化

1 parent 7b55dc63
......@@ -251,22 +251,24 @@ export default {
request.req(params).then(res => {
this.childLoading = false
const arr = res.merchantParams
const index = []
// const index = []
let list = []
if (!res.merchantParams || !res.merchantParams.length) {
this.businessChildList = []
return
}
for (var i of res.merchantParams) {
for (var j of this.addList) {
if (i.merchantId === j.merchantId) {
index.push(i.merchantId)
}
}
}
list = arr.filter(item => !index.includes(item.merchantId))
// list = [...arr].filter(item => [...this.addList].every(obj => obj.merchantId !== item.merchantId))
this.businessChildList = index.length ? list : arr
// for (var i of res.merchantParams) {
// for (var j of this.addList) {
// if (i.merchantId === j.merchantId) {
// index.push(i.merchantId)
// }
// }
// }
// list = arr.filter(item => !index.includes(item.merchantId))
list = [...arr].filter(item => [...this.addList].every(obj => obj.merchantId !== item.merchantId))
console.log(list)
// this.businessChildList = index.length ? list : arr
this.businessChildList = list
}).catch(err => {
notice.errorTips(err)
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!