From 94622a4e89fc844b96016859dc136f868fe15d31 Mon Sep 17 00:00:00 2001
From: hailu <962012470@qq.com>
Date: 星期四, 16 二月 2023 18:48:16 +0800
Subject: [PATCH] 点智优化

---
 src/components/SeniorTranfer.vue |  140 +++-------------------------------------------
 1 files changed, 11 insertions(+), 129 deletions(-)

diff --git a/src/components/SeniorTranfer.vue b/src/components/SeniorTranfer.vue
index 0d3e18e..c250343 100644
--- a/src/components/SeniorTranfer.vue
+++ b/src/components/SeniorTranfer.vue
@@ -169,103 +169,38 @@
       console.log(this.activeKey);
       switch (this.activeKey) {
         case 'ipcCodeSort':
-          
             url = GetIpcClass
-            // params = [{ year: `${this.ICPYear}`,FieldName:'desc',ConditionalType:'1',FieldValue:this.parentCodeSearch}],
             params = { "year": `${this.ICPYear}`, "json": JSON.stringify([{ FieldName: 'desc', ConditionalType: '1', FieldValue: this.parentCodeSearch }]) },
-              // this.treeDimensions = { children: 'children', title: 'Desc', key: 'Code' }
-          
-              this.treeDimensions = { children: 'children', title: 'lable', key: 'value',valueshow:'valueshow' }
+              this.treeDimensions = { children: 'children', title: 'lable', key: 'Code' }
           break;
         case 'cpcCodeSort':
-         
             url = GetCpcClass
             params = { "json": JSON.stringify([{ FieldName: 'desc', ConditionalType: '1', FieldValue: this.parentCodeSearch }]) },
-
-            // this.treeDimensions = { children: 'children', title: 'Desc', key: 'Code' }
-            this.treeDimensions = { children: 'children', title: 'lable', key: 'value',valueshow:'valueshow' }
-        
+            this.treeDimensions = { children: 'children', title: 'lable', key: 'Code' }
+            // this.treeDimensions = { children: 'children', title: 'lable', key: 'value',valueshow:'valueshow' }
           break;
         case 'industrycode':
           url = GetEcoindustryTree
           params = { "json": JSON.stringify([{ FieldName: 'Name', ConditionalType: '1', FieldValue: this.parentCodeSearch }]) },
-            this.treeDimensions = { children: 'children', title: 'lable', key: 'value',valueshow:'valueshow' }
-          // console.log(this.treeDimensions);
+            // this.treeDimensions = { children: 'children', title: 'lable', key: 'value',valueshow:'valueshow' }
+            this.treeDimensions = { children: 'children', title: 'lable', key: 'value' }
           break;
         case 'strategicIndustryCode':
           url = GetStraindustryTree
           params = { "json": JSON.stringify([{ FieldName: 'Name', ConditionalType: '1', FieldValue: this.parentCodeSearch }]) },
-
-            this.treeDimensions = { children: 'children', title: 'lable', key: 'value',valueshow:'valueshow' }
+            // this.treeDimensions = { children: 'children', title: 'lable', key: 'value',valueshow:'valueshow' }
+            this.treeDimensions = { children: 'children', title: 'lable', key: 'value' }
           break;
         case 'locarnoCodeSort':
           url = GetLoccn
           params = { "json": JSON.stringify([{ FieldName: 'desc', ConditionalType: '1', FieldValue: this.parentCodeSearch }]) },
-            // this.treeDimensions = { children: 'children', title: 'Desc', key: 'Code' }
-            this.treeDimensions = { children: 'children', title: 'lable', key: 'value' ,valueshow:'valueshow'}
+          this.treeDimensions = { children: 'children', title: 'lable', key: 'value' }
+            // this.treeDimensions = { children: 'children', title: 'lable', key: 'value' ,valueshow:'valueshow'}
           break;
       }
       this.treeLoading = true
       url(params).then(res => {
         this.treeData = this.formatTreeData(res.Data)
-        // console.log(this.treeData);
-        // if (url.toString().indexOf('GetCpcClass') > 0) {
-        //   // this.treeData
-        //   for (let i = 0; i < this.treeData.length; i++) {
-        //     console.log(this.treeData[i]);
-        //     this.treeData[i].title = `${this.treeData[i].value}  ${this.treeData[i].lable}`
-        //     for (let k = 0; k < this.treeData[i].children.length; k++) {
-        //       this.treeData[i].children[k].title = `${this.treeData[i].children[k].value}  ${this.treeData[i].children[k].lable}`
-        //     }
-        //   }
-        // }
-        // if (url.toString().indexOf('GetStraindustryTree') > 0) {
-        //   // this.treeData
-        //   for (let i = 0; i < this.treeData.length; i++) {
-        //     console.log(this.treeData[i]);
-        //     this.treeData[i].title = `${this.treeData[i].value}  ${this.treeData[i].title}`
-        //     for (let k = 0; k < this.treeData[i].children.length; k++) {
-        //       this.treeData[i].children[k].title = `${this.treeData[i].children[k].value}  ${this.treeData[i].children[k].title}`
-        //     }
-        //   }
-        // }
-        // if (url.toString().indexOf('GetLoccn') > 0) {
-        //   // this.treeData
-        //   for (let i = 0; i < this.treeData.length; i++) {
-        //     console.log(this.treeData[i]);
-        //     this.treeData[i].title = `${this.treeData[i].value}  ${this.treeData[i].lable}`
-        //     for (let k = 0; k < this.treeData[i].children.length; k++) {
-        //       this.treeData[i].children[k].title = `${this.treeData[i].children[k].value}  ${this.treeData[i].children[k].lable}`
-        //     }
-        //   }
-        // }
-        // if (url.toString().indexOf('GetEcoindustryTree') > 0) {
-        //   console.log(1111);
-        //   // this.treeData
-        //   // for(let i=0;i<this.treeData.children.length;i++){
-        //   //   console.log(this.treeData.children[i]);
-        //   //   this.treeData.children[i].label= `${this.treeData.children[i].value }  ${ this.treeData.children[i].label }`
-        //   //   for(let k=0;k<this.treeData.children[i].children.length;k++){
-        //   //     this.treeData.children[i].children[k].label= `${this.treeData.children[i].children[k].value }  ${ this.treeData.children[i].children[k].label }`
-        //   //   }
-        //   // }
-        //   for (let i = 0; i < this.treeData.length; i++) {
-        //     this.treeData[i].title = `${this.treeData[i].value}  ${this.treeData[i].lable}`
-        //     for (let k = 0; k < this.treeData[i].children.length; k++) {
-        //       this.treeData[i].children[k].title = `${this.treeData[i].children[k].value}  ${this.treeData[i].children[k].lable}`
-        //       for (let j = 0; j < this.treeData[i].children[k].children.length; j++) {
-        //         this.treeData[i].children[k].children[j].title = `${this.treeData[i].children[k].children[j].value}  ${this.treeData[i].children[k].children[j].lable}`
-        //         for (let q = 0; q < this.treeData[i].children[k].children[j].children.length; q++) {
-        //           this.treeData[i].children[k].children[j].children[q].title = `${this.treeData[i].children[k].children[j].children[q].value}  ${this.treeData[i].children[k].children[j].children[q].lable}`
-
-        //         }
-        //       }
-        //     }
-        //   }
-
-
-          console.log(this.treeData);
-        // }
         this.treeLoading = false
       })
     },
@@ -295,7 +230,6 @@
         case 'industrycode':
           url = GetEcoindustryTree
           this.treeDimensions = { children: 'children', title: 'lable', key: 'value' }
-          // console.log(this.treeDimensions);
           break;
         case 'strategicIndustryCode':
           url = GetStraindustryTree
@@ -313,47 +247,6 @@
       this.treeLoading = true
       url(params).then(res => {
         this.treeData = this.formatTreeData(res.Data)
-        // console.log(this.treeData);
-        if (url.toString().indexOf('GetStraindustryTree') > 0) {
-          // this.treeData
-          for (let i = 0; i < this.treeData.length; i++) {
-            console.log(this.treeData[i]);
-            this.treeData[i].title = `${this.treeData[i].value}  ${this.treeData[i].title}`
-            for (let k = 0; k < this.treeData[i].children.length; k++) {
-              this.treeData[i].children[k].title = `${this.treeData[i].children[k].value}  ${this.treeData[i].children[k].title}`
-            }
-          }
-        }
-        if (url.toString().indexOf('GetLoccn') > 0) {
-          // this.treeData
-          for (let i = 0; i < this.treeData.length; i++) {
-            console.log(this.treeData[i]);
-            this.treeData[i].title = `${this.treeData[i].value}  ${this.treeData[i].lable}`
-            for (let k = 0; k < this.treeData[i].children.length; k++) {
-              this.treeData[i].children[k].title = `${this.treeData[i].children[k].value}  ${this.treeData[i].children[k].lable}`
-            }
-          }
-        }
-        if (url.toString().indexOf('GetEcoindustryTree') > 0) {
-          console.log(1111);
-
-          for (let i = 0; i < this.treeData.length; i++) {
-            this.treeData[i].title = `${this.treeData[i].value}  ${this.treeData[i].lable}`
-            for (let k = 0; k < this.treeData[i].children.length; k++) {
-              this.treeData[i].children[k].title = `${this.treeData[i].children[k].value}  ${this.treeData[i].children[k].lable}`
-              for (let j = 0; j < this.treeData[i].children[k].children.length; j++) {
-                this.treeData[i].children[k].children[j].title = `${this.treeData[i].children[k].children[j].value}  ${this.treeData[i].children[k].children[j].lable}`
-                for (let q = 0; q < this.treeData[i].children[k].children[j].children.length; q++) {
-                  this.treeData[i].children[k].children[j].children[q].title = `${this.treeData[i].children[k].children[j].children[q].value}  ${this.treeData[i].children[k].children[j].children[q].lable}`
-
-                }
-              }
-            }
-          }
-
-
-          console.log(this.treeData);
-        }
         this.treeLoading = false
       })
     },
@@ -364,14 +257,11 @@
       let that = this
       function flatten(list = []) {
         list.forEach(item => {
-          
-          item.title=(that.activeKey==='strategicIndustryCode')?item.valueshow.split(' ')[1]: item.valueshow
-          // item.title= item.valueshow
+          // item.title=(that.activeKey==='strategicIndustryCode')?item.valueshow.split(' ')[1]: item.valueshow
+          item.title= item.valueshow
           item.key = item[that.treeDimensions.key]
           flatten(item.children);
-          
         });
-       
       }
       console.log(tempList);
       tempList = JSON.parse(JSON.stringify(listData))
@@ -401,20 +291,12 @@
             url = GetCpcClassTree
           }
           this.copy=treeNode.dataRef.key
-          
           url({
             // year: this.activeKey == 'cpcCodeSort' ? this.ICPYear : undefined,
             year: this.activeKey == 'ipcCodeSort' ? this.ICPYear : undefined,
-
             parentCode: treeNode.dataRef.key
-
           }).then(res => {
-            // if(this.parentCodeSearch){
-            //   treeNode.dataRef.children = this.formatTreeData(res.Data,0)
-            // }else{
               treeNode.dataRef.children = this.formatTreeData(res.Data)
-            // }
-            
             this.treeData = [...this.treeData];
             resolve();
           })

--
Gitblit v1.8.0