Skip to content

Commit c264e65

Browse files
authored
fix(grid): fix rowspan border can not visible (#3673)
1 parent 2103fb4 commit c264e65

File tree

4 files changed

+40
-24
lines changed

4 files changed

+40
-24
lines changed

packages/theme-saas/src/grid/footer.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
.@{grid-prefix-cls} .@{grid-prefix-cls}__footer-border-line {
2525
@apply w-full;
2626
@apply h-px;
27-
@apply bg-color-bg-4;
27+
@apply bg-color-border-separator;
2828
@apply absolute;
2929
@apply z-10;
3030
}

packages/theme-saas/src/grid/table-global.less

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -242,19 +242,9 @@
242242
);
243243
@apply bg-no-repeat;
244244
background-size: 1px 100%, 100% 1px;
245-
background-position: 100% 0, 100% 99%;
246-
}
247-
248-
&.is__row-span .@{grid-prefix-cls}-body__column {
249245
background-position: 100% 0, 100% 100%;
250246
}
251247

252-
.@{grid-prefix-cls}-body__row:last-child {
253-
.@{grid-prefix-cls}-body__column {
254-
background-position: 100% 0, 100% 100%;
255-
}
256-
}
257-
258248
.@{grid-prefix-cls}__fixed-left-wrapper {
259249
.@{grid-prefix-cls}-body__column {
260250
@apply border-r-color-border;

packages/theme-saas/src/grid/table.less

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,27 @@
268268
}
269269
}
270270

271+
// tiny新增滚动条放置表格内
272+
tbody tr.row__last-visible {
273+
@apply relative;
274+
275+
&::after {
276+
@apply content-[''];
277+
@apply absolute;
278+
@apply bottom-0;
279+
@apply left-0;
280+
@apply right-0;
281+
@apply bottom-0;
282+
@apply h-px;
283+
@apply bg-color-border-separator;
284+
@apply ~'z-[3]';
285+
}
286+
}
287+
288+
&:has(.@{grid-prefix-cls}__footer-wrapper) tbody tr.row__last-visible {
289+
display: none;
290+
}
291+
271292
&&__border,
272293
&&__border-saas {
273294
// 启用 border 只有表头生效,默认不建议启用 border 属性,另外如果内嵌列,则表头会自动启用 border 属性
@@ -323,16 +344,6 @@
323344
background-position: 100% 0, 100% 100%;
324345
}
325346

326-
&.is__row-span .@{grid-prefix-cls}-body__column {
327-
background-position: 100% 0, 100% 100%;
328-
}
329-
330-
.@{grid-prefix-cls}-body__row:last-child {
331-
.@{grid-prefix-cls}-body__column {
332-
background-position: 100% 0, 100% 100%;
333-
}
334-
}
335-
336347
.@{grid-prefix-cls}__fixed-left-wrapper {
337348
.@{grid-prefix-cls}-body__column {
338349
@apply border-r-color-border;

packages/vue/src/grid/src/body/src/body.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,8 @@ function renderRows(_vm) {
345345
const seqCount = { value: 0 }
346346
const $seq = ''
347347

348+
const lastVisibleIndex = rowPool.findLastIndex(({ used }) => Boolean(used))
349+
348350
rowPool.forEach(({ id, item: { payload: row, level: rowLevel }, used }, $rowIndex) => {
349351
const rowActived = editConfig && actived.row === row
350352
const virtualRow = isVirtualRow(row)
@@ -369,7 +371,19 @@ function renderRows(_vm) {
369371

370372
renderRowGroupData({ $table, _vm, id, row, rowGroup, rowid, rows, used, virtualRow })
371373

372-
let args = { $rowIndex, $seq, $table, _vm, editStore, id, isSkipRowRender, row, rowActived, rowClassName }
374+
let args = {
375+
$rowIndex,
376+
$seq,
377+
$table,
378+
_vm,
379+
editStore,
380+
id,
381+
isSkipRowRender,
382+
row,
383+
rowActived,
384+
rowClassName,
385+
lastVisibleIndex
386+
}
373387

374388
Object.assign(args, { rowIndex, rowLevel, rowid, rows, selection, seq, treeConfig, used, selectRow })
375389

@@ -426,7 +440,7 @@ function renderRowAfter({ $table, _vm, row, rowIndex, rows, id, used }) {
426440

427441
function renderRow(args) {
428442
const { $rowIndex, $seq, $table, _vm, editStore, id, isSkipRowRender, row, rowActived, rowClassName } = args
429-
const { rowIndex, rowLevel, rowid, rows, selection, selectRow, seq, treeConfig, used } = args
443+
const { rowIndex, rowLevel, rowid, rows, selection, selectRow, seq, treeConfig, used, lastVisibleIndex } = args
430444

431445
if (isSkipRowRender) {
432446
return
@@ -459,7 +473,8 @@ function renderRow(args) {
459473
'row__new': editStore.insertList.includes(row),
460474
'row__selected': selection.includes(row),
461475
'row__radio': selectRow === row,
462-
'row__actived': rowActived
476+
'row__actived': rowActived,
477+
'row__last-visible': lastVisibleIndex === $rowIndex
463478
},
464479
rowClassName
465480
? isFunction(rowClassName)

0 commit comments

Comments
 (0)