feat: popConfirm button
parent
56263ec782
commit
ff5358da4b
|
@ -57,7 +57,6 @@ function onCreate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除角色 */
|
/** 删除角色 */
|
||||||
// TODO @xingyu:删除这个二次确认,有啥好的办法么?
|
|
||||||
async function onDelete(row: SystemRoleApi.Role) {
|
async function onDelete(row: SystemRoleApi.Role) {
|
||||||
const hideLoading = message.loading({
|
const hideLoading = message.loading({
|
||||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||||
|
@ -66,6 +65,7 @@ async function onDelete(row: SystemRoleApi.Role) {
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
await deleteRole(row.id as number);
|
await deleteRole(row.id as number);
|
||||||
|
hideLoading();
|
||||||
message.success($t('ui.actionMessage.deleteSuccess', [row.name]));
|
message.success($t('ui.actionMessage.deleteSuccess', [row.name]));
|
||||||
onRefresh();
|
onRefresh();
|
||||||
} catch {
|
} catch {
|
||||||
|
@ -162,20 +162,23 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
danger: true,
|
danger: true,
|
||||||
icon: 'ant-design:delete-outlined',
|
icon: 'ant-design:delete-outlined',
|
||||||
auth: ['system:role:delete'],
|
auth: ['system:role:delete'],
|
||||||
onClick: onDelete.bind(null, row),
|
popConfirm: {
|
||||||
|
title: $t('ui.actionMessage.deleteConfirm', [row.name]),
|
||||||
|
confirm: onDelete.bind(null, row),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
:drop-down-actions="[
|
:drop-down-actions="[
|
||||||
{
|
{
|
||||||
label: '数据权限',
|
label: '数据权限',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
auth: ['system:role:update'],
|
auth: ['system:permission:assign-role-data-scope'],
|
||||||
onClick: onAssignDataPermission.bind(null, row),
|
onClick: onAssignDataPermission.bind(null, row),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '菜单权限',
|
label: '菜单权限',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
auth: ['system:role:update'],
|
auth: ['system:permission:assign-role-menu'],
|
||||||
onClick: onAssignMenu.bind(null, row),
|
onClick: onAssignMenu.bind(null, row),
|
||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
|
|
Loading…
Reference in New Issue