From 651cc37b98c2f496bbaa42704f801d4ac0af58bb Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期五, 08 十一月 2024 11:39:35 +0800
Subject: [PATCH] time range disabled

---
 src/components/chat/chatComponents/summaryCom/components/recordSet/components/List.vue |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/components/chat/chatComponents/summaryCom/components/recordSet/components/List.vue b/src/components/chat/chatComponents/summaryCom/components/recordSet/components/List.vue
index 2dc9908..eccf785 100644
--- a/src/components/chat/chatComponents/summaryCom/components/recordSet/components/List.vue
+++ b/src/components/chat/chatComponents/summaryCom/components/recordSet/components/List.vue
@@ -1,13 +1,13 @@
 <template>
 	<el-select
 		class="w-32"
-		:style="{width:selectWidth}"
+		:style="{ width: selectWidth }"
 		v-model="selectValue"
 		@change="changeValue"
 		:disabled="disabled"
 		:placeholder="data.title"
 	>
-		<el-option v-for="item in data.list" :key="item.value" :value="item.value" :label="item.title"></el-option>
+		<el-option v-for="item in selectList" :key="item.value" :value="item.value" :label="item.title"></el-option>
 	</el-select>
 </template>
 
@@ -15,6 +15,7 @@
 import { ref, type PropType, computed } from 'vue';
 import { getTextWidth } from '/@/utils/util';
 import { StepParam } from '../types';
+import { DAY_STEP_LIST, HOUR_STEP_LIST, IS_DAY_LIST } from './constants';
 
 const props = defineProps({
 	data: {
@@ -26,6 +27,17 @@
 	},
 });
 
+const getSelectList = (defaultStepValue: string) => {
+	if (IS_DAY_LIST.includes(defaultStepValue)) {
+		return DAY_STEP_LIST;
+	} else {
+		return HOUR_STEP_LIST;
+	}
+};
+
+const selectList = getSelectList(props.data?.origin?.step_value);
+// const fontSize = ref('14px');
+
 const emit = defineEmits(['change']);
 const SELECT_OFFSET = 47;
 const selectWidth = computed(() => {
@@ -33,7 +45,7 @@
 		// 浠ユ渶澶у瓧闀夸负瀹藉害
 		const widthList = props.data.list.map((item) =>
 			getTextWidth(item.title, {
-				size: fontSize.value,
+				size:'14px',
 			})
 		);
 		const maxWidth = Math.max(...widthList);
@@ -44,7 +56,6 @@
 	}
 });
 
-const fontSize = ref('14px');
 const selectValue = defineModel({
 	type: String,
 });
@@ -55,6 +66,6 @@
 </script>
 <style scoped lang="scss">
 :deep(.el-input) {
-	font-size: v-bind(fontSize);
+	font-size: 14px;
 }
 </style>

--
Gitblit v1.9.3