|
|
@ -913,6 +913,7 @@ const state = reactive({ |
|
|
|
middleHeight: 0, // 表格当前middle区域高度(表格列头及数据行区域) |
|
|
|
columnHeadHeight: 0, // 表格当前列头高度 |
|
|
|
tableTitleWidth: 0, // 当前表格title宽度 |
|
|
|
titleTotalHeight: 0, // 当前表格title排除无数据行的总高度 |
|
|
|
}, |
|
|
|
pagination: { |
|
|
|
config: { |
|
|
@ -1192,7 +1193,10 @@ const noDataTrHeightComputed = computed(() => { |
|
|
|
(state.refHeightWidth.middleScrollWidth - state.refHeightWidth.middleWidth > 0 ? 15 : 0) - |
|
|
|
otherHeight; |
|
|
|
return { |
|
|
|
height: props.height > 0 ? props.height + 'px' : resultHeight + 'px', |
|
|
|
height: |
|
|
|
props.height > 0 |
|
|
|
? props.height - state.refHeightWidth.titleTotalHeight - (state.refHeightWidth.middleScrollWidth - state.refHeightWidth.middleWidth > 0 ? 15 : 0) + 'px' |
|
|
|
: resultHeight + 'px', |
|
|
|
}; |
|
|
|
}); |
|
|
|
const noDataTrColspanComputed = computed(() => { |
|
|
@ -1267,6 +1271,13 @@ const onResize = () => { |
|
|
|
state.refHeightWidth.middleHeight = state.refHeightWidth.columnHeadHeight + scrollHeight; |
|
|
|
} |
|
|
|
state.refHeightWidth.tableTitleWidth = tableRef.value.$el.getElementsByClassName('_table-title')[0]?.clientWidth; |
|
|
|
let titleTotalHeight = tableRef.value.$el.getElementsByTagName('thead')[0].offsetHeight; |
|
|
|
// 无数据时列头会增加一行,多表头的top距离计算会出错,需减掉多出来的提示行。 |
|
|
|
if (table.rows.length === 0) { |
|
|
|
const noDataTrHeight = tableRef.value.$el.getElementsByClassName('noDataTr')[0].offsetHeight; |
|
|
|
titleTotalHeight = titleTotalHeight - noDataTrHeight; |
|
|
|
} |
|
|
|
state.refHeightWidth.titleTotalHeight = titleTotalHeight; |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
@ -1708,6 +1719,7 @@ const stickyHeaderColumn = (time = 500) => { |
|
|
|
const noDataTrHeight = tableRef.value.$el.getElementsByClassName('noDataTr')[0].offsetHeight; |
|
|
|
titleTotalHeight = titleTotalHeight - noDataTrHeight; |
|
|
|
} |
|
|
|
state.refHeightWidth.titleTotalHeight = titleTotalHeight; |
|
|
|
const titleRowHeight = titleTotalHeight / columnTitleState.columnTitleRowNum; |
|
|
|
if (columnTitleState.columnTitleRowNum) { |
|
|
|
const row1Height = titleRowHeight * 1; |
|
|
|