|
|
|
@ -1,9 +1,9 @@ |
|
|
|
import { luckysheetfontformat } from '../utils/util'; |
|
|
|
import {luckysheetfontformat} from '../utils/util'; |
|
|
|
import menuButton from '../controllers/menuButton'; |
|
|
|
import { getcellvalue,checkstatusByCell } from './getdata'; |
|
|
|
import { colLocationByIndex } from './location'; |
|
|
|
import { hasChinaword, isRealNull,checkWordByteLength } from './validate'; |
|
|
|
import { isInlineStringCell } from '../controllers/inlineString'; |
|
|
|
import {checkstatusByCell} from './getdata'; |
|
|
|
import {colLocationByIndex,colSpanLocationByIndex} from './location'; |
|
|
|
import {checkWordByteLength, hasChinaword, isRealNull} from './validate'; |
|
|
|
import {isInlineStringCell} from '../controllers/inlineString'; |
|
|
|
import Store from '../store'; |
|
|
|
|
|
|
|
/** |
|
|
|
@ -90,12 +90,19 @@ function computeRowlenByContent(d, r) { |
|
|
|
for(let c = 0; c < d[r].length; c++){ |
|
|
|
let cell = d[r][c]; |
|
|
|
|
|
|
|
if(cell == null || cell.mc != null){ |
|
|
|
if (cell == null) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
if (cell.mc != null) { |
|
|
|
if (1 !== cell.mc.rs) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(cell != null && (cell.v != null || isInlineStringCell(cell)) ){ |
|
|
|
let cellWidth = colLocationByIndex(c)[1] - colLocationByIndex(c)[0] - 2; |
|
|
|
let cellWidth = computeCellWidth(cell, c); |
|
|
|
|
|
|
|
let textInfo = getCellTextInfo(cell, canvas,{ |
|
|
|
r:r, |
|
|
|
@ -105,12 +112,12 @@ function computeRowlenByContent(d, r) { |
|
|
|
|
|
|
|
let computeRowlen = 0; |
|
|
|
|
|
|
|
if(textInfo!=null){ |
|
|
|
computeRowlen = textInfo.textHeightAll+2; |
|
|
|
if (textInfo != null) { |
|
|
|
computeRowlen = textInfo.textHeightAll + 2; |
|
|
|
} |
|
|
|
|
|
|
|
//比较计算高度和当前高度取最大高度
|
|
|
|
if(computeRowlen > currentRowLen){ |
|
|
|
if (computeRowlen > currentRowLen) { |
|
|
|
currentRowLen = computeRowlen; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -119,6 +126,15 @@ function computeRowlenByContent(d, r) { |
|
|
|
return currentRowLen; |
|
|
|
} |
|
|
|
|
|
|
|
function computeCellWidth(cell, col_index) { |
|
|
|
let colLocationArr = colLocationByIndex(col_index); |
|
|
|
if (cell.mc && cell.mc.c !== cell.mc.cs) { |
|
|
|
colLocationArr = colSpanLocationByIndex(col_index, cell.mc.cs); |
|
|
|
} |
|
|
|
|
|
|
|
return colLocationArr[1] - colLocationArr[0] - 2; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//计算表格行高数组
|
|
|
|
function computeRowlenArr(rowHeight, cfg) { |
|
|
|
|