| | |
| | | @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 }" |
| | | v-for="item in Object.keys(timeRangeEnumMapTitle)" |
| | | v-for="item in Object.keys(timeRangeMapTitle)" |
| | | :key="item" |
| | | > |
| | | {{ timeRangeEnumMapTitle[item] }} |
| | | {{ timeRangeMapTitle[item] }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | import { definePropType } from 'element-plus/es/utils/vue/props/runtime'; |
| | | import { ref, type PropType, computed, watch, nextTick } from 'vue'; |
| | | import type { TimeRangeParam } from '../types'; |
| | | import type { TimeRangeEnum } from './types'; |
| | | import { timeRangeEnumMapTitle, timeRangeEnumMapValue } from './types'; |
| | | import { TimeRangeEnum, TimeStepValue, monthTimeRangeEnumMapTitle } from './types'; |
| | | import { dayTimeRangeEnumMapTitle, timeRangeEnumMapValue } from './types'; |
| | | import { |
| | | CURRENT_DAY, |
| | | DEFAULT_FORMATS_DATE, |
| | |
| | | default: false, |
| | | }, |
| | | }); |
| | | |
| | | const getRangeMapTitle = (timeStep: TimeStepValue) => { |
| | | switch (timeStep) { |
| | | case TimeStepValue.Day: |
| | | return dayTimeRangeEnumMapTitle; |
| | | case TimeStepValue.Month: |
| | | return monthTimeRangeEnumMapTitle; |
| | | default: |
| | | return dayTimeRangeEnumMapTitle; |
| | | } |
| | | }; |
| | | |
| | | const timeRangeMapTitle = getRangeMapTitle(props.data?.origin?.time_step); |
| | | const dateValue = defineModel({ |
| | | type: definePropType<[string, string]>(Array), |
| | | }); |