Commit 0510a979 by 杨北旺

企微绑定页递归添加参数

1 parent b6909a0d
...@@ -127,12 +127,12 @@ export default { ...@@ -127,12 +127,12 @@ export default {
}, },
getDepartmentList() { getDepartmentList() {
getDepartment({ id: 1 }).then(res => { getDepartment({ id: 1 }).then(res => {
this.departmentList = this.traverse(res, 'relevanceMerchant') this.departmentList = this.traverse(1,res, 'relevanceMerchant')
}) })
}, },
getMerchantList() { getMerchantList() {
getMerchantTree().then(res => { getMerchantTree().then(res => {
this.shopList = this.traverse(res, 'entmicroName', 'merchantAccountLevel') this.shopList = this.traverse(2,res, 'entmicroName', 'merchantAccountLevel')
}) })
}, },
// 关联当前选择的 // 关联当前选择的
...@@ -256,15 +256,15 @@ export default { ...@@ -256,15 +256,15 @@ export default {
}) })
}, },
// 递归:处理层级数组 // 递归:处理层级数组
traverse(arr, string1, string2, arr1 = []) { traverse(type,arr, string1, string2, arr1 = []) {
arr.map(item => { arr.map(item => {
if (item[string1] || item[string2] != 4) { if (item[string1] || (item[string2] != 4&&type==2)) {
item.disabled = true item.disabled = true
} else { } else {
item.disabled = false item.disabled = false
} }
if (item.children && item.children instanceof Array) { if (item.children && item.children instanceof Array) {
this.traverse(item.children, string1, string2, (arr1 = [])) this.traverse(type,item.children, string1, string2, (arr1 = []))
} }
return arr1.push(item) return arr1.push(item)
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!