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;
updateTime: Date;
templateType: number;
// TODO @puhui999使用后端统一配置。因为一般需要批量的团队会一直需要。不需要的一般一直不需要哈。
deleteBatch: boolean;
parentMenuId: number;
}

View File

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

View File

@ -1,3 +1,4 @@
// TODO @
<script lang="ts" setup>
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' });
// 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 = {
BPMN: 10, // BPMN
SIMPLE: 20, //

View File

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

View File

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

View File

@ -151,6 +151,7 @@ export function useGridColumns(
minWidth: 200,
align: 'center',
fixed: 'right',
// TODO @puhui999headerAlign 要使用 headerAlign: 'center' 么?看着现在分成了 align 和 headerAlign 两种
headerAlign: 'center',
showOverflow: false,
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 showDeleteBatchBtn = computed(() => isEmpty(deleteIds.value));
/** 批量删除示例联系人 */

View File

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

View File

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