From 28e2148b721f5a1da7ebc56c477921655e3fb513 Mon Sep 17 00:00:00 2001 From: lijisanxiong <1518062161@qq.com> Date: Fri, 11 Jul 2025 16:05:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat=EF=BC=9A=E5=88=97=E8=A1=A8=E9=83=A8?= =?UTF-8?q?=E4=BB=B6=E6=94=AF=E6=8C=81=E5=88=86=E7=BB=84=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?2=E7=BB=98=E5=88=B6=EF=BC=8C=E8=AF=A5=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=B8=8B=E6=97=B6=E9=97=B4=E5=80=BC=E7=9A=84=E5=88=86=E7=BB=84?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E9=BB=98=E8=AE=A4=E4=BB=A5=E5=A4=A9=E4=B8=BA?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E8=BF=9B=E8=A1=8C=E6=A0=BC=E5=BC=8F=E5=8C=96?= =?UTF-8?q?=E5=B9=B6=E6=9B=BF=E6=8D=A2=E5=8E=9F=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/control/list/list.scss | 31 +++++++++++++++++++++++++++++++ src/control/list/list.tsx | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 933f48f3..64702404 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - 重复器表单拖拽支持表单自动保存配置 - 支持codeEditorTheme代码编辑器主题配置参数 +- 列表部件支持分组样式2绘制,该样式下时间值的分组标题默认以天为单位进行格式化并替换原值 ## [0.7.41-alpha.10] - 2025-07-08 diff --git a/src/control/list/list.scss b/src/control/list/list.scss index 0f6269f2..3c2940a3 100644 --- a/src/control/list/list.scss +++ b/src/control/list/list.scss @@ -8,6 +8,10 @@ $control-list: ( item-bg-color: unset, ); +$control-list-group-style2: ( + color: getCssVar(color, disabled, text), +); + @include b(control-list-item) { flex-grow: 1; min-height: getCssVar(control-list, item-height); @@ -130,4 +134,31 @@ $control-list: ( @include when(active) { background-color: getCssVar(control-list, active-bg-color); } +} + +@include b('control-list-group-style2') { + @include set-component-css-var(control-list-group-style2, $control-list-group-style2); + + @include e('header') { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + @include m('title') { + padding: 0 getCssVar('spacing', 'tight'); + font-size: getCssVar('font-size', 'regular'); + color: getCssVar(control-list-group-style2, color); + } + + &::before, + &::after { + display: block; + flex: 1; + height: 1px; + margin-top: 1px; + content: ''; + border-top: 1px getCssVar(color, border) solid; + transform: translateY(-50%); + } + } } \ No newline at end of file diff --git a/src/control/list/list.tsx b/src/control/list/list.tsx index a9f39927..0407baa7 100644 --- a/src/control/list/list.tsx +++ b/src/control/list/list.tsx @@ -367,9 +367,44 @@ export const ListControl = defineComponent({ ); }; + /** + * 绘制分组样式2项 + * @return {*} {VNode[]} + */ + const renderGroupStyle2 = (): VNode[] => { + return c.state.groups?.map(group => { + return ( +