From 58cb6e913eebfa6552c20211d54d2cfd12181c93 Mon Sep 17 00:00:00 2001 From: weizong song Date: Tue, 6 Jan 2026 11:37:16 +0800 Subject: [PATCH] up --- src/utils/formBuilder.js | 26 ++++++++++++++++++++++++-- src/views/flow/create.vue | 11 ++++++++++- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/utils/formBuilder.js b/src/utils/formBuilder.js index a3ed9e2..665364a 100644 --- a/src/utils/formBuilder.js +++ b/src/utils/formBuilder.js @@ -1444,9 +1444,20 @@ export default function formBuilder( ) { isJointly = !!log.is_jointly_sign; if (log.status > 0 && log.user) { + // 对于 budget-source 类型字段,如果值是 JSON 格式,不显示原始 JSON + let displayValue = value.value; + if (info.type === 'budget-source' && displayValue) { + const strValue = String(displayValue); + // 如果是 JSON 字符串,不显示 + if (strValue.trim().startsWith('{') || strValue.trim().startsWith('[')) { + displayValue = ''; // 不显示原始 JSON + } else if (typeof displayValue === 'object' || Array.isArray(displayValue)) { + displayValue = ''; // 不显示对象或数组 + } + } jointlySignContent.push( h("div", [ - h("span", value.value), + h("span", displayValue), h("br"), info.is_sign ? log.user?.sign_file?.url @@ -2657,9 +2668,20 @@ export default function formBuilder( ) { isJointly = !!log.is_jointly_sign; if (log.status > 0 && log.user) { + // 对于 budget-source 类型字段,如果值是 JSON 格式,不显示原始 JSON + let displayValue = value.value; + if (info.type === 'budget-source' && displayValue) { + const strValue = String(displayValue); + // 如果是 JSON 字符串,不显示 + if (strValue.trim().startsWith('{') || strValue.trim().startsWith('[')) { + displayValue = ''; // 不显示原始 JSON + } else if (typeof displayValue === 'object' || Array.isArray(displayValue)) { + displayValue = ''; // 不显示对象或数组 + } + } jointlySignContent.push( h("div", [ - h("span", value.value), + h("span", displayValue), h("br"), info.is_sign ? log.user?.sign_file?.url diff --git a/src/views/flow/create.vue b/src/views/flow/create.vue index 7867e65..d86870b 100644 --- a/src/views/flow/create.vue +++ b/src/views/flow/create.vue @@ -228,7 +228,7 @@