From a567edf28abb00581c93b27405ed9657b63a8bd7 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期二, 19 五月 2026 13:32:17 +0800
Subject: [PATCH] 模板类型设置

---
 src/views/officeProcessAutomation/ApproveManage/approve-template/approveTemplateConstants.js |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-template/approveTemplateConstants.js b/src/views/officeProcessAutomation/ApproveManage/approve-template/approveTemplateConstants.js
index 1ffdbf5..3325e55 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-template/approveTemplateConstants.js
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-template/approveTemplateConstants.js
@@ -14,7 +14,9 @@
 export { TEMPLATE_TYPE_OPTIONS };
 
 export function templateTypeLabel(type) {
-  return TEMPLATE_TYPE_OPTIONS.find((x) => x.value === type)?.label || "鈥�";
+  if (type == null || type === "") return "鈥�";
+  const n = Number(type);
+  return TEMPLATE_TYPE_OPTIONS.find((x) => x.value === n)?.label || "鈥�";
 }
 
 /** 鑺傜偣鍐呭鎵规柟寮忥細浼氱 / 鎴栫 */
@@ -162,7 +164,7 @@
     description: row.description || "",
     enabled: mapEnabledFromApi(row.enabled),
     enabledRaw: row.enabled,
-    templateType: row.templateType,
+    templateType: row.templateType != null ? Number(row.templateType) : undefined,
     formConfig: row.formConfig,
     formConfigData: parseFormConfigToData(row.formConfig),
     createdUser: row.createdUser,
@@ -210,15 +212,14 @@
   return dto;
 }
 
-/** 鏋勫缓鍒嗛〉鏌ヨ鍙傛暟 */
-export function buildApprovalTemplateListParams({ page, searchForm }) {
+export function buildApprovalTemplateListParams({ page, searchForm, templateType = TEMPLATE_TYPE_CUSTOM }) {
   const params = {
     current: page.current,
     size: page.size,
+    templateType: searchForm?.templateType != null && searchForm.templateType !== ""
+      ? searchForm.templateType
+      : templateType,
   };
-  if (searchForm?.templateType != null && searchForm.templateType !== "") {
-    params.templateType = searchForm.templateType;
-  }
   const kw = (searchForm?.keyword || "").trim();
   if (kw) params.templateName = kw;
   if (searchForm?.enabledOnly) params.enabled = "1";

--
Gitblit v1.9.3