From 4c846958fd4046b7a125224c759ae7ae0af673fa Mon Sep 17 00:00:00 2001
From: WX <1377869194@qq.com>
Date: 星期三, 30 八月 2023 14:13:10 +0800
Subject: [PATCH] 需求修改完成

---
 src/components/dateTimePicker.vue |   56 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 51 insertions(+), 5 deletions(-)

diff --git a/src/components/dateTimePicker.vue b/src/components/dateTimePicker.vue
index 54ee125..86b28a8 100644
--- a/src/components/dateTimePicker.vue
+++ b/src/components/dateTimePicker.vue
@@ -88,15 +88,15 @@
     const store = useStore();
 
     let selectform = reactive({
-      value: "",
+      value: null,
       fetch: "",
       start: 0,
-      end: 30,
+      end: 0,
     });
     let btnState = false;
     let CS = {
       start: 0,
-      end: 30,
+      end: 0,
       Classify: "",
     };
     const selectBtn = () => {
@@ -130,6 +130,13 @@
         }
 
         emit("changeTime", { data: newTimeStr, week: week });
+        CS.start = selectform.start;
+        CS.end = selectform.end;
+        CS.Classify = selectform.fetch;
+        if (selectform.start > selectform.end) {
+          CS.start = selectform.end;
+          CS.end = selectform.start;
+        }
         if (props.tpData == "d21") {
           menuTool.createFC("sj", newTimeStr);
         } else if (props.tpData == "d22") {
@@ -144,7 +151,6 @@
       }
     };
     function FQselectBtn() {
-      selectform.value = "";
       CS.start = selectform.start;
       CS.end = selectform.end;
       CS.Classify = selectform.fetch;
@@ -154,13 +160,53 @@
       }
       if (props.tpData == "d22") {
         CS.Classify = "West";
-        menuTool.createFC("fc", "", CS);
       } else if (props.tpData == "d23") {
         CS.Classify = "East";
+      }
+      if (btnState) {
+        menuTool.createFC("sj", selectform.value, CS);
+      } else {
         menuTool.createFC("fc", "", CS);
       }
     }
     function changeTime() {}
+    watch(
+      () => selectform.value,
+      (nVal, oVal) => {
+        if (nVal == null) {
+          btnState = false;
+        } else {
+          btnState = true;
+        }
+      },
+
+      { deep: true }
+    );
+    watch(
+      () => props.tpData,
+      (nVal, oVal) => {
+        if (nVal == "d22") {
+          selectform.start = 20;
+          selectform.end = 25;
+          selectform.value = null;
+        } else if (nVal == "d23") {
+          selectform.start = 13;
+          selectform.end = 19;
+          selectform.value = null;
+        }
+      },
+
+      { deep: true }
+    );
+    onMounted(() => {
+      if (props.tpData == "d22") {
+        selectform.start = 20;
+        selectform.end = 25;
+      } else if (props.tpData == "d23") {
+        selectform.start = 13;
+        selectform.end = 19;
+      }
+    });
     return {
       selectBtn,
       changeTime,

--
Gitblit v1.9.3