perf: table action
parent
007faab168
commit
0602e8d620
|
@ -69,7 +69,6 @@ const getActions = computed(() => {
|
|||
.map((action) => {
|
||||
const { popConfirm } = action;
|
||||
return {
|
||||
// getPopupContainer: document.body,
|
||||
type: 'link' as ButtonType,
|
||||
...action,
|
||||
...popConfirm,
|
||||
|
@ -135,7 +134,7 @@ function handleMenuClick(e: any) {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<div class="m-table-action">
|
||||
<div class="table-actions">
|
||||
<Space
|
||||
:size="
|
||||
getActions?.some((item: ActionItem) => item.type === 'link') ? 0 : 8
|
||||
|
@ -230,7 +229,7 @@ function handleMenuClick(e: any) {
|
|||
</div>
|
||||
</template>
|
||||
<style lang="scss">
|
||||
.m-table-action {
|
||||
.table-actions {
|
||||
.ant-btn {
|
||||
padding: 4px;
|
||||
margin-left: 0;
|
||||
|
|
|
@ -58,17 +58,15 @@ function onEdit(row: SystemTenantApi.Tenant) {
|
|||
|
||||
/** 删除租户 */
|
||||
async function onDelete(row: SystemTenantApi.Tenant) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||
duration: 0,
|
||||
key: 'action_process_msg',
|
||||
});
|
||||
try {
|
||||
message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||
duration: 2.5,
|
||||
});
|
||||
await deleteTenant(row.id as number);
|
||||
message.success($t('ui.actionMessage.deleteSuccess', [row.name]));
|
||||
onRefresh();
|
||||
} catch {
|
||||
hideLoading();
|
||||
} finally {
|
||||
message.error($t('ui.actionMessage.deleteFailed', [row.name]));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -78,8 +76,6 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||
},
|
||||
gridOptions: {
|
||||
columns: useGridColumns(getPackageName),
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
"deleteConfirm": "Are you sure to delete {0}?",
|
||||
"deleting": "Deleting {0} ...",
|
||||
"deleteSuccess": "{0} deleted successfully",
|
||||
"deleteFailed": "{0} deleted failed",
|
||||
"operationSuccess": "Operation succeeded",
|
||||
"operationFailed": "Operation failed",
|
||||
"importSuccess": "Import succeeded",
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
"deleteConfirm": "确定删除 {0} 吗?",
|
||||
"deleting": "正在删除 {0} ...",
|
||||
"deleteSuccess": "{0} 删除成功",
|
||||
"deleteFailed": "{0} 删除失败",
|
||||
"operationSuccess": "操作成功",
|
||||
"operationFailed": "操作失败",
|
||||
"importSuccess": "导入成功",
|
||||
|
|
Loading…
Reference in New Issue