Browse Source

修改客户树叶子节点

pull/152/head
xuxiaoming 3 years ago
parent
commit
d740fb786a
1 changed files with 11 additions and 11 deletions
  1. +11
    -11
      src/views/plan/workbench/homePage/customer/index.vue

+ 11
- 11
src/views/plan/workbench/homePage/customer/index.vue View File

@ -41,16 +41,7 @@ import { get } from "@/server/api.js";
//
get(`/admin/base/customer/customertree`).then(({ code, data }) => {
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) {
data[0].Children.forEach(el => {
el.Children.forEach(elChild => {
@ -68,7 +59,16 @@ import { get } from "@/server/api.js";
})
},
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) {
if (!value) return true
return data.Label.indexOf(value) !== -1


Loading…
Cancel
Save