|
@@ -45,7 +45,17 @@ const HtObj=ref({
|
|
|
2:'right'
|
|
|
})
|
|
|
|
|
|
-const handleFF = (ff) => {
|
|
|
+const handleCellStyle = (cell) : string => {
|
|
|
+ return `
|
|
|
+ color: ${cell.fc};
|
|
|
+ font-weight: ${cell.bl ? 'bold' : 'normal'};
|
|
|
+ font-style: ${cell.it ? 'italic' : 'normal'};
|
|
|
+ text-align: ${HtObj.value[cell.HorizontalType]};
|
|
|
+ font-family: ${handleFF(cell.ff)};
|
|
|
+ `
|
|
|
+};
|
|
|
+
|
|
|
+const handleFF = (ff:string|number) : string => {
|
|
|
return ff ? (typeof ff == 'number' ? SheetFFType[ff] : ff) : ''
|
|
|
}
|
|
|
|
|
@@ -78,30 +88,20 @@ initTableCellsWid('init',props.sceneConfig)
|
|
|
: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'};
|
|
|
+ width:${index==0?getSize(cell_index,'width'):'auto'};
|
|
|
background: ${cell.bg};
|
|
|
- text-align: ${HtObj[cell.HorizontalType]};
|
|
|
- font-size: ${cell.fs||props.config.FontSize||12}px;
|
|
|
- width:${getSize(cell_index,'width')};
|
|
|
- ${cell.ct.s ? '' : `font-family: ${handleFF(cell.ff)};`}
|
|
|
+ font-size: ${props.config.FontSize||cell.fs||12}px;
|
|
|
+ ${!cell.ct.s ? handleCellStyle(cell) : ''}
|
|
|
`"
|
|
|
@mousemove="e =>isCanDrag && handleMouseMove(e,index,cell_index)"
|
|
|
@mousedown="e =>isCanDrag && handleMouseDown(e,index,cell_index)"
|
|
|
>
|
|
|
<!-- 单元格拆分 -->
|
|
|
- <div class="split-word" v-if="cell.ct.s">
|
|
|
+ <div class="split-word" v-if="cell.ct.s" :style="`text-align: ${HtObj[cell.HorizontalType]};`">
|
|
|
<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'};
|
|
|
- text-decoration:${word.un?'underline':word.cl?'line-through':'normal'};
|
|
|
- font-family: ${handleFF(word.ff)};
|
|
|
- `"
|
|
|
+ :style="handleCellStyle(word)"
|
|
|
>{{word.v}}</span>
|
|
|
</div>
|
|
|
<div v-else
|