Browse Source

表格兼容样式删除线、下划线

cldu 4 days ago
parent
commit
2efc80b76b
2 changed files with 8 additions and 4 deletions
  1. 4 2
      src/CustomElement/EtaTable.ce.vue
  2. 4 2
      src/views/ppt/components/SheetWrap.vue

+ 4 - 2
src/CustomElement/EtaTable.ce.vue

@@ -71,13 +71,15 @@ async function getTableData(){
 getTableData()
 
 function handleCellStyle(cell){
-    return `
+    let res = `
         color: ${cell.fc};
         font-weight: ${cell.bl ? 'bold' : 'normal'};
         font-style: ${cell.it ? 'italic' : 'normal'};
         text-align: ${HtObj[cell.HorizontalType]};
         font-family: ${handleFF(cell.ff)};
-    `
+    `;
+    if(cell.cl || cell.un) res += `text-decoration:${cell.cl ? 'line-through' : ''}  ${cell.un ? 'underline' : ''};`;
+    return res;
 }
 
 function handleFF(ff){

+ 4 - 2
src/views/ppt/components/SheetWrap.vue

@@ -57,13 +57,15 @@ function setDefaultSource(sourceText){
 }
 
 function handleCellStyle(cell){
-    return `
+    let res =  `
         color: ${cell.fc};
         font-weight: ${cell.bl ? 'bold' : 'normal'};
         font-style: ${cell.it ? 'italic' : 'normal'};
         text-align: ${HtObj[cell.HorizontalType]};
         font-family: ${handleFF(cell.ff)};
-    `
+    `;
+    if(cell.cl || cell.un) res += `text-decoration:${cell.cl ? 'line-through' : ''}  ${cell.un ? 'underline' : ''};`;
+    return res;
 }
 
 function handleFF(ff){