From 0d350682a70ac80d1d73ed7dcbeb1fd6c129dfc8 Mon Sep 17 00:00:00 2001 From: "jlj05024111@163.com" Date: Wed, 29 Oct 2025 13:55:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=97=A5=E5=8E=86=E6=97=B6=E5=85=89=E8=BD=B4=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/control/calendar/calendar.scss | 53 +++++++ src/control/calendar/calendar.tsx | 218 ++++++++++++++++++++--------- 3 files changed, 206 insertions(+), 66 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03fd90f8cae..8e0abde7d26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### Added +- 新增支持日历时光轴模式 - 新增多数据部件和卡片支持表单搜索 - 新增支持多数据部件和卡片新建数据功能 - 新增移动端分割容器组件 diff --git a/src/control/calendar/calendar.scss b/src/control/calendar/calendar.scss index d68c942b4bd..361b3e9929a 100644 --- a/src/control/calendar/calendar.scss +++ b/src/control/calendar/calendar.scss @@ -18,6 +18,15 @@ $control-calendar: ( calendar-disabled-color: getCssVar(color, disabled, text), calendar-active-color: getCssVar(color, primary), calendar-active-bg: getCssVar(color, primary, light, default), + timeline-item-padding: getCssVar(spacing, base), + timeline-item-size: getCssVar(width-icon, small), + timeline-item-bg-color: getCssVar(color, border), + tab-bg: transparent, + timeline-item-margin: 0 0 getCssVar(spacing, base) 0, + timeline-padding: getCssVar(spacing, base), + timeline-timespan-padding: getCssVar(spacing, extra-tight) getCssVar(spacing, tight), + timeline-item-border-radius: getCssVar(spacing, tight), + timeline-item-content-margin: getCssVar(spacing, base), ); @include b(control-calendar) { @@ -120,6 +129,28 @@ $control-calendar: ( .van-list { height: 100%; } + + @include e('tab-item') { + .van-tab__text { + position: relative; + overflow: visible; + &::before { + content:''; + width: 100%; + height: rem(3px); + bottom: rem(-8px); + border-radius: rem(3px); + transform: translateY(-50%); + background-color: getCssVar(control-calendar, tab-bg); + position: absolute; + } + } + &.van-tab--active { + .van-tab__text::before { + content: unset; + } + } + } } @include b(control-calendar-header-toolbar) { @@ -140,3 +171,25 @@ $control-calendar: ( background-color: getCssVar(control-calendar, toolbar-bg); } } + +// 时间轴样式 +@include b(control-calendar-timeline) { + @include set-component-css-var(control-calendar, $control-calendar); + padding: getCssVar(control-calendar, timeline-padding); + @include e(item) { + margin: getCssVar(control-calendar, timeline-item-margin); + @include m('timespan') { + width: auto; + display: inline-block; + padding: getCssVar(control-calendar, timeline-timespan-padding); + border-radius: getCssVar(control-calendar, timeline-item-border-radius); + background-color: getCssVar(control-calendar, timeline-item-bg-color); + } + @include m('content'){ + margin-top: getCssVar(control-calendar, timeline-item-content-margin); + } + .#{bem(control-calendar-item)}{ + padding: 0; + } + } +} diff --git a/src/control/calendar/calendar.tsx b/src/control/calendar/calendar.tsx index 3a489a5cbd9..e62ef7df4c4 100644 --- a/src/control/calendar/calendar.tsx +++ b/src/control/calendar/calendar.tsx @@ -174,11 +174,6 @@ export const CalendarControl = defineComponent({ return date; }); - c.evt.on('onMounted', () => { - loadMarkerData(c.state.selectedDate || new Date()); - loadData(c.state.selectedDate || new Date()); - }); - const dateChange = (newDate: Date) => { c.state.selectedDate = newDate; loadData(c.state.selectedDate); @@ -190,6 +185,12 @@ export const CalendarControl = defineComponent({ loadMarkerData(c.state.selectedDate); }; + c._evt.on('onUpdateSelectDate', () => { + if (calendar.value) { + calendar.value.reset(c.state.selectedDate); + } + }); + // 自定义选择日期 const onCustom = () => { const temptime = dayjs(c.state.selectedDate) @@ -288,7 +289,10 @@ export const CalendarControl = defineComponent({ }; // 绘制默认列表项 - const renderDefaultItem = (item: ICalendarItemData): VNode => { + const renderDefaultItem = ( + item: ICalendarItemData, + isLink: boolean = true, + ): VNode => { // 是否选中数据 const findIndex = this.c.state.selectedData.findIndex(data => { return data.deData.srfkey === item.deData.srfkey; @@ -302,7 +306,7 @@ export const CalendarControl = defineComponent({ this.c.onRowClick(item)} > @@ -379,68 +383,150 @@ export const CalendarControl = defineComponent({ ); }; - return ( - this.c.state.isCreated && ( - -
- { - this.dateChange(date); - }} - > - {{ - day: ({ date }: { extendAttr: IData; date: IData }): VNode => { + // 绘制默认日历内容 + const renderCalendarContent = (): VNode[] => { + return [ +
+ { + this.dateChange(date); + }} + > + {{ + day: ({ date }: { extendAttr: IData; date: IData }): VNode => { + return ( +
+ {date?.day} +
{renderMarker(date)}
+
+ ); + }, + action: () => { + return renderHeaderToolbar(); + }, + }} +
+
, +
+ + {this.c.model.sysCalendarItems?.map(calendarItem => { + let label = calendarItem.name!; + if (calendarItem.nameLanguageRes) { + label = ibiz.i18n.t( + calendarItem.nameLanguageRes.lanResTag!, + calendarItem.name, + ); + } + return ( + + + {renderCalendarListByItemType(calendarItem.itemType!)} + + + ); + })} + +
, + + + , + ]; + }; + + // 绘制时光轴 + const renderTimeLine = (): VNode | undefined => { + if (this.c.state.items.length === 0) { + return renderNoData(); + } + const groupMap = new Map(); + const groups: IData[] = []; + this.c.state.items.forEach(item => { + const value = item.beginTime; + if (value) { + if (!groupMap.has(value)) { + groupMap.set(value, []); + } + if (groupMap.has(value)) { + groupMap.get(value)!.push(item); + } + } + }); + groupMap.forEach((value, key) => { + groups.push({ + key: `${key}`, + caption: key + ? dayjs(key).format(this.c.state.timelineCaptionFormat) + : key, + children: value, + }); + }); + + return ( +
+ {groups.map(item => { + return ( +
+
+ {item.caption} +
+ {item.children.map((child: ICalendarItemData) => { + const model = this.c.model.sysCalendarItems?.find( + (calendarItems: IData) => { + return child.itemType === calendarItems.itemType; + }, + ); + const style: IData = {}; + if (model?.bkcolor) { + Object.assign(style, { + [`--${this.ns.b()}-timeline-item-bg-color`]: + model.bkcolor, + }); + } return ( -
- {date?.day} -
{renderMarker(date)}
+
+ {model?.layoutPanel + ? renderPanelItem(child, model.layoutPanel) + : renderDefaultItem(child, false)}
); - }, - action: () => { - return renderHeaderToolbar(); - }, - }} - -
-
- - {this.c.model.sysCalendarItems?.map(calendarItem => { - let label = calendarItem.name!; - if (calendarItem.nameLanguageRes) { - label = ibiz.i18n.t( - calendarItem.nameLanguageRes.lanResTag!, - calendarItem.name, - ); - } - return ( - - - {renderCalendarListByItemType(calendarItem.itemType!)} - - - ); - })} - -
- - - + })} +
+ ); + })} +
+ ); + }; + + return ( + this.c.state.isCreated && ( + + {this.c.model.calendarStyle === 'TIMELINE' + ? renderTimeLine() + : renderCalendarContent()} ) ); -- Gitee From 6677a7a0d8fbb9acecc478172611b7c1753de0be Mon Sep 17 00:00:00 2001 From: "jlj05024111@163.com" Date: Wed, 29 Oct 2025 13:59:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E5=86=85=E5=AE=B9=E8=A7=86=E9=A2=91=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E6=97=B6=EF=BC=8C=E6=9C=AA=E9=85=8D=E7=BD=AE=E7=9A=84?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=BC=9A=E8=A6=86=E7=9B=96=E6=8E=89=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=8F=82=E6=95=B0=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=9A=E6=95=B0=E6=8D=AE=E9=83=A8=E4=BB=B6?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E8=A1=A8=E5=8D=95=E6=98=BE=E7=A4=BA=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E7=9A=84=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E4=BB=85=E5=9C=A8=E5=AD=98=E5=9C=A8=E6=90=9C=E7=B4=A2=E6=A0=8F?= =?UTF-8?q?=E6=97=B6=E6=89=8D=E6=98=BE=E7=A4=BA=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ src/common/rawitem/rawitem.tsx | 24 +++++++++++++------ .../setting-container.controller.ts | 15 ++++++++++++ .../setting-container/setting-container.tsx | 19 ++++++++++++++- 4 files changed, 52 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e0abde7d26..8e6c0f3a2f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,6 +82,8 @@ ### Fixed +- 修复表单直接内容视频模式时,未配置的参数会覆盖掉默认参数的问题 +- 修复多数据部件搜索表单显示按钮的显示问题,仅在存在搜索栏时才显示按钮 - 修复分割容器在统一页面内有多个可交互元素时,分割容器的pointerdown事件被浏览器忽略的问题 - 修复返回顶部按钮在无视图参数时判断异常报错的问题 - 修复面板直接内容为视频类型时,配置的参数未识别的问题 diff --git a/src/common/rawitem/rawitem.tsx b/src/common/rawitem/rawitem.tsx index a600f0d7164..eaf4af68db5 100644 --- a/src/common/rawitem/rawitem.tsx +++ b/src/common/rawitem/rawitem.tsx @@ -166,13 +166,23 @@ export const IBizRawItem = defineComponent({ rawConfig = func(); switch (rawItemType.value) { case 'VIDEO': - Object.assign(playerParams.value, rawConfig, { - path: getParamsValue('path'), - autoplay: getParamsValue('autoplay'), - mute: getParamsValue('mute'), - replay: getParamsValue('replay'), - showcontrols: getParamsValue('showcontrols'), - }); + Object.assign(playerParams.value, rawConfig); + if (rawItem?.rawItemParams) { + const tempConfig: IData = { + path: getParamsValue('path'), + autoplay: getParamsValue('autoplay'), + mute: getParamsValue('mute'), + replay: getParamsValue('replay'), + showcontrols: getParamsValue('showcontrols'), + }; + Object.keys(tempConfig).forEach(key => { + if (tempConfig[key] !== undefined) { + Object.assign(playerParams.value, { + [key]: tempConfig[key], + }); + } + }); + } break; case 'DIVIDER': Object.assign(dividerParams.value, rawConfig); diff --git a/src/panel-component/setting-container/setting-container.controller.ts b/src/panel-component/setting-container/setting-container.controller.ts index d6e5f2ce923..f38fb3a39fe 100644 --- a/src/panel-component/setting-container/setting-container.controller.ts +++ b/src/panel-component/setting-container/setting-container.controller.ts @@ -1,5 +1,6 @@ import { IMobMDCtrlController, + ISearchBarController, ISearchFormController, PanelContainerController, } from '@ibiz-template/runtime'; @@ -35,6 +36,17 @@ export class SettingContainerController extends PanelContainerController 0); } + /** + * 是否有快速搜索栏 + * + * @readonly + * @type {boolean} + * @memberof SettingContainerController + */ + get searchbar(): ISearchBarController | undefined { + return this.panel.view.getController('searchbar') as ISearchBarController; + } + /** * @description 是否可见 * @readonly @@ -42,6 +54,9 @@ export class SettingContainerController extends PanelContainerController - + + + )}
-- Gitee