perf: table action
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user