Browse Source

网络图提交到测试环境

tyler 2 years ago
parent
commit
464cf09e27
4 changed files with 260 additions and 76 deletions
  1. 104 20
      src/components/TreeChart/index.vue
  2. 1 1
      src/styles/style.scss
  3. 86 24
      src/views/atlas/network-ex.vue
  4. 69 31
      src/views/atlas/relation-ex.vue

+ 104 - 20
src/components/TreeChart/index.vue

@@ -24,10 +24,18 @@ export default {
     clickNodeList: Array
   },
   watch: {
-    clickNodeList:{
+    clickNodeList: {
       handler(newValue, old){
-        console.log(newValue,old)
-        this.init()
+        if (newValue) {
+          this.init()
+        }
+      }
+    },
+    treeData: {
+      handler(newValue, old) {
+        if (newValue) {
+          this.init()
+        }
       }
     }
   },
@@ -55,33 +63,109 @@ export default {
           formatter: function(params) {
             // 提示框浮层内容格式器,支持字符串模板和回调函数两种形式
             // console.log('params:', params)
-            return "<div style='display: flex;flex-direction: column;'>" +
-              '<span>' +
-              (that.type == 'placement' ? (params.data.TOP_NETWORK_DEEP - that.topDeep) : '') +
+            const relationStr =  "<div style='display: flex;flex-direction: column;'>" +
+              '<div>' +
+              (that.type === 'relation' ?
+                ( '<span style="color: #606266;">' + that.$t('atlas.algebra')  + ': ' + '</span>'  +  '<span style="color: #000000;">' + (Number(params.data.TOP_RELATION_DEEP) - Number(that.topDeep))  + '</span>' ) :
+                ( '<span style="color: #606266;">' + that.$t('atlas.numberOfLayers') + ': ' + '</span>') + '<span style="color: #000000;">' + (Number(params.data.TOP_NETWORK_DEEP) - Number(that.topDeep)) + '</span>' ) +
+              '</div>' +
+              '<div>' +
+              '<span style="color: #606266;">' +
+              that.$t('atlas.memberCode') + ': ' +
               '</span>' +
-              '<span>' +
+              '<span style="color: #000000;">' +
               params.data.USER_NAME +
               '</span>' +
-              '<span>' +
+              '</div>' +
+
+              '<div>' +
+              '<span style="color: #606266;">' +
+              that.$t('atlas.name') + ': ' +
+              '</span>' +
+              '<span style="color: #000000;">' +
               params.data.REAL_NAME +
               '</span>' +
-              '<span>' +
-              that.$t('atlas.location') +
-              ': ' +
+              '</div>' +
+
+              '<div>' +
+              '<span style="color: #606266;">' +
+              that.$t('atlas.level') + ': ' +
+              '</span>' +
+              '<span style="color: #000000;">' +
+              params.data.DEC_LV_NAME +
+              '</span>' +
+              '</div>' +
+              '<div>' +
+              '<span style="color: #606266;">' +
+              that.$t('atlas.highest') + ': ' +
+              '</span>' +
+              '<span style="color: #000000;">' +
+              params.data.EMP_LV_NAME + ',' + params.data.CROWN_LV_NAME +
+              '</span>' +
+              '</div>' +
+
+
+              '</div>'
+            const networkStr =  "<div style='display: flex;flex-direction: column;'>" +
+              '<div>' +
+              (that.type === 'relation' ?
+                ( '<span style="color: #606266;">' + that.$t('atlas.algebra')  + ': ' + '</span>'  +  '<span style="color: #000000;">' + (Number(params.data.TOP_RELATION_DEEP) - Number(that.topDeep))  + '</span>' ) :
+                ( '<span style="color: #606266;">' + that.$t('atlas.numberOfLayers') + ': ' + '</span>') + '<span style="color: #000000;">' + (Number(params.data.TOP_NETWORK_DEEP) - Number(that.topDeep)) + '</span>' ) +
+              '</div>' +
+              '<div>' +
+              '<span style="color: #606266;">' +
+              that.$t('atlas.memberCode') + ': ' +
+              '</span>' +
+              '<span style="color: #000000;">' +
+              params.data.USER_NAME +
+              '</span>' +
+              '</div>' +
+
+              '<div>' +
+              '<span style="color: #606266;">' +
+              that.$t('atlas.name') + ': ' +
+              '</span>' +
+              '<span style="color: #000000;">' +
+              params.data.REAL_NAME +
+              '</span>' +
+              '</div>' +
+
+              '<div>' +
+              '<span style="color: #606266;">' +
+              that.$t('atlas.location') + ': ' +
+              '</span>' +
+              '<span style="color: #000000;">' +
               (params.data.RELATIVE_LOCATION || '') +
               '</span>' +
-              '<span>' +
+              '</div>' +
+              '<div>' +
+              '<span style="color: #606266;">' +
+              that.$t('atlas.level') + ': ' +
+              '</span>' +
+              '<span style="color: #000000;">' +
               params.data.DEC_LV_NAME +
               '</span>' +
-              '<span>' +
-              that.$t('atlas.highest') +
-              ': ' +
+              '</div>' +
+              '<div>' +
+              '<span style="color: #606266;">' +
+              that.$t('atlas.highest') + ': ' +
+              '</span>' +
+              '<span style="color: #000000;">' +
               params.data.EMP_LV_NAME + ',' + params.data.CROWN_LV_NAME +
               '</span>' +
-              '<span>' +
+              '</div>' +
+
+              "<div>" +
+              '<span style="color: #606266;">' +
+              that.$t('atlas.joiningPeriod') + ': ' +
+              '</span>' +
+              '<span style="color: #000000;">' +
               params.data.PERIOD_AT +
               '</span>' +
+              '</div>' +
               '</div>'
+
+            return that.type === 'relation' ? relationStr : networkStr
           },
           // valueFormatter: function (value) { // tooltip 中数值显示部分的格式化回调函数
           //   return '$' + value.toFixed(2)
@@ -123,7 +207,7 @@ export default {
             type: 'tree',
             data: [this.treeData],
             name: '树图',
-            top: '10%', // 组件离容器上侧的距离,像素值20,或相对容器的百分比20%
+            top: '5%', // 组件离容器上侧的距离,像素值20,或相对容器的百分比20%
             left: '5%', // 组件离容器左侧的距离
             bottom: '1%', // 组件离容器下侧的距离
             right: '2%', // 组件离容器右侧的距离
@@ -131,7 +215,7 @@ export default {
             orient: 'TB', // 树图中正交布局的方向,'LR','RL','TB','BT',只有布局是正交时才生效
             edgeShape: 'polyline', // 树图边的形状,有曲线curve和折线polyline两种,只有正交布局下生效
             roam: true, // 是否开启鼠标缩放或平移,默认false
-            zoom: 1,
+            zoom: 0.6,
             scaleLimit: {
               min: 0.5,
               max: 10
@@ -173,7 +257,7 @@ export default {
               borderWidth: 0.5, // 文字块边框宽度
               borderType: 'solid', // 文字块边框描边类型 solid dashed dotted
               borderRadius: 6, // 文字块的圆角
-              padding: [9, 6], // 文字块内边距
+              padding: [6, 5], // 文字块内边距
               shadowColor: 'rgba(0,121,221,0.6)', // 文字块的背景阴影颜色
               shadowBlur: 6, // 文字块的背景阴影长度
               // width: 60,
@@ -264,6 +348,6 @@ export default {
 <style lang="scss" scoped>
 .echarts-container {
   width: 100%;
-  height: calc(100vh - 105px);
+  height: calc(100vh - 230px);
 }
 </style>

+ 1 - 1
src/styles/style.scss

@@ -592,4 +592,4 @@ td .cell .no-border{font-size: 14px;color: #666; font-family: Menlo,Monaco,Conso
 .el-dropdown-menu__item{white-space: nowrap}
 .form-page{width: 650px;}
 .form-page .el-form-item > .el-form-item__content > .el-input,.form-page .el-form-item > .el-form-item__content > .el-cascader,.form-page .el-form-item > .el-form-item__content > .el-select,.form-page .el-form-item > .el-form-item__content > .el-textarea,.form-page .el-form-item > .el-form-item__content > .el-slider{width: 400px;}
-.form-dialog .el-form-item > .el-form-item__content > .el-input,.form-dialog .el-form-item > .el-form-item__content > .el-cascader,.form-dialog .el-form-item > .el-form-item__content > .el-select,.form-dialog .el-form-item > .el-form-item__content > .el-textarea,.form-dialog .el-form-item > .el-form-item__content > .el-slider{width: 350px;}
+.form-dialog .el-form-item > .el-form-item__content > .el-input,.form-dialog .el-form-item > .el-form-item__content > .el-cascader,.form-dialog .el-form-item > .el-form-item__content > .el-select,.form-dialog .el-form-item > .el-form-item__content > .el-textarea,.form-dialog .el-form-item > .el-form-item__content > .el-slider{width: 350px;}

+ 86 - 24
src/views/atlas/network-ex.vue

@@ -15,23 +15,26 @@
               </el-input>
               <el-button type="primary" size="small" @click="getMainData()">{{ $t('common.confirm') }}<!-- 确定 --></el-button>
             </div>
-            <el-tree :props="props" :data="treeData" node-key="USER_ID" @node-click="getChildData" ref="tree" :indent="0"
-                     default-expand-all :height="tool.getTableHeight(true)">
-              <span :id="'node_'+data.USER_ID" :class="'custom-tree-node '+data.className"
-                    slot-scope="{ node, data }">
-                <span :class="'el-icon-loading '+ data.displayNone"></span>
-                <span :class="data.icon"></span>
-                <span>
-                  <el-tag type="danger">{{ $t('atlas.numberOfLayers') }} :{{countTopDeep(data.TOP_NETWORK_DEEP,topDeep)}}</el-tag>
-                  <el-tag><!-- 会员编号 -->{{ $t('atlas.memberCode') }}:{{ node.label }}</el-tag>
-                  <el-tag>{{ $t('atlas.name') }}<!-- 姓名 -->:{{data.REAL_NAME}}</el-tag>
-                  <el-tag type="danger"><!-- 区位 -->{{ $t('atlas.location') }}:{{data.RELATIVE_LOCATION}}</el-tag>
-                  <el-tag type="success"><!-- 级别 -->{{ $t('atlas.level') }}:{{data.DEC_LV_NAME}}</el-tag>
-                  <el-tag type="warning"><!-- 聘级 -->{{ $t('atlas.highest') }}:{{data.EMP_LV_NAME}}, {{data.CROWN_LV_NAME}}</el-tag>
-                  <el-tag><!-- 加入期数 -->{{ $t('atlas.joiningPeriod') }}:{{data.PERIOD_AT}}</el-tag>
-                </span>
-              </span>
-            </el-tree>
+<!--            <el-tree :props="props" :data="treeData" node-key="USER_ID" @node-click="getChildData" ref="tree" :indent="0"-->
+<!--                     default-expand-all :height="tool.getTableHeight(true)">-->
+<!--              <span :id="'node_'+data.USER_ID" :class="'custom-tree-node '+data.className"-->
+<!--                    slot-scope="{ node, data }">-->
+<!--                <span :class="'el-icon-loading '+ data.displayNone"></span>-->
+<!--                <span :class="data.icon"></span>-->
+<!--                <span>-->
+<!--                  <el-tag type="danger">{{ $t('atlas.numberOfLayers') }} :{{countTopDeep(data.TOP_NETWORK_DEEP,topDeep)}}</el-tag>-->
+<!--                  <el-tag>&lt;!&ndash; 会员编号 &ndash;&gt;{{ $t('atlas.memberCode') }}:{{ node.label }}</el-tag>-->
+<!--                  <el-tag>{{ $t('atlas.name') }}&lt;!&ndash; 姓名 &ndash;&gt;:{{data.REAL_NAME}}</el-tag>-->
+<!--                  <el-tag type="danger">&lt;!&ndash; 区位 &ndash;&gt;{{ $t('atlas.location') }}:{{data.RELATIVE_LOCATION}}</el-tag>-->
+<!--                  <el-tag type="success">&lt;!&ndash; 级别 &ndash;&gt;{{ $t('atlas.level') }}:{{data.DEC_LV_NAME}}</el-tag>-->
+<!--                  <el-tag type="warning">&lt;!&ndash; 聘级 &ndash;&gt;{{ $t('atlas.highest') }}:{{data.EMP_LV_NAME}}, {{data.CROWN_LV_NAME}}</el-tag>-->
+<!--                  <el-tag>&lt;!&ndash; 加入期数 &ndash;&gt;{{ $t('atlas.joiningPeriod') }}:{{data.PERIOD_AT}}</el-tag>-->
+<!--                </span>-->
+<!--              </span>-->
+<!--            </el-tree>-->
+            <div v-if="treeChartShow" class="tree-chart">
+              <tree-chart :tree-data="treeData" :top-deep="topDeep" type="network" @clickNode="getNodeData" :clickNodeList="clickNodeList" />
+            </div>
           </el-tab-pane>
           <el-tab-pane :label="$t('atlas.placementNetworkList')" name="two" v-if="permission.hasPermission(`atlas/network-list`)"><!-- 安置网络列表 -->
             <div class="filter-user">
@@ -92,10 +95,11 @@ import baseInfo from '@/utils/baseInfo'
 import permission from '@/utils/permission'
 import tool from '@/utils/tool'
 import store from '@/utils/vuexStore'
+  import treeChart from "@/components/TreeChart/index.vue";
 
   export default {
     name: 'atlas_network-ex',
-    components: {Pagination},
+    components: {treeChart, Pagination},
     mounted() {
       this.getData()
       store.state.socket.onMessageCallback = this.onMessageCallback
@@ -112,7 +116,7 @@ import store from '@/utils/vuexStore'
           //isLeaf: 'leaf',
           icon: 'icon',
         },
-        treeData: null,
+        // treeData: null,
         expandDeep: 2,
         topDeep: 0,
         mainUserName: '',
@@ -132,9 +136,28 @@ import store from '@/utils/vuexStore'
           periodNum: null,
         },
         listTopDeep: 0,
+        //tree
+        treeChartShow: false,
+        treeData: {
+          name: null,
+          children: null
+        },
+        clickNodeList:[],
+        clickNodeUserId:null
       }
     },
     methods: {
+      //tree
+      getNodeData(e) {
+        // console.log(e)
+        if (e.collapsed === false && e.data.children == null) {
+          console.log(e.name + '---节点展开')
+        }
+        if (e.data.children == null) {
+          this.clickNodeUserId = e.data.USER_ID
+          this.getChildData(e.data, 'clickNode')
+        }
+      },
       getData() {
         this.$message({
           message: this.$t('atlas.getDataWait'), // 正在获取数据,请稍后
@@ -144,6 +167,7 @@ import store from '@/utils/vuexStore'
         if (permission.hasPermission(`atlas/network-list`) && !permission.hasPermission(`atlas/network`)) {
           this.tabActiveName = 'two'
           this.getListData()
+          console.log(this.treeData)
         }
         if (permission.hasPermission(`atlas/network`)) {
           this.tabActiveName = 'first'
@@ -166,13 +190,17 @@ import store from '@/utils/vuexStore'
         if (this.mainUserName !== null) {
           requestData = {userName: this.mainUserName,periodNum: this.periodNum}
         }
-
         mainUserInfo(requestData).then(response=>{
-            thisObj.treeData = response.data
+            const treeData = Object.assign(response.data[0])
+            thisObj.treeData = {...treeData}
             thisObj.topDeep = Number(response.data[0].TOP_NETWORK_DEEP)
             thisObj.listPeriodNum = response.data[0].listPeriodNum
             if(getList) thisObj.getListData()
+            this.getChildData(treeData)
+
             thisObj.loading = false
+            thisObj.treeChartShow = false
+
         }).catch(err => {
             this.$message({
                 message: err,
@@ -181,7 +209,7 @@ import store from '@/utils/vuexStore'
             thisObj.loading = false
         })
       },
-      getChildData (data, node) {
+      getChildData (data, type) {
         let thisObj = this
         let userId = data.USER_ID
         let thisData = data
@@ -200,10 +228,22 @@ import store from '@/utils/vuexStore'
           deep: thisObj.expandDeep,
           periodNum: this.periodNum
         }).then(response => {
-            thisObj.$refs.tree.updateKeyChildren(userId, response.data.allData)
+            // thisObj.$refs.tree.updateKeyChildren(userId, response.data.allData)
             thisObj.listPeriodNum = response.data.periodNum
             thisData.displayNone = 'display-none'
             thisData.isExpanded = true
+            const resAllData = response.data.allData
+
+          if (type === 'clickNode') {
+            console.log('clickNode', thisData.USER_ID)
+            thisObj.clickNodeList = resAllData
+            thisObj.treeData.children = thisObj.treeAddNode(thisObj.treeData.children)
+          } else {
+            thisObj.treeData.children = thisObj.traversalTree(resAllData, thisObj)
+          }
+
+          thisObj.treeChartShow = true
+          thisObj.loading = false
         }).catch(err => {
             this.$message({
               message: err,
@@ -211,6 +251,28 @@ import store from '@/utils/vuexStore'
             })
         })
       },
+      traversalTree(tree) {
+        const that = this
+        tree.forEach((item) => {
+          item.name = item.USER_NAME
+          if (item.children && item.children.length > 0) {
+            that.traversalTree(item.children)
+          }
+        })
+        return tree
+      },
+      treeAddNode(tree) {
+        const that = this
+        tree.forEach((item) => {
+          if (item.USER_ID == that.clickNodeUserId) {
+            item.children = this.clickNodeList
+          }
+          if (item.children && item.children.length > 0) {
+            that.treeAddNode(item.children)
+          }
+        })
+        return tree
+      },
       countTopDeep(deep,topDeep){
         return Number(deep)-Number(topDeep)
       },
@@ -287,7 +349,7 @@ import store from '@/utils/vuexStore'
   </script>
 
   <style>
-    .filter-user{font-size: 14px;margin-bottom: 20px;}
+    .filter-user{font-size: 14px;margin-bottom: 5px;}
     .filter-user:after{content: '';display: table;
       clear: both;}
     .filter-user .el-input-group{float: left;margin-right: 15px;}

+ 69 - 31
src/views/atlas/relation-ex.vue

@@ -15,24 +15,24 @@
               </el-input>
               <el-button type="primary" size="small" @click="getMainData()">{{ $t('common.confirm') }}<!-- 确定 --></el-button>
             </div>
-            <el-tree :props="props" :data="treeData" node-key="USER_ID" @node-click="getChildData" ref="tree" :indent="0"
-                     default-expand-all>
-                  <span :id="'node_'+data.USER_ID" :class="'custom-tree-node '+data.className"
-                        slot-scope="{ node, data }">
-                      <span :class="'el-icon-loading '+ data.displayNone"></span>
-                      <span :class="data.icon"></span>
-                      <span>
-                        <el-tag type="danger"><!-- 代数 -->{{ $t('atlas.algebra') }}:  {{countTopDeep(data.TOP_RELATION_DEEP,topDeep)}}</el-tag>
-                        <el-tag><!-- 会员编号 -->{{ $t('atlas.memberCode') }}:{{ node.label }}</el-tag>
-                        <el-tag type="success">{{ $t('atlas.name') }}<!-- 姓名 -->:{{data.REAL_NAME}}</el-tag>
-                        <el-tag type="warning">{{ $t('atlas.level') }}<!-- 级别 -->:{{data.DEC_LV_NAME}}</el-tag>
-                        <el-tag type="warning">{{ $t('atlas.highest') }}:<!-- 聘级 -->{{data.EMP_LV_NAME}}, {{data.CROWN_LV_NAME}}</el-tag>
-  <!--                      <el-tag type="warning">Star:&lt;!&ndash; 星级 &ndash;&gt;{{data.CROWN_LV_NAME}}</el-tag>-->
-                      </span>
-                  </span>
-            </el-tree>
+<!--            <el-tree :props="props" :data="treeData" node-key="USER_ID" @node-click="getChildData" ref="tree" :indent="0"-->
+<!--                     default-expand-all>-->
+<!--                  <span :id="'node_'+data.USER_ID" :class="'custom-tree-node '+data.className"-->
+<!--                        slot-scope="{ node, data }">-->
+<!--                      <span :class="'el-icon-loading '+ data.displayNone"></span>-->
+<!--                      <span :class="data.icon"></span>-->
+<!--                      <span>-->
+<!--                        <el-tag type="danger">&lt;!&ndash; 代数 &ndash;&gt;{{ $t('atlas.algebra') }}:  {{countTopDeep(data.TOP_RELATION_DEEP,topDeep)}}</el-tag>-->
+<!--                        <el-tag>&lt;!&ndash; 会员编号 &ndash;&gt;{{ $t('atlas.memberCode') }}:{{ node.label }}</el-tag>-->
+<!--                        <el-tag type="success">{{ $t('atlas.name') }}&lt;!&ndash; 姓名 &ndash;&gt;:{{data.REAL_NAME}}</el-tag>-->
+<!--                        <el-tag type="warning">{{ $t('atlas.level') }}&lt;!&ndash; 级别 &ndash;&gt;:{{data.DEC_LV_NAME}}</el-tag>-->
+<!--                        <el-tag type="warning">{{ $t('atlas.highest') }}:&lt;!&ndash; 聘级 &ndash;&gt;{{data.EMP_LV_NAME}}, {{data.CROWN_LV_NAME}}</el-tag>-->
+<!--  &lt;!&ndash;                      <el-tag type="warning">Star:&lt;!&ndash; 星级 &ndash;&gt;{{data.CROWN_LV_NAME}}</el-tag>&ndash;&gt;-->
+<!--                      </span>-->
+<!--                  </span>-->
+<!--            </el-tree>-->
             <div v-if="treeChartShow" class="tree-chart">
-              <tree-chart :tree-data="treeData" :top-deep="topDeep" type="placement" @clickNode="getNodeData" :clickNodeList="clickNodeList" />
+              <tree-chart :tree-data="treeData" :top-deep="topDeep" type="relation" @clickNode="getNodeData" :clickNodeList="clickNodeList" />
             </div>
           </el-tab-pane>
           <el-tab-pane :label="$t('atlas.sponsorNetworkList')" name="two" v-if="permission.hasPermission(`atlas/relation-list`)"><!-- 开拓网络列表 -->
@@ -136,7 +136,6 @@ import store from '@/utils/vuexStore'
             periodNum: null,
           },
           listTopDeep: 0,
-
           //tree
           treeChartShow: false,
           treeData: {
@@ -157,9 +156,7 @@ import store from '@/utils/vuexStore'
           if (e.data.children == null) {
             this.clickNodeUserId = e.data.USER_ID
             this.getChildData(e.data, 'clickNode')
-
           }
-
         },
         getData() {
           this.$message({
@@ -171,6 +168,7 @@ import store from '@/utils/vuexStore'
           if (permission.hasPermission(`atlas/relation-list`) && !permission.hasPermission(`atlas/relation`)) {
             this.tabActiveName = 'two'
             this.getListData()
+            console.log(this.treeData)
           }
           if (permission.hasPermission(`atlas/relation`)) {
             this.tabActiveName = 'first'
@@ -194,11 +192,15 @@ import store from '@/utils/vuexStore'
             requestData = {userName: this.mainUserName,periodNum: this.periodNum}
           }
           mainUserInfo(requestData).then(response=>{
-            thisObj.treeData = response.data
+            const treeData = Object.assign(response.data[0])
+            thisObj.treeData = {...treeData}
             thisObj.topDeep = Number(response.data[0].TOP_RELATION_DEEP)
             thisObj.listPeriodNum = response.data[0].listPeriodNum
             if(getList) thisObj.getListData()
+            this.getChildData(treeData)
             thisObj.loading = false
+            thisObj.treeChartShow = false
+
           }).catch(err => {
             this.$message({
                 message: err,
@@ -207,8 +209,10 @@ import store from '@/utils/vuexStore'
             thisObj.loading = false
           })
         },
-        getChildData (data, node) {
+        getChildData (data, type) {
           let thisObj = this
+          thisObj.loading = true
+
           let userId = data.USER_ID
           let thisData = data
           if (thisData.leaf) {
@@ -220,26 +224,60 @@ import store from '@/utils/vuexStore'
           if (thisData.children !== null && thisData.children.length > 0) {
             return ''
           }
-          this.$message({
-            message: this.$t('atlas.getDataWait'),//正在获取数据,请稍后
-          })
+          // this.$message({
+          //   message: this.$t('atlas.getDataWait'),//正在获取数据,请稍后
+          // })
           thisData.displayNone = ''
           getRelation({
             id: userId,
             deep: thisObj.expandDeep,
             periodNum: this.periodNum
           }).then(response => {
-            thisObj.$refs.tree.updateKeyChildren(userId, response.data.allData)
-            thisData.listPeriodNum = response.data.periodNum
-            thisData.displayNone = 'display-none'
-            thisData.isExpanded = true
+            // thisObj.$refs.tree.updateKeyChildren(userId, response.data.allData)
+            thisObj.listPeriodNum = response.data.periodNum
+            thisObj.displayNone = 'display-none'
+            thisObj.isExpanded = true
+            const resAllData = response.data.allData
+
+            if (type === 'clickNode') {
+              console.log('clickNode', thisData.USER_ID)
+              thisObj.clickNodeList = resAllData
+              thisObj.treeData.children = thisObj.treeAddNode(thisObj.treeData.children)
+            } else {
+              thisObj.treeData.children = thisObj.traversalTree(resAllData, thisObj)
+            }
+
+            thisObj.treeChartShow = true
+            thisObj.loading = false
           }).catch(err => {
-            this.$message({
+            thisObj.$message({
                 message: err,
                 type: 'error'
             })
           })
         },
+        traversalTree(tree) {
+          const that = this
+          tree.forEach((item) => {
+            item.name = item.USER_NAME
+            if (item.children && item.children.length > 0) {
+              that.traversalTree(item.children)
+            }
+          })
+          return tree
+        },
+        treeAddNode(tree) {
+          const that = this
+          tree.forEach((item) => {
+            if (item.USER_ID == that.clickNodeUserId) {
+              item.children = this.clickNodeList
+            }
+            if (item.children && item.children.length > 0) {
+              that.treeAddNode(item.children)
+            }
+          })
+          return tree
+        },
         countTopDeep(deep,topDeep){
           return Number(deep)-Number(topDeep)
         },
@@ -314,7 +352,7 @@ import store from '@/utils/vuexStore'
   </script>
 
   <style>
-    .filter-user{font-size: 14px;margin-bottom: 20px;}
+    .filter-user{font-size: 14px;margin-bottom: 5px;}
     .filter-user:after{content: '';display: table;
       clear: both;}
     .filter-user .el-input-group{float: left;margin-right: 15px;}