| | |
| | | THICK_BORDER_WIDTH * (maxColsNum.value - 1) + |
| | | THICK_BORDER_WIDTH * 2; |
| | | let restWidth = width - currentWidth; |
| | | if (restWidth > 0) { |
| | | // 尽可能分给第一列 |
| | | if (rowHeaderCellContentWidth.value + restWidth > ROW_HEADER_CELL_MAX_WIDTH) { |
| | | restWidth = rowHeaderCellContentWidth.value + restWidth - ROW_HEADER_CELL_MAX_WIDTH; |
| | | firstColWidth.value = ROW_HEADER_CELL_MAX_WIDTH; |
| | | } else { |
| | | firstColWidth.value = rowHeaderCellContentWidth.value + restWidth; |
| | | restWidth = 0; |
| | | } |
| | | |
| | | // 尽可能分给第一列 |
| | | if (rowHeaderCellContentWidth.value + restWidth > ROW_HEADER_CELL_MAX_WIDTH) { |
| | | restWidth = rowHeaderCellContentWidth.value - ROW_HEADER_CELL_MAX_WIDTH; |
| | | firstColWidth.value = ROW_HEADER_CELL_MAX_WIDTH; |
| | | } else { |
| | | firstColWidth.value = rowHeaderCellContentWidth.value + restWidth; |
| | | restWidth = 0; |
| | | } |
| | | |
| | | // 其余分给其他列 |
| | | if (restWidth !== 0) { |
| | | const currentWidth = colHeaderCellContentWidth.value + restWidth; |
| | | restColWidth.value = currentWidth > CELL_MAX_WIDTH ? CELL_MAX_WIDTH : currentWidth; |
| | | // 其余分给其他列 |
| | | if (restWidth !== 0) { |
| | | const averageWidth = restWidth / (maxColsNum.value - 1); |
| | | const currentWidth = colHeaderCellContentWidth.value + averageWidth; |
| | | restColWidth.value = currentWidth > CELL_MAX_WIDTH ? CELL_MAX_WIDTH : currentWidth; |
| | | } |
| | | } |
| | | |
| | | const groupCount = (props.data?.rows?.length ?? 0) + 1; |