+
diff --git a/frontend/web/src/views/module_system/dict/components/DataDrawer.vue b/frontend/web/src/views/module_system/dict/components/DataDrawer.vue
index 645e58ac..f37bdec8 100644
--- a/frontend/web/src/views/module_system/dict/components/DataDrawer.vue
+++ b/frontend/web/src/views/module_system/dict/components/DataDrawer.vue
@@ -786,71 +786,66 @@ function formatDictDataOperationCell(row: DictDataTable) {
});
}
-function deleteDictDataRow(id: number) {
- ElMessageBox.confirm("确认删除该项数据?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- await DictAPI.deleteDictData([id]);
- dictStore.clearDictData();
- if (props.dictType) {
- await dictStore.getDict([props.dictType]);
- }
- ElMessage.success("删除成功");
- faTableRef.value?.elTableRef?.clearSelection();
- await refreshRemove();
- })
- .catch(() => {});
+async function deleteDictDataRow(id: number) {
+ try {
+ await ElMessageBox.confirm("确认删除该项数据?", "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ await DictAPI.deleteDictData([id]);
+ dictStore.clearDictData();
+ if (props.dictType) await dictStore.getDict([props.dictType]);
+ ElMessage.success("删除成功");
+ faTableRef.value?.elTableRef?.clearSelection();
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ }
}
-function handleBatchDelete() {
+async function handleBatchDelete() {
const ids = selectedIds.value;
if (ids.length === 0) return;
- ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- try {
- batchDeleting.value = true;
- await DictAPI.deleteDictData(ids);
- dictStore.clearDictData();
- if (props.dictType) {
- await dictStore.getDict([props.dictType]);
- }
- ElMessage.success("删除成功");
- faTableRef.value?.elTableRef?.clearSelection();
- await refreshRemove();
- } finally {
- batchDeleting.value = false;
- }
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ batchDeleting.value = true;
+ await DictAPI.deleteDictData(ids);
+ dictStore.clearDictData();
+ if (props.dictType) await dictStore.getDict([props.dictType]);
+ ElMessage.success("删除成功");
+ faTableRef.value?.elTableRef?.clearSelection();
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ } finally {
+ batchDeleting.value = false;
+ }
}
-function handleMoreClick(status: string) {
+async function handleMoreClick(status: string) {
const ids = selectedIds.value;
if (!ids.length) {
ElMessage.warning("请先选择要操作的数据");
return;
}
- ElMessageBox.confirm(`确认${status === "0" ? "启用" : "停用"}该项数据?`, "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- await DictAPI.batchDictData({ ids, status });
- await refreshData();
- dictStore.clearDictData();
- if (props.dictType) {
- await dictStore.getDict([props.dictType]);
- }
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm(`确认${status === "0" ? "启用" : "停用"}该项数据?`, "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ await DictAPI.batchDictData({ ids, status });
+ await refreshData();
+ dictStore.clearDictData();
+ if (props.dictType) await dictStore.getDict([props.dictType]);
+ } catch {
+ // 用户取消
+ }
}
function openExportModal() {
@@ -890,11 +885,11 @@ function openExportModal() {
border-color: var(--el-border-color-lighter);
}
-.crud-dialog-art-form ::v-deep(.el-row > .el-col:last-child) {
+.crud-dialog-art-form :deep(.el-row > .el-col:last-child) {
display: none;
}
-.crud-dialog-art-form ::v-deep(.el-form-item__content) {
+.crud-dialog-art-form :deep(.el-form-item__content) {
max-width: 100%;
}
diff --git a/frontend/web/src/views/module_system/dict/index.vue b/frontend/web/src/views/module_system/dict/index.vue
index b6a19a9f..5e0d6e6e 100644
--- a/frontend/web/src/views/module_system/dict/index.vue
+++ b/frontend/web/src/views/module_system/dict/index.vue
@@ -560,74 +560,69 @@ async function handleSubmit() {
});
}
-function deleteDictTypeRow(id: number) {
- ElMessageBox.confirm("确认删除该项数据?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- await DictAPI.deleteDictType([id]);
- dictStore.clearDictData();
- const dictTypes = Object.keys(dictStore.dictData);
- if (dictTypes.length > 0) {
- await dictStore.getDict(dictTypes);
- }
- ElMessage.success("删除成功");
- faTableRef.value?.elTableRef?.clearSelection();
- await refreshRemove();
- })
- .catch(() => {});
+async function deleteDictTypeRow(id: number) {
+ try {
+ await ElMessageBox.confirm("确认删除该项数据?", "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ await DictAPI.deleteDictType([id]);
+ dictStore.clearDictData();
+ const dictTypes = Object.keys(dictStore.dictData);
+ if (dictTypes.length > 0) await dictStore.getDict(dictTypes);
+ ElMessage.success("删除成功");
+ faTableRef.value?.elTableRef?.clearSelection();
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ }
}
-function handleBatchDelete() {
+async function handleBatchDelete() {
const ids = selectedIds.value;
if (ids.length === 0) return;
- ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- try {
- batchDeleting.value = true;
- await DictAPI.deleteDictType(ids);
- dictStore.clearDictData();
- const dictTypes = Object.keys(dictStore.dictData);
- if (dictTypes.length > 0) {
- await dictStore.getDict(dictTypes);
- }
- ElMessage.success("删除成功");
- faTableRef.value?.elTableRef?.clearSelection();
- await refreshRemove();
- } finally {
- batchDeleting.value = false;
- }
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ batchDeleting.value = true;
+ await DictAPI.deleteDictType(ids);
+ dictStore.clearDictData();
+ const dictTypes = Object.keys(dictStore.dictData);
+ if (dictTypes.length > 0) await dictStore.getDict(dictTypes);
+ ElMessage.success("删除成功");
+ faTableRef.value?.elTableRef?.clearSelection();
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ } finally {
+ batchDeleting.value = false;
+ }
}
-function handleMoreClick(status: string) {
+async function handleMoreClick(status: string) {
const ids = selectedIds.value;
if (!ids.length) {
ElMessage.warning("请先选择要操作的数据");
return;
}
- ElMessageBox.confirm(`确认${status === "0" ? "启用" : "停用"}该项数据?`, "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- await DictAPI.batchDictType({ ids, status });
- await refreshData();
- dictStore.clearDictData();
- const dictTypes = Object.keys(dictStore.dictData);
- if (dictTypes.length > 0) {
- await dictStore.getDict(dictTypes);
- }
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm(`确认${status === "0" ? "启用" : "停用"}该项数据?`, "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ await DictAPI.batchDictType({ ids, status });
+ await refreshData();
+ dictStore.clearDictData();
+ const dictTypes = Object.keys(dictStore.dictData);
+ if (dictTypes.length > 0) await dictStore.getDict(dictTypes);
+ } catch {
+ // 用户取消
+ }
}
function openExportModal() {
@@ -636,11 +631,11 @@ function openExportModal() {
diff --git a/frontend/web/src/views/module_system/log/index.vue b/frontend/web/src/views/module_system/log/index.vue
index 24e61634..a097553f 100644
--- a/frontend/web/src/views/module_system/log/index.vue
+++ b/frontend/web/src/views/module_system/log/index.vue
@@ -461,19 +461,20 @@ async function handleOpenDialog(id: number) {
dialogVisible.value.visible = true;
}
-function deleteLogRow(id: number) {
- ElMessageBox.confirm("确认删除该项数据?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- await LogAPI.deleteLog([id]);
- ElMessage.success("删除成功");
- faTableRef.value?.elTableRef?.clearSelection();
- await refreshRemove();
- })
- .catch(() => {});
+async function deleteLogRow(id: number) {
+ try {
+ await ElMessageBox.confirm("确认删除该项数据?", "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ await LogAPI.deleteLog([id]);
+ ElMessage.success("删除成功");
+ faTableRef.value?.elTableRef?.clearSelection();
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ }
}
function buildLogRowActions(row: LogTable): TableOperationAction[] {
@@ -507,26 +508,25 @@ function formatLogOperationCell(row: LogTable) {
});
}
-function handleBatchDelete() {
+async function handleBatchDelete() {
const ids = selectedIds.value;
if (ids.length === 0) return;
- ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- try {
- batchDeleting.value = true;
- await LogAPI.deleteLog(ids);
- ElMessage.success("删除成功");
- faTableRef.value?.elTableRef?.clearSelection();
- await refreshRemove();
- } finally {
- batchDeleting.value = false;
- }
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ batchDeleting.value = true;
+ await LogAPI.deleteLog(ids);
+ ElMessage.success("删除成功");
+ faTableRef.value?.elTableRef?.clearSelection();
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ } finally {
+ batchDeleting.value = false;
+ }
}
function openExportModal() {
diff --git a/frontend/web/src/views/module_system/menu/index.vue b/frontend/web/src/views/module_system/menu/index.vue
index f58fcbb8..3e65d443 100644
--- a/frontend/web/src/views/module_system/menu/index.vue
+++ b/frontend/web/src/views/module_system/menu/index.vue
@@ -436,7 +436,7 @@
-
+
{
- await MenuAPI.deleteMenu([id]);
- await userStore.getUserInfo();
- ElMessage.success("删除成功");
- selectedRows.value = [];
- await loadMenuData();
- })
- .catch(() => {});
+async function deleteMenuRow(id: number) {
+ try {
+ await ElMessageBox.confirm("确认删除该项数据?", "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+
+ await MenuAPI.deleteMenu([id]);
+ await userStore.getUserInfo();
+ ElMessage.success("删除成功");
+ selectedRows.value = [];
+ await loadMenuData();
+ } catch {
+ // 用户取消
+ }
}
const opCtx = {
@@ -1040,11 +1043,11 @@ async function handleOpenDialog(
Object.assign(detailFormData.value, response.data.data ?? {});
} else if (type === "update") {
dialogVisible.title = "修改菜单";
- Object.assign(formData, response.data.data);
+ Object.assign(formData.value, response.data.data);
}
} else {
dialogVisible.title = "新增菜单";
- Object.assign(formData, initialFormData);
+ formData.value = { ...initialFormData };
if (parentRow?.id != null) {
formData.value.parent_id = parentRow.id;
formData.value.client = (parentRow.client as MenuClientEnum) || menuClientTab.value;
@@ -1102,27 +1105,26 @@ async function handleSubmit() {
});
}
-function handleBatchDelete() {
+async function handleBatchDelete() {
const ids = selectedIds.value;
if (ids.length === 0) return;
- ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- try {
- batchDeleting.value = true;
- await MenuAPI.deleteMenu(ids);
- await userStore.getUserInfo();
- ElMessage.success("删除成功");
- selectedRows.value = [];
- await loadMenuData();
- } finally {
- batchDeleting.value = false;
- }
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ batchDeleting.value = true;
+ await MenuAPI.deleteMenu(ids);
+ await userStore.getUserInfo();
+ ElMessage.success("删除成功");
+ selectedRows.value = [];
+ await loadMenuData();
+ } catch {
+ // 用户取消
+ } finally {
+ batchDeleting.value = false;
+ }
}
async function handleMoreClick(status: string) {
@@ -1135,16 +1137,18 @@ async function handleMoreClick(status: string) {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
- })
- .then(async () => {
- try {
- await MenuAPI.batchMenu({ ids, status });
- await loadMenuData();
- } catch (error: unknown) {
- console.error(error);
- }
- })
- .catch(() => {});
+ });
+ try {
+ await ElMessageBox.confirm("确认启用或停用该项数据?", "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ await MenuAPI.batchMenu({ ids, status });
+ await loadMenuData();
+ } catch {
+ // 用户取消
+ }
}
onMounted(() => {
@@ -1153,7 +1157,7 @@ onMounted(() => {
diff --git a/frontend/web/src/views/module_system/notice/index.vue b/frontend/web/src/views/module_system/notice/index.vue
index 64c54712..252e75db 100644
--- a/frontend/web/src/views/module_system/notice/index.vue
+++ b/frontend/web/src/views/module_system/notice/index.vue
@@ -637,20 +637,22 @@ async function handleSubmit() {
});
}
-function deleteNoticeRow(id: number) {
- ElMessageBox.confirm("确认删除该项数据?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- await NoticeAPI.deleteNotice([id]);
- await noticeStore.getNotice();
- ElMessage.success("删除成功");
- faTableRef.value?.elTableRef?.clearSelection();
- await refreshRemove();
- })
- .catch(() => {});
+async function deleteNoticeRow(id: number) {
+ try {
+ await ElMessageBox.confirm("确认删除该项数据?", "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+
+ await NoticeAPI.deleteNotice([id]);
+ await noticeStore.getNotice();
+ ElMessage.success("删除成功");
+ faTableRef.value?.elTableRef?.clearSelection();
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ }
}
function buildNoticeRowActions(row: NoticeTable): TableOperationAction[] {
@@ -694,30 +696,29 @@ function formatNoticeOperationCell(row: NoticeTable) {
});
}
-function handleBatchDelete() {
+async function handleBatchDelete() {
const ids = selectedIds.value;
if (ids.length === 0) return;
- ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- try {
- batchDeleting.value = true;
- await NoticeAPI.deleteNotice(ids);
- await noticeStore.getNotice();
- ElMessage.success("删除成功");
- faTableRef.value?.elTableRef?.clearSelection();
- await refreshRemove();
- } finally {
- batchDeleting.value = false;
- }
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ batchDeleting.value = true;
+ await NoticeAPI.deleteNotice(ids);
+ await noticeStore.getNotice();
+ ElMessage.success("删除成功");
+ faTableRef.value?.elTableRef?.clearSelection();
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ } finally {
+ batchDeleting.value = false;
+ }
}
-function handleMoreClick(status: string) {
+async function handleMoreClick(status: string) {
const ids = selectedIds.value;
if (!ids.length) {
ElMessage.warning("请先选择要操作的数据");
@@ -727,13 +728,14 @@ function handleMoreClick(status: string) {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
- })
- .then(async () => {
- await NoticeAPI.batchNotice({ ids, status });
- await refreshData();
- await noticeStore.getNotice();
- })
- .catch(() => {});
+ });
+ try {
+ await NoticeAPI.batchNotice({ ids, status });
+ await refreshData();
+ await noticeStore.getNotice();
+ } catch {
+ // 用户取消
+ }
}
function openExportModal() {
@@ -747,11 +749,11 @@ onMounted(async () => {
diff --git a/frontend/web/src/views/module_system/position/index.vue b/frontend/web/src/views/module_system/position/index.vue
index 9ab55fdf..bc7e1fa9 100644
--- a/frontend/web/src/views/module_system/position/index.vue
+++ b/frontend/web/src/views/module_system/position/index.vue
@@ -403,20 +403,22 @@ function onTableSelectionChange(rows: PositionTable[]) {
selectedRows.value = rows;
}
-function deletePositionRow(id: number) {
- ElMessageBox.confirm("确认删除该项数据?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- await PositionAPI.deletePosition([id]);
- await userStore.getUserInfo();
- ElMessage.success("删除成功");
- faTableRef.value?.elTableRef?.clearSelection();
- await refreshRemove();
- })
- .catch(() => {});
+async function deletePositionRow(id: number) {
+ try {
+ await ElMessageBox.confirm("确认删除该项数据?", "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+
+ await PositionAPI.deletePosition([id]);
+ await userStore.getUserInfo();
+ ElMessage.success("删除成功");
+ faTableRef.value?.elTableRef?.clearSelection();
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ }
}
const opCtx = {
@@ -680,63 +682,59 @@ async function handleSubmit() {
});
}
-function handleBatchDelete() {
+async function handleBatchDelete() {
const ids = selectedIds.value;
if (ids.length === 0) return;
- ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- try {
- batchDeleting.value = true;
- await PositionAPI.deletePosition(ids);
- await userStore.getUserInfo();
- ElMessage.success("删除成功");
- faTableRef.value?.elTableRef?.clearSelection();
- await refreshRemove();
- } finally {
- batchDeleting.value = false;
- }
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ batchDeleting.value = true;
+ await PositionAPI.deletePosition(ids);
+ await userStore.getUserInfo();
+ ElMessage.success("删除成功");
+ faTableRef.value?.elTableRef?.clearSelection();
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ } finally {
+ batchDeleting.value = false;
+ }
}
-function handleMoreClick(status: string) {
+async function handleMoreClick(status: string) {
const ids = selectedIds.value;
if (!ids.length) {
ElMessage.warning("请先选择要操作的数据");
return;
}
- ElMessageBox.confirm(`确认${status === "0" ? "启用" : "停用"}该项数据?`, "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- try {
- await PositionAPI.batchPosition({ ids, status });
- await refreshData();
- await userStore.getUserInfo();
- } catch (error: unknown) {
- console.error(error);
- }
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm(`确认${status === "0" ? "启用" : "停用"}该项数据?`, "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ await PositionAPI.batchPosition({ ids, status });
+ await refreshData();
+ await userStore.getUserInfo();
+ } catch {
+ // 用户取消
+ }
}
diff --git a/frontend/web/src/views/module_system/role/index.vue b/frontend/web/src/views/module_system/role/index.vue
index 54f68786..69ff1ede 100644
--- a/frontend/web/src/views/module_system/role/index.vue
+++ b/frontend/web/src/views/module_system/role/index.vue
@@ -409,21 +409,22 @@ function handleOpenAssignPermDialog(roleId: number, roleName: string) {
drawerVisible.value = true;
}
-function deleteRoleRow(id: number) {
- ElMessageBox.confirm("确认删除该项数据?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- await RoleAPI.deleteRole([id]);
- const userStore = useUserStore();
- await userStore.getUserInfo();
- ElMessage.success("删除成功");
- faTableRef.value?.elTableRef?.clearSelection();
- await refreshRemove();
- })
- .catch(() => {});
+async function deleteRoleRow(id: number) {
+ try {
+ await ElMessageBox.confirm("确认删除该项数据?", "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ await RoleAPI.deleteRole([id]);
+ const userStore = useUserStore();
+ await userStore.getUserInfo();
+ ElMessage.success("删除成功");
+ faTableRef.value?.elTableRef?.clearSelection();
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ }
}
const opCtx = {
@@ -716,48 +717,48 @@ async function handleSubmit() {
});
}
-function handleBatchDelete() {
+async function handleBatchDelete() {
const ids = selectedIds.value;
if (ids.length === 0) return;
- ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- try {
- batchDeleting.value = true;
- await RoleAPI.deleteRole(ids);
- const userStore = useUserStore();
- await userStore.getUserInfo();
- ElMessage.success("删除成功");
- faTableRef.value?.elTableRef?.clearSelection();
- await refreshRemove();
- } finally {
- batchDeleting.value = false;
- }
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ batchDeleting.value = true;
+ await RoleAPI.deleteRole(ids);
+ const userStore = useUserStore();
+ await userStore.getUserInfo();
+ ElMessage.success("删除成功");
+ faTableRef.value?.elTableRef?.clearSelection();
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ } finally {
+ batchDeleting.value = false;
+ }
}
-function handleMoreClick(status: string) {
+async function handleMoreClick(status: string) {
const ids = selectedIds.value;
if (!ids.length) {
ElMessage.warning("请先选择要操作的数据");
return;
}
- ElMessageBox.confirm(`确认${status === "0" ? "启用" : "停用"}该项数据?`, "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- await RoleAPI.batchRole({ ids, status });
- await refreshData();
- const userStore = useUserStore();
- await userStore.getUserInfo();
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm(`确认${status === "0" ? "启用" : "停用"}该项数据?`, "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ await RoleAPI.batchRole({ ids, status });
+ await refreshData();
+ const userStore = useUserStore();
+ await userStore.getUserInfo();
+ } catch {
+ // 用户取消
+ }
}
function openExportModal() {
@@ -766,15 +767,15 @@ function openExportModal() {
diff --git a/frontend/web/src/views/module_system/tenant/index.vue b/frontend/web/src/views/module_system/tenant/index.vue
index e58f2a83..c7bf12c7 100644
--- a/frontend/web/src/views/module_system/tenant/index.vue
+++ b/frontend/web/src/views/module_system/tenant/index.vue
@@ -364,19 +364,21 @@ function onTableSelectionChange(rows: TenantTable[]) {
selectedRows.value = rows;
}
-function deleteTenantRow(id: number) {
- ElMessageBox.confirm("确认删除该项数据?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- await TenantAPI.deleteTenant([id]);
- ElMessage.success("删除成功");
- faTableRef.value?.elTableRef?.clearSelection();
- await refreshRemove();
- })
- .catch(() => {});
+async function deleteTenantRow(id: number) {
+ try {
+ await ElMessageBox.confirm("确认删除该项数据?", "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+
+ await TenantAPI.deleteTenant([id]);
+ ElMessage.success("删除成功");
+ faTableRef.value?.elTableRef?.clearSelection();
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ }
}
const opCtx = {
@@ -648,39 +650,38 @@ async function handleSubmit() {
});
}
-function handleBatchDelete() {
+async function handleBatchDelete() {
const ids = selectedIds.value;
if (ids.length === 0) return;
- ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- try {
- batchDeleting.value = true;
- await TenantAPI.deleteTenant(ids);
- ElMessage.success("删除成功");
- faTableRef.value?.elTableRef?.clearSelection();
- await refreshRemove();
- } finally {
- batchDeleting.value = false;
- }
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ batchDeleting.value = true;
+ await TenantAPI.deleteTenant(ids);
+ ElMessage.success("删除成功");
+ faTableRef.value?.elTableRef?.clearSelection();
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ } finally {
+ batchDeleting.value = false;
+ }
}
diff --git a/frontend/web/src/views/module_system/user/components/DeptTree.vue b/frontend/web/src/views/module_system/user/components/DeptTree.vue
index 45ed95dc..7fd6aed1 100644
--- a/frontend/web/src/views/module_system/user/components/DeptTree.vue
+++ b/frontend/web/src/views/module_system/user/components/DeptTree.vue
@@ -152,15 +152,14 @@ const queryFormData = reactive({
const loading = ref(true);
-onBeforeMount(() => {
+onBeforeMount(async () => {
loading.value = true;
- DeptAPI.listDept(queryFormData)
- .then((response) => {
- deptOptions.value = formatTree(response.data.data);
- })
- .finally(() => {
- loading.value = false;
- });
+ try {
+ const response = await DeptAPI.listDept(queryFormData);
+ deptOptions.value = formatTree(response.data.data);
+ } finally {
+ loading.value = false;
+ }
});
diff --git a/frontend/web/src/views/module_system/user/components/UserTableSelect.vue b/frontend/web/src/views/module_system/user/components/UserTableSelect.vue
index 675858ce..e2cacbd2 100644
--- a/frontend/web/src/views/module_system/user/components/UserTableSelect.vue
+++ b/frontend/web/src/views/module_system/user/components/UserTableSelect.vue
@@ -54,7 +54,7 @@ const selectConfig: ISelectConfig = {
],
},
],
- indexAction(params: UserPageQuery) {
+ async indexAction(params: UserPageQuery) {
// 映射查询参数到后端接口
const query: any = { ...params };
// 清理空字符串/空值,避免后端 422
@@ -70,12 +70,11 @@ const selectConfig: ISelectConfig = {
else if (query.status === "false") query.status = false;
}
// 请求用户分页列表并适配 TableSelect 需要的结构
- return UserAPI.listUser(query).then((res: any) => {
- return {
- total: res.data.data.total,
- list: res.data.data.items,
- };
- });
+ const res = await UserAPI.listUser(query);
+ return {
+ total: res.data.data.total,
+ list: res.data.data.items,
+ };
},
tableColumns: [
{ type: "selection", width: 50, align: "center" },
diff --git a/frontend/web/src/views/module_system/user/index.vue b/frontend/web/src/views/module_system/user/index.vue
index d13ec797..2f84ddcc 100644
--- a/frontend/web/src/views/module_system/user/index.vue
+++ b/frontend/web/src/views/module_system/user/index.vue
@@ -545,41 +545,43 @@ function onTableSelectionChange(rows: UserInfo[]) {
selectedRows.value = rows;
}
-function handleResetPassword(row: UserInfo) {
- ElMessageBox.prompt(`请输入用户【${row.username ?? ""}】的新密码`, "重置密码", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- }).then(
- async ({ value }) => {
- if (!value || value.length < 6) {
- ElMessage.warning("密码至少需要6位字符,请重新输入");
- return;
- }
- await UserAPI.resetUserPassword({ id: row.id!, password: value });
- ElMessage.success("密码已重置");
- },
- () => {}
- );
+async function handleResetPassword(row: UserInfo) {
+ try {
+ const { value } = await ElMessageBox.prompt(
+ `请输入用户【${row.username ?? ""}】的新密码`,
+ "重置密码",
+ { confirmButtonText: "确定", cancelButtonText: "取消" }
+ );
+ if (!value || value.length < 6) {
+ ElMessage.warning("密码至少需要6位字符,请重新输入");
+ return;
+ }
+ await UserAPI.resetUserPassword({ id: row.id!, password: value });
+ ElMessage.success("密码已重置");
+ } catch {
+ // 用户取消
+ }
}
-function deleteUserRow(id: number) {
- ElMessageBox.confirm("确认删除该项数据?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- await UserAPI.deleteUser([id]);
- const idSet = [id];
- if (userStore.basicInfo.id && idSet.includes(userStore.basicInfo.id)) {
- userStore.clearUserInfo();
- } else {
- ElMessage.success("删除成功");
- }
- faTableRef.value?.elTableRef?.clearSelection();
- await refreshRemove();
- })
- .catch(() => {});
+async function deleteUserRow(id: number) {
+ try {
+ await ElMessageBox.confirm("确认删除该项数据?", "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ await UserAPI.deleteUser([id]);
+ const idSet = [id];
+ if (userStore.basicInfo.id && idSet.includes(userStore.basicInfo.id)) {
+ userStore.clearUserInfo();
+ } else {
+ ElMessage.success("删除成功");
+ }
+ faTableRef.value?.elTableRef?.clearSelection();
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ }
}
const opCtx = {
@@ -708,7 +710,7 @@ const exportQueryParams = computed(() => {
const userImportContentConfig = computed(() => ({
permPrefix: "module_system:user",
cols: userCrudCols.value,
- indexAction: async () => ({}) as any,
+ indexAction: async () => ({}),
importTemplate: () => UserAPI.downloadTemplateUser(),
}));
@@ -839,25 +841,23 @@ function openExportModal() {
exportModalVisible.value = true;
}
-function handleImportUpload(formDataUpload: FormData) {
+async function handleImportUpload(formDataUpload: FormData) {
uploadLoading.value = true;
- UserAPI.importUser(formDataUpload)
- .then(async (response) => {
- if (response.data.code === ResultEnum.SUCCESS) {
- ElMessage.success(`${response.data.msg},${response.data.data}`);
- importModalVisible.value = false;
- await refreshData();
- } else {
- ElMessage.error(response.data.msg || "导入失败");
- }
- })
- .catch((error: unknown) => {
- console.error(error);
- ElMessage.error("上传失败");
- })
- .finally(() => {
- uploadLoading.value = false;
- });
+ try {
+ const response = await UserAPI.importUser(formDataUpload);
+ if (response.data.code === ResultEnum.SUCCESS) {
+ ElMessage.success(`${response.data.msg},${response.data.data}`);
+ importModalVisible.value = false;
+ await refreshData();
+ } else {
+ ElMessage.error(response.data.msg || "导入失败");
+ }
+ } catch (error: unknown) {
+ console.error(error);
+ ElMessage.error("上传失败");
+ } finally {
+ uploadLoading.value = false;
+ }
}
async function resetForm() {
@@ -950,61 +950,57 @@ async function handleSubmit() {
});
}
-function handleBatchDelete() {
+async function handleBatchDelete() {
const ids = selectedIds.value;
if (ids.length === 0) return;
- ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- try {
- batchDeleting.value = true;
- await UserAPI.deleteUser(ids);
- if (userStore.basicInfo.id && ids.includes(userStore.basicInfo.id)) {
- userStore.clearUserInfo();
- } else {
- ElMessage.success("删除成功");
- }
- selectedRows.value = [];
- await refreshRemove();
- } finally {
- batchDeleting.value = false;
- }
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm(`确定删除选中的 ${ids.length} 条数据吗?`, "批量删除", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ batchDeleting.value = true;
+ await UserAPI.deleteUser(ids);
+ if (userStore.basicInfo.id && ids.includes(userStore.basicInfo.id)) {
+ userStore.clearUserInfo();
+ } else {
+ ElMessage.success("删除成功");
+ }
+ selectedRows.value = [];
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ } finally {
+ batchDeleting.value = false;
+ }
}
-function handleMoreClick(status: string) {
+async function handleMoreClick(status: string) {
const ids = selectedIds.value;
if (!ids.length) {
ElMessage.warning("请先选择要操作的数据");
return;
}
- ElMessageBox.confirm("确认启用或停用该项数据?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- try {
- batchDeleting.value = true;
- await UserAPI.batchUser({ ids, status });
- await refreshData();
- } catch (error: unknown) {
- console.error(error);
- } finally {
- batchDeleting.value = false;
- }
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm("确认启用或停用该项数据?", "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ batchDeleting.value = true;
+ await UserAPI.batchUser({ ids, status });
+ await refreshData();
+ } catch {
+ // 用户取消
+ } finally {
+ batchDeleting.value = false;
+ }
}
diff --git a/frontend/web/src/views/module_task/workflow/components/NodeConfigPanel.vue b/frontend/web/src/views/module_task/workflow/components/NodeConfigPanel.vue
index 16012672..c3aafd41 100644
--- a/frontend/web/src/views/module_task/workflow/components/NodeConfigPanel.vue
+++ b/frontend/web/src/views/module_task/workflow/components/NodeConfigPanel.vue
@@ -250,15 +250,15 @@ onMounted(() => {
flex: 1;
}
-.panel-art-form ::v-deep(.el-row > .el-col:last-child) {
+.panel-art-form :deep(.el-row > .el-col:last-child) {
display: none;
}
-.panel-art-form ::v-deep(.el-form-item__content) {
+.panel-art-form :deep(.el-form-item__content) {
max-width: 100%;
}
-.panel-art-form ::v-deep(section) {
+.panel-art-form :deep(section) {
padding: 0;
}
diff --git a/frontend/web/src/views/module_task/workflow/components/WorkflowDesignDrawer.vue b/frontend/web/src/views/module_task/workflow/components/WorkflowDesignDrawer.vue
index 7f7ff8d8..49954717 100644
--- a/frontend/web/src/views/module_task/workflow/components/WorkflowDesignDrawer.vue
+++ b/frontend/web/src/views/module_task/workflow/components/WorkflowDesignDrawer.vue
@@ -534,19 +534,20 @@ onMounted(() => {
onInit((vueFlowInstance) => {
vueFlowInstance.fitView();
if (workflowId.value) {
- WorkflowDefinitionAPI.getWorkflowDetail(workflowId.value)
- .then((res) => {
+ (async () => {
+ try {
+ const res = await WorkflowDefinitionAPI.getWorkflowDetail(workflowId.value!);
if (res.data && res.data.data) {
nodes.value = res.data.data.nodes || [];
edges.value = res.data.data.edges || [];
- saveToHistory(nodes.value as any, edges.value as any);
+ saveToHistory(nodes.value, edges.value);
}
- })
- .catch(() => {
+ } catch {
ElMessage.error("流程加载失败");
- });
+ }
+ })();
} else {
- saveToHistory(nodes.value as any, edges.value as any);
+ saveToHistory(nodes.value, edges.value);
}
});
@@ -556,7 +557,7 @@ onConnect((connection) => {
type: edgeStyle.value,
animated: edgeAnimated.value,
});
- saveToHistory(nodes.value as any, edges.value as any);
+ saveToHistory(nodes.value, edges.value);
});
function handleValidate() {
@@ -662,7 +663,7 @@ function handleSaveNode(data: any) {
if (!selectedNode.value) return;
const nodeId = selectedNode.value!.id;
if (nodeId && updateNodeData(nodeId, data, getNodes, setNodes)) {
- saveToHistory(nodes.value as any, edges.value as any);
+ saveToHistory(nodes.value, edges.value);
}
}
@@ -671,23 +672,28 @@ function handleDeleteNode() {
const nodeId = selectedNode.value!.id;
if (!nodeId) return;
- ElMessageBox.confirm("确定要删除该节点吗?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- deleteNode(nodeId, getNodes, setNodes, getEdges, setEdges);
- ElMessage.success("节点删除成功");
- handleClosePanel();
- saveToHistory(nodes.value as any, edges.value as any);
- });
+ (async () => {
+ try {
+ await ElMessageBox.confirm("确定要删除该节点吗?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ deleteNode(nodeId, getNodes, setNodes, getEdges, setEdges);
+ ElMessage.success("节点删除成功");
+ handleClosePanel();
+ saveToHistory(nodes.value, edges.value);
+ } catch {
+ // 用户取消
+ }
+ })();
}
function handleSaveEdge(data: any) {
if (!selectedEdge.value) return;
const edgeId = selectedEdge.value!.id;
if (edgeId && updateEdgeData(edgeId, data, getEdges, setEdges)) {
- saveToHistory(nodes.value as any, edges.value as any);
+ saveToHistory(nodes.value, edges.value);
}
}
@@ -696,16 +702,21 @@ function handleDeleteEdge() {
const edgeId = selectedEdge.value!.id;
if (!edgeId) return;
- ElMessageBox.confirm("确定要删除该连线吗?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- deleteEdge(edgeId, getEdges, setEdges);
- ElMessage.success("连线删除成功");
- handleClosePanel();
- saveToHistory(nodes.value as any, edges.value as any);
- });
+ (async () => {
+ try {
+ await ElMessageBox.confirm("确定要删除该连线吗?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ deleteEdge(edgeId, getEdges, setEdges);
+ ElMessage.success("连线删除成功");
+ handleClosePanel();
+ saveToHistory(nodes.value, edges.value);
+ } catch {
+ // 用户取消
+ }
+ })();
}
function handleSave() {
@@ -723,11 +734,12 @@ function handleSave() {
if (workflowId.value) {
return WorkflowDefinitionAPI.updateWorkflow(workflowId.value, saveData as WorkflowForm);
} else {
- return WorkflowDefinitionAPI.createWorkflow(saveData as WorkflowForm).then((res) => {
+ return (async () => {
+ const res = await WorkflowDefinitionAPI.createWorkflow(saveData as WorkflowForm);
if (res.data && res.data.data) {
workflowId.value = res.data.data.id;
}
- });
+ })();
}
}
@@ -904,7 +916,7 @@ function deleteEdge(edgeId: string, getEdges: () => Edge[], setEdges: (edges: Ed
diff --git a/frontend/web/src/views/module_task/workflow/definition/index.vue b/frontend/web/src/views/module_task/workflow/definition/index.vue
index 807a3bb6..da785995 100644
--- a/frontend/web/src/views/module_task/workflow/definition/index.vue
+++ b/frontend/web/src/views/module_task/workflow/definition/index.vue
@@ -198,42 +198,42 @@ function onTableSelectionChange(rows: WorkflowTable[]) {
selectedRows.value = rows;
}
-function deleteWorkflowRow(id: number | undefined) {
+async function deleteWorkflowRow(id: number | undefined) {
if (id == null) return;
- ElMessageBox.confirm("确认删除该工作流吗?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- await WorkflowDefinitionAPI.deleteWorkflow([id]);
- ElMessage.success("删除成功");
- faTableRef.value?.elTableRef?.clearSelection();
- await refreshRemove();
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm("确认删除该工作流吗?", "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ await WorkflowDefinitionAPI.deleteWorkflow([id]);
+ ElMessage.success("删除成功");
+ faTableRef.value?.elTableRef?.clearSelection();
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ }
}
-function handleBatchDelete() {
+async function handleBatchDelete() {
const ids = selectedIds.value;
if (ids.length === 0) return;
- ElMessageBox.confirm(BATCH_DELETE_MSG, "批量删除", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- try {
- batchDeleting.value = true;
- await WorkflowDefinitionAPI.deleteWorkflow(ids);
- ElMessage.success("删除成功");
- selectedRows.value = [];
- await refreshRemove();
- } finally {
- batchDeleting.value = false;
- }
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm(BATCH_DELETE_MSG, "批量删除", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ batchDeleting.value = true;
+ await WorkflowDefinitionAPI.deleteWorkflow(ids);
+ ElMessage.success("删除成功");
+ selectedRows.value = [];
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ } finally {
+ batchDeleting.value = false;
+ }
}
function getStatusType(status: string): "success" | "warning" | "info" | "danger" | "primary" {
@@ -363,55 +363,49 @@ function onDrawerRefresh() {
void refreshUpdate();
}
-function handlePublish(record: WorkflowTable) {
- ElMessageBox.confirm("确定要发布此工作流吗?发布后可执行。", "确认发布", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- try {
- if (!record.id) {
- ElMessage.error("工作流ID不存在");
- return;
- }
- await WorkflowDefinitionAPI.publishWorkflow(record.id, {});
- ElMessage.success("发布成功");
- await refreshUpdate();
- } catch {
- ElMessage.error("发布失败");
- }
- })
- .catch(() => {});
+async function handlePublish(record: WorkflowTable) {
+ try {
+ await ElMessageBox.confirm("确定要发布此工作流吗?发布后可执行。", "确认发布", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ if (!record.id) {
+ ElMessage.error("工作流ID不存在");
+ return;
+ }
+ await WorkflowDefinitionAPI.publishWorkflow(record.id, {});
+ ElMessage.success("发布成功");
+ await refreshUpdate();
+ } catch {
+ ElMessage.error("发布失败");
+ }
}
-function handleExecute(action: string, record: WorkflowTable) {
+async function handleExecute(action: string, record: WorkflowTable) {
if (action !== "execute") return;
- ElMessageBox.confirm("确定要立即执行此工作流吗?", "确认执行", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- try {
- if (!record.id) {
- ElMessage.error("工作流ID不存在");
- return;
- }
- const res = await WorkflowDefinitionAPI.executeWorkflow({
- workflow_id: record.id,
- variables: {},
- });
- if (res.data?.data) {
- const result = res.data.data;
- ElMessage.success(`工作流执行${result.status === "completed" ? "成功" : "失败"}`);
- }
- await refreshUpdate();
- } catch {
- ElMessage.error("执行失败");
- }
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm("确定要立即执行此工作流吗?", "确认执行", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ if (!record.id) {
+ ElMessage.error("工作流ID不存在");
+ return;
+ }
+ const res = await WorkflowDefinitionAPI.executeWorkflow({
+ workflow_id: record.id,
+ variables: {},
+ });
+ if (res.data?.data) {
+ const result = res.data.data;
+ ElMessage.success(`工作流执行${result.status === "completed" ? "成功" : "失败"}`);
+ }
+ await refreshUpdate();
+ } catch {
+ ElMessage.error("执行失败");
+ }
}
diff --git a/frontend/web/src/views/module_task/workflow/node-type/index.vue b/frontend/web/src/views/module_task/workflow/node-type/index.vue
index e8c30217..c94a211e 100644
--- a/frontend/web/src/views/module_task/workflow/node-type/index.vue
+++ b/frontend/web/src/views/module_task/workflow/node-type/index.vue
@@ -209,42 +209,42 @@ function categoryLabel(c?: string) {
return c ? m[c] || c : "-";
}
-function deleteNodeTypeRow(id: number | undefined) {
+async function deleteNodeTypeRow(id: number | undefined) {
if (id == null) return;
- ElMessageBox.confirm("确认删除该节点类型吗?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- await WorkflowNodeTypeAPI.deleteWorkflowNodeType([id]);
- ElMessage.success("删除成功");
- faTableRef.value?.elTableRef?.clearSelection();
- await refreshRemove();
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm("确认删除该节点类型吗?", "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ await WorkflowNodeTypeAPI.deleteWorkflowNodeType([id]);
+ ElMessage.success("删除成功");
+ faTableRef.value?.elTableRef?.clearSelection();
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ }
}
-function handleBatchDelete() {
+async function handleBatchDelete() {
const ids = selectedIds.value;
if (ids.length === 0) return;
- ElMessageBox.confirm(BATCH_DELETE_MSG, "批量删除", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- try {
- batchDeleting.value = true;
- await WorkflowNodeTypeAPI.deleteWorkflowNodeType(ids);
- ElMessage.success("删除成功");
- selectedRows.value = [];
- await refreshRemove();
- } finally {
- batchDeleting.value = false;
- }
- })
- .catch(() => {});
+ try {
+ await ElMessageBox.confirm(BATCH_DELETE_MSG, "批量删除", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ });
+ batchDeleting.value = true;
+ await WorkflowNodeTypeAPI.deleteWorkflowNodeType(ids);
+ ElMessage.success("删除成功");
+ selectedRows.value = [];
+ await refreshRemove();
+ } catch {
+ // 用户取消
+ } finally {
+ batchDeleting.value = false;
+ }
}
const {
@@ -518,11 +518,11 @@ async function submitForm() {
diff --git a/frontend/web/vite.config.ts b/frontend/web/vite.config.ts
index e16817b4..d6597f4f 100755
--- a/frontend/web/vite.config.ts
+++ b/frontend/web/vite.config.ts
@@ -169,23 +169,17 @@ export default ({ mode }: { mode: string }) => {
output: {
manualChunks(id) {
if (id.includes("node_modules")) {
- if (id.includes("echarts")) {
- return "echarts";
- }
- if (id.includes("element-plus")) {
- return "element-plus";
- }
- if (id.includes("@wangeditor-next")) {
- return "wangeditor";
- }
- if (id.includes("codemirror")) {
- return "codemirror";
- }
- if (id.includes("exceljs")) {
- return "exceljs";
- }
+ if (id.includes("echarts")) return "echarts";
+ if (id.includes("element-plus")) return "element-plus";
+ if (id.includes("@wangeditor-next")) return "wangeditor";
+ if (id.includes("codemirror")) return "codemirror";
+ if (id.includes("exceljs")) return "exceljs";
+ if (id.includes("@vue-flow")) return "vue-flow";
+ if (id.includes("highlight.js") || id.includes("highlightjs")) return "highlight";
+ if (id.includes("xgplayer")) return "xgplayer";
+ if (id.includes("markdown-it")) return "markdown";
const module = id.toString().split("node_modules/")[1].split("/")[0];
- if (["birpc", "hookable"].includes(module)) return;
+ if (["birpc", "hookable", "tslib", "copy-anything"].includes(module)) return;
return module;
}
},