Browse Source

#13598 修复点击更多时的选中记录数量问题

ZL 1 week ago
parent
commit
c1418a1570

+ 2 - 1
jeecgboot-vue3/src/views/system/role/components/RoleUserTable.vue

@@ -157,7 +157,8 @@ async function handleEdit(record: Recordable) {
  */
 async function handleDelete(record) {
   await deleteUserRole({ userId: record.id, roleId: roleId.value }, () => {
-    setSelectedRowKeys([]);
+    const updatedKeys = getSelectRowKeys().filter(key => key !== record.id);
+    setSelectedRowKeys(updatedKeys);
     reload()});
 }
 

+ 7 - 1
jeecgboot-vue3/src/views/system/role/index.vue

@@ -157,7 +157,13 @@ function handleDetail(record) {
  * 删除事件
  */
 async function handleDelete(record) {
-  await deleteRole({ id: record.id }, reload);
+  await deleteRole({ id: record.id }, () => {
+    const index = selectedRowKeys.value.indexOf(record.id);
+    if (index > -1) {
+      selectedRowKeys.value.splice(index, 1);
+    }
+    reload();
+  });
 }
 /**
  * 批量删除事件