From 0647fd26414fc8a3ab077d355f50da6e3e36ad63 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期三, 15 一月 2025 17:40:57 +0800 Subject: [PATCH] 实现原本功能 --- src/components/chat/chatComponents/summaryCom/components/recordSet/components/TimeRange.vue | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/components/chat/chatComponents/summaryCom/components/recordSet/components/TimeRange.vue b/src/components/chat/chatComponents/summaryCom/components/recordSet/components/TimeRange.vue index 20a8cd0..ef234c6 100644 --- a/src/components/chat/chatComponents/summaryCom/components/recordSet/components/TimeRange.vue +++ b/src/components/chat/chatComponents/summaryCom/components/recordSet/components/TimeRange.vue @@ -33,8 +33,15 @@ <div class="ml-2 inline-flex items-center space-x-2 text-[14px]"> <div @click="quickPickRangeClick(parseInt(item))" - class="border border-solid rounded-md px-2 cursor-pointer" - :class="{ 'bg-[#1677ff]': parseInt(item) === quickPickValue, 'text-white': parseInt(item) === quickPickValue }" + class="border border-solid rounded-md px-2 py-1 cursor-pointer" + :class="{ + 'bg-[#1677ff]': parseInt(item) === quickPickValue, + 'text-white': parseInt(item) === quickPickValue, + 'bg-[#f5f7fa]': disabled, + 'text-[#a9acb3]': disabled, + 'border-[#dcdfe6]': disabled, + '!cursor-not-allowed': disabled, + }" v-for="item in Object.keys(timeRangeMapTitle)" :key="item" > @@ -61,6 +68,7 @@ } from '/@/components/form/datepicker/constants'; import { formatDate } from '/@/utils/formatTime'; import moment from 'moment'; +import { isSharePage } from '/@/stores/chatRoom'; const valueFormat = DEFAULT_FORMATS_DATE + ' ' + DEFAULT_FORMATS_TIME; const props = defineProps({ @@ -84,7 +92,7 @@ } }; -const timeRangeMapTitle = getRangeMapTitle(props.data.origin.time_step); +const timeRangeMapTitle = getRangeMapTitle(props.data?.origin?.time_step); const dateValue = defineModel({ type: definePropType<[string, string]>(Array), }); @@ -105,6 +113,7 @@ }; const quickPickValue = ref<TimeRangeEnum>(null); const quickPickRangeClick = (val: TimeRangeEnum) => { + if (props.disabled) return; if (quickPickValue.value === val) return; quickPickValue.value = val; @@ -114,6 +123,8 @@ const offsetClickIsAllow = computed(() => !!dateValue.value && !props.disabled); const preDayClick = () => { + if (props.disabled) return; + if (!dateValue.value) return; dateValue.value[0] = moment(dateValue.value[0]).subtract(1, 'day').format('YYYY-MM-DD HH:mm:ss'); dateChange(); @@ -122,6 +133,8 @@ }; const nextDayClick = () => { + if (props.disabled) return; + if (!dateValue.value) return; dateValue.value[1] = moment(dateValue.value[1]).add(1, 'day').format('YYYY-MM-DD HH:mm:ss'); dateChange(); -- Gitblit v1.9.3