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