@@ -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()});
}
@@ -157,7 +157,13 @@ function handleDetail(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();
+ });
/**
* 批量删除事件