无人机管理后台前端(已迁走)
张含笑
2025-10-28 0f16db42e4e331bfaf084c27ca602c275e87668d
src/views/tickets/orderLog.vue
@@ -9,140 +9,150 @@
      >
        <basic-main-content>
          <!-- 查询条件筛选栏 -->
          <div class="filter-bar">
            <div class="search-bar-box">
              <div class="search-bar-box-item">
                <el-input
                  v-model="filters.key_word"
                  placeholder="输入工单编号/名称/内容/姓名"
                  clearable
                  @keyup.enter="handleSearch"
                />
              </div>
          <div class="ztzf-form-search">
            <el-form :model="filters" inline>
              <el-row :gutter="24">
                <el-col :span="4">
                  <el-form-item label="关键字:">
                    <el-input
                      v-model="filters.key_word"
                      placeholder="编号/名称/内容/姓名"
                      clearable
                      @keyup.enter="handleSearch"
                    />
                  </el-form-item>
              <!--              <div class="search-bar-box-item">-->
              <!--                <el-select placeholder="请选择所属单位" v-model="filters.create_dept" clearable>-->
              <!--                  <el-option v-for="dept in departments" :key="dept.value" :label="dept.label" :value="dept.value" />-->
              <!--                </el-select>-->
              <!--              </div>-->
                  <!--              <div class="search-bar-box-item">-->
                  <!--                <el-select placeholder="请选择所属单位" v-model="filters.create_dept" clearable>-->
                  <!--                  <el-option v-for="dept in departments" :key="dept.value" :label="dept.label" :value="dept.value" />-->
                  <!--                </el-select>-->
                  <!--              </div>-->
              <div class="search-bar-box-item">
                <el-date-picker
                  @change="handleSearch"
                  v-model="filters.dateRange"
                  type="daterange"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                  :default-value="datePickerDefaultVal"
                />
              </div>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="选择日期:">
                    <el-date-picker
                      @change="handleSearch"
                      v-model="filters.dateRange"
                      type="daterange"
                      range-separator="至"
                      start-placeholder="开始日期"
                      end-placeholder="结束日期"
                      :default-value="datePickerDefaultVal"
                    />
                  </el-form-item>
                </el-col>
                <el-col :span="4">
                  <el-form-item label="关联航线:">
                    <el-select
                      @change="handleSearch"
                      v-model="filters.file_id"
                      placeholder="请选择关联航线"
                      filterable
                      clearable
                    >
                      <el-option
                        v-for="item in wayLineList"
                        :key="item.wayline_id"
                        :label="item.name"
                        :value="item.wayline_id"
                      />
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="4">
                  <el-form-item label="关联算法:">
                    <el-select
                      @change="handleSearch"
                      v-model="filters.ai_types"
                      placeholder="关联算法"
                      clearable
                    >
                      <el-option
                        v-for="item in ai_types"
                        :key="item.dictKey"
                        :label="item.dictValue"
                        :value="item.dictKey"
                      />
                    </el-select>
                  </el-form-item>
              <div class="search-bar-box-item">
                <el-select
                  @change="handleSearch"
                  v-model="filters.file_id"
                  placeholder="请选择关联航线"
                  filterable
                  clearable
                >
                  <el-option
                    v-for="item in wayLineList"
                    :key="item.wayline_id"
                    :label="item.name"
                    :value="item.wayline_id"
                  />
                </el-select>
              </div>
                  <!-- <div class="search-bar-box-item">
                    <el-select v-model="filters.type" placeholder="请选择工单类型" clearable>
                      <el-option v-for="item in types" :key="item.dictValue" :label="item.dictValue"
                        :value="item.dictKey" />
                    </el-select>
                  </div> -->
              <div class="search-bar-box-item">
                <el-select
                  @change="handleSearch"
                  v-model="filters.ai_types"
                  placeholder="关联算法"
                  clearable
                >
                  <el-option
                    v-for="item in ai_types"
                    :key="item.dictKey"
                    :label="item.dictValue"
                    :value="item.dictKey"
                  />
                </el-select>
              </div>
              <!-- <div class="search-bar-box-item">
                <el-select v-model="filters.type" placeholder="请选择工单类型" clearable>
                  <el-option v-for="item in types" :key="item.dictValue" :label="item.dictValue"
                    :value="item.dictKey" />
                </el-select>
              </div> -->
              <div class="search-bar-box-item">
                <el-select
                  @change="handleSearch"
                  v-model="filters.status"
                  placeholder="请选择工单状态"
                  clearable
                  :disabled="activeTab !== 'all'"
                >
                  <el-option
                    v-for="item in statuses"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
              </div>
            </div>
            <div class="search-bar-box">
              <div class="search-bar-box-item flex-2">
                <el-date-picker
                  @change="handleSearch"
                  v-model="filters.cycleDateRange"
                  type="daterange"
                  range-separator="至"
                  start-placeholder="工单周期开始日期"
                  end-placeholder="工单周期结束日期"
                  :default-value="datePickerDefaultVal"
                />
              </div>
              <div class="search-bar-box-item">
                <el-select
                  @change="handleSearch"
                  v-model="filters.rep_fre_type"
                  placeholder="请选择频次"
                  clearable
                >
                  <el-option v-for="item in cycles" :key="item" :label="item" :value="item" />
                </el-select>
              </div>
              <div class="search-bar-box-item">
                <el-time-picker
                  @change="handleSearch"
                  v-model="filters.deal_time"
                  placeholder="请选择执行时间"
                  prop="deal_time"
                  value-format="HH:mm"
                  :picker-options="{
                </el-col>
                <el-col :span="4">
                  <el-form-item label="工单状态:">
                    <el-select
                      @change="handleSearch"
                      v-model="filters.status"
                      placeholder="请选择工单状态"
                      clearable
                      :disabled="activeTab !== 'all'"
                    >
                      <el-option
                        v-for="item in statuses"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                      />
                    </el-select>
                  </el-form-item>
                </el-col>
                </el-row>
                <el-row :gutter="24">
                  <el-col :span="8">
                    <el-form-item label="工单周期:">
                      <el-date-picker
                        @change="handleSearch"
                        v-model="filters.cycleDateRange"
                        type="daterange"
                        range-separator="至"
                        start-placeholder="工单周期开始日期"
                        end-placeholder="工单周期结束日期"
                        :default-value="datePickerDefaultVal"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item label="选择频次:">
                      <el-select
                        @change="handleSearch"
                        v-model="filters.rep_fre_type"
                        placeholder="请选择频次"
                        clearable
                      >
                        <el-option v-for="item in cycles" :key="item" :label="item" :value="item" />
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item label="执行时间:">
                      <el-time-picker
                        @change="handleSearch"
                        v-model="filters.deal_time"
                        placeholder="请选择执行时间"
                        prop="deal_time"
                        value-format="HH:mm"
                        :picker-options="{
                    selectableRange: '00:00 - 23:59',
                  }"
                />
              </div>
              <div class="search-bar-box-item"></div>
              <div class="search-bar-box-item"></div>
              <div class="search-bar-box-item search-btn">
                <el-button type="primary" icon="el-icon-search" @click="handleSearch"
                  >搜索</el-button
                >
                <el-button icon="el-icon-refresh" @click="handleReset">清空</el-button>
              </div>
            </div>
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-button type="primary" icon="el-icon-search" @click="handleSearch"
                    >搜索
                    </el-button
                    >
                    <el-button icon="el-icon-refresh" @click="handleReset">清空</el-button>
                  </el-col>
                </el-row>
            </el-form>
          </div>
          <!-- 表格部分 -->
@@ -178,10 +188,12 @@
                type="primary"
                icon="el-icon-plus"
                @click="handleAdd"
                >新建工单</el-button
              >新建工单
              </el-button
              >
              <el-button type="success" plain icon="el-icon-download" @click="exportData"
                >导出</el-button
              >导出
              </el-button
              >
            </template>
@@ -193,7 +205,8 @@
                    type="text"
                    icon="el-icon-view"
                    @click="handleCheckDetail(row)"
                    >审核</el-button
                  >审核
                  </el-button
                  >
                </template>
                <!-- v-if="
@@ -207,42 +220,50 @@
                    icon="el-icon-warning"
                    v-if="hasRecallPaddingBtnPermission()"
                    @click="orderLogRecall(row.id)"
                    >撤回</el-button
                  >撤回
                  </el-button
                  >
                  <!-- <el-button type="text" icon="el-icon-view" @click="handleViewDetail(row)">详情</el-button> -->
                </template>
                <!--已驳回-->
                <template v-if="row.status == 2">
                  <el-button type="text" icon="el-icon-warning" @click="rejectDetail(row.id)"
                    >驳回原因</el-button
                  >驳回原因
                  </el-button
                  >
                  <el-button
                    v-if="userInfo.user_id == row.create_user"
                    type="text"
                    icon="el-icon-view"
                    @click="handleViewDetail(row)"
                    >编辑</el-button
                  >编辑
                  </el-button
                  >
                  <el-button v-else type="text" icon="el-icon-view" @click="handleViewDetail(row)"
                    >详情</el-button
                  >详情
                  </el-button
                  >
                </template>
                <!-- 已通过 -->
                <template v-if="row.status == 3">
                  <el-button type="text" icon="el-icon-view" @click="handleViewDetail(row)"
                    >详情</el-button
                  >详情
                  </el-button
                  >
                </template>
                <!--草稿-->
                <template v-if="row.status == 0">
                  <el-button type="text" icon="el-icon-edit" @click="handleViewDetail(row)"
                    >编辑</el-button
                  >编辑
                  </el-button
                  >
                  <el-button type="text" icon="el-icon-position" @click="userPublishPush(row.id)"
                    >发布</el-button
                  >发布
                  </el-button
                  >
                  <el-button type="text" icon="el-icon-delete" @click="deleteOrderLog(row.id)"
                    >删除</el-button
                  >删除
                  </el-button
                  >
                </template>
              </div>
@@ -299,10 +320,10 @@
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="安全返航真高" prop="rth_altitude">
            <el-form-item label="安全返航真高" prop="rth_altitude" class="safe-height">
              <el-input-number
                v-model="form.rth_altitude"
                :min="30"
                :min="50"
                :max="300"
              ></el-input-number>
            </el-form-item>
@@ -394,13 +415,13 @@
          </el-col>
        </el-row>
<!--        <el-row>-->
<!--          <div class="add-box-btns">-->
<!--            <el-button type="danger" @click="submitForm(1)">发起</el-button>-->
<!--            <el-button type="primary" @click="submitForm(0)">存草稿</el-button>-->
<!--            <el-button @click="dialogVisible = false">取消</el-button>-->
<!--          </div>-->
<!--        </el-row>-->
        <!--        <el-row>-->
        <!--          <div class="add-box-btns">-->
        <!--            <el-button type="danger" @click="submitForm(1)">发起</el-button>-->
        <!--            <el-button type="primary" @click="submitForm(0)">存草稿</el-button>-->
        <!--            <el-button @click="dialogVisible = false">取消</el-button>-->
        <!--          </div>-->
        <!--        </el-row>-->
      </el-form>
      <template #footer>
        <div class="dialog-footer">
@@ -469,7 +490,7 @@
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
          <el-col :span="6">
            <el-form-item label="关联航线" prop="file_id">
              <el-select
                v-model="form.file_id"
@@ -485,6 +506,16 @@
                  :value="item.wayline_id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="安全返航真高" prop="rth_altitude" class="safe-height">
              <el-input-number
                :disabled="detailTitle === '工单详情'"
                v-model="form.rth_altitude"
                :min="50"
                :max="300"
              ></el-input-number>
            </el-form-item>
          </el-col>
        </el-row>
@@ -558,7 +589,8 @@
          <el-col :span="3">
            <el-time-picker
              style="width: 100px"
            class="timeStyle"
        :style="{width:pxToRem(140)}"
              v-model="form.deal_time"
              prop="deal_time"
              value-format="HH:mm"
@@ -599,14 +631,16 @@
            v-if="form.status == 0 || (form.status == 2 && userInfo.user_id == form.create_user)"
            @click="submitForm(1)"
            icon="el-icon-position"
          >发布</el-button
          >发布
          </el-button
          >
          <el-button
            type="primary"
            v-if="form.status == 0 || (form.status == 2 && userInfo.user_id == form.create_user)"
            @click="submitForm(0)"
            icon="el-icon-plus"
          >保存</el-button
          >保存
          </el-button
          >
          <!-- <el-button type="primary" v-if="form.status == 0 || userInfo.user_id == form.create_user"
                          @click="submitForm(0)">保存</el-button> -->
@@ -615,16 +649,18 @@
            type="primary"
            v-if="form.status == 1 && hasPaddingBtnPermission()"
            @click="orderLogPass(form.id)"
          >通过</el-button
          >通过
          </el-button
          >
          <el-button
            type="danger"
            v-if="form.status == 1 && hasRejectionBtnPermission()"
            @click="orderLogReject(form.id)"
          >驳回</el-button
          >驳回
          </el-button
          >
        </div>
        </template>
      </template>
    </el-dialog>
    <!-- 工单详情 -->
@@ -685,7 +721,7 @@
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
          <el-col :span="6">
            <el-form-item label="关联航线" prop="file_id">
              <el-select v-model="form.file_id" placeholder="请选择航线" :disabled="true">
                <el-option
@@ -695,6 +731,16 @@
                  :value="item.wayline_id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="安全返航真高" prop="rth_altitude" class="safe-height">
              <el-input-number
                :disabled="true"
                v-model="form.rth_altitude"
                :min="50"
                :max="300"
              ></el-input-number>
            </el-form-item>
          </el-col>
        </el-row>
@@ -800,39 +846,43 @@
      </el-form>
      <template #footer>
      <div class="dialog-footer">
        <el-button
          type="danger"
          v-if="form.status == 0 || (form.status == 2 && userInfo.user_id == form.create_user)"
          @click="submitForm(1)"
          icon="el-icon-position"
        >发布</el-button
        >
        <!-- <el-button type="primary" v-if="form.status == 0 || userInfo.user_id == form.create_user"
                        @click="submitForm(0)">保存</el-button> -->
        <div class="dialog-footer">
          <el-button
            type="danger"
            v-if="form.status == 0 || (form.status == 2 && userInfo.user_id == form.create_user)"
            @click="submitForm(1)"
            icon="el-icon-position"
          >发布
          </el-button
          >
          <!-- <el-button type="primary" v-if="form.status == 0 || userInfo.user_id == form.create_user"
                          @click="submitForm(0)">保存</el-button> -->
        <el-button
          type="primary"
          v-if="form.status == 1 && hasPaddingBtnPermission()"
          @click="orderLogPass(form.id)"
          icon="el-icon-check"
        >通过</el-button
        >
        <el-button
          type="danger"
          v-if="form.status == 1 && hasRejectionBtnPermission()"
          @click="orderLogReject(form.id)"
          icon="el-icon-close"
        >驳回</el-button
        >
        <el-button @click="detailVisibleCopy = false" icon="el-icon-circle-close">取消</el-button>
      </div>
        </template>
          <el-button
            type="primary"
            v-if="form.status == 1 && hasPaddingBtnPermission()"
            @click="orderLogPass(form.id)"
            icon="el-icon-check"
          >通过
          </el-button
          >
          <el-button
            type="danger"
            v-if="form.status == 1 && hasRejectionBtnPermission()"
            @click="orderLogReject(form.id)"
            icon="el-icon-close"
          >驳回
          </el-button
          >
          <el-button @click="detailVisibleCopy = false" icon="el-icon-circle-close">取消</el-button>
        </div>
      </template>
    </el-dialog>
  </basic-container>
</template>
<script>
import { pxToRem, pxToRemNum } from '@/utils/rem'
import { calculateDefaultRange } from '@/utils/util';
import {
  getList,
@@ -844,11 +894,11 @@
  orderLogExport,
  jobStatusNum,
  userPublish,
  deleteOrderLog,
  deleteOrderLog
} from '@/api/tickets/orderLog';
import { getTicketInfo } from '@/api/tickets/ticket';
import { getDictionaryByCode } from '@/api/system/dictbiz';
import { getWaylineFileListByArea } from '@/api/resource/wayline';
import { getWaylineFileListByArea, newGetWorkspacesPage } from '@/api/resource/wayline';
import { export_json_to_excel } from '@/utils/exportExcel';
import { getFlyingNestBy } from '@/api/device/device';
import { mapGetters } from 'vuex';
@@ -861,9 +911,13 @@
import weekday from 'dayjs/plugin/weekday';
import elTooltipCopy from '@/components/ElTooltipCopy.vue';
import { CircleClose, Promotion, Select } from '@element-plus/icons-vue';
import { useStore } from 'vuex';
import _ from 'lodash';
// const store = useStore()
dayjs.extend(weekday);
dayjs.locale('zh-cn');
// const lastHeight = computed(() => store.state.common.lastHeight)
export default {
  components: { elTooltipCopy },
@@ -871,13 +925,13 @@
  data() {
    return {
      activeTab: 'all',
      getlastHeight: 0,
      tabs: [
        { label: '全部工单', name: 'all', value: null, count: 0 },
        { label: '待审核', name: 'WAIT_AUDIT', value: 1, count: 0 },
        { label: '已驳回', name: 'REJECTED', value: 2, count: 0 },
        { label: '已通过', name: 'PASS', value: 3, count: 0 },
        { label: '草稿', name: 'DRAFT', value: 0, count: 0 },
        { label: '草稿', name: 'DRAFT', value: 0, count: 0 }
      ],
      filters: {
        key_word: '',
@@ -887,7 +941,7 @@
        file_id: '',
        ai_types: [],
        status: '',
        dateRange: [],
        dateRange: []
      },
      departments: [],
      types: [],
@@ -901,7 +955,7 @@
        { label: '草稿', value: '0' },
        { label: '待审核', value: '1' },
        { label: '已驳回', value: '2' },
        { label: '已通过', value: '3' },
        { label: '已通过', value: '3' }
      ],
      //周期
      cycles: ['每天', '周一', '周二', '周三', '周四', '周五', '周六', '周末', '周天', '工作日'],
@@ -913,7 +967,7 @@
        indexLabel: '序号',
        indexFixed: true,
        align: 'center',
        align: 'left',
        border: true,
        stripe: false,
        searchShow: true,
@@ -938,7 +992,7 @@
          {
            label: '工单编号',
            prop: 'job_info_num',
            width: 150,
            width: 150
          },
          {
            label: '工单名称',
@@ -946,47 +1000,47 @@
            width: 100,
            ellipsis: true,
            overHidden: true,
            showOverflowTooltip: true,
            showOverflowTooltip: true
          },
          {
            label: '工单状态',
            prop: 'status',
            width: 88,
            showOverflowTooltip: true,
            showOverflowTooltip: true
          },
          {
            label: '所属单位',
            prop: 'dept_name',
            ellipsis: true,
            showOverflowTooltip: true,
            showOverflowTooltip: true
          },
          {
            label: '创建时间',
            prop: 'create_time',
            width: 144,
            ellipsis: true,
            showOverflowTooltip: true,
            showOverflowTooltip: true
          },
          {
            label: '已执行次数',
            prop: 'job_num',
            width: 70,
            ellipsis: true,
            showOverflowTooltip: true,
            showOverflowTooltip: true
          },
          {
            label: '工单内容',
            prop: 'content',
            ellipsis: true,
            overHidden: true,
            showOverflowTooltip: true,
            showOverflowTooltip: true
          },
          {
            label: '关联航线',
            prop: 'wayline_name',
            ellipsis: true,
            overHidden: true,
            showOverflowTooltip: true,
            showOverflowTooltip: true
          },
          {
            label: '关联算法',
@@ -994,7 +1048,7 @@
            width: 100,
            ellipsis: true,
            overHidden: true,
            showOverflowTooltip: true,
            showOverflowTooltip: true
          },
          {
            label: '关联机巢',
@@ -1002,7 +1056,7 @@
            width: 100,
            ellipsis: true,
            overHidden: true,
            showOverflowTooltip: true,
            showOverflowTooltip: true
          },
          {
@@ -1011,7 +1065,7 @@
            width: 96,
            ellipsis: true,
            overHidden: true,
            showOverflowTooltip: true,
            showOverflowTooltip: true
          },
          // {
          //   label: '关联机巢', prop: 'device_names', width: 112, ellipsis: true, overHidden: true,
@@ -1024,16 +1078,16 @@
            formatter: row => this.formatCycleTime(row),
            html: true,
            ellipsis: true,
            showOverflowTooltip: true,
            showOverflowTooltip: true
            // overHidden: true
          },
        ],
          }
        ]
      },
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
        total: 0
      },
      dialogVisible: false,
      detailVisible: false,
@@ -1042,24 +1096,24 @@
      rules: {
        name: [
          { required: true, message: '请输入工单名称', trigger: 'blur' },
          { max: 100, message: '工单名称不能超过100个字', trigger: 'blur' },
          { max: 100, message: '工单名称不能超过100个字', trigger: 'blur' }
        ],
        file_id: [{ required: true, message: '需要选择航线', trigger: 'change' }],
        device_sns: [{ required: true, message: '请选择机巢', trigger: 'change' }],
        content: [
          { required: true, message: '请输入工单内容', trigger: 'blur' },
          { max: 255, message: '工单内容不能超过255个字', trigger: 'blur' },
          { max: 255, message: '工单内容不能超过255个字', trigger: 'blur' }
        ],
        date_range: [{ required: true, message: '请选择时间不能为空', trigger: 'blur' }],
        rep_fre_type: [{ required: true, message: '请选择周期', trigger: 'blur' }],
        deal_time: [{ required: true, message: '请选择执行时间', trigger: 'blur' }],
        deal_time: [{ required: true, message: '请选择执行时间', trigger: 'blur' }]
      },
      loading: false,
      globalCounts: {},
      mapLoaded: false,
      // 配置时间选择器默认配置
      datePickerDefaultVal: calculateDefaultRange(),
      datePickerDefaultVal: calculateDefaultRange()
    };
  },
  async created() {
@@ -1073,7 +1127,7 @@
    const { dept_data, event_type, ai_type } = response2.data.data;
    this.departments = dept_data.map(item => ({
      label: item.dept_name,
      value: item.id,
      value: item.id
    }));
  },
  mounted() {
@@ -1092,9 +1146,13 @@
  },
  computed: {
    CircleClose() {
      return CircleClose
      return CircleClose;
    },
    ...mapGetters(['userInfo', 'permission']),
    lastHeight() {
      const height = this.$store.state.common.lastHeight;
      return Number(height) || 0; // 确保是数字类型
    },
    filteredTabs() {
      // rejection_and_draft 权限控制“已驳回”和“草稿”tab
      // console.log(this.permission, '权限信息')
@@ -1111,7 +1169,7 @@
          return { ...tab, isShow: true };
        })
        .filter(tab => tab.isShow);
    },
    }
  },
  methods: {
@@ -1243,7 +1301,7 @@
        rep_fre_type: this.filters.rep_fre_type || undefined,
        deal_time: this.filters.deal_time || undefined,
        current: this.page.currentPage,
        size: this.page.pageSize,
        size: this.page.pageSize
      };
      return params;
    },
@@ -1269,43 +1327,57 @@
              return this.$message.warning('任务时间不能小于当前时间');
            }
          }
          const maxItem = this.form.device_map_infos.reduce((max, item) => {
            return item.drone_height > max.drone_height ? item : max;
          });
          console.log(maxItem.drone_height, '高度');
          console.log(this.lastHeight, '最后一点高度');
          let result = _.round((maxItem.drone_height + this.form.rth_altitude), 2);
          const submitData = {
            ...this.form,
            status: status,
            ai_types: this.form.ai_types?.length ? this.form.ai_types : [],
          };
          // 判断该值this.form.date_range[0] 周几 和rep_fre_type 是不是相等
          // if (this.form.deal_time) {
          //    const weekday = dayjs(this.form.date_range[0]).format('dddd');
          //    console.log('444', weekday)
          //   //  form.rep_fre_type
          //   const now = new Date()
          //   const today = now.toDateString()
          //   const selectedDate = new Date(this.form.date_range[0]).toDateString()
          let resultHeight = this.lastHeight - maxItem.drone_height
          let resultH = _.round(resultHeight, 2)
          //   if (today === selectedDate) {
          //     const [hours, minutes] = this.form.deal_time.split(':')
          //     const selectedTime = new Date()
          //     selectedTime.setHours(parseInt(hours), parseInt(minutes))
          if (this.lastHeight > result) {
            this.$confirm(`当前返航高度存在安全隐患,建议调整为${resultH}米以上后进行发布`, '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(async () => {
              const submitData = {
                ...this.form,
                status: status,
                ai_types: this.form.ai_types?.length ? this.form.ai_types : []
              };
              await saveUpdateOrderLog(submitData);
              let id = this.form.id;
              if (id) {
                this.$message.success('工单发布成功');
              } else {
                this.$message.success('工单创建成功');
              }
              this.dialogVisible = false;
              this.detailVisible = false;
              (this.device_sns = []), (this.wayLineList = []), this.fetchTableData();
            }).catch(() => {
          //     if (selectedTime < now) {
          //       return this.$message.warning('任务时间不能小于当前时间')
          //     }
          //   }
          // }
          await saveUpdateOrderLog(submitData);
          let id = this.form.id;
          if (id) {
            this.$message.success('工单发布成功');
            });
          } else {
            this.$message.success('工单创建成功');
            const submitData = {
              ...this.form,
              status: status,
              ai_types: this.form.ai_types?.length ? this.form.ai_types : []
            };
            await saveUpdateOrderLog(submitData);
            let id = this.form.id;
            if (id) {
              this.$message.success('工单发布成功');
            } else {
              this.$message.success('工单创建成功');
            }
            this.dialogVisible = false;
            this.detailVisible = false;
            (this.device_sns = []), (this.wayLineList = []), this.fetchTableData();
          }
          this.dialogVisible = false;
          this.detailVisible = false;
          (this.device_sns = []), (this.wayLineList = []), this.fetchTableData();
        }
      });
    },
@@ -1316,10 +1388,10 @@
      this.$confirm(data.remark, '驳回原因', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        type: 'warning'
      }).then(() => {
        this.form = {
          ...response.data.data,
          ...response.data.data
        };
        // this.detailVisible = true
        this.handleViewDetail(data);
@@ -1338,7 +1410,7 @@
        0: '草稿',
        1: '待审核',
        2: '已驳回',
        3: '已通过',
        3: '已通过'
      };
      return statusTextMap[status] || '未知状态';
    },
@@ -1349,7 +1421,7 @@
        2: 'info',
        3: 'primary',
        4: 'success',
        5: 'danger',
        5: 'danger'
      };
      return statusMap[status] || 'info';
    },
@@ -1381,7 +1453,7 @@
        department: '',
        type: '',
        dateRange: [],
        status: '',
        status: ''
      };
      this.page.currentPage = 1;
      this.fetchTableData();
@@ -1397,7 +1469,7 @@
        DRAFT: 0,
        WAIT_AUDIT: 0,
        REJECTED: 0,
        PASS: 0,
        PASS: 0
      };
      var reponse = await jobStatusNum();
      // console.log('统计' + reponse.data.data)
@@ -1411,6 +1483,7 @@
    handleAdd() {
      this.form = {};
      this.form.rth_altitude = 120;
      this.dialogVisible = true;
      this.$nextTick(() => {
@@ -1432,7 +1505,7 @@
        location: '',
        address: '',
        content: '',
        photos: [],
        photos: []
      };
      if (this.$refs.testform) {
        this.$refs.testform.resetFields();
@@ -1449,7 +1522,7 @@
      const response = await orderLogDetails(row.id);
      const data = response.data.data;
      this.form = {
        ...data,
        ...data
      };
      // 更新机巢列表
@@ -1485,7 +1558,7 @@
      const response = await orderLogDetails(row.id);
      const data = response.data.data;
      this.form = {
        ...data,
        ...data
      };
      // 更新航线列表,追加 wayline_file_region_vo 数据
      // 更新航线列表,追加 wayline_file_region_vo 数据
@@ -1511,7 +1584,7 @@
      this.$confirm('是否智飞工单数据?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        type: 'warning'
      }).then(() => {
        NProgress.start();
        let params = this.getQueryParam();
@@ -1548,7 +1621,7 @@
      this.$confirm('确定发布吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        type: 'warning'
      }).then(() => {
        let response = userPublish(id);
        this.$message.success('发布成功');
@@ -1561,7 +1634,7 @@
      this.$confirm('确定删除吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        type: 'warning'
      }).then(() => {
        let response = deleteOrderLog(id);
        this.$message.success('删除');
@@ -1573,13 +1646,21 @@
    },
    //获取航线列表
    async asyncgetWaylineFileListByArea(name) {
      var wayLineListResponse = await getWaylineFileListByArea(this.userInfo.detail.areaCode);
      this.wayLineList = wayLineListResponse.data.data;
      const formData = {
        name: '',
        waylineType: undefined,
        current: 1,
        size: 99999999,
        descs: 'update_time'
      };
      var wayLineListResponse = await newGetWorkspacesPage(formData);
      this.wayLineList = wayLineListResponse.data.data.records;
      this.initMapLine();
    },
    initMapLine(infos = {}, cb = () => {}) {
    initMapLine(infos = {}, cb = () => {
    }) {
      let currentLine = this.wayLineList.find(item => item.wayline_id == this.form.file_id);
      if (!currentLine) return;
@@ -1592,7 +1673,7 @@
            }?_t=${new Date().getTime()}`,
            type: currentLine.wayline_type,
            cb,
            infos,
            infos
          });
        }
      });
@@ -1608,12 +1689,11 @@
      this.initMapLine({}, async polygon => {
        const currentLine = that.wayLineList.find(item => item.wayline_id === waylineId);
        //按照航线来
        const params = {
          type: [2, 4, 5].includes(currentLine.wayline_type) ? 2 : 0,
          type: ['2', '4', '5'].includes(currentLine.wayline_type) ? 2 : 0,
          wayline_id: waylineId,
          polygon,
          polygon
        };
        var wayLineListResponse = await getFlyingNestBy(params);
        // 再赋值
@@ -1626,7 +1706,7 @@
      this.$confirm('确定撤回则到草稿箱。', '是否撤回?', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        type: 'warning'
      }).then(async () => {
        let reposne = await orderLogRecall(id);
        this.handleSearch();
@@ -1656,7 +1736,7 @@
    async orderLogReject(id) {
      this.$prompt('', '驳回原因', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        cancelButtonText: '取消'
      }).then(async ({ value }) => {
        let response = await orderLogReject(id, value);
        let data = response.data.data;
@@ -1668,27 +1748,32 @@
        this.page.currentPage = 1;
        this.onLoad(this.page, this.query);
      });
    },
    }
  },
  watch: {
    // lastHeight(newVal, oldVal) {
    //   console.log('lastHeight', newVal, oldVal);
    //   this.getlastHeight = newVal;
    // },
    tableData: {
      handler() {
        // this.updateTabCounts()
      },
      deep: true,
    },
  },
      deep: true
    }
  }
};
</script>
<style lang="scss" scoped>
:deep(.el-input-number) {
  width: 200px;
}
:deep(.el-form-item__label) {
  width: 100px !important;
}
//:deep(.el-input-number) {
//  width: 200px;
//}
//:deep(.el-form-item__label) {
//  width: 100px !important;
//}
::v-deep(.el-tabs) {
  height: 100%;
  display: flex;
@@ -1886,6 +1971,15 @@
  justify-content: center;
}
.safe-height {
  :deep(.el-form-item__label) {
    width: 120px !important;
  }
  :deep(.el-input-number) {
    width: 180px !important;
  }
}
.flex {
  display: flex;
}