| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="label">巡查任务类型</div> |
| | | <div class="val">{{ getDictLabel(formData.patrolTaskType, dictObj.workOrderType) }}</div> |
| | | <div class="val">{{ getDictLabelXT(formData.patrolTaskType, workOrderTypeXT) }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="label">任务执行时间</div> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="label">推荐飞手</div> |
| | | <div class="val">{{ formData.recommendFlyerName }}</div> |
| | | <div class="val">{{ getFlyerName(formData.deviceFlyerId) }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="label">选择设备</div> |
| | |
| | | <el-col :span="12"> |
| | | <div class="label">巡查任务描述</div> |
| | | <div class="val">{{ formData.taskDesc }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="label">算法</div> |
| | | <div class="val">{{ getAlgorithmNames(formData.algorithmIds) }}</div> |
| | | </el-col> |
| | | </el-row> |
| | | <template v-if="['6', '7', '8'].includes(taskStatus)"> |
| | |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in dictObj.workOrderType" |
| | | :key="item.dictKey" |
| | | :label="item.dictValue" |
| | | :value="item.dictKey" |
| | | v-for="item in workOrderTypeXT" |
| | | :key="item.dictValue" |
| | | :label="item.dictLabel" |
| | | :value="item.dictValue" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="推荐飞手" prop="recommendFlyerName"> |
| | | <el-form-item label="推荐飞手" prop="deviceFlyerId"> |
| | | <el-select |
| | | class="gd-select" |
| | | popper-class="gd-select-popper" |
| | | v-model="formData.recommendFlyerName" |
| | | v-model="formData.deviceFlyerId" |
| | | placeholder="请选择" |
| | | filterable |
| | | clearable |
| | | > |
| | | <el-option v-for="item in flyerList" :key="item.id" :label="item.flyerName" :value="item.flyerName" /> |
| | | <el-option v-for="item in flyerList" :key="item.id" :label="item.flyerName" :value="item.flyerId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联工单"> |
| | | <span>{{ getWorkOrderName(formData.workOrderId) }}</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- 算法下拉 --> |
| | | <el-col :span="12"> |
| | | <el-form-item label="算法" prop="algorithmIds"> |
| | | <el-tree-select |
| | | class="gd-select" |
| | | popper-class="gd-tree-select-popper" |
| | | v-model="formData.algorithmIds" |
| | | :data="algorithmTreeData" |
| | | :props="{ label: 'name', children: 'children', value: 'id' }" |
| | | node-key="id" |
| | | multiple |
| | | collapse-tags |
| | | collapse-tags-tooltip |
| | | check-strictly |
| | | filterable |
| | | clearable |
| | | placeholder="请选择" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <template #footer> |
| | | <template #footer v-if="detailLoaded"> |
| | | <el-button v-if="['1', '4', '7'].includes(taskStatus)" @click="viewDescription" color="#F2F3F5"> |
| | | {{ gdStatusObj[taskStatus].reason }} |
| | | </el-button> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed, ref, onMounted } from 'vue' |
| | | import { computed, ref, onMounted, inject } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import { fieldRules, flyVisual, getDictLabel, geomAnalysis } from '@ztzf/utils' |
| | | import { fieldRules, flyVisual, getDictLabel, getDictLabelXT, geomAnalysis } from '@ztzf/utils' |
| | | import { |
| | | gdPatrolTaskRepublish, |
| | | gdFlyerPageApi, |
| | |
| | | import { gdTaskResultListApi } from '@/views/orderView/orderManage/clueEvents/achievementApi' |
| | | import RefuseOrderDialog1 from '@/views/orderView/orderManage/inspectionRequest/RefuseOrderDialog1.vue' |
| | | import { Check } from '@element-plus/icons-vue' |
| | | import { queryAirById, airlineListApi } from '@/api/zkxt' |
| | | import { queryAirById, airlineListApi, algorithmGroupedApi } from '@/api/zkxt' |
| | | import * as Cesium from 'cesium' |
| | | import { useStore } from 'vuex' |
| | | |
| | |
| | | patrolTaskType: '', |
| | | executeTime: '', |
| | | patrolRouteUrl: '', |
| | | recommendFlyerName: '', |
| | | deviceFlyerId: null, |
| | | deviceId: null, |
| | | algorithmIds: [], |
| | | taskDesc: '', |
| | | workOrderId: null, |
| | | }) |
| | |
| | | const visible = defineModel() |
| | | const dialogMode = ref('view') |
| | | const submitting = ref(false) |
| | | const detailLoaded = ref(false) |
| | | const dialogReadonly = computed(() => dialogMode.value === 'view') |
| | | const titleEnum = ref({ edit: '编辑', view: '查看' }) |
| | | const taskStatus = computed(() => formData.value.taskStatus) |
| | |
| | | const getAirName = id => { |
| | | const item = routeOptions.value.find(item => item.id === id) |
| | | return item ? item.name : id |
| | | } |
| | | |
| | | const algorithmTreeData = ref([]) // 算法树形数据 |
| | | const workOrderTypeXT = inject('workOrderTypeXT', ref([])) |
| | | |
| | | // 获取算法分组数据 |
| | | async function getAlgorithmList() { |
| | | try { |
| | | const res = await algorithmGroupedApi() |
| | | const list = res?.data?.data ?? [] |
| | | algorithmTreeData.value = list.map(group => ({ |
| | | id: 'group_' + group.type, |
| | | name: group.type, |
| | | disabled: true, |
| | | children: (group.algorithms || []).map(alg => ({ |
| | | id: alg.id, |
| | | name: alg.name, |
| | | })) |
| | | })) |
| | | } catch (e) { |
| | | console.error('获取算法列表失败', e) |
| | | } |
| | | } |
| | | |
| | | // 根据 algorithmIds 数组获取算法名称,逗号分割回显 |
| | | function getAlgorithmNames(algorithmIds) { |
| | | if (!algorithmIds || !algorithmIds.length) return '' |
| | | const allAlgorithms = algorithmTreeData.value.flatMap(group => group.children || []) |
| | | return algorithmIds.map(id => { |
| | | const item = allAlgorithms.find(alg => alg.id === id) |
| | | return item ? item.name : id |
| | | }).join(', ') |
| | | } |
| | | |
| | | const gdStatusObj = { |
| | |
| | | patrolTaskType: fieldRules(true), |
| | | executeTime: fieldRules(true), |
| | | patrolRouteUrl: fieldRules(true), |
| | | recommendFlyerName: fieldRules(true), |
| | | deviceFlyerId: fieldRules(true), |
| | | deviceId: fieldRules(true), |
| | | } |
| | | |
| | |
| | | function getDeviceName(id) { |
| | | const item = deviceList.value.find(item => item.id === id) |
| | | return item ? item.nickname : id |
| | | } |
| | | |
| | | // 获取飞手名称 |
| | | function getFlyerName(id) { |
| | | const item = flyerList.value.find(item => item.flyerId === id) |
| | | return item ? item.flyerName : id |
| | | } |
| | | |
| | | // 获取工单名称 |
| | |
| | | |
| | | // 打开弹框 |
| | | async function open({ mode = 'view', row } = {}) { |
| | | detailLoaded.value = false |
| | | dialogMode.value = mode |
| | | |
| | | const res = await gdPatrolTaskDetailApi({ id: row.id }) |
| | | formData.value = { ...initForm(), ...res.data.data } |
| | | // 确保 algorithmIds 是数组 |
| | | if (formData.value.algorithmIds && typeof formData.value.algorithmIds === 'string') { |
| | | formData.value.algorithmIds = formData.value.algorithmIds.split(',').filter(Boolean) |
| | | } else if (!formData.value.algorithmIds) { |
| | | formData.value.algorithmIds = [] |
| | | } |
| | | detailLoaded.value = true |
| | | // 获取算法列表 |
| | | getAlgorithmList() |
| | | // 获取工单详情并根据geom范围获取航线列表 |
| | | await getWorkOrderDetail(formData.value.workOrderId) |
| | | ;['6', '7', '8'].includes(row.taskStatus) && await getTaskResultList() |