feat: 更新组件和API,优化数据处理逻辑

- 将 TreeSelect 组件的 fieldNames 属性更改为 props
- 更新商品分类API的请求路径
- 在多个模块中引入 ElMessageBox 以增强用户交互体验
- 新增售后管理和订单管理的详细视图组件
- 优化了多个表单组件的逻辑,提升了用户体验
This commit is contained in:
lrl
2025-07-15 13:23:20 +08:00
parent 067df741b4
commit 6ce1363dea
69 changed files with 2314 additions and 969 deletions

View File

@@ -4,7 +4,7 @@ import type { MemberGroupApi } from '#/api/member/group';
import { Page, useVbenModal } from '@vben/common-ui';
import { ElLoading, ElMessage } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { deleteGroup, getGroupPage } from '#/api/member/group';
@@ -35,17 +35,14 @@ function handleEdit(row: MemberGroupApi.Group) {
/** 删除分组 */
async function handleDelete(row: MemberGroupApi.Group) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.name]),
fullscreen: true,
await ElMessageBox.confirm('确定要删除该分组吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
});
try {
await deleteGroup(row.id as number);
ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name]));
onRefresh();
} finally {
loadingInstance.close();
}
await deleteGroup(row.id as number);
ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name]));
onRefresh();
}
const [Grid, gridApi] = useVbenVxeGrid({

View File

@@ -4,7 +4,7 @@ import type { MemberLevelApi } from '#/api/member/level';
import { Page, useVbenModal } from '@vben/common-ui';
import { ElLoading, ElMessage } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { deleteLevel, getLevelList } from '#/api/member/level';
@@ -35,17 +35,14 @@ function handleEdit(row: MemberLevelApi.Level) {
/** 删除等级 */
async function handleDelete(row: MemberLevelApi.Level) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.name]),
fullscreen: true,
await ElMessageBox.confirm('确定要删除该等级吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
});
try {
await deleteLevel(row.id as number);
ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name]));
onRefresh();
} finally {
loadingInstance.close();
}
await deleteLevel(row.id as number);
ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name]));
onRefresh();
}
const [Grid, gridApi] = useVbenVxeGrid({

View File

@@ -4,7 +4,7 @@ import type { MemberTagApi } from '#/api/member/tag';
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
import { ElLoading, ElMessage } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { deleteMemberTag, getMemberTagPage } from '#/api/member/tag';
@@ -35,17 +35,14 @@ function handleEdit(row: MemberTagApi.Tag) {
/** 删除会员标签 */
async function handleDelete(row: MemberTagApi.Tag) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.name]),
fullscreen: true,
await ElMessageBox.confirm('确定要删除该会员标签吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
});
try {
await deleteMemberTag(row.id as number);
ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name]));
onRefresh();
} finally {
loadingInstance.close();
}
await deleteMemberTag(row.id as number);
ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name]));
onRefresh();
}
const [Grid, gridApi] = useVbenVxeGrid({

View File

@@ -86,7 +86,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '所在地',
componentProps: {
api: () => getAreaTree(),
fieldNames: { label: 'name', value: 'id', children: 'children' },
props: { label: 'name', value: 'id', children: 'children' },
},
},
{
@@ -95,7 +95,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '用户标签',
componentProps: {
api: () => getSimpleTagList(),
fieldNames: { label: 'name', value: 'id' },
props: { label: 'name', value: 'id' },
mode: 'multiple',
},
},
@@ -105,7 +105,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '用户分组',
componentProps: {
api: () => getSimpleGroupList(),
fieldNames: { label: 'name', value: 'id' },
props: { label: 'name', value: 'id' },
},
},
{
@@ -151,7 +151,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: {
api: () => getSimpleTagList(),
fieldNames: { label: 'name', value: 'id' },
props: { label: 'name', value: 'id' },
mode: 'multiple',
},
},
@@ -161,7 +161,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: {
api: () => getSimpleLevelList(),
fieldNames: { label: 'name', value: 'id' },
props: { label: 'name', value: 'id' },
},
},
{
@@ -170,7 +170,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: {
api: () => getSimpleGroupList(),
fieldNames: { label: 'name', value: 'id' },
props: { label: 'name', value: 'id' },
},
},
];
@@ -290,7 +290,7 @@ export function useLeavelFormSchema(): VbenFormSchema[] {
component: 'ApiSelect',
componentProps: {
api: () => getSimpleLevelList(),
fieldNames: { label: 'name', value: 'id' },
props: { label: 'name', value: 'id' },
},
},
{