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

@@ -6,7 +6,7 @@ import { useAccess } from '@vben/access';
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { ElLoading, ElMessage, ElSwitch } from 'element-plus';
import { ElLoading, ElMessage, ElMessageBox, ElSwitch } from 'element-plus';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
@@ -68,17 +68,14 @@ function openCreateUserForm() {
/** 清除上级推广人 */
async function handleClearBindUser(row: MallBrokerageUserApi.BrokerageUser) {
const loadingInstance = ElLoading.service({
text: `正在清除"${row.nickname}"的上级推广人...`,
fullscreen: true,
await ElMessageBox.confirm(`确定清除"${row.nickname}"的上级推广人吗?`, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
});
try {
await clearBindUser({ id: row.id as number });
ElMessage.success('清除成功');
onRefresh();
} finally {
loadingInstance.close();
}
await clearBindUser({ id: row.id as number });
ElMessage.success('清除成功');
onRefresh();
}
/** 推广资格:开通/关闭 */

View File

@@ -4,10 +4,10 @@ import type { MallBrokerageWithdrawApi } from '#/api/mall/trade/brokerage/withdr
import { h } from 'vue';
import { confirm, Page, prompt } from '@vben/common-ui';
import { Page, prompt } from '@vben/common-ui';
import { formatDateTime } from '@vben/utils';
import { ElInput, ElMessage } from 'element-plus';
import { ElInput, ElMessage, ElMessageBox } from 'element-plus';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
@@ -35,14 +35,14 @@ function onRefresh() {
/** 审核通过 */
async function handleApprove(row: MallBrokerageWithdrawApi.BrokerageWithdraw) {
try {
await confirm('确定要审核通过吗?');
await approveBrokerageWithdraw(row.id);
ElMessage.success($t('ui.actionMessage.operationSuccess'));
onRefresh();
} catch (error) {
console.error('审核失败:', error);
}
await ElMessageBox.confirm('确定要审核通过吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
});
await approveBrokerageWithdraw(row.id);
ElMessage.success($t('ui.actionMessage.operationSuccess'));
onRefresh();
}
/** 审核驳回 */
@@ -73,14 +73,14 @@ function handleReject(row: MallBrokerageWithdrawApi.BrokerageWithdraw) {
async function handleRetryTransfer(
row: MallBrokerageWithdrawApi.BrokerageWithdraw,
) {
try {
await confirm('确定要重新转账吗?');
await approveBrokerageWithdraw(row.id);
ElMessage.success($t('ui.actionMessage.operationSuccess'));
onRefresh();
} catch (error) {
console.error('重新转账失败:', error);
}
await ElMessageBox.confirm('确定要重新转账吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
});
await approveBrokerageWithdraw(row.id);
ElMessage.success($t('ui.actionMessage.operationSuccess'));
onRefresh();
}
const [Grid, gridApi] = useVbenVxeGrid({