From e3dfaf1960dc436b8408188d47943d469a065e07 Mon Sep 17 00:00:00 2001 From: suixy <2277317060@qq.com> Date: Wed, 4 Feb 2026 16:09:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A8=A1=E7=89=88=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/contract/index.vue | 7 +++- src/views/oa/erp/contractInfo/contract.vue | 48 ++++------------------ 2 files changed, 14 insertions(+), 41 deletions(-) diff --git a/src/views/contract/index.vue b/src/views/contract/index.vue index 88c3184..527171f 100644 --- a/src/views/contract/index.vue +++ b/src/views/contract/index.vue @@ -424,10 +424,15 @@ const insertText = (e) => { font-size: 16px; } } + +/deep/ .t-button--theme-warning { + border-color: var(--td-warning-color-hover); + background-color: var(--td-warning-color-hover); +} \ No newline at end of file + diff --git a/src/views/oa/erp/contractInfo/contract.vue b/src/views/oa/erp/contractInfo/contract.vue index 8a32479..3412214 100644 --- a/src/views/oa/erp/contractInfo/contract.vue +++ b/src/views/oa/erp/contractInfo/contract.vue @@ -19,8 +19,6 @@ const template = ref({}); const editorRef = ref(); -const fieldList = ref([]); - let templateData = {}; const options = ref({ document: { @@ -100,7 +98,7 @@ const rowRenderTemplate = (str, index) => { if (arr.length > 0) { arr[0] = `#{${arr[0]}}`; } - return arr.reduce((o, k) => o?.[k], templateData) ?? ' '; + return arr.reduce((o, k) => o?.[k], templateData) || ' '; }); return res; }; @@ -136,7 +134,7 @@ const fillRowData = (e, index) => { return fillRowData(item, index); }); } else { - e.text = rowRenderTemplate(e.text || '', index); + e.text = rowRenderTemplate(e.text || ' ', index); } return e; }; @@ -172,7 +170,7 @@ const fillData = (e) => { return fillData(item); }); } else { - e.text = renderTemplate(e.text || '', templateData); + e.text = renderTemplate(e.text || ' ', templateData); } } return e; @@ -206,7 +204,7 @@ onMounted(async () => { templateData = {}; assignData.forEach((item) => { // templateData[extractPlaceholders(item.varName)] = item.varValue; - templateData[item.varName] = item.varValue; + templateData[item.varName] = item.varValue || ' '; }); // console.log(templateData); getPrintTemplate(route.query.templateId).then((e) => { @@ -214,46 +212,12 @@ onMounted(async () => { const editor = editorRef.value; const docData = JSON.parse(e.data.templateData || '{}'); const data = fillData(docData); - // console.log(data); - // console.log(JSON.parse(e.data.templateData || '{}')); - // editor.setContent(JSON.parse(e.data.templateData || '{}')); editor.setContent(data); }); });