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); }); });