From efc0c3a697969503634138d7881543f4099b81ca Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期三, 20 五月 2026 13:32:09 +0800
Subject: [PATCH] 审批模板导入只能从已有模板导入
---
src/views/officeProcessAutomation/ApproveManage/approve-list/approveListConstants.js | 33 +++++++++++++++++++++++----------
1 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-list/approveListConstants.js b/src/views/officeProcessAutomation/ApproveManage/approve-list/approveListConstants.js
index 8974cf4..acbed98 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-list/approveListConstants.js
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-list/approveListConstants.js
@@ -8,6 +8,7 @@
nodeSignModeLabel,
} from "../approve-template/approveTemplateConstants.js";
import { buildFormPayloadFromFields, parseFormConfigToData } from "../approve-template/formConfigUtils.js";
+import { isDynamicOptionSource, selectOptionSourceLabel } from "../approve-template/selectOptionSource.js";
/** 瀹℃壒绫诲瀷锛堜笌鍚庣瀛楁 approvalType 瀵归綈锛屽悗鏈熷彲鍚屾锛� */
export const APPROVAL_TYPE_OPTIONS = [
@@ -33,16 +34,6 @@
{ value: "rejected", label: "宸查┏鍥�" },
{ value: "cancelled", label: "宸叉挙閿�" },
];
-
-export const LEGACY_APPROVE_LIST_STORAGE_KEY = "oa_unified_approve_list_v1";
-
-export function clearLegacyApproveListStorage() {
- try {
- localStorage.removeItem(LEGACY_APPROVE_LIST_STORAGE_KEY);
- } catch {
- /* ignore */
- }
-}
/** 鎻愪氦寮圭獥锛氭ā鏉垮崱鐗囷紙鏉ヨ嚜鍚庣鍒楄〃锛� */
export function mapSubmitTemplateCard(row) {
@@ -176,6 +167,9 @@
/** 鍗曞瓧娈靛睍绀哄�硷紙璇︽儏鍙锛� */
export function formatFieldDisplayValue(field, val) {
if (val == null || val === "" || (Array.isArray(val) && !val.length)) return "鈥�";
+ if (field?.type === "select" && isDynamicOptionSource(field.optionSource)) {
+ return `${selectOptionSourceLabel(field.optionSource)}锛�${String(val)}`;
+ }
if (field?.type === "select" && field.options?.length) {
const hit = field.options.find((o) => String(o.value) === String(val));
return hit?.label || String(val);
@@ -286,6 +280,12 @@
formConfig: buildInstanceFormConfigJson({ ...tpl, fields: tpl.fields || submitForm?.formFieldDefs }, payload),
tasks: taskList,
};
+
+ const attachments =
+ (Array.isArray(submitForm?.storageBlobDTOs) && submitForm.storageBlobDTOs.length
+ ? submitForm.storageBlobDTOs
+ : null) || tpl.storageBlobDTOs;
+ if (attachments?.length) dto.storageBlobDTOs = attachments;
if (isUpdate) {
dto.id = existingRow?.id ?? submitForm?.instanceId;
@@ -487,6 +487,10 @@
formFieldDefs: fields,
formPayload,
flowNodes,
+ templateAttachments: initTemplateAttachmentsFromSnapshot(templateSnapshot),
+ storageBlobDTOs: row?.storageBlobDTOs?.length
+ ? JSON.parse(JSON.stringify(row.storageBlobDTOs))
+ : [],
};
}
@@ -511,5 +515,14 @@
formFieldDefs: tpl?.fields || [],
formPayload: payload,
flowNodes,
+ templateAttachments: tpl?.storageBlobDTOs
+ ? JSON.parse(JSON.stringify(tpl.storageBlobDTOs))
+ : [],
+ storageBlobDTOs: [],
};
}
+
+export function initTemplateAttachmentsFromSnapshot(templateSnapshot) {
+ const list = templateSnapshot?.storageBlobDTOs;
+ return list?.length ? JSON.parse(JSON.stringify(list)) : [];
+}
--
Gitblit v1.9.3