From 816f46f6ad6f291dda6d58b6dd1e6e50419dda3d Mon Sep 17 00:00:00 2001 From: ximena Date: Sat, 19 Jul 2025 11:48:39 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E8=A1=A8=E5=B7=A5=E5=85=B7=E6=A0=8F?= =?UTF-8?q?=E7=9A=84=E6=98=AF=E5=90=A6=E5=8F=AF=E8=A7=81=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=B8=B8=E9=87=8F=E9=85=8D=E7=BD=AE=EF=BC=9B=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=97=A5=E6=9C=9F=E5=8C=BA=E9=97=B4=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../condition-value/date-range-value.ts | 3 +++ .../date-range/date-range.component.tsx | 11 ++++---- .../response-toolbar.property-config.ts | 26 +++++++++++++++++-- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/packages/ui-vue/components/condition/src/composition/condition-value/date-range-value.ts b/packages/ui-vue/components/condition/src/composition/condition-value/date-range-value.ts index fd45cefcb07..0021922b979 100644 --- a/packages/ui-vue/components/condition/src/composition/condition-value/date-range-value.ts +++ b/packages/ui-vue/components/condition/src/composition/condition-value/date-range-value.ts @@ -36,6 +36,9 @@ export class DateRangeValue implements ConditionValue { } // TODO getDisplayText() { + if(!this.begin&&!this.end){ + return ''; + } return (this.begin === null ? '' : this.begin) + '~' + (this.end === null ? '' : this.end); } diff --git a/packages/ui-vue/components/date-picker/src/components/date-range/date-range.component.tsx b/packages/ui-vue/components/date-picker/src/components/date-range/date-range.component.tsx index a3a01e0dbae..7b278034658 100644 --- a/packages/ui-vue/components/date-picker/src/components/date-range/date-range.component.tsx +++ b/packages/ui-vue/components/date-picker/src/components/date-range/date-range.component.tsx @@ -54,13 +54,14 @@ export default defineComponent({ * 可能只有beginValue或者endValue的值,modelValue没有设置值 * @returns */ - function getInitModelValue(){ - if(props.modelValue){ + function getInitModelValue() { + if (props.modelValue) { return props.modelValue; } - if(props.beginValue||props.endValue){ - return props.beginValue+'~'+props.endValue; + if (props.beginValue || props.endValue) { + return props.beginValue + '~' + props.endValue; } + return ''; } const modelValue = ref(getInitModelValue()); function getDisplayText(dateText) { @@ -194,7 +195,7 @@ export default defineComponent({ }); function onMouseEnter() { - showClearButton.value = !!startDisplayDate.value||!!endDisplayDate.value; + showClearButton.value = !!startDisplayDate.value || !!endDisplayDate.value; } function onMouseLeave() { diff --git a/packages/ui-vue/components/response-toolbar/src/property-config/response-toolbar.property-config.ts b/packages/ui-vue/components/response-toolbar/src/property-config/response-toolbar.property-config.ts index f270b3b6041..578069315eb 100644 --- a/packages/ui-vue/components/response-toolbar/src/property-config/response-toolbar.property-config.ts +++ b/packages/ui-vue/components/response-toolbar/src/property-config/response-toolbar.property-config.ts @@ -15,8 +15,30 @@ export class ResponseToolbarProperty extends BaseControlProperty { if (this.toolbarType !== 'tab-toolbar') { this.getAppearancePropConfig(propertyData); } - // 行为 - this.propertyConfig.categories['behavior'] = this.getBehaviorConfig(propertyData); + if (this.toolbarType === 'response-toolbar') { + this.propertyConfig.categories['behavior'] = this.getBehaviorConfig(propertyData); + } else { + const self = this; + const editor = this.getPropertyEditorParams(propertyData, ['Const'], 'visible'); + this.propertyConfig.categories['behavior'] = { + title: "行为", + description: "", + properties: { + visible: { + title: "是否可见", + type: "boolean", + description: "运行时组件是否可见", + editor + } + }, + setPropertyRelates(changeObject, parameters: any) { + if (!changeObject) { + return; + } + self.afterMutilEditorChanged(propertyData, changeObject); + } + }; + } return this.propertyConfig; } -- Gitee From fe2bdf0e5eb5855745f2599891b0bad0c4b83b25 Mon Sep 17 00:00:00 2001 From: ximena Date: Sat, 19 Jul 2025 17:30:56 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8C=BA=E9=97=B4?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/date-picker/src/date-picker.component.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/ui-vue/components/date-picker/src/date-picker.component.tsx b/packages/ui-vue/components/date-picker/src/date-picker.component.tsx index 6fa74d34962..e427f495795 100644 --- a/packages/ui-vue/components/date-picker/src/date-picker.component.tsx +++ b/packages/ui-vue/components/date-picker/src/date-picker.component.tsx @@ -195,10 +195,10 @@ export default defineComponent({ const parts = modelValue.value.split('~'); if (parts.length === 1) { // 只有结束日期的情况 - return `${newValue}`; + modelValue.value = `${newValue}`; } else if (parts.length === 2) { // 有开始和结束日期的情况 - return `${newValue}~${parts[1]}`; + modelValue.value = `${newValue}~${parts[1]}`; } } } @@ -213,10 +213,10 @@ export default defineComponent({ const parts = modelValue.value.split('~'); if (parts.length === 1) { // 只有结束日期的情况 - return `${parts[0]}~${newValue}`; + modelValue.value = `${parts[0]}~${newValue}`; } else if (parts.length === 2) { // 有开始和结束日期的情况 - return `${parts[0]}~${newValue}`; + modelValue.value = `${parts[0]}~${newValue}`; } } }); -- Gitee From 346cf4d3c71eea80ca0b62b0253001f0f3b8c7ad Mon Sep 17 00:00:00 2001 From: ximena Date: Mon, 21 Jul 2025 19:32:27 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E5=8C=BA=E9=97=B4=E9=80=9A=E8=BF=87modelvalue=E8=B5=8B?= =?UTF-8?q?=E5=80=BC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/date-range/date-range.component.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/ui-vue/components/date-picker/src/components/date-range/date-range.component.tsx b/packages/ui-vue/components/date-picker/src/components/date-range/date-range.component.tsx index 7b278034658..fa728d1cb27 100644 --- a/packages/ui-vue/components/date-picker/src/components/date-range/date-range.component.tsx +++ b/packages/ui-vue/components/date-picker/src/components/date-range/date-range.component.tsx @@ -50,12 +50,18 @@ export default defineComponent({ const newBeginValue = ref(props.beginValue); const newEndValue = ref(props.endValue); + const setBeginAndEndValueFromModelValue = (dateValue) => { + const splitValue = dateValue.split('~'); + newBeginValue.value = splitValue?.[0] || ''; + newEndValue.value = splitValue?.[1] || ''; + }; /** * 可能只有beginValue或者endValue的值,modelValue没有设置值 * @returns */ function getInitModelValue() { if (props.modelValue) { + setBeginAndEndValueFromModelValue(props.modelValue); return props.modelValue; } if (props.beginValue || props.endValue) { @@ -86,9 +92,7 @@ export default defineComponent({ modelValue.value = props.modelValue; }); watch(modelValue, (newValue) => { - const splitValue = newValue.split('~'); - newBeginValue.value = splitValue?.[0] || ''; - newEndValue.value = splitValue?.[1] || ''; + setBeginAndEndValueFromModelValue(newValue); }); const buttonEditClass = computed(() => { const classObject = { -- Gitee From 719527c92bac046bd60f0455b2ac4ec7b4865497 Mon Sep 17 00:00:00 2001 From: ximena Date: Mon, 21 Jul 2025 19:55:49 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E5=8C=BA=E9=97=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../date-picker-container.component.tsx | 106 +++++++++--------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/packages/ui-vue/components/date-picker/src/components/date-picker-container/date-picker-container.component.tsx b/packages/ui-vue/components/date-picker/src/components/date-picker-container/date-picker-container.component.tsx index f8ec4f14367..aef4c538ce9 100644 --- a/packages/ui-vue/components/date-picker/src/components/date-picker-container/date-picker-container.component.tsx +++ b/packages/ui-vue/components/date-picker/src/components/date-picker-container/date-picker-container.component.tsx @@ -76,7 +76,7 @@ export default defineComponent({ const disableSecondaryPrePage = ref(false); const disableSecondaryPreRecord = ref(false); const disableSecondaryNextRecord = ref(false); - const disableSecondaryNextPage = ref(false); + const disableSecondaryNextPage = ref(false); /** 每日 */ const weekDays = ref([]); /** 是否允许键盘定位 */ @@ -97,7 +97,7 @@ export default defineComponent({ const selectedWeek = ref(props.selectedWeek); /** 每周标题 */ const weekTitle = ref(props.weekTitle); - + /** 选择的月份 */ const selectedMonth = ref(props.selectedMonth); /** 最早年限 */ @@ -119,9 +119,9 @@ export default defineComponent({ const { getToday, getDateObject, getTimeValue, getEndTimeValue, emptyDate } = useDate(); const { setNewDateRange, getActiveMonth, getTimeStr, getMonthAndYear } = useNormalizeDate(props); - const selectedPeriod = ref({ from: { ...emptyDate() }, to: { ...emptyDate()} }); + const selectedPeriod = ref({ from: { ...emptyDate() }, to: { ...emptyDate() } }); + - function getWeekDays() { const { weekDayLabels } = props.locales; const dayLabels: any = []; @@ -135,9 +135,9 @@ export default defineComponent({ } } return dayLabels; - } + } - weekDays.value = getWeekDays(); + weekDays.value = getWeekDays(); const refDisableDate: UseDisableDate = useDisableDate( minYear.value, @@ -157,15 +157,15 @@ export default defineComponent({ const { generateMonths, getNextMonth, getPreviousMonth, daysInMonth } = useMonth(); const { getNowWeekTime } = useWeek(); const { getWeekNumber } = useNumber(); - - + + const { generateYears } = useYear(); const { equalOrEarlier, isInitializedDate, isDateEarlier } = useCompare(); const today = getToday(); const selectedDateObj = computed(() => { const todayClone = cloneDeep(today); - const parsedDate = dateValue.value && parseToDate(dateValue.value, valueFormat.value); + const parsedDate = dateValue.value && !enablePeriod.value ? parseToDate(dateValue.value, valueFormat.value) : null; return parsedDate ? getDateObject(formatTo(parsedDate, 'yyyy-MM-dd'), 'yyyy-MM-dd') : todayClone; }); @@ -238,7 +238,7 @@ export default defineComponent({ }); const secondaryDates = ref(secondaryRealDates.value); watch(() => secondaryRealDates.value, (newValue, oldValue) => { - secondaryDates.value = newValue; + secondaryDates.value = newValue; }); const months = computed(() => { @@ -288,7 +288,7 @@ export default defineComponent({ secondaryYears.value = newValue; }); - const secondMonths = computed(() => { + const secondMonths = computed(() => { const monthViewItems = generateMonths( nameOfMonths.value, { year: secondaryActiveMonth.value.year, month: secondaryActiveMonth.value.month }, @@ -396,7 +396,7 @@ export default defineComponent({ } function navigateToNextYear($event: any, isSecondCalendar: boolean) { - if(!isSecondCalendar) { + if (!isSecondCalendar) { let nextYear = activeMonth.value.year + 1; if (selectingYear.value) { nextYear = years.value[3][0].year + 2; @@ -441,7 +441,7 @@ export default defineComponent({ if (selectMode.value === 'month') { selectingMonth.value = !selectingMonth.value; } else { - selectingMonth.value = false; + selectingMonth.value = false; } } else { selectingSecondaryYear.value = selectMode.value === 'year' ? true : !selectingSecondaryYear.value; @@ -526,7 +526,7 @@ export default defineComponent({ const shouldShowCalendarView = computed(() => { return (isSecondCalendar: boolean) => { - if (isSecondCalendar) { + if (isSecondCalendar) { return selectMode.value !== 'week' && !selectingSecondaryMonth.value && !selectingSecondaryYear.value && !selectingTime.value; } else { return !selectingMonth.value && !selectingYear.value && !selectingTime.value; @@ -690,12 +690,12 @@ export default defineComponent({ function renderCalender(calendarProps: any, isSecondCalendar: boolean) { return onClickDay(payload, isSecondCalendar)} - onClickWeek={(payload: any) => onClickWeek(payload)} - onKeyDown={(payload: any) => onKeyDownCalendar(payload)} - onMouseEnter={(payload: any) => onMouseEnterCalendar(payload, isSecondCalendar)} - onMouseLeave={(payload: any) => onMouseLeaveCalendar(payload, isSecondCalendar)} - >; + onClick={(payload: any) => onClickDay(payload, isSecondCalendar)} + onClickWeek={(payload: any) => onClickWeek(payload)} + onKeyDown={(payload: any) => onKeyDownCalendar(payload)} + onMouseEnter={(payload: any) => onMouseEnterCalendar(payload, isSecondCalendar)} + onMouseLeave={(payload: any) => onMouseLeaveCalendar(payload, isSecondCalendar)} + >; }; const monthProps = computed(() => { @@ -729,13 +729,13 @@ export default defineComponent({ // both already selected - set begin date and reset end date selectedPeriod.value.from = { year: currentMonth.year, month: currentMonth.month }; selectedPeriod.value.to = emptyDate(); - } else if(!isBeginMonthInitialized) { + } else if (!isBeginMonthInitialized) { selectedPeriod.value.from = { year: currentMonth.year, month: currentMonth.month }; } else { const firstDateEarlier: boolean = isDateEarlier({ year: currentMonth.year, month: currentMonth.month }, begin); if (firstDateEarlier) { const _date = selectedPeriod.value.from; - selectedPeriod.value.to = {..._date}; + selectedPeriod.value.to = { ..._date }; selectedPeriod.value.from = { year: currentMonth.year, month: currentMonth.month }; } else { selectedPeriod.value.to = { year: currentMonth.year, month: currentMonth.month }; @@ -746,14 +746,14 @@ export default defineComponent({ }; function onClickMonth(currentMonth: DateObject, isSecondCalendar: boolean) { - if(!isSecondCalendar) { + if (!isSecondCalendar) { activeMonth.value = { month: currentMonth.month || 1, displayTextOfMonth: nameOfMonths.value[currentMonth.month || '1'], year: currentMonth.year || 1, displayTextOfYear: `${currentMonth.year}` }; - if(selectMode.value === 'month') { + if (selectMode.value === 'month') { if (!enablePeriod.value) { context.emit('datePicked', currentMonth); } else { @@ -772,7 +772,7 @@ export default defineComponent({ displayTextOfYear: `${currentMonth.year}` }; - if(selectMode.value === 'month') { + if (selectMode.value === 'month') { selectRangeMonth(currentMonth); } else { selectingSecondaryMonth.value = false; @@ -787,7 +787,7 @@ export default defineComponent({ if (isSecondCalendar) { for (const item of months.value) { for (const month of item) { - month.range = + month.range = (equalOrEarlier(selectedPeriod.value.from, month.date) && equalOrEarlier(month.date, cell.date)) || (equalOrEarlier(month.date, selectedPeriod.value.from) && equalOrEarlier(cell.date, month.date)); } @@ -842,7 +842,7 @@ export default defineComponent({ }); function onClickYear(currentYear: DateObject, isSecondCalendar: boolean) { - if (!isSecondCalendar) { + if (!isSecondCalendar) { activeMonth.value = { month: activeMonth.value.month, displayTextOfMonth: activeMonth.value.displayTextOfMonth, @@ -869,14 +869,14 @@ export default defineComponent({ displayTextOfYear: `${currentYear.year}` }; - if(selectMode.value === 'year') { + if (selectMode.value === 'year') { selectRangeMonth(currentYear); } else { selectingSecondaryMonth.value = true; selectingSecondaryYear.value = false; } } - + } function onKeyDownYearView($event: any) { } @@ -924,20 +924,20 @@ export default defineComponent({ selectedPeriod.value.to = { ...selectedPeriod.value.from }; } - + if (props.showTime) { const { hour, minute, second } = getTimeValue(timeValue.value, true); - selectedPeriod.value.from = {...selectedPeriod.value.from, ...{ hour, minute, second } }; + selectedPeriod.value.from = { ...selectedPeriod.value.from, ...{ hour, minute, second } }; const { hour: endHour, minute: endMinute, second: endSecond } = getEndTimeValue(timeRangeValue.value); - selectedPeriod.value.to = {...selectedPeriod.value.to, ...{ hour: endHour, minute: endMinute, second: endSecond } }; + selectedPeriod.value.to = { ...selectedPeriod.value.to, ...{ hour: endHour, minute: endMinute, second: endSecond } }; } const { from, to } = selectedPeriod.value; - context.emit('datePicked', { startDate: from, endDate: to}); + context.emit('datePicked', { startDate: from, endDate: to }); } else { if (props.showTime) { const { hour, minute, second } = getTimeValue(timeValue.value, true); - selectedDate.value = {...selectedDate.value,...{ hour, minute, second } }; + selectedDate.value = { ...selectedDate.value, ...{ hour, minute, second } }; } context.emit('confirm', selectedDate.value); } @@ -968,7 +968,7 @@ export default defineComponent({ onClickMonth(selectedDate.value, false); if (selectMode.value === 'month') { - context.emit('datePicked', selectedMonth.value); + context.emit('datePicked', selectedMonth.value); } } @@ -984,7 +984,7 @@ export default defineComponent({ onClickYear(selectedDate.value, false); if (selectMode.value === 'year') { - context.emit('datePicked', selectedDate.value); + context.emit('datePicked', selectedDate.value); } } @@ -992,17 +992,17 @@ export default defineComponent({ return enablePeriod.value && selectMode.value !== 'week'; }); - + const containerClass = computed(() => { const classObject = { 'f-datepicker-container': true, - 'f-daterange-select-timerange':shouldShowSecondCalendar.value&&selectingTime.value + 'f-daterange-select-timerange': shouldShowSecondCalendar.value && selectingTime.value } as Record; const className = `container-position-${position.value}`; classObject[className] = true; return classObject; }); - + const showConfirmButton = computed(() => props.showTime && selectMode.value !== 'week'); function renderYear(yearProps: any, isSecondCalendar: boolean) { @@ -1035,7 +1035,7 @@ export default defineComponent({ onMounted(() => { if (enablePeriod.value) { - const { dateRange, beginDateActiveMonth, endDateActiveMonth, beginTime, endTime, selectedWeekInfo} = getActiveMonth(dateValue.value); + const { dateRange, beginDateActiveMonth, endDateActiveMonth, beginTime, endTime, selectedWeekInfo } = getActiveMonth(dateValue.value); selectedPeriod.value = dateRange; if (beginDateActiveMonth) { activeMonth.value = beginDateActiveMonth; @@ -1056,7 +1056,7 @@ export default defineComponent({ selectedWeek.value = selectedWeekInfo; } } else { - if (props.showTime) { + if (props.showTime) { const dateAndTimeFormatList = valueFormat.value.split(' '); const timeFormat = dateAndTimeFormatList[1] || 'HH:mm:ss'; timeValue.value = formatTo(dateValue.value, timeFormat); @@ -1113,7 +1113,7 @@ export default defineComponent({ selectedDate.value.second = seconds; } } - + } else { timeRangeValue.value = textValue.text; if (enablePeriod.value && selectedPeriod.value) { @@ -1124,9 +1124,9 @@ export default defineComponent({ } }; - function renderTimePicker(isSecondCalendar: boolean) { + function renderTimePicker(isSecondCalendar: boolean) { return onValueChangeHandler(timeValue, isSecondCalendar)} >; @@ -1173,14 +1173,14 @@ export default defineComponent({ const { from: begin, to: end } = selectedPeriod.value; const canClick = equalOrEarlier(begin, end); return { - "pointer-events": canClick?"auto": "none", - opacity: canClick ? 1: 0.3, + "pointer-events": canClick ? "auto" : "none", + opacity: canClick ? 1 : 0.3, }; } return true; } else { const { hour, minute, second } = getTimeValue(timeValue.value, true); - const currentDateValue = {...selectedDate.value,...{ hour, minute, second } }; + const currentDateValue = { ...selectedDate.value, ...{ hour, minute, second } }; return btnTodayStyle.value(currentDateValue); } }); @@ -1211,8 +1211,8 @@ export default defineComponent({ } const currentLabels = props.locales.buttons.current; - const toggleDateAndTimeLabel = computed(() => { - return selectingTime.value ? props.locales.buttons.selectDate: props.locales.buttons.selectTime; + const toggleDateAndTimeLabel = computed(() => { + return selectingTime.value ? props.locales.buttons.selectDate : props.locales.buttons.selectTime; }); return () => { @@ -1246,7 +1246,7 @@ export default defineComponent({ } { shouldShowSecondCalendar.value && selectMode.value !== 'week' && -
+
{renderNavBar(secondaryCalendarNavBarProps.value, true)} {shouldShowCalendarView.value(true) && renderCalender(secondaryCalendarProps.value, true)} {selectingSecondaryMonth.value && renderMonth(secondMonthProps.value, true)} @@ -1257,14 +1257,14 @@ export default defineComponent({ { showConfirmButton.value &&
{!enablePeriod.value && shouldShowCalendarView.value(false) && } - {!enablePeriod.value &&shouldShowMonthView.value && } - {!enablePeriod.value &&shouldShowYearView.value && } + {!enablePeriod.value && shouldShowMonthView.value && } + {!enablePeriod.value && shouldShowYearView.value && } {enablePeriod.value && selectMode.value === 'day' &&
} 确定
- + } {!enablePeriod.value && !showConfirmButton.value &&
{shouldShowCalendarView.value(false) && } -- Gitee