From 2b5e0880896929389c873b3a1d9f47d789d0f6e1 Mon Sep 17 00:00:00 2001
From: 王震 <10952869+daywangzhen@user.noreply.gitee.com>
Date: 星期二, 12 九月 2023 09:07:15 +0800
Subject: [PATCH] 改bug

---
 src/components/view/technology.vue |   53 ++++++++++++++++++++++++++++-------------------------
 1 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/src/components/view/technology.vue b/src/components/view/technology.vue
index c4e5282..12fc170 100644
--- a/src/components/view/technology.vue
+++ b/src/components/view/technology.vue
@@ -171,7 +171,7 @@
           :data="towTree"
           ref="tree"
           :props="{ children: 'children', label: 'father' }"
-          node-key="id"
+          node-key="name"
           default-expand-all
           @node-click="handleNodeClick"
           style="height: 500px;overflow-y: auto;"
@@ -234,6 +234,7 @@
               <el-select
                 v-model="edit.type"
                 placeholder="璇烽�夋嫨"
+                disabled
                 style="width: 310px"
               >
                 <el-option label="姗¤兌杩炴帴鍣�" :value="0"></el-option>
@@ -252,12 +253,14 @@
             <el-select
               v-model="edit.father"
               style="width: 310px"
+              disabled
               placeholder="璇烽�夋嫨"
             >
               <el-option
                 v-for="item in procedure"
                 :key="item"
                 :label="item"
+                disabled
                 :value="item"
               >
               </el-option>
@@ -270,8 +273,9 @@
           >
           <el-col :span="16" :offset="1">
             <el-select
-              v-model="AAA.id"
+              v-model="edit.children"
               style="width: 310px"
+              
               multiple
               placeholder="璇烽�夋嫨"
             >
@@ -279,7 +283,7 @@
                 v-for="item in element"
                 :key="item.id"
                 :label="item.name"
-                :value="item.id"
+                :value="item.name"
               >
               </el-option>
             </el-select>
@@ -322,6 +326,7 @@
                 v-model="form.type"
                 placeholder="璇烽�夋嫨"
                 style="width: 480px"
+                @change="edittype"
               >
                 <el-option label="姗¤兌杩炴帴鍣�" :value="0"></el-option>
                 <el-option label="閲戝睘杩炴帴鍣�" :value="1"></el-option>
@@ -378,7 +383,7 @@
                   >
                     <el-option
                       v-for="item in element"
-                      :key="item.value"
+                      :key="item.id"
                       :label="item.name"
                       :value="item.id"
                     >
@@ -521,11 +526,10 @@
       ],
       edit: {
         deviceGroup: "",
-        elementId: "",
         father: "",
         name: "",
         type: "",
-        // children:[],
+        children:[],
       },
       upData: {
         name: "",
@@ -576,7 +580,7 @@
     },
     Deleteapi() {
       this.dialogVisible = false;
-      this.form = "";
+      this.form = {};
     },
     addTechTemp() {
       // console.log(this.$api.url.addTechTemp);
@@ -621,11 +625,19 @@
 
     //宸ュ簭
     chooseTech() {
-      this.$axios.get(this.$api.url.chooseTech).then((res) => {
-        this.procedure = res.data;
-        console.log(this.procedure);
-      });
+      this.$axios.get(this.$api.url.chooseTech,{
+          params:{
+            type:this.typeselect
+          }
+      }).then(res =>{
+        console.log(res);
+        this.procedure = res.data
+      })
     },
+    edittype(val) {
+				this.typeselect = val
+				this.chooseTech()
+			},
     //鎵归噺鍒犻櫎
     delAllTech() {
       console.log(this.delete);
@@ -679,7 +691,10 @@
         })
         .then((res) => {
           this.towTree = res.data;
-		  console.log(this.towTree);
+          console.log(this.towTree);
+          this.$nextTick(() => {
+				this.$refs.tree.setCurrentKey(this.towTree[0].children[0].name) // 榛樿閫変腑鑺傜偣绗竴涓�
+			})
 		  let one=this.towTree.filter(item=>{
 			return item.children.length>0
 		  })[0]
@@ -792,25 +807,13 @@
         })
         .then((res) => {
           this.edit = res.data[0];
-          this.AAA = res.data[0].children;
           console.log(this.edit);
-          console.log(this.AAA);
-          // this.edit.forEach(el => {
-          // // el.children.forEach(ele =>{
-          // //     this.AAA.push(ele)
-          // console.log(el);
-          // })
-          // console.log(this.AAA.id);
-          // })
-          // console.log(this.edit);
         });
     },
     //缂栬緫鍐呭
     upContent(ob) {
       this.upData = ob;
-      this.selecTechById();
-      this.selecTechById();
-      console.log(this.upData);
+      this.selecTechById()
       this.upDia = true;
     },
 

--
Gitblit v1.9.3