From da056d7380fff877f01c88769af3fc6d5cad7c00 Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期四, 24 十月 2024 16:34:32 +0800
Subject: [PATCH] 角色管理和访问日志

---
 src/components/chat/chatComponents/summaryCom/components/recordSet/components/TimeRange.vue |   22 +++++++++++++++++++---
 1 files changed, 19 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 96d24d5..74da627 100644
--- a/src/components/chat/chatComponents/summaryCom/components/recordSet/components/TimeRange.vue
+++ b/src/components/chat/chatComponents/summaryCom/components/recordSet/components/TimeRange.vue
@@ -47,7 +47,7 @@
 <script setup lang="ts">
 import { ElDatePicker } from 'element-plus';
 import { definePropType } from 'element-plus/es/utils/vue/props/runtime';
-import { ref, type PropType, computed, watch, nextTick } from 'vue';
+import { ref, type PropType, computed, watch, nextTick, onMounted } from 'vue';
 import type { TimeRangeParam } from '../types';
 import type { TimeRangeEnum } from './types';
 import { timeRangeEnumMapTitle, timeRangeEnumMapValue } from './types';
@@ -71,6 +71,11 @@
 		type: Boolean,
 		default: false,
 	},
+
+	quickActive: {
+		type: Number as PropType<TimeRangeEnum>,
+		required: false,
+	},
 });
 const dateValue = defineModel({
 	type: definePropType<[string, string]>(Array),
@@ -91,11 +96,16 @@
 	quickPickValue.value = null;
 };
 const quickPickValue = ref<TimeRangeEnum>(null);
-const quickPickRangeClick = (val: TimeRangeEnum) => {
-	if (quickPickValue.value === val) return;
 
+const pickQuickRange = (val: TimeRangeEnum) => {
+	if(val==undefined) return;
 	quickPickValue.value = val;
 	dateValue.value = timeRangeEnumMapValue[val]().map((item) => formatDate(item)) as [string, string];
+};
+const quickPickRangeClick = (val: TimeRangeEnum) => {
+	if (quickPickValue.value === val) return;
+	pickQuickRange(val);
+
 	dateChange();
 };
 
@@ -121,6 +131,12 @@
 	dateChange();
 };
 
+onMounted(() => {
+	if(props.quickActive !=null){
+		pickQuickRange(props.quickActive);
+	}
+});
+
 defineExpose({
 	formatDateValue: dateValue,
 });

--
Gitblit v1.9.3