From 449084cb30b77ebb7ad77f1bb4cdc6942ff0d266 Mon Sep 17 00:00:00 2001
From: charlie <charlie@lvguanqingdeMacBook-Pro.local>
Date: 星期四, 20 一月 2022 16:33:25 +0800
Subject: [PATCH] update & fixbug:顧問結案頁面下拉icon樣式調整、必填項樣式、跑版修正

---
 PAMapp/components/Ui/UiTimePicker.vue |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/PAMapp/components/Ui/UiTimePicker.vue b/PAMapp/components/Ui/UiTimePicker.vue
index 3a13512..6803eae 100644
--- a/PAMapp/components/Ui/UiTimePicker.vue
+++ b/PAMapp/components/Ui/UiTimePicker.vue
@@ -6,7 +6,7 @@
         :clearable="false"
         :picker-options="pickerOptions"
         placeholder="������"
-        prefix-icon="icon-down"
+        prefix-icon="icon-down down-icon"
         value-format="timestamp"
         @change="changeTime"
     >
@@ -14,7 +14,7 @@
 </template>
 
 <script lang="ts">
-import { Component, Emit, Vue } from "nuxt-property-decorator";
+import { Component, Emit, Prop, Vue, Watch } from "nuxt-property-decorator";
 
 @Component
 export default class UiTimePicker extends Vue {
@@ -25,9 +25,22 @@
         end: '21:00'
     }
 
+    @Prop()
+    defaultValue!: string;
+
     @Emit('changeTime')
     changeTime() {
         return this.timeValue;
     }
+
+    @Watch('defaultValue', {immediate: true})
+    updateDefault() {
+        if (this.defaultValue) {
+            const hours = new Date(this.defaultValue).getHours();
+            const minutes = new Date(this.defaultValue).getMinutes();
+            this.timeValue = `${hours < 10 ? '0' + hours : hours}:${minutes < 10 ? '0' + minutes : minutes}`;
+            this.changeTime();
+        }
+    }
 }
 </script>
\ No newline at end of file

--
Gitblit v1.8.0