燕山石化溯源三维电子沙盘-【前端】-Web
WX
2023-08-30 4c846958fd4046b7a125224c759ae7ae0af673fa
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;
      }