riku
2024-08-23 1788c96aea9247cc36ef8b82734997f1a6a92fb4
src/components/search/SearchBar.vue
@@ -8,8 +8,17 @@
          :type="formSearch.type"
          v-model="formSearch.deviceCode"
        ></OptionDevice>
        <OptionTime v-model="formSearch.timeArray"></OptionTime>
        <el-button type="primary" class="el-button-custom" @click="handleClick">
        <OptionTime
          v-model="formSearch.timeArray"
          :start-date="dateRange[0]"
          :end-date="dateRange[1]"
        ></OptionTime>
        <el-button
          :loading="loading"
          type="primary"
          class="el-button-custom"
          @click="handleClick"
        >
          分析
        </el-button>
      </el-form>
@@ -21,16 +30,19 @@
// 搜索框
export default {
  props: {
    loading: Boolean,
    searchTime: Array
  },
  data() {
    return {
      mission: {},
      mission: undefined,
      formSearch: {
        type: '',
        deviceCode: '',
        timeArray: []
      }
      },
      // 可选日期范围,根据走航任务决定
      dateRange: []
    };
  },
  emits: ['search'],
@@ -46,8 +58,16 @@
          new Date(nV.startTime),
          new Date(nV.endTime)
        ];
        this.dateRange = [new Date(nV.startTime), new Date(nV.endTime)];
        this.formSearch.type = nV.deviceType;
        this.formSearch.deviceCode = nV.deviceCode;
        // 代表首次进入界面,此时自动执行首个任务的数据查询操作
        if (oV == undefined) {
          setTimeout(() => {
            this.handleClick();
          }, 500);
        }
      }
    }
  },
@@ -58,7 +78,7 @@
  }
};
</script>
<style lang="scss">
<style scoped lang="scss">
.map-date-selector {
  display: inline-block;
  position: relative;
@@ -72,4 +92,9 @@
.p-events-auto {
}
.el-form-item {
  margin-bottom: 0px;
  margin-right: 8px !important;
}
</style>