From 58c0f11fe2f23a1be2dec768f9ac02107301a634 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 19 九月 2025 17:30:36 +0800
Subject: [PATCH] 2025.9.19 数据产品(待完成)

---
 src/components/search-option/FYOptionTime.vue |   41 ++++++++++++++++++++++++++---------------
 1 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/src/components/search-option/FYOptionTime.vue b/src/components/search-option/FYOptionTime.vue
index b55bb6b..9008260 100644
--- a/src/components/search-option/FYOptionTime.vue
+++ b/src/components/search-option/FYOptionTime.vue
@@ -1,11 +1,14 @@
 <template>
-  <el-form-item label="鏃堕棿">
+  <el-form-item :label="label" :prop="prop">
     <el-date-picker
-      :model-value="value"
+      v-model="date"
       @change="handleChange"
-      type="month"
+      :type="type"
       placeholder="閫夋嫨鏃堕棿"
+      start-placeholder="閫夋嫨寮�濮嬫椂闂�"
+      end-placeholder="閫夋嫨缁撴潫鏃堕棿"
       style="width: 150px"
+      v-bind="$attrs"
     />
   </el-form-item>
 </template>
@@ -14,6 +17,9 @@
 import dayjs from 'dayjs';
 
 const MONTH = 'month';
+const DATE = 'date';
+const RANGE = 'datetimerange';
+const RANGE2 = 'daterange';
 
 export default {
   props: {
@@ -22,33 +28,38 @@
       default: MONTH
     },
     // 杩斿洖缁撴灉
-    value: Date,
+    value: Date || Array,
     // 鏄惁榛樿杩斿洖鍒濆閫夐」
     initValue: {
       type: Boolean,
       default: true
+    },
+    label: {
+      type: String,
+      default: '鏃堕棿'
+    },
+    prop: {
+      type: String,
+      default: 'time'
     }
   },
-  emits: ['update:value'],
+  emits: ['update:value', 'change'],
   data() {
-    return {};
+    return {
+      date: this.value
+    };
   },
+  computed: {},
   methods: {
     handleChange(value) {
       this.$emit('update:value', value);
-    },
-    timeFormat() {
-      switch (this.type) {
-        case MONTH:
-          return 'YYYY-MM';
-        default:
-          return 'YYYY-MM';
-      }
+      this.$emit('change', value);
     }
   },
   mounted() {
     if (this.initValue) {
-      this.handleChange(new Date());
+      this.date = new Date();
+      this.handleChange(this.date);
     }
   }
 };

--
Gitblit v1.9.3