|
@ -41,16 +41,7 @@ import { get } from "@/server/api.js"; |
|
|
// 获取客户列表树状图 |
|
|
// 获取客户列表树状图 |
|
|
get(`/admin/base/customer/customertree`).then(({ code, data }) => { |
|
|
get(`/admin/base/customer/customertree`).then(({ code, data }) => { |
|
|
if (code === 200) { |
|
|
if (code === 200) { |
|
|
console.log('%cindex.vue line:44 data', 'color: #007acc;', data); |
|
|
|
|
|
data.forEach(item => { |
|
|
|
|
|
item.Children.forEach( child => { |
|
|
|
|
|
child.Children.forEach( ch => { |
|
|
|
|
|
ch.Label = ch.CustomerId + "-" + ch.Label |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
this.customerData = data |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.customerData = this.editTreeNode(data) |
|
|
if (this.currentCustomId) { |
|
|
if (this.currentCustomId) { |
|
|
data[0].Children.forEach(el => { |
|
|
data[0].Children.forEach(el => { |
|
|
el.Children.forEach(elChild => { |
|
|
el.Children.forEach(elChild => { |
|
@ -68,7 +59,16 @@ import { get } from "@/server/api.js"; |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
|
|
|
|
|
|
editTreeNode(data){ |
|
|
|
|
|
data.forEach(item => { |
|
|
|
|
|
if(!item.Children && typeof(item.Children) != 'undefined' && item.children != 0) { |
|
|
|
|
|
item.Label = item.CustomerId + "-" + item.Label |
|
|
|
|
|
} else { |
|
|
|
|
|
this.editTreeNode(item.Children) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
return data |
|
|
|
|
|
}, |
|
|
filterNode(value, data) { |
|
|
filterNode(value, data) { |
|
|
if (!value) return true |
|
|
if (!value) return true |
|
|
return data.Label.indexOf(value) !== -1 |
|
|
return data.Label.indexOf(value) !== -1 |
|
|