From 022a757742c70b3106d817461464e821b537e794 Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期二, 05 十一月 2024 13:20:40 +0800
Subject: [PATCH] process loading bug;报告

---
 src/components/chat/chatComponents/summaryCom/components/recordSet/components/TimeRange.vue |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 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 96d24d5..005ad19 100644
--- a/src/components/chat/chatComponents/summaryCom/components/recordSet/components/TimeRange.vue
+++ b/src/components/chat/chatComponents/summaryCom/components/recordSet/components/TimeRange.vue
@@ -35,10 +35,10 @@
 				@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>
@@ -49,8 +49,8 @@
 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,
@@ -72,6 +72,19 @@
 		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),
 });

--
Gitblit v1.9.3