From e5cdf3af17609b49138cec3e8fb200752365f651 Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期五, 01 十一月 2024 14:58:12 +0800
Subject: [PATCH] 1

---
 src/views/tpm/MachineTab.vue |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/views/tpm/MachineTab.vue b/src/views/tpm/MachineTab.vue
index 6c02bcb..49a4e66 100644
--- a/src/views/tpm/MachineTab.vue
+++ b/src/views/tpm/MachineTab.vue
@@ -1,15 +1,15 @@
 <!--
  * @Date: 2024-04-27 20:04:34
- * @LastEditors: Sneed
- * @LastEditTime: 2024-05-07 22:40:21
- * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/tpm/MachineTab.vue
+ * @LastEditors: gaoshp
+ * @LastEditTime: 2024-09-24 21:03:08
+ * @FilePath: /cps-web/src/views/tpm/MachineTab.vue
 -->
 <template>
     <el-container>
         <el-aside width="200px" v-loading="showGrouploading">
             <el-container>
                 <el-main class="nopadding">
-                    <el-tree ref="group" default-expand-all node-key="id" :data="group"
+                    <el-tree :expand-on-click-node="false" ref="group" default-expand-all node-key="id" :data="group"
                         :current-node-key="params.groupId" :highlight-current="true" @node-click="nodeClick"></el-tree>
                 </el-main>
             </el-container>
@@ -58,7 +58,7 @@
                             <el-button-group>
                                 <el-button text type="primary" size="small"
                                     @click="table_edit(scope.row, scope.$index)">缂栬緫</el-button>
-                                <el-popconfirm cancel-button-text="鍋滅敤" confirm-button-text="鍒犻櫎"
+                                <el-popconfirm width="220" cancel-button-text="鍋滅敤" confirm-button-text="鍒犻櫎"
                                     title="鍒犻櫎鏁版嵁浼氬奖鍝嶅凡鍏宠仈鐨勪笟鍔� ,鑻ユ偍鎯冲湪宸插叧鑱旂殑涓氬姟涓緷鐒舵樉绀鸿繖浜涙暟鎹�, 鎮ㄥ彲浠ラ�夋嫨 鍋滅敤 鎿嶄綔銆傚仠鐢ㄥ悗姝ゆ暟鎹皢涓嶈兘鍐嶈鏂颁笟鍔′娇鐢ㄣ��"
                                     @confirm="table_del(scope.row, scope.$index, '0')"
                                     @cancel="table_del(scope.row, scope.$index, '1')">
@@ -112,7 +112,7 @@
     },
     methods: {
         init() {
-            this.$HTTP.get('/api/blade-cps/device-types/page?keyWord=&current=1&size=-1').then(res => {
+            this.$HTTP.get('/api/smis/device-types/page?keyWord=&current=1&size=-1').then(res => {
                 if (res.code === 200) {
                     this.types = res.data.records.map(item => ({
                         label: item.name,
@@ -122,7 +122,7 @@
             })
         },
         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.params.groupId = res.data[0].id
@@ -149,12 +149,14 @@
             this.getTreeData()
         },
         table_del(row, index, type) {
-            this.$HTTP.delete(`/api/blade-cps/machine?type=${type}`, {
+            this.$HTTP.delete(`/api/smis/machine?type=${type}`, {
                 ids: [row.id]
             }).then(res => {
                 if (res.code === 200) {
                     this.$message.success("鎿嶄綔鎴愬姛");
                     this.getTreeData()
+                } else {
+                    this.$message.error(res.msg);
                 }
             })
         },
@@ -165,12 +167,14 @@
             if (this.selection.length === 0) {
                 return this.$message.warning("璇烽�夋嫨");
             }
-            this.$HTTP.delete(`/api/blade-cps/machine?type=1`, {
+            this.$HTTP.delete(`/api/smis/machine?type=1`, {
                 ids: this.selection.map(item => item.id)
             }).then(res => {
                 if (res.code === 200) {
                     this.$message.success("鎿嶄綔鎴愬姛");
                     this.getTreeData()
+                } else {
+                    this.$message.error(res.msg);
                 }
             })
         },

--
Gitblit v1.9.3