From dc4ba8076aebd30f33282121a414262b4d4919f4 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 09 九月 2024 10:40:34 +0800
Subject: [PATCH] 1. 编写设备匹配功能

---
 src/components/search-option/FYOptionTime.vue |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/src/components/search-option/FYOptionTime.vue b/src/components/search-option/FYOptionTime.vue
index 18ccb34..ac1292c 100644
--- a/src/components/search-option/FYOptionTime.vue
+++ b/src/components/search-option/FYOptionTime.vue
@@ -1,9 +1,9 @@
 <template>
   <el-form-item label="鏃堕棿" :prop="prop">
     <el-date-picker
-      :model-value="value"
+      v-model="date"
       @change="handleChange"
-      type="month"
+      :type="type"
       placeholder="閫夋嫨鏃堕棿"
       style="width: 150px"
     />
@@ -14,6 +14,7 @@
 import dayjs from 'dayjs';
 
 const MONTH = 'month';
+const DATE = 'date';
 
 export default {
   props: {
@@ -32,24 +33,21 @@
   },
   emits: ['update:value'],
   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';
-      }
-    }
   },
   mounted() {
     if (this.initValue) {
-      this.handleChange(new Date());
+      this.date = new Date()
+      this.handleChange(this.date);
     }
   }
 };

--
Gitblit v1.9.3