From 4d5f750e8fa64ec7d113a76a4d91a0757bdd2a33 Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期二, 14 十月 2025 21:52:52 +0800
Subject: [PATCH] Merge branch 'master' of http://47.93.189.255:8099/r/archiveFrontEnd

---
 src/views/archiveManager/seleUser.vue |   43 +++++++++++++++++++++++++++++--------------
 1 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/src/views/archiveManager/seleUser.vue b/src/views/archiveManager/seleUser.vue
index ba874e2..1c61ea5 100644
--- a/src/views/archiveManager/seleUser.vue
+++ b/src/views/archiveManager/seleUser.vue
@@ -24,7 +24,8 @@
       </el-form-item>
     </el-form>
     <el-row>
-      <el-table @row-click="clickRow" ref="table" :data="userList" @selection-change="handleSelectionChange" height="260px">
+      <el-table @row-click="clickRow" ref="table" :data="userList"   @selection-change="handleSingleSelection"
+ height="260px">
         <el-table-column type="selection" width="55"></el-table-column>
         <el-table-column label="鐢ㄦ埛鍚嶇О" prop="userName" :show-overflow-tooltip="true" />
         <el-table-column label="鐢ㄦ埛鏄电О" prop="nickName" :show-overflow-tooltip="true" />
@@ -93,19 +94,30 @@
     }
   },
   methods: {
+      // 鏇挎崲鍘熸湁鐨刪andleSelectionChange鏂规硶
+  handleSingleSelection(selection) {
+    if (selection.length > 1) {
+      this.$refs.table.clearSelection();
+      this.$refs.table.toggleRowSelection(selection[selection.length - 1]);
+    }
+    else
+    this.userIds = selection.map(item => item.userId);
+  },
     // 鏄剧ず寮规
     show(archiveRecordsId) {
       if (archiveRecordsId) {
-    this.archiveRecordsId = archiveRecordsId
-  }
+        // 杩涜绫诲瀷杞崲
+        this.archiveRecordsId = !isNaN(Number(archiveRecordsId)) ? Number(archiveRecordsId) : 0
+      }
       this.queryParams.roleId = this.roleId
       this.queryParams.archiveRecordsId = this.archiveRecordsId
-
+  
       this.getList()
       this.visible = true
     },
     clickRow(row) {
-      this.$refs.table.toggleRowSelection(row)
+      this.$refs.table.clearSelection();
+    this.$refs.table.toggleRowSelection(row);
     },
     // 澶氶�夋閫変腑鏁版嵁
     handleSelectionChange(selection) {
@@ -134,20 +146,23 @@
     handleSelectUser() {
       const archiveRecordsId = this.queryParams.archiveRecordsId
       const userIds = this.userIds.join(",")
-
- 
+  
       if (userIds == "") {
         this.$modal.msgError("璇烽�夋嫨瑕佸垎閰嶇殑鐢ㄦ埛")
         return
       }
-      authRecordToUser({ recordId: archiveRecordsId, userIds: userIds }).then(res => {
+      
+      // 鍒涘缓杞崲鍚庣殑鍙傛暟锛岀‘淇漴ecordId鏄暟瀛楃被鍨�
+      const convertedRecordId = !isNaN(Number(archiveRecordsId)) ? Number(archiveRecordsId) : 0
+      
+      authRecordToUser({ recordId: convertedRecordId, userIds: userIds }).then(res => {
         if(res.code === 200) {
-      this.$modal.msgSuccess(res.msg)
-      this.visible = false
-      this.$emit("ok")
-    } else {
-      this.$modal.msgError(res.msg || "鎺堟潈澶辫触锛屽凡缁忔巿鏉冭繃浜�")
-    }
+          this.$modal.msgSuccess(res.msg)
+          this.visible = false
+          this.$emit("ok")
+        } else {
+          this.$modal.msgError(res.msg || "鎺堟潈澶辫触锛屽凡缁忔巿鏉冭繃浜�")
+        }
       })
     }
   }

--
Gitblit v1.9.1