Преглед изворни кода

Merge branch 'need_pool_57/12.13'

Karsa пре 2 година
родитељ
комит
d68760106c
1 измењених фајлова са 27 додато и 6 уклоњено
  1. 27 6
      src/components/sheet.vue

+ 27 - 6
src/components/sheet.vue

@@ -28,8 +28,26 @@ const props = defineProps({
           :key="cell_index"
           :colspan="cell.mc.cs||1"
           :rowspan="cell.mc.rs||1"
+          :style="`
+            color: ${cell.fc};
+            font-weight: ${cell.bl ? 'bold' : 'normal'};
+            font-style: ${cell.it ? 'italic' : 'normal'};
+            background: ${cell.bg};
+          `"
         >
-          {{cell.m}}
+          <!-- 单元格拆分 -->
+          <div class="split-word" v-if="cell.ct.s">
+            <span 
+              v-for="(word,word_index) in cell.ct.s" 
+              :key="`${index}_${cell_index}_${word_index}`"
+              :style="`
+                color: ${word.fc};
+                font-weight: ${word.bl ? 'bold' : 'normal'};
+                font-style: ${word.it ? 'italic' : 'normal'};
+              `"
+            >{{word.v}}</span>
+          </div>
+          <div v-else>{{cell.m}}</div>
         </td>
       </tr>
     </tbody>
@@ -83,11 +101,6 @@ table {
 		}
   }
 
-  .head-column {
-    background-color: #505B78;
-    color: #fff !important;
-  }
-
   .data-cell{
     color: #666;
     &.one-bg {
@@ -102,5 +115,13 @@ table {
     position: sticky;
     top: 0;
   }
+
+  .head-column {
+    background-color: #505B78;
+    color: #fff;
+  }
+  .split-word {
+    span { display: inline; }
+  }
 }
 </style>