Browse Source

处理更新按钮显示异常及文章不显示输入框

yangg 9 months ago
parent
commit
d48c468142

+ 1 - 1
.env.development

@@ -2,5 +2,5 @@
 ENV = 'development'
 port = 8080
 # base api
-VUE_APP_BASE_API = 'http://58.246.234.210:8084'
+VUE_APP_BASE_API = 'http://192.168.1.199:8084'
 #192.168.1.199

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


+ 0 - 0
dist/static/css/chunk-d38ceedc.68741a84.css → dist/static/css/chunk-fbe87a14.68741a84.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.8fad701b.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-d38ceedc.52772c66.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-fbe87a14.d12630f4.js


+ 12 - 15
src/views/document/create.vue

@@ -33,8 +33,7 @@
           size="mini"
           @click="renew"
           v-if="
-            docAttr.is_template == 0 &&
-            docAttr.id > 0 &&
+           articleId !== undefined &&
             type !== 'module' &&
             type == 'document'
           "
@@ -1221,7 +1220,6 @@ export default {
         });
 
         this.coms = [data];
-        console.log("11", this.coms);
       } catch (error) {
         console.error("加载模板信息失败:", error);
       }
@@ -1289,7 +1287,6 @@ export default {
     },
     //加载文档信息
     async onLoadArticle(id) {
-      console.log("文档");
       try {
         this.loading = true;
         const res = await getDocumentInfo({ id });
@@ -1315,20 +1312,20 @@ export default {
           typeof res.data.data === "string"
             ? JSON.parse(res.data.data)
             : res.data.data;
-
+            
         const updatedComs = await Promise.all(
           templateData.map(async (el) => {
-            let templateInfo = { data: {} };
+            /* let templateInfo = { data: {} };
             if (this.type !== "document") {
               templateInfo = await getTemplateInfo({ id: el.id });
-            }
+            } */
             const formulaData = await searchFormula({ page: 1, pageSize: 999 });
 
-            const attrs =
-              typeof templateInfo.data.attrs === "string"
+            const attrs =el.attrs
+              /* typeof templateInfo.data.attrs === "string"
                 ? JSON.parse(templateInfo.data.attrs)
-                : templateInfo.data.attrs || []; // Add a fallback empty array
-
+                : templateInfo.data.attrs || []; // Add a fallback empty array */
+           
             attrs.forEach((item) => {
               const matchedFormula = formulaData.data.dataList.find(
                 (ite) => ite.id === item.data.id
@@ -1339,7 +1336,7 @@ export default {
               }
             });
 
-            return { ...el, ...templateInfo.data, attrs };
+            return { ...el/* , ...templateInfo.data, attrs */ };
           })
         );
 
@@ -1369,9 +1366,9 @@ export default {
         }
 
         this.docAttr = {
-          id: res.data.id,
-          category_id: Number(res.data.category_id),
-          title: res.data.title,
+          id: this.docAttr.id,
+          category_id: Number(this.docAttr.category_id),
+          title: this.docAttr.title,
           content: "",
           status: res.data.status,
           is_template: res.data.is_template,

Some files were not shown because too many files changed in this diff