Explorar o código

处理编辑器工具栏不展示图文可点击情况

yangg hai 9 meses
pai
achega
174861406c

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/index.html


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/css/chunk-23942cdd.8e7554c0.css


+ 0 - 0
dist/static/css/chunk-1b8f06f0.68741a84.css → dist/static/css/chunk-5f6e410d.68741a84.css


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/css/chunk-f321ba56.cdeb37c9.css


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/app.e28653d7.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/chunk-1b8f06f0.3a0ee7a0.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/chunk-5f6e410d.5f435a71.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/chunk-f321ba56.3183b641.js


+ 5 - 5
src/views/document/com/components/TextArea/index.vue

@@ -1027,7 +1027,7 @@ export default {
 
 .editor-area {
   ::v-deep .cke_top {
-    display: none; // Hide the original toolbar
+    display: block; // Hide the original toolbar
   }
 }
 ::v-deep .directory-level-1 {
@@ -1042,25 +1042,25 @@ export default {
   margin-left: 20px;
 }
 
-.directory-level-3 {
+::v-deep .directory-level-3 {
   font-size: 18px;
   font-weight: bold;
   margin-left: 40px;
 }
 
-.directory-level-4 {
+::v-deep .directory-level-4 {
   font-size: 16px;
   font-weight: bold;
   margin-left: 60px;
 }
 
-.directory-level-5 {
+::v-deep .directory-level-5 {
   font-size: 14px;
   font-weight: bold;
   margin-left: 80px;
 }
 
-.directory-level-6 {
+::v-deep .directory-level-6 {
   font-size: 12px;
   font-weight: normal;
   margin-left: 100px;

+ 7 - 7
src/views/document/com/menus.vue

@@ -16,8 +16,8 @@
               @click="onClickMenus(item)"
               :class="{
                 disabled:
-                  (type === 'document' && item.key !== 'ai') ||
-                  (item.key === 'article' && (type === 'module' || type === undefined)),
+                  (typeMenu === 'document' && item.key !== 'ai') ||
+                  (item.key === 'article' && (typeMenu === 'module' || typeMenu === undefined)),
               }"
             >
               <div class="icon">
@@ -171,6 +171,7 @@ export default {
       showSourceAi: false,
       showSourceEs: false,
       type: null,
+      typeMenu:null,
       insertTitle: "插入变量",
       menus: [
         {
@@ -185,7 +186,7 @@ export default {
               key: "article",
               name: "图文",
               icon: "图文",
-              disabled: () =>this.type === "module" || this.type === undefined,
+              disabled: () =>this.typeMenu === "module" || this.typeMenu === undefined,
             },
 
             /* {
@@ -285,8 +286,7 @@ export default {
     },
   },
   mounted() {
-    this.type = this.$route.query.type;
-    console.log(this.type);
+    this.typeMenu = this.$route.query.type;
   },
   methods: {
     /* 变量变动 */
@@ -340,8 +340,8 @@ export default {
     },
     onClickMenus(e) {
       if (
-        (this.type === "document" && e.key !== "ai") ||
-        (e.key === "article" && (this.type === "module" || this.type === undefined))
+        (this.typeMenu === "document" && e.key !== "ai") ||
+        (e.key === "article" && (this.typeMenu === "module" || this.typeMenu === undefined))
       ) {
         return; // Exit the method if the item is disabled
       }

+ 1 - 1
src/views/document/com/view.vue

@@ -16,7 +16,7 @@
     </div>
     <div class="export">
       <el-button
-        @click="onExports"
+        @click="onExport"
         type="primary"
         :loading="exporting"
         :disabled="exporting"

+ 13 - 6
src/views/document/create.vue

@@ -713,8 +713,8 @@ export default {
         if (val == null || val == undefined || val <= 0) return;
         if (this.$route.query.type == "document") {
           this.loadArticle(val);
-        }else{
-          this.onTemplateInfo(val)
+        } else {
+          this.onTemplateInfo(val);
         }
         //
       },
@@ -1215,13 +1215,20 @@ export default {
         const {
           data: { dataList },
         } = await searchFormula({ page: 1, pageSize: 999 });
-        /* console.log(data); */
+        console.log(data);
         data.attrs = data.attrs.map((item) => {
           const formula = dataList.find((el) => el.id === item.id);
           return formula
             ? { ...item, formula: formula.formula, data: formula }
             : item;
         });
+        // 从 content 中提取 {{}} 包裹的 ID
+        const contentIds = (data.content.match(/{{([^}]+)}}/g) || []).map(
+          (match) => match.slice(2, -2).trim()
+        );
+
+        // 过滤 attrs,只保留在 content 中出现的 ID
+        data.attrs = data.attrs.filter((item) => contentIds.includes(item.id));
 
         this.coms = [data];
       } catch (error) {
@@ -1362,7 +1369,6 @@ export default {
     },
     /* 加载模版信息 */
     async onTemplateInfo(id) {
-     
       try {
         this.loading = true;
         const res = await getDocumentInfo({ id });
@@ -1434,7 +1440,7 @@ export default {
         // 过滤掉 null 值
         this.coms = updatedComs.filter(Boolean);
         console.log("coms", this.coms);
-        console.log("模版",this.docAttr);
+        console.log("模版", this.docAttr);
         if (this.articleId !== undefined) {
           document.title = `${this.docAttr.title}-轻良实业`;
         }
@@ -1559,6 +1565,7 @@ export default {
         createDocument(_this.docAttr).then((res) => {
           if (res.status != 200) return; //保存文档
           _this.docAttr.id = res.data;
+          _this.articleId=res.data
           _this.$alert("文档保存成功");
           _this.docVisible = false;
           _this.docForm = {
@@ -1630,7 +1637,7 @@ export default {
       createDocument(_this.docAttr).then((res) => {
         if (res.status != 200) return; //保存文档
         _this.docAttr.id = res.data;
-        _this.articleId=res.data
+        _this.articleId = res.data;
         _this.$alert("模版保存成功");
         _this.searchArticle();
       });

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio