Browse Source

表格样式

cxmo 1 year ago
parent
commit
0328d955f7
1 changed files with 25 additions and 3 deletions
  1. 25 3
      src/views/ppt_manage/newVersion/components/formatEl/SheetEl.vue

+ 25 - 3
src/views/ppt_manage/newVersion/components/formatEl/SheetEl.vue

@@ -12,8 +12,30 @@
           <td v-for="(col,colIndex) in row" 
               :key="colIndex"
               :rowspan="col.mc.rs===0?1:col.mc.rs"
-              :colspan="col.mc.cs===0?1:col.mc.cs">
-            <div>{{col.m}}</div>
+              :colspan="col.mc.cs===0?1:col.mc.cs"
+              :style="`background: ${col.bg};`"
+              >
+            <div :style="{
+                'color': col.fc,
+                'font-weight': col.bl ? 'bold' : 'normal',
+                'font-style': col.it ? 'italic' : 'normal',
+            }">
+                <div class="split-word" v-if="col.ct.s">
+                    <span v-for="(word,wordIndex) in col.ct.s" :key="`${rowIndex}_${colIndex}_${wordIndex}`"
+                        :style="{
+                            'color': word.fc,
+                            'font-weight': word.bl ? 'bold' : 'normal',
+                            'font-style': word.it ? 'italic' : 'normal',
+                            'text-decoration':word.un?'underline':word.cl?'line-through':'normal'
+                        }"
+                    >
+                        {{word.v}}
+                    </span>
+                </div>
+                <div v-else
+                    :style="`text-decoration:${col.un?'underline':col.cl?'line-through':'normal'};`"
+                >{{col.m}}</div>
+            </div>
           </td>
         </tr>
       </tbody>
@@ -72,7 +94,7 @@ export default {
     width:100%;
     td{
 				/* min-width: 55px; */
-				word-break: keep-all;
+				white-space: nowrap;
 				border: 1px solid #747474;
 				height: 40px;
 				text-align: center;