From a93ada3c02477d2f929347d6c8122e345baecfc8 Mon Sep 17 00:00:00 2001 From: sakurayinfei <970412446@qq.com> Date: Mon, 27 Oct 2025 09:11:21 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix(table):=20=E4=BF=AE=E5=A4=8D=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E5=8D=95=E5=85=83=E6=A0=BC=E4=B8=BA=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E6=97=B6last=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/opendesign/src/table/__demo__/TableSpan.vue | 3 ++- packages/opendesign/src/table/table.ts | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/opendesign/src/table/__demo__/TableSpan.vue b/packages/opendesign/src/table/__demo__/TableSpan.vue index 1c31f6fb9..71ca586d3 100644 --- a/packages/opendesign/src/table/__demo__/TableSpan.vue +++ b/packages/opendesign/src/table/__demo__/TableSpan.vue @@ -32,9 +32,10 @@ function cellSpanFn(rowIdx: number, colIdx: number) { }; } - if (rowIdx === 2 && colIdx === 5) { + if (rowIdx === 2 && colIdx === 4) { return { rowspan: 2, + colspan: 2, }; } } diff --git a/packages/opendesign/src/table/table.ts b/packages/opendesign/src/table/table.ts index a3155dcfc..ad6de4f0f 100644 --- a/packages/opendesign/src/table/table.ts +++ b/packages/opendesign/src/table/table.ts @@ -39,7 +39,7 @@ export function getBodyData(columnData: Ref, bodyData?: TableRow const t = bodyData.length; const s = 0; - const colLenght = columnData.value.length; + const colLength = columnData.value.length; const rlt = []; let span = null; @@ -49,7 +49,7 @@ export function getBodyData(columnData: Ref, bodyData?: TableRow for (let r = s; r < end; r += 1) { const row = bodyData[r]; const cols = []; - for (let c = 0; c < colLenght; c += 1) { + for (let c = 0; c < colLength; c += 1) { const col = columnData.value[c]; if (isFunction(cellSpan)) { span = cellSpan(r, c, row, col); @@ -59,8 +59,8 @@ export function getBodyData(columnData: Ref, bodyData?: TableRow key: col.key, }; + const { colspan = 1, rowspan = 1 } = span || {}; if (span) { - const { colspan = 1, rowspan = 1 } = span; Object.assign(skipCell, getSkipCell(r, c, span)); if (colspan > 1) { @@ -72,7 +72,7 @@ export function getBodyData(columnData: Ref, bodyData?: TableRow } if (!skipCell[`${r}-${c}`]) { - if (c === colLenght - 1) { + if (c + colspan >= colLength) { cell.last = true; } cols.push(cell); -- Gitee From 8181b4e789efbbd73ab1c219326fa25518422d3a Mon Sep 17 00:00:00 2001 From: sakurayinfei <970412446@qq.com> Date: Mon, 27 Oct 2025 11:03:14 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix(table):=20=E6=9B=B4=E6=96=B0=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../opendesign/src/table/style/media.scss | 72 +++++++------------ packages/opendesign/src/table/style/var.scss | 16 ++--- 2 files changed, 33 insertions(+), 55 deletions(-) diff --git a/packages/opendesign/src/table/style/media.scss b/packages/opendesign/src/table/style/media.scss index 871ef1022..d9f78db1e 100644 --- a/packages/opendesign/src/table/style/media.scss +++ b/packages/opendesign/src/table/style/media.scss @@ -4,85 +4,63 @@ @include respond-to('<=pad') { --table-radius: var(--o-radius_control-s); } - - @include respond-to('laptop') { + @include respond-to('<=pc_s') { --table-text-size: var(--o-font_size-tip1); --table-text-height: var(--o-line_height-tip1); --table-head-cell-height: 40px; - --table-cell-height: 48px; + --table-cell-height: 40px; --table-head-cell-padding: 8px 12px; - --table-cell-padding: 12px 12px; + --table-cell-padding: 8px 12px; --table-edge-padding: 24px; } - @include respond-to('pad') { - --table-text-size: var(--o-font_size-tip1); - --table-text-height: var(--o-line_height-tip1); - - --table-head-cell-height: 40px; - --table-cell-height: 48px; - - --table-head-cell-padding: 8px 8px; - --table-cell-padding: 8px 8px; - + @include respond-to('<=pad') { + --table-radius: var(--o-radius-s); --table-edge-padding: 16px; } - @include respond-to('phone') { + @include respond-to('<=pad_v') { --table-text-size: var(--o-font_size-tip2); --table-text-height: var(--o-line_height-tip2); - --table-head-cell-height: 32px; - --table-cell-height: 32px; + --table-head-cell-height: 34px; + --table-cell-height: 34px; --table-head-cell-padding: 8px 8px; - --table-cell-padding: 8px 8px; + --table-cell-padding: 7px 8px; --table-edge-padding: 12px; } } .o-table-small { - @include respond-to('<=pad') { - --table-radius: var(--o-radius_control-s); - } - - @include respond-to('laptop') { + @include respond-to('<=pc_s') { --table-text-size: var(--o-font_size-tip1); --table-text-height: var(--o-line_height-tip1); - --table-head-cell-height: 32px; - --table-cell-height: 40px; + --table-head-text-size: var(--table-text-size); + --table-head-text-height: var(--table-text-height); - --table-head-cell-padding: 5px 8px; - --table-cell-padding: 8px 8px; + --table-radius: var(--o-radius_control-m); - --table-edge-padding: 24px; - } - - @include respond-to('pad') { - --table-text-size: var(--o-font_size-tip1); - --table-text-height: var(--o-line_height-tip1); + --table-head-cell-height: 38px; + --table-cell-height: 38px; - --table-head-cell-height: 32px; - --table-cell-height: 40px; - - --table-head-cell-padding: 5px 8px; - --table-cell-padding: 5px 8px; - - --table-edge-padding: 16px; + --table-head-cell-padding: 8px 16px; + --table-cell-padding: 7px 16px; + --table-edge-padding: 24px; } - - @include respond-to('phone') { + @include respond-to('<=pad') { --table-text-size: var(--o-font_size-tip2); --table-text-height: var(--o-line_height-tip2); + --table-radius: var(--o-radius-s); - --table-head-cell-height: 32px; - --table-cell-height: 32px; - - --table-head-cell-padding: 7px 8px; + --table-head-cell-padding: 8px 8px; --table-cell-padding: 7px 8px; - --table-edge-padding: 12px; + --table-head-cell-height: 34px; + --table-cell-height: 34px; + --table-radius: var(--o-radius_control-s); + --table-edge-padding: 16px; } } diff --git a/packages/opendesign/src/table/style/var.scss b/packages/opendesign/src/table/style/var.scss index bf3725917..5485e869a 100644 --- a/packages/opendesign/src/table/style/var.scss +++ b/packages/opendesign/src/table/style/var.scss @@ -26,28 +26,28 @@ --table-radius: var(--o-radius_control-m); --table-head-cell-height: 48px; - --table-cell-height: 56px; + --table-cell-height: 48px; --table-head-cell-padding: 12px 16px; - --table-cell-padding: 16px 16px; + --table-cell-padding: 11px 16px; --table-edge-padding: 40px; } .o-table-small { - --table-text-size: var(--o-font_size-text1); - --table-text-height: var(--o-line_height-text1); + --table-text-size: var(--o-font_size-tip1); + --table-text-height: var(--o-line_height-tip1); --table-head-text-size: var(--table-text-size); --table-head-text-height: var(--table-text-height); --table-radius: var(--o-radius_control-m); - --table-head-cell-height: 40px; - --table-cell-height: 48px; + --table-head-cell-height: 38px; + --table-cell-height: 38px; - --table-head-cell-padding: 8px 12px; - --table-cell-padding: 12px 12px; + --table-head-cell-padding: 8px 16px; + --table-cell-padding: 7px 16px; --table-edge-padding: 40px; } -- Gitee From 00f8af644c799dd21498aada88af67ac376ac647 Mon Sep 17 00:00:00 2001 From: sakurayinfei <970412446@qq.com> Date: Mon, 27 Oct 2025 11:11:43 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat(table):=20=E6=96=B0=E5=A2=9E=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E7=9A=AE=E8=82=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/opendesign/src/table/style/theme-ascend.scss | 3 +++ packages/opendesign/src/table/style/theme-kunpeng.scss | 3 +++ packages/opendesign/src/table/style/theme-openeuler.scss | 3 +++ 3 files changed, 9 insertions(+) diff --git a/packages/opendesign/src/table/style/theme-ascend.scss b/packages/opendesign/src/table/style/theme-ascend.scss index e69de29bb..d3942e429 100644 --- a/packages/opendesign/src/table/style/theme-ascend.scss +++ b/packages/opendesign/src/table/style/theme-ascend.scss @@ -0,0 +1,3 @@ +.o-table { + --table-head-bg: var(--o-color-control3-light); +} \ No newline at end of file diff --git a/packages/opendesign/src/table/style/theme-kunpeng.scss b/packages/opendesign/src/table/style/theme-kunpeng.scss index e69de29bb..d3942e429 100644 --- a/packages/opendesign/src/table/style/theme-kunpeng.scss +++ b/packages/opendesign/src/table/style/theme-kunpeng.scss @@ -0,0 +1,3 @@ +.o-table { + --table-head-bg: var(--o-color-control3-light); +} \ No newline at end of file diff --git a/packages/opendesign/src/table/style/theme-openeuler.scss b/packages/opendesign/src/table/style/theme-openeuler.scss index e69de29bb..d3942e429 100644 --- a/packages/opendesign/src/table/style/theme-openeuler.scss +++ b/packages/opendesign/src/table/style/theme-openeuler.scss @@ -0,0 +1,3 @@ +.o-table { + --table-head-bg: var(--o-color-control3-light); +} \ No newline at end of file -- Gitee