From d96a7562b2515584fac4dcb57fdbdcadc8f36fef Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期六, 03 八月 2024 17:48:23 +0800
Subject: [PATCH] 测试完成

---
 src/views/knowledge/education/index.vue |   35 +++++++++++++++++++++++++++++++++--
 1 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/src/views/knowledge/education/index.vue b/src/views/knowledge/education/index.vue
index fb79e5a..de1d072 100644
--- a/src/views/knowledge/education/index.vue
+++ b/src/views/knowledge/education/index.vue
@@ -39,6 +39,17 @@
               >
               </el-button>
             </span>
+            <span v-if="data.id > 0">
+              <el-button
+                type="text"
+                circle
+                size="mini"
+                @click="() => altertag(node, data)"
+                ><span class="button-textxg"
+                  ><i class="el-icon-edit-outline"></i
+                ></span>
+              </el-button>
+            </span>
           </span>
         </el-tree>
       </div>
@@ -390,7 +401,7 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button @click="dialogFormVisible = false">鍙� 娑�</el-button>
+        <el-button @click="getDeptTree()">鍙� 娑�</el-button>
         <el-button type="primary" @click="submitsidecolumn">纭� 瀹�</el-button>
       </div>
     </el-dialog>
@@ -459,6 +470,7 @@
   getheLibraryAssort,
   delheLibraryAssort,
   addheLibraryAssort,
+  editheLibraryAssort,
   addtargetillness,
   getlibrarylist,
   dellibraryinfo,
@@ -672,12 +684,21 @@
     getDeptTree() {
       getheLibraryAssort({}).then((res) => {
         this.deptOptions = res.rows;
-        console.log(res);
+        this.dialogFormVisible = false;
       });
     },
 
     // 娣诲姞绫诲埆鏍�
     submitsidecolumn() {
+      if (this.classifyform.id) {
+        editheLibraryAssort(this.classifyform).then((res) => {
+          this.getDeptTree();
+          this.$modal.msgSuccess("淇敼鎴愬姛");
+          this.classifyform = {};
+          this.dialogFormVisible = false;
+        });
+        return;
+      }
       let calssvalue = {};
       if (
         this.classifyform.pid &&
@@ -731,6 +752,16 @@
           .catch(() => {});
       }
     },
+    altertag(a, b) {
+      this.dialogFormVisible = true;
+      if (!b.pid) {
+        this.radio = "涓诲垎绫�";
+      } else {
+        this.radio = "瀛愬垎绫�";
+      }
+      this.classifyform = b;
+      this.dialogFormVisible = true;
+    },
 
     // 绛涢�夎妭鐐�
     filterNode(value, data) {

--
Gitblit v1.9.3