|
|
@@ -55,13 +55,14 @@ const handleUpdate = async (fields) => { |
|
|
|
* 删除节点 |
|
|
|
* @param selectedRows |
|
|
|
*/ |
|
|
|
const handleRemove = async (selectedRows) => { |
|
|
|
const handleRemove = async (record) => { |
|
|
|
const hide = message.loading('正在删除'); |
|
|
|
if (!selectedRows) return true; |
|
|
|
if (!record) return true; |
|
|
|
try { |
|
|
|
await removeRole(selectedRows.map((row) => row.id)); |
|
|
|
await removeRole([record.id]).then(r => { |
|
|
|
message.success(r.data); |
|
|
|
}) |
|
|
|
hide(); |
|
|
|
message.success('删除成功,即将刷新'); |
|
|
|
return true; |
|
|
|
} catch (error) { |
|
|
|
hide(); |
|
|
@@ -160,9 +161,11 @@ const roleManager = () => { |
|
|
|
disabled={record.code == 'sys_manager_role'} |
|
|
|
style={{ pointerEvents: record.code == 'sys_manager_role' ? 'none' : 'auto' }} |
|
|
|
onClick={() => { |
|
|
|
removeRole([record.id]).then(r => { |
|
|
|
actionRef.current.reload(); |
|
|
|
}) |
|
|
|
handleRemove(record); |
|
|
|
// removeRole([record.id]).then(r => { |
|
|
|
// message.success(r); |
|
|
|
// actionRef.current.reload(); |
|
|
|
// }) |
|
|
|
}} |
|
|
|
> |
|
|
|
删除 |
|
|
|