| | |
| | | clearable |
| | | filterable |
| | | :disabled="dialogMode !== 'add'" |
| | | @change="handleWorkOrderChange" |
| | | > |
| | | <el-option v-for="item in workOrderList" :key="item.id" :label="item.workOrderName" :value="item.id" /> |
| | | </el-select> |
| | |
| | | import { computed, ref, onMounted } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import { Plus, Delete } from '@element-plus/icons-vue' |
| | | import { getDictLabel } from '@ztzf/utils' |
| | | import { geomAnalysis, getDictLabel } from '@ztzf/utils' |
| | | import { gdPatrolTaskSaveApi, gdFlyerPageApi, gdPatrolTaskAuditApi } from './inspectionRequestApi' |
| | | import { gdWorkOrderPageApi } from '../orderManage/orderManageApi' |
| | | import { gdManageDeviceListApi } from '../orderManage/gdManageDeviceApi' |
| | |
| | | const routeOptions = inject('routeOptions') |
| | | |
| | | // 子任务列表 |
| | | const taskList = ref([initTaskRow(), initTaskRow(), initTaskRow(), initTaskRow(), initTaskRow()]) |
| | | const taskList = ref([initTaskRow()]) |
| | | |
| | | // 处理工单选择变化 |
| | | function handleWorkOrderChange(val) { |
| | |
| | | await getFlyerList(index, skilledTaskType) |
| | | } |
| | | |
| | | import * as turf from '@turf/turf' |
| | | |
| | | function getPolygonCenter(rawData) { |
| | | const coordinates = [rawData.map(p => [p.longitude, p.latitude])]; |
| | | const polygon = turf.polygon(coordinates); |
| | | const center = turf.centroid(polygon); |
| | | const [centerLon, centerLat] = center.geometry.coordinates; |
| | | return {longitude: centerLon, latitude: centerLat}; |
| | | } |
| | | |
| | | |
| | | // 获取飞手列表 |
| | | async function getFlyerList(index, skilledTaskType) { |
| | | const obj = getPolygonCenter(geomAnalysis(selectedWorkOrder.value.geom)) |
| | | const res = await gdFlyerPageApi({ |
| | | size: 999, |
| | | current: 1, |
| | | skilledTaskType, |
| | | longitude: obj.longitude || '', |
| | | latitude: obj.latitude || '', |
| | | }) |
| | | flyerListMap.value[index] = res?.data?.data?.records ?? [] |
| | | } |