From 1988d77f4df3c01a9137303e0c959b3442c14377 Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期一, 30 九月 2024 22:10:30 +0800
Subject: [PATCH] 1

---
 src/views/mdc/configComp/Status.vue |   35 +++++++++++++++++++++++++++++------
 1 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/src/views/mdc/configComp/Status.vue b/src/views/mdc/configComp/Status.vue
index bacfb27..331f075 100644
--- a/src/views/mdc/configComp/Status.vue
+++ b/src/views/mdc/configComp/Status.vue
@@ -1,13 +1,14 @@
 <!--
  * @Date: 2024-04-17 18:53:45
- * @LastEditors: Sneed
- * @LastEditTime: 2024-06-16 14:35:07
- * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/configComp/Status.vue
+ * @LastEditors: gaosp
+ * @LastEditTime: 2024-09-19 21:45:01
+ * @FilePath: /mdc/Users/mache/Documents/demo/cps-web/src/views/mdc/configComp/Status.vue
 -->
 <template>
     <el-main>
         <el-row>
-            <scFormTable ref="table" size="small" v-model="data" stripe hideAdd hideDelete dragSort @rowDrop="save">
+            <!-- dragSort -->
+            <scFormTable ref="table" size="small" v-model="data" stripe hideAdd hideDelete dragSort @rowDrop="rowDrop">
                 <el-table-column label="宸ヤ綅/鏈哄櫒鐘舵��" prop="name"></el-table-column>
                 <el-table-column label="缂栧彿" prop="code"></el-table-column>
                 <el-table-column label="棰滆壊" prop="color"></el-table-column>
@@ -34,8 +35,10 @@
                 </el-table-column>
             </scFormTable>
         </el-row>
-        <el-row style="margin-top: 20px;">
-            <scFormTable ref="table1" v-model="Tabledata" stripe @delRow="remove" :addTemplate="addTemplate" dragSort>
+        <el-row style="margin-top: 20px;position: relative">
+            <!-- dragSort -->
+            <scFormTable ref=" table1" v-model="Tabledata" stripe @delRow="remove" :addTemplate="addTemplate"
+                @rowDrop="rowDrop" dragSort hideDelete>
                 <el-table-column label="浜哄伐鍙嶉鐘舵��" prop="name">
                     <template #default="scope">
                         <el-input v-model="scope.row.name" @change="update(scope.row)"></el-input>
@@ -64,6 +67,11 @@
                 </el-table-column>
                 <el-table-column label="鎿嶄綔" prop="state">
                     <template #default="scope">
+                        <el-popconfirm title="纭畾鍒犻櫎鍚楋紵" @confirm="rowDel(scope.row, scope.$index)">
+                            <template #reference>
+                                <el-button type="danger" icon="el-icon-delete" size="small" plain circle></el-button>
+                            </template>
+                        </el-popconfirm>
                         <el-button v-show="scope.row.isNew" @click="add(scope.row)">淇濆瓨</el-button>
                     </template>
                 </el-table-column>
@@ -167,6 +175,11 @@
         this.getList()
     },
     methods: {
+        rowDel(row, index) {
+            // this.$emit('delRow', row)
+            this.remove(row)
+            this.data.splice(index, 1)
+        },
         getList() {
             this.$HTTP.get('/api/blade-cps/global_wcs/wcs-achievements').then(res => {
                 if (res.code === 200) {
@@ -232,6 +245,16 @@
                     this.getList()
                 }
             })
+        },
+        rowDrop(arr) {
+            this.$HTTP.post(`/api/blade-cps/global_wcs/update-wcs-seq`, arr.map(v => v.code)).then(res => {
+                if (res.success) {
+                    this.$message.success(res.msg)
+                } else {
+                    this.$message.success(res.msg)
+                }
+            })
+            console.log(arr)
         }
     }
 }

--
Gitblit v1.9.3