jwyu 1 gadu atpakaļ
vecāks
revīzija
f76c96813a

+ 7 - 1
src/views/dataEntry_manage/thirdBase/mixins/leftMixin.js

@@ -44,7 +44,12 @@ export default {
       // let arr = this.findParentNodeHandle(deep_arr, code).slice(1).reverse(); // 父的父的父-父的父-父
       this.defaultShowNodes = selectClassifyNodes;
       this.select_node = code;
-      this.$refs.treeRef.setCurrentKey(this.select_node);
+      this.$nextTick(()=>{
+        setTimeout(() => {
+          this.$refs.treeRef.setCurrentKey(this.select_node);
+        }, 300);
+      })
+      
       // // 重置筛选状态
       this.edb_id = id;
       this.getFrequency();
@@ -68,6 +73,7 @@ export default {
 
     /* 拖动时node宽度跟随变化 */
     resetNodeStyle: _.debounce(function(node) {
+      console.log(node);
 			const tree = $('.target_tree')[0];
 			let width = tree.offsetWidth;
 			let label_wid =

+ 12 - 9
src/views/dataEntry_manage/thirdBase/smmTargetbase.vue

@@ -655,7 +655,7 @@ export default {
 
       this.$nextTick(() => {
         //找到父节点并展开
-        const targetData = this.getTargetData(e.IndexCode, this.classifyList);
+        const targetData = this.getTargetData(e.ClassifyId, this.classifyList);
         if (targetData) {
           //一级节点
           const { topParentNodeId, UniqueCode } = targetData;
@@ -670,11 +670,14 @@ export default {
           let width = tree.offsetWidth;
           let label_width =
             width > 500 ? "auto" : width <= 500 ? 90 : 0.7 * width;
-          targetData.NodeWidth = label_width;
-          this.select_node = UniqueCode;
-          this.$refs.treeRef.setCurrentNode(targetData);
-          const node = this.$refs.treeRef.getCurrentNode();
-          this.resetNodeStyle(node);
+          // targetData.NodeWidth = label_width;
+          this.select_node = `${e.ClassifyId}_${e.BaseFromSmmIndexId}_${e.IndexCode}`;
+
+          setTimeout(() => {
+            this.$refs.treeRef.setCurrentKey(this.select_node);
+            const node = this.$refs.treeRef.getNode(this.select_node);
+            this.resetNodeStyle(node);
+          }, 1000);
         }
         //this.handleScrollLeftWrap()
       });
@@ -686,11 +689,11 @@ export default {
         scrollTop: top - 200,
       });
     },
-    getTargetData(code, arr) {
+    getTargetData(ClassifyId, arr) {
       for (const item of arr) {
-        if (item.BaseFromSmmIndexCode === code) return item;
+        if (item.ClassifyId === ClassifyId) return item;
         if (item.Children && item.Children.length) {
-          const _item = this.getTargetData(code, item.Children);
+          const _item = this.getTargetData(ClassifyId, item.Children);
           if (_item) return _item;
         }
       }

+ 3 - 1
src/views/dataEntry_manage/thirdBase/steelChemicalbase.vue

@@ -498,7 +498,9 @@ export default {
 
       this.leftSearchVal = e.IndexName;
 
-      this.getClassify({ code: e.UniqueCode, id: e.Id });
+      // 父级
+      let selectClassifyNodes=[`${e.ParentClassifyId}`,`${e.BaseFromMysteelChemicalClassifyId}`]
+      this.getClassify({ code: e.UniqueCode, id: e.Id ,selectClassifyNodes});
     },
 
     /* 编辑分类 */