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 |   81 +++++++++++++++++++++++++++++++++++-----
 1 files changed, 71 insertions(+), 10 deletions(-)

diff --git a/src/components/dateTimePicker.vue b/src/components/dateTimePicker.vue
index cc37748..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: 0,
     });
     let btnState = false;
     let CS = {
-      start: "",
-      end: "",
+      start: 0,
+      end: 0,
       Classify: "",
     };
     const selectBtn = () => {
@@ -130,10 +130,20 @@
         }
 
         emit("changeTime", { data: newTimeStr, week: week });
-        if (props.tpData == "d2") {
-          if (!btnState) {
-            return ElMessage.error("璇峰厛閫夋嫨椋庡尯");
-          }
+        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") {
+          CS.Classify = "West";
+          menuTool.createFC("sj", newTimeStr, CS);
+        } else if (props.tpData == "d23") {
+          CS.Classify = "East";
           menuTool.createFC("sj", newTimeStr, CS);
         } else {
           menuTool.createWRW("sj", newTimeStr);
@@ -141,8 +151,6 @@
       }
     };
     function FQselectBtn() {
-      btnState = true;
-      selectform.value = "";
       CS.start = selectform.start;
       CS.end = selectform.end;
       CS.Classify = selectform.fetch;
@@ -150,9 +158,55 @@
         CS.start = selectform.end;
         CS.end = selectform.start;
       }
-      menuTool.createFC("fc", "", CS);
+      if (props.tpData == "d22") {
+        CS.Classify = "West";
+      } 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,
@@ -213,6 +267,13 @@
         color: #ffffff;
         padding-right: 10px;
       }
+      i {
+        font-size: 24px;
+        font-weight: 400;
+        color: #ffffff;
+        padding-right: 10px;
+        padding-left: 10px;
+      }
       :deep(.el-date-editor) {
         height: 64px;
       }

--
Gitblit v1.9.3