review:【ANTD】批量删除代码

pull/110/MERGE
YunaiV 2025-05-19 19:52:25 +08:00
parent 9503ef4b52
commit 241e340c3f
10 changed files with 21 additions and 7 deletions

View File

@ -21,6 +21,7 @@ export namespace InfraCodegenApi {
createTime: Date; createTime: Date;
updateTime: Date; updateTime: Date;
templateType: number; templateType: number;
// TODO @puhui999使用后端统一配置。因为一般需要批量的团队会一直需要。不需要的一般一直不需要哈。
deleteBatch: boolean; deleteBatch: boolean;
parentMenuId: number; parentMenuId: number;
} }

View File

@ -47,6 +47,7 @@ export function deleteDemo01Contact(id: number) {
} }
// 批量删除示例联系人 // 批量删除示例联系人
// TODO @puhui999注释风格哈。
export function deleteDemo01ContactByIds(ids: number[]) { export function deleteDemo01ContactByIds(ids: number[]) {
return requestClient.delete( return requestClient.delete(
`/infra/demo01-contact/delete-batch?ids=${ids.join(',')}`, `/infra/demo01-contact/delete-batch?ids=${ids.join(',')}`,

View File

@ -1,3 +1,4 @@
// TODO @
<script lang="ts" setup> <script lang="ts" setup>
import type { DataNode } from 'ant-design-vue/es/tree'; import type { DataNode } from 'ant-design-vue/es/tree';

View File

@ -33,6 +33,7 @@ import FormDesign from './modules/form-design.vue';
defineOptions({ name: 'BpmModelCreate' }); defineOptions({ name: 'BpmModelCreate' });
// TODO apps 使 @utils/constant.ts @ // TODO apps 使 @utils/constant.ts @
// TODO @jason/Users/yunai/Java/yudao-ui-admin-vben-v5/apps/web-antd/src/utils/constants.ts apps
const BpmModelType = { const BpmModelType = {
BPMN: 10, // BPMN BPMN: 10, // BPMN
SIMPLE: 20, // SIMPLE: 20, //

View File

@ -162,6 +162,7 @@ const handleCategorySortSubmit = async () => {
<template> <template>
<Page auto-content-height> <Page auto-content-height>
<!-- TODO @jaosn没头像的图标展示文字头像哈 -->
<!-- 流程分类表单弹窗 --> <!-- 流程分类表单弹窗 -->
<CategoryFormModal @success="getList" /> <CategoryFormModal @success="getList" />
<Card <Card

View File

@ -159,6 +159,7 @@ export function useGenerationInfoBaseFormSchema(): VbenFormSchema[] {
rules: 'selectRequired', rules: 'selectRequired',
}, },
{ {
// TODO @puhui999使用后端统一配置。因为一般需要批量的团队会一直需要。不需要的一般一直不需要哈。
component: 'RadioGroup', component: 'RadioGroup',
fieldName: 'deleteBatch', fieldName: 'deleteBatch',
label: '批量删除?', label: '批量删除?',

View File

@ -151,6 +151,7 @@ export function useGridColumns(
minWidth: 200, minWidth: 200,
align: 'center', align: 'center',
fixed: 'right', fixed: 'right',
// TODO @puhui999headerAlign 要使用 headerAlign: 'center' 么?看着现在分成了 align 和 headerAlign 两种
headerAlign: 'center', headerAlign: 'center',
showOverflow: false, showOverflow: false,
cellRender: { cellRender: {

View File

@ -61,6 +61,7 @@ async function onDelete(row: Demo01ContactApi.Demo01Contact) {
} }
} }
// TODO @puhui999:1/** */ deleteIds 2showDeleteBatchBtn disabled
const deleteIds = ref<number[]>([]); // ID const deleteIds = ref<number[]>([]); // ID
const showDeleteBatchBtn = computed(() => isEmpty(deleteIds.value)); const showDeleteBatchBtn = computed(() => isEmpty(deleteIds.value));
/** 批量删除示例联系人 */ /** 批量删除示例联系人 */

View File

@ -55,6 +55,7 @@ function onCreate() {
} }
/** 删除角色 */ /** 删除角色 */
// TODO @ handleXXX
async function onDelete(row: SystemRoleApi.Role) { async function onDelete(row: SystemRoleApi.Role) {
message.loading({ message.loading({
content: $t('ui.actionMessage.deleting', [row.name]), content: $t('ui.actionMessage.deleting', [row.name]),

View File

@ -57,16 +57,21 @@ function onEdit(row: SystemTenantApi.Tenant) {
/** 删除租户 */ /** 删除租户 */
async function onDelete(row: SystemTenantApi.Tenant) { async function onDelete(row: SystemTenantApi.Tenant) {
message.loading({ const loading = message.loading({
content: $t('ui.actionMessage.deleting', [row.name]), content: $t('ui.actionMessage.deleting', [row.name]),
key: 'action_key_msg', key: 'action_key_msg',
}); });
await deleteTenant(row.id as number); try {
message.success({ await deleteTenant(row.id as number);
content: $t('ui.actionMessage.deleteSuccess', [row.name]), message.success({
key: 'action_key_msg', content: $t('ui.actionMessage.deleteSuccess', [row.name]),
}); key: 'action_key_msg',
onRefresh(); });
onRefresh();
} finally {
// TODO @ loading12loading
loading();
}
} }
const [Grid, gridApi] = useVbenVxeGrid({ const [Grid, gridApi] = useVbenVxeGrid({