|
@@ -402,7 +402,7 @@
|
|
<span v-else>查看模版</span>
|
|
<span v-else>查看模版</span>
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
- v-if="type !== 'document'"
|
|
|
|
|
|
+ v-if="type !== 'document'"
|
|
class="sidebar-item"
|
|
class="sidebar-item"
|
|
:class="showView == 1 ? 'active-item' : ''"
|
|
:class="showView == 1 ? 'active-item' : ''"
|
|
@click="viewModule"
|
|
@click="viewModule"
|
|
@@ -1289,6 +1289,7 @@ export default {
|
|
},
|
|
},
|
|
//加载文档信息
|
|
//加载文档信息
|
|
async onLoadArticle(id) {
|
|
async onLoadArticle(id) {
|
|
|
|
+ console.log("文档");
|
|
try {
|
|
try {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
const res = await getDocumentInfo({ id });
|
|
const res = await getDocumentInfo({ id });
|
|
@@ -1317,13 +1318,16 @@ export default {
|
|
|
|
|
|
const updatedComs = await Promise.all(
|
|
const updatedComs = await Promise.all(
|
|
templateData.map(async (el) => {
|
|
templateData.map(async (el) => {
|
|
- const templateInfo = await getTemplateInfo({ id: el.id });
|
|
|
|
|
|
+ let templateInfo = { data: {} };
|
|
|
|
+ if (this.type !== "document") {
|
|
|
|
+ templateInfo = await getTemplateInfo({ id: el.id });
|
|
|
|
+ }
|
|
const formulaData = await searchFormula({ page: 1, pageSize: 999 });
|
|
const formulaData = await searchFormula({ page: 1, pageSize: 999 });
|
|
|
|
|
|
const attrs =
|
|
const attrs =
|
|
typeof templateInfo.data.attrs === "string"
|
|
typeof templateInfo.data.attrs === "string"
|
|
? JSON.parse(templateInfo.data.attrs)
|
|
? JSON.parse(templateInfo.data.attrs)
|
|
- : templateInfo.data.attrs;
|
|
|
|
|
|
+ : templateInfo.data.attrs || []; // Add a fallback empty array
|
|
|
|
|
|
attrs.forEach((item) => {
|
|
attrs.forEach((item) => {
|
|
const matchedFormula = formulaData.data.dataList.find(
|
|
const matchedFormula = formulaData.data.dataList.find(
|
|
@@ -1355,6 +1359,7 @@ export default {
|
|
},
|
|
},
|
|
/* 加载模版信息 */
|
|
/* 加载模版信息 */
|
|
async onTemplateInfo(id) {
|
|
async onTemplateInfo(id) {
|
|
|
|
+ console.log("模版");
|
|
try {
|
|
try {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
const res = await getDocumentInfo({ id });
|
|
const res = await getDocumentInfo({ id });
|