diff --git a/CHANGELOG.md b/CHANGELOG.md index 220194d5de6dd108f1583bce86fcb61f467a5fcf..0feefd03d559b6870ac39bcf358e58de45838e33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ ## [Unreleased] +### Fixed + +- 修复日历时间范围标题未显示及适配列表项开始时间或结束时间没有时的样式 +- 修复工具栏导出行为未打开导出弹框 + ## [0.7.38-alpha.46] - 2025-01-06 ### Added diff --git a/src/control/calendar/calendar-util.ts b/src/control/calendar/calendar-util.ts index ead59a767c11f8db0042d3e833ec75e5dbc4a73c..e8a73d5d06b7bbca9f13b13cc23723d885fdcbca 100644 --- a/src/control/calendar/calendar-util.ts +++ b/src/control/calendar/calendar-util.ts @@ -42,10 +42,12 @@ export const isTimeBetween = (_argrs: { unit?: dayjs.OpUnitType | undefined; }): boolean => { const { date, beginTime, endTime, unit = 'day' } = _argrs; - return ( + return !!( dayjs(date).isSame(beginTime, unit) || dayjs(date).isSame(endTime, unit) || - (dayjs(date).isAfter(beginTime, unit) && + (beginTime && + endTime && + dayjs(date).isAfter(beginTime, unit) && dayjs(date).isBefore(endTime, unit)) ); }; diff --git a/src/control/calendar/calendar.scss b/src/control/calendar/calendar.scss index dba085f0fc865414f459384a40d6e594d78f937b..bfe1544523569f27ee1b6729eec0799e2bc4fd62 100644 --- a/src/control/calendar/calendar.scss +++ b/src/control/calendar/calendar.scss @@ -123,6 +123,13 @@ $control-calendar: ( z-index: -1; opacity: 0; } + + &.is-no-end-time, + &.is-no-begin-time { + width: calc(100% - getCssVar(spacing, super-tight) * 2); + margin-left: getCssVar(spacing, super-tight); + border-radius: getCssVar(spacing, extra-tight); + } } } } diff --git a/src/control/calendar/calendar.tsx b/src/control/calendar/calendar.tsx index 8736ac550fb7964cfdfda51d4526251fc37b7e87..6ac2d5d1c41bbfde9e5907a5caaaa42afa6e43dc 100644 --- a/src/control/calendar/calendar.tsx +++ b/src/control/calendar/calendar.tsx @@ -208,6 +208,8 @@ export const CalendarControl = defineComponent({ date, }), ), + this.ns.is('no-begin-time', this.showDateRange && !item.beginTime), + this.ns.is('no-end-time', this.showDateRange && !item.endTime), this.ns.is('end-time', date && dayjs(date).isSame(item.endTime, 'day')), ]; const style = this.calcItemStyle(item); @@ -259,6 +261,8 @@ export const CalendarControl = defineComponent({ date, }), ), + this.ns.is('no-begin-time', this.showDateRange && !item.beginTime), + this.ns.is('no-end-time', this.showDateRange && !item.endTime), this.ns.is('end-time', date && dayjs(date).isSame(item.endTime, 'day')), ]; const style = this.calcItemStyle(item); @@ -274,7 +278,8 @@ export const CalendarControl = defineComponent({ {this.showDateRange ? date && (dayjs(date).isSame(item.beginTime, 'day') || - dayjs(date).day() === 0) + dayjs(date).day() === 0 || + (!item.beginTime && dayjs(date).isSame(item.endTime, 'day'))) ? item.text : '' : item.text} diff --git a/src/control/toolbar/toolbar.tsx b/src/control/toolbar/toolbar.tsx index 77774b2423b863a195d23cb0852302120b3d0960..8b143be20d20e3e472fd55f16632a41e7cc6284b 100644 --- a/src/control/toolbar/toolbar.tsx +++ b/src/control/toolbar/toolbar.tsx @@ -220,7 +220,10 @@ export const ToolbarControl = defineComponent({ const buttonType = ( item2 as IDETBUIActionItem ).buttonStyle?.toLowerCase(); - if (actionId === 'exportexcel') { + if ( + actionId === 'exportexcel' || + actionId === 'gridview_exportaction' + ) { return (