Browse Source

处理双重线条

yangg 9 months ago
parent
commit
32854d3882

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


+ 0 - 0
dist/static/css/chunk-db25e5ec.68741a84.css → dist/static/css/chunk-269b71dc.68741a84.css


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


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-269b71dc.ca28a4c5.js


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


+ 23 - 21
src/views/document/com/view.vue

@@ -537,31 +537,33 @@ export default {
           }
         });
         contentClone.querySelectorAll("table").forEach((table, tableIndex) => {
-          table.style.borderCollapse = "separate";
-          table.style.width = "100%";
-          table.style.border = "none";
-
-          table.querySelectorAll("tr").forEach((row, rowIndex) => {
-            row.querySelectorAll("td, th").forEach((cell, cellIndex) => {
-              cell.style.padding = "5px";
+      table.style.cssText = `
+        border-collapse: separate !important;
+        width: 100% !important;
+        border: none !important;
+      `;
+
+      table.querySelectorAll("tr").forEach((row, rowIndex) => {
+        row.querySelectorAll("td, th").forEach((cell, cellIndex) => {
+          let cellStyle = `
+            padding: 5px !important;
+            border: 0.1px solid #000000 !important;
+          `;
 
-              // 为所有单元格设置右边框和下边框
-              cell.style.borderRight = "0.1px solid #000000";
-              cell.style.borderBottom = "0.1px solid #000000";
+          // 移除顶部边框(除了第一行)
+          if (rowIndex !== 0) {
+            cellStyle += 'border-top: none !important;';
+          }
 
-              // 为所有行的第一个单元格设置左边框
-              if (cellIndex === 0) {
-                cell.style.borderLeft = "0px solid #000000";
-              }
+          // 移除左侧边框(除了第一列)
+          if (cellIndex !== 0) {
+            cellStyle += 'border-left: none !important;';
+          }
 
-              // 为第一行的所有单元格设置上边框
-              if (rowIndex === 0) {
-                cell.style.borderTop = "0px solid #000000";
-              }
-            });
-          });
+          cell.style.cssText += cellStyle;
         });
-
+      });
+    });
         // 等待所有图片加载完成并转换为 Base64
         const images = contentClone.querySelectorAll("img");
         for (let img of images) {

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