From f58f07875461b7cc8205978cf4f0fac86564df72 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 20 十二月 2023 17:49:01 +0800
Subject: [PATCH] 新增调试下载环信码功能

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

diff --git a/src/components/search-option/FYOptionTime.vue b/src/components/search-option/FYOptionTime.vue
index fdea90c..b55bb6b 100644
--- a/src/components/search-option/FYOptionTime.vue
+++ b/src/components/search-option/FYOptionTime.vue
@@ -1,7 +1,8 @@
 <template>
   <el-form-item label="鏃堕棿">
     <el-date-picker
-      v-model="selectedOptions"
+      :model-value="value"
+      @change="handleChange"
       type="month"
       placeholder="閫夋嫨鏃堕棿"
       style="width: 150px"
@@ -10,9 +11,9 @@
 </template>
 
 <script>
-import dayjs from 'dayjs'
+import dayjs from 'dayjs';
 
-const MONTH = 'month'
+const MONTH = 'month';
 
 export default {
   props: {
@@ -30,40 +31,25 @@
   },
   emits: ['update:value'],
   data() {
-    return {
-      selectedOptions: ''
-    }
-  },
-  watch: {
-    selectedOptions: {
-      handler(nVal, oVal) {
-        if (nVal != oVal) {
-          this.$emit('update:value', nVal)
-        }
-      }
-    },
-    value: {
-      handler(nVal, oVal) {
-        if (nVal != oVal) {
-          this.selectedOptions = nVal
-        }
-      }
-    }
+    return {};
   },
   methods: {
+    handleChange(value) {
+      this.$emit('update:value', value);
+    },
     timeFormat() {
       switch (this.type) {
         case MONTH:
-          return 'YYYY-MM'
+          return 'YYYY-MM';
         default:
-          return 'YYYY-MM'
+          return 'YYYY-MM';
       }
     }
   },
   mounted() {
     if (this.initValue) {
-      this.selectedOptions = new Date()
+      this.handleChange(new Date());
     }
   }
-}
+};
 </script>

--
Gitblit v1.9.3