Browse Source

Merge pull request '修改客户树叶子节点' (#152) from xuxiaoming into develop

Reviewed-on: http://101.201.121.115:3000/leo/LAPP_AdvancedPlanner_Front/pulls/152
pull/156/head
xuxiaoming 3 years ago
parent
commit
e38066f237
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 }) => { 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


Loading…
Cancel
Save