refactor: (web-ele)优化多个组件的删除操作和确认逻辑

- 将 ElMessageBox 替换为自定义 confirm 函数- 添加全局 loading 功能
- 优化错误处理和消息提示- 调整部分组件属性和样式
This commit is contained in:
lrl
2025-08-01 13:56:55 +08:00
parent c447145d62
commit 38daaa2934
63 changed files with 674 additions and 662 deletions

View File

@@ -3,10 +3,10 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MallBrokerageUserApi } from '#/api/mall/trade/brokerage/user';
import { useAccess } from '@vben/access';
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { ElLoading, ElMessage, ElMessageBox, ElSwitch } from 'element-plus';
import { ElLoading, ElMessage, ElSwitch } from 'element-plus';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
@@ -68,11 +68,7 @@ function openCreateUserForm() {
/** 清除上级推广人 */
async function handleClearBindUser(row: MallBrokerageUserApi.BrokerageUser) {
await ElMessageBox.confirm(`确定清除"${row.nickname}"的上级推广人吗?`, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
});
await confirm(`确定清除"${row.nickname}"的上级推广人吗?`);
await clearBindUser({ id: row.id as number });
ElMessage.success('清除成功');
onRefresh();