From 6689bfb1c2f0638e8493adfa058d57d86e473eac Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期二, 19 五月 2026 17:21:10 +0800
Subject: [PATCH] 审批列表得提交审批根据模板类型区分
---
src/views/officeProcessAutomation/ApproveManage/approve-template/useApproveTemplate.js | 31 ++-----------------------------
1 files changed, 2 insertions(+), 29 deletions(-)
diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-template/useApproveTemplate.js b/src/views/officeProcessAutomation/ApproveManage/approve-template/useApproveTemplate.js
index 3e27afb..95eac7b 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-template/useApproveTemplate.js
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-template/useApproveTemplate.js
@@ -6,13 +6,13 @@
TEMPLATE_TYPE_CUSTOM,
updateApprovalTemplate,
} from "@/api/officeProcessAutomation/approvalTemplate.js";
-import { getTypeEnums } from "@/api/basicData/enum.js";
import { Search } from "@element-plus/icons-vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { reactive, ref } from "vue";
import {
buildApprovalTemplateListParams,
createEmptyTemplateForm,
+ fetchBusinessTypeOptions,
flowNodesSummary,
mapTemplateFromApi,
mapTemplateToApi,
@@ -29,32 +29,6 @@
{ value: 0, label: "绯荤粺鍐呯疆" },
{ value: 1, label: "鑷畾涔�" },
];
-
-function unwrapEnumList(data) {
- if (Array.isArray(data)) return data;
- if (!data || typeof data !== "object") return [];
- if (Array.isArray(data.TypeEnums)) return data.TypeEnums;
- if (Array.isArray(data.typeEnums)) return data.typeEnums;
- const nested = Object.values(data).find((v) => Array.isArray(v));
- return nested || [];
-}
-
-function normalizeTypeEnumOptions(data) {
- return unwrapEnumList(data)
- .map((item) => {
- const rawValue = item?.value ?? item?.code ?? item?.businessType ?? item?.dictValue ?? item?.key;
- if (rawValue == null || rawValue === "") return null;
- const num = Number(rawValue);
- const value =
- typeof rawValue === "number" || (Number.isFinite(num) && String(rawValue).trim() !== "")
- ? num
- : rawValue;
- const label =
- item?.label ?? item?.name ?? item?.desc ?? item?.dictLabel ?? item?.text ?? String(value);
- return { label, value };
- })
- .filter(Boolean);
-}
function matchTemplateTypeValue(options, type) {
if (type == null || type === "") return false;
@@ -99,8 +73,7 @@
async function loadTemplateTypeOptions() {
try {
- const res = await getTypeEnums();
- const list = normalizeTypeEnumOptions(res?.data);
+ const list = await fetchBusinessTypeOptions();
templateTypeOptions.value = list.length ? list : [...FALLBACK_TEMPLATE_TYPE_OPTIONS];
} catch {
templateTypeOptions.value = [...FALLBACK_TEMPLATE_TYPE_OPTIONS];
--
Gitblit v1.9.3