feat:【antd】【ele】【member 会员】level 迁移 antd

This commit is contained in:
YunaiV
2025-10-07 10:14:23 +08:00
parent f6ca135efb
commit 2f6e7ced5e
3 changed files with 60 additions and 19 deletions

View File

@@ -2,7 +2,7 @@
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MemberLevelApi } from '#/api/member/level';
import { Page, useVbenModal } from '@vben/common-ui';
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
import { message } from 'ant-design-vue';
@@ -19,7 +19,7 @@ const [FormModal, formModalApi] = useVbenModal({
});
/** 刷新表格 */
function onRefresh() {
function handleRefresh() {
gridApi.query();
}
@@ -41,10 +41,8 @@ async function handleDelete(row: MemberLevelApi.Level) {
});
try {
await deleteLevel(row.id as number);
message.success({
content: $t('ui.actionMessage.deleteSuccess', [row.name]),
});
onRefresh();
message.success($t('ui.actionMessage.deleteSuccess', [row.name]));
handleRefresh();
} finally {
hideLoading();
}
@@ -63,7 +61,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
},
proxyConfig: {
ajax: {
query: async (_params, formValues) => {
query: async (_, formValues) => {
return await getLevelList({
...formValues,
});
@@ -72,6 +70,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
},
rowConfig: {
keyField: 'id',
isHover: true,
},
toolbarConfig: {
refresh: true,
@@ -83,7 +82,12 @@ const [Grid, gridApi] = useVbenVxeGrid({
<template>
<Page auto-content-height>
<FormModal @success="onRefresh" />
<DocAlert
title="会员等级、积分、签到"
url="https://doc.iocoder.cn/member/level/"
/>
<FormModal @success="handleRefresh" />
<Grid table-title="等级列表">
<template #toolbar-tools>
<TableAction