yangg 6 ヶ月 前
コミット
0c08fffe55

+ 1 - 1
.env.development

@@ -3,7 +3,7 @@ ENV = 'development'
 port = 8080
 # base api
 VUE_APP_BASE_AI_API='https://ylaiapi.raycos.com.cn'
-VUE_APP_BASE_API = 'http://183.195.216.54:8084'
+VUE_APP_BASE_API = 'http://192.168.66.163:8084'
 #192.168.66.187
 #朱:192.168.66.163
 #测试服务器:121.36.251.245

ファイルの差分が大きいため隠しています
+ 0 - 0
dist/index.html


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/static/css/chunk-12233f47.c837f9cc.css


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/static/css/chunk-3b697c9a.9015865e.css


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/static/css/chunk-69f52cea.9015865e.css


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/static/css/chunk-cd9127fe.542740e6.css


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/static/js/app.02b33837.js


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/static/js/chunk-12233f47.fb09a43e.js


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/static/js/chunk-143f34d0.45cedec0.js


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/static/js/chunk-3b697c9a.eaa5cf7b.js


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/static/js/chunk-69f52cea.88f6d808.js


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/static/js/chunk-6ec5c8f6.0bdff326.js


ファイルの差分が大きいため隠しています
+ 1 - 1
dist/static/js/chunk-bc7b7e9c.b5945ed0.js


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/static/js/chunk-cd9127fe.4d3e4742.js


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/static/js/chunk-f77a8942.9c0f396e.js


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

@@ -131,6 +131,12 @@ export default {
       editorConfig: {
         language: "zh-cn",
         height: "650px",
+         // 添加以下配置
+       contentsCss: [
+         // 可以是外部CSS文件路径,或直接写入样式
+         'body { line-height: 12pt !important; }'
+       ],
+      
       },
 
       content: "",

+ 62 - 15
src/views/project/components/dataList.vue

@@ -420,8 +420,6 @@ export default {
     async exportDocument(template) {
       try {
         const templateData = JSON.parse(template.data || "[]");
-
-        // 创建一个临时的容器来存放内容
         const contentContainer = document.createElement("div");
         contentContainer.className = "content";
 
@@ -433,6 +431,43 @@ export default {
           // 创建临时div用于处理HTML内容
           const tempDiv = document.createElement("div");
           tempDiv.innerHTML = item.content;
+
+          // 合并嵌套的样式标签
+          const mergeStyleTags = (element) => {
+            const spans = element.getElementsByTagName('span');
+            for (let i = spans.length - 1; i >= 0; i--) {
+              const span = spans[i];
+              if (span.firstElementChild && span.firstElementChild.tagName === 'SPAN') {
+                const childSpan = span.firstElementChild;
+                // 合并样式
+                const parentStyle = span.getAttribute('style') || '';
+                const childStyle = childSpan.getAttribute('style') || '';
+                
+                // 解析样式
+                const styleMap = {};
+                [...parentStyle.split(';'), ...childStyle.split(';')]
+                  .filter(s => s.trim())
+                  .forEach(s => {
+                    const [key, value] = s.split(':').map(s => s.trim());
+                    styleMap[key] = value;
+                  });
+                
+                // 创建新的样式字符串
+                const mergedStyle = Object.entries(styleMap)
+                  .map(([key, value]) => `${key}: ${value}`)
+                  .join('; ');
+                
+                // 创建新的span元素
+                const newSpan = document.createElement('span');
+                newSpan.setAttribute('style', mergedStyle);
+                newSpan.innerHTML = childSpan.innerHTML;
+                
+                // 替换原始嵌套标签
+                span.parentNode.replaceChild(newSpan, span);
+              }
+            }
+          };
+
           // 处理所有表格
           tempDiv.querySelectorAll("table").forEach((table) => {
             // 检查表格及其单元格是否有任何边框
@@ -466,9 +501,13 @@ export default {
             }
           });
 
+          // 对整个内容进行样式合并
+          mergeStyleTags(tempDiv);
+
           templateSection.innerHTML = tempDiv.innerHTML;
           contentContainer.appendChild(templateSection);
         });
+
         let contentData = `
     <!DOCTYPE html>
     <html>
@@ -478,7 +517,12 @@ export default {
           body {
             font-family: SimSun, serif;
             font-size: 12pt;
-            line-height: 1.5;
+            line-height: 12pt !important; /* 设置固定行距为12磅 */
+          }
+          
+          /* 确保所有段落和文本容器都使用相同的行距 */
+          p, div, span, td, th {
+            line-height: 12pt !important;
           }
           
           /* 有边框的表格样式 */
@@ -490,6 +534,7 @@ export default {
           table[data-code="active"] th {
             border: 1px solid black;
             padding: 8px;
+            line-height: 12pt !important;
           }
           
           /* 无边框的表格样式 */
@@ -502,10 +547,12 @@ export default {
           table[data-code="noactive"] th {
             border: none;
             padding: 8px;
+            line-height: 12pt !important;
           }
           
           .template-textarea {
             page-break-after: always;
+            line-height: 12pt !important;
           }
         </style>
       </head>
@@ -773,7 +820,7 @@ export default {
     formatRequestParams(locations) {
       const locationArray = Array.isArray(locations) ? locations : [locations];
 
-      // 初始化求参数对象
+      // 初始化求参数对象
       const params = {
         /* project_id:'', */
         template_location: [],
@@ -881,7 +928,7 @@ export default {
         return;
       }
       if (_this.docAttr.title == "") {
-        _this.$message.error("请填写模版题");
+        _this.$message.error("请填写模版题");
         return;
       }
       _this.docAttr.links = JSON.stringify(_this.docAttr.linkProduct);
@@ -960,7 +1007,7 @@ export default {
     async replaceAll() {
       this.batchReplaceLoading = true;
       try {
-        // 收所有
+        // 收所有配
         const allLocations = this.matchResults.map((item) => {
           return item.replace(/[\[\]【】]/g, "");
         });
@@ -1117,7 +1164,7 @@ export default {
           // 先获取纯文本内容用于匹配
           const plainText = processNode(tempDiv);
 
-          // 构建用于匹配分割标记��正则表达式
+          // 构建用于匹配分割标记正则表达式
           const splitRegex = new RegExp(
             `(\\[|【)(.*?)(${searchCode})(.*?)(\\]|】)`,
             "g"
@@ -1239,7 +1286,7 @@ export default {
         }
       );
 
-      // 保持原���的图片和文本处理逻辑不变
+      // 保持原的图片和文本处理逻辑不变
       html = html.replace(
         /\[图片:(.*?)\|style=(.*?)\|class=(.*?)\]/g,
         (match, src, style, className) => {
@@ -1279,7 +1326,7 @@ export default {
       this.templateQueryForm.page = page;
       this.loadTemplateList();
     },
-    // 加载模版���
+    // 加载模版表
     loadTemplateList() {
       this.templateLoading = true;
       searchList(this.templateQueryForm)
@@ -1328,7 +1375,7 @@ export default {
       // 如果之前是全选状态,现在取消了某些选择
       if (this.isAllSelected && selection.length < this.templateList.length) {
         this.isAllSelected = false;
-        // 保留其页面的选择和已绑定的模版
+        // 保留其���页面的选择和已绑定的模版
         const allSelectedIds = new Set(this.currentData.documentIds || []);
         this.selectedPageIds.forEach((pageIds, page) => {
           if (page !== currentPage) {
@@ -1369,7 +1416,7 @@ export default {
           .catch(() => {
             // 仅选择当前页
             this.selectCurrentPage(selection);
-            // 更���当前页的选择记录
+            // 更当前页的选择记录
             this.selectedPageIds.set(
               currentPage,
               new Set(selection.map((item) => item.id))
@@ -1411,9 +1458,9 @@ export default {
     // 仅选择当前页
     selectCurrentPage(selection) {
       this.isAllSelected = false;
-      // 清除前的选择
+      // 清除前的选择
       this.selectedTemplateIds.clear();
-      // ��加当前页选中项
+      // 加当前页选中项
       selection.forEach((item) => {
         this.selectedTemplateIds.add(item.id);
       });
@@ -1600,10 +1647,10 @@ export default {
         })
         .catch((error) => {
           console.error("获取模版位置信息失败:", error);
-          this.$message.error("获取模版位置信失败");
+          this.$message.error("获取模版位置信��失败");
         });
     },
-    /* 产品类名称 */
+    /* 产品类名称 */
     getCategoryTypeName(categoryId) {
       if (!categoryId) return "未分类";
       const product = this.productList.find((item) => item.id === categoryId);

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません