无人机管理后台前端(已迁走)
张含笑
2025-07-18 e64e01d698c071cb4e904a7a6f6dbe25a5268c3a
src/views/job/components/SearchBox.vue
@@ -59,7 +59,7 @@
        </el-form-item>
        <el-form-item label="任务算法:" v-if="isExpand" class="taskAlgorithm">
          <TaskAlgorithmBusiness
            :setWidth="162"
            :setWidth="222"
            :showAlgorithm="true"
            @algorithmChange="algorithmChange"
          />
@@ -234,12 +234,15 @@
let checked = ref('today');
let timeClick = (item, index) => {
  checked.value = item;
  // dateRange.value = dateRanges[item];
  dateRange.value = [];
  // emit('change', dateRanges[item],timeListEnum[index]);
  searchForm.date_enum = timeListEnum[index];
  handleSearch();
  if (checked.value === item){
    checked.value = null
    searchForm.date_enum = undefined
  }else{
    checked.value = item
    searchForm.date_enum = timeListEnum[index]
  }
  dateRange.value = []
  handleSearch()
};
// 搜索
const handleSearch = () => {
@@ -265,18 +268,8 @@
  emit('search', params);
};
const handleDateChange = val => {
  if (val && val.length === 2) {
    const start = dayjs(val[0]);
    const end = dayjs(val[1]);
    const diff = end.diff(start, 'day');
    if (diff > 31) {
      ElMessage.warning('日期范围不能超过31天');
      dateRange.value = [];
      return;
    }
  }
  handleSearch();
  checked.value = null
  searchForm.date_enum = undefined
};
// 重置
@@ -302,7 +295,7 @@
// watch(
//   () => store.state.task.jumpTask,
//   newVal => {
//     if (newVal && Object.keys(newVal).length) {
//       // 兼容当日任务 计划任务 历史任务传参
//       if (newVal.clickValue) {
@@ -343,7 +336,7 @@
    const date = dayjs(calendarday.value).format(timeFormat);
    const dateArray = [date, date];
    dateRange.value = dateArray;
  }
    // 查询一次
@@ -451,6 +444,7 @@
    .el-form-item {
      margin-bottom: 0;
      width: 233px;
         margin-right: 20px;
      .el-form-item__label {
        color: #363636;