From dcc4992bd51e9ee4a97099cd3a15085f7e247f23 Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期日, 03 十一月 2024 20:21:41 +0800
Subject: [PATCH] update

---
 src/views/tpm/MachineGroup.vue |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/src/views/tpm/MachineGroup.vue b/src/views/tpm/MachineGroup.vue
index 3c561a9..6c28209 100644
--- a/src/views/tpm/MachineGroup.vue
+++ b/src/views/tpm/MachineGroup.vue
@@ -1,8 +1,8 @@
 <!--
  * @Date: 2024-04-27 20:02:44
- * @LastEditors: Sneed
- * @LastEditTime: 2024-04-27 22:21:36
- * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/tpm/MachineGroup.vue
+ * @LastEditors: gaoshp
+ * @LastEditTime: 2024-09-29 19:33:58
+ * @FilePath: /cps-web/src/views/tpm/MachineGroup.vue
 -->
 <template>
     <el-container>
@@ -61,7 +61,7 @@
     },
     methods: {
         getTreeData() {
-            this.$HTTP.get('/api/blade-cps/group/tree?groupCategory=1&groupType=group_machine').then(res => {
+            this.$HTTP.get('/api/smis/group/tree?groupCategory=1&groupType=group_machine').then(res => {
                 if (res.code === 200) {
                     this.group = res.data
                     this.groupClick(res.data[0])
@@ -105,7 +105,7 @@
                 }
             )
                 .then(() => {
-                    this.$HTTP.delete('/api/blade-cps/group/deleteGroup', {}, { params: { groupId: this.form.id } }).then(res => {
+                    this.$HTTP.delete('/api/smis/group/deleteGroup', {}, { params: { groupId: this.form.id } }).then(res => {
                         if (res.code === 200) {
                             this.$message.success("鎿嶄綔鎴愬姛");
                             this.getTreeData()
@@ -118,11 +118,20 @@
         },
         save() {
             this.group = []
-            this.$HTTP.post('/api/blade-cps/group', this.form).then(res => {
-                if (res.code === 200) {
-                    this.getTreeData()
-                }
-            })
+            if (this.form.id) {
+                this.$HTTP.put('/api/smis/group', this.form).then(res => {
+                    if (res.code === 200) {
+                        this.getTreeData()
+                    }
+                })
+            } else {
+                this.$HTTP.post('/api/smis/group', this.form).then(res => {
+                    if (res.code === 200) {
+                        this.getTreeData()
+                    }
+                })
+            }
+
         }
     }
 }

--
Gitblit v1.9.3