Commit 9ae2078f by 胡悦

优化

1 parent 7b55dc63
...@@ -251,22 +251,24 @@ export default { ...@@ -251,22 +251,24 @@ export default {
request.req(params).then(res => { request.req(params).then(res => {
this.childLoading = false this.childLoading = false
const arr = res.merchantParams const arr = res.merchantParams
const index = [] // const index = []
let list = [] let list = []
if (!res.merchantParams || !res.merchantParams.length) { if (!res.merchantParams || !res.merchantParams.length) {
this.businessChildList = [] this.businessChildList = []
return return
} }
for (var i of res.merchantParams) { // for (var i of res.merchantParams) {
for (var j of this.addList) { // for (var j of this.addList) {
if (i.merchantId === j.merchantId) { // if (i.merchantId === j.merchantId) {
index.push(i.merchantId) // index.push(i.merchantId)
} // }
} // }
} // }
list = arr.filter(item => !index.includes(item.merchantId)) // list = arr.filter(item => !index.includes(item.merchantId))
// list = [...arr].filter(item => [...this.addList].every(obj => obj.merchantId !== item.merchantId)) list = [...arr].filter(item => [...this.addList].every(obj => obj.merchantId !== item.merchantId))
this.businessChildList = index.length ? list : arr console.log(list)
// this.businessChildList = index.length ? list : arr
this.businessChildList = list
}).catch(err => { }).catch(err => {
notice.errorTips(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!