feat: 项目和License管理模块删除功能修复

This commit is contained in:
caiyuchao
2025-07-04 14:18:26 +08:00
parent 843ec65541
commit 5de519d413
4 changed files with 8 additions and 6 deletions

View File

@@ -434,7 +434,7 @@ export function useGridColumns(
showOverflow: false,
cellRender: {
attrs: {
nameField: 'id',
nameField: 'sn',
nameTitle: 'License',
onClick: onActionClick,
},

View File

@@ -47,13 +47,14 @@ function onEdit(row: LicenseApi.License) {
/** 删除License */
async function onDelete(row: LicenseApi.License) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.id]),
content: $t('ui.actionMessage.deleting', [row.sn]),
duration: 0,
key: 'action_process_msg',
});
try {
await deleteLicense(row.id as number);
message.success($t('ui.actionMessage.deleteSuccess', [row.id]));
hideLoading();
message.success($t('ui.actionMessage.deleteSuccess', [row.sn]));
onRefresh();
} catch {
hideLoading();

View File

@@ -493,7 +493,7 @@ export function useGridColumns(
showOverflow: false,
cellRender: {
attrs: {
nameField: 'id',
nameField: 'name',
nameTitle: $t('project.project'),
onClick: onActionClick,
},

View File

@@ -47,13 +47,14 @@ function onEdit(row: ProjectApi.Project) {
/** 删除项目 */
async function onDelete(row: ProjectApi.Project) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.id]),
content: $t('ui.actionMessage.deleting', [row.name]),
duration: 0,
key: 'action_process_msg',
});
try {
await deleteProject(row.id as number);
message.success($t('ui.actionMessage.deleteSuccess', [row.id]));
hideLoading();
message.success($t('ui.actionMessage.deleteSuccess', [row.name]));
onRefresh();
} catch {
hideLoading();