| | |
| | | <!-- 飞行活动申请 --> |
| | | <template> |
| | | <view class="flightApplication-add"> |
| | | <view class="title"> |
| | | 基本信息 |
| | | </view> |
| | | <u-form labelPosition="top" :model="formParams" :rules="rules" ref="formRef"> |
| | | <view class="title form-title">基本信息</view> |
| | | <u-form-item |
| | | label="飞行计划" |
| | | labelWidth="200rpx" |
| | |
| | | > |
| | | <u-input v-model="formParams.flightEndTime" border="none" suffixIcon="calendar"></u-input> |
| | | </u-form-item> |
| | | |
| | | |
| | | <u-form-item |
| | | label="计划类型" |
| | | labelWidth="200rpx" |
| | |
| | | </view> |
| | | </template> |
| | | <script setup> |
| | | import { flightPlanSaveApi, |
| | | flightRoutePageInfoApi, |
| | | aircraftInfoPageInfoOfMyApi, |
| | | pilotInfoPageInfoOfMyApi, |
| | | flightAirspacePageInfoApi, |
| | | uploadFileApi, |
| | | flightTaskApi,flightRulesApi,flightModeApi,flightPlanApi,flightPlanDetailsApi |
| | | import { |
| | | flightPlanDetailsApi, |
| | | flightRoutePageInfoApi, |
| | | aircraftInfoPageInfoOfMyApi, |
| | | pilotInfoPageInfoOfMyApi, |
| | | flightAirspacePageInfoApi, |
| | | } from '@/api/index' |
| | | import { ref, computed, onMounted } from 'vue' |
| | | import dayjs from 'dayjs' |
| | | |
| | | // 获取store中的数据 字典 |
| | | import { useAppStore, useUserStore } from "@/store"; |
| | | const appStore = useAppStore() |
| | | |
| | | const formRef = ref(null); |
| | | const formParams = ref({}) |
| | | const rules = ref({}) |
| | | // 任务类型 |
| | | const isShowFlightTaskType = ref(false) |
| | | const actionsFlightTaskType = ref([]) |
| | | |
| | | const actionsFlightTaskType = ref(appStore.getTaskType) |
| | | |
| | | // 飞行规则 |
| | | const isShowFlightRule = ref(false) |
| | | const actionsFlightRule = ref([]) |
| | | const actionsFlightRule = ref(appStore.getFlightRules) |
| | | |
| | | // 飞行方式 |
| | | const isShowFlightMode = ref(false) |
| | | const actionsFlightMode = ref([]) |
| | | const actionsFlightMode = ref(appStore.getFlightMode) |
| | | |
| | | // 计划类型 |
| | | const isShowPlanType = ref(false) |
| | | const actionsPlanType = ref([]) |
| | | const actionsPlanType = ref(appStore.getFlightPlan) |
| | | |
| | | // 是否显示开始时间选择器 |
| | | const isShowStartTime = ref(false) |
| | | // 是否显示结束时间选择器 |
| | | const isShowEndTime = ref(false) |
| | | const startTime = ref(Date.now()); // 设置默认值为当前时间戳 |
| | | const endTime = ref(Date.now()); // 设置默认值为当前时间戳 |
| | | // const startTime = ref(Date.now()); // 设置默认值为当前时间戳 |
| | | // const endTime = ref(Date.now()); // 设置默认值为当前时间戳 |
| | | |
| | | const onConfirmStartTime = (e) => { |
| | | formParams.value.flightStartTime = dayjs(e.value).format('YYYY-MM-DD HH:mm:ss') |
| | | isShowStartTime.value = false |
| | | } |
| | | const onConfirmEndTime = (e) => { |
| | | formParams.value.flightEndTime = dayjs(e.value).format('YYYY-MM-DD HH:mm:ss') |
| | | isShowEndTime.value = false |
| | | } |
| | | // const onConfirmStartTime = (e) => { |
| | | // formParams.value.flightStartTime = dayjs(e.value).format('YYYY-MM-DD HH:mm:ss') |
| | | // isShowStartTime.value = false |
| | | // } |
| | | // const onConfirmEndTime = (e) => { |
| | | // formParams.value.flightEndTime = dayjs(e.value).format('YYYY-MM-DD HH:mm:ss') |
| | | // isShowEndTime.value = false |
| | | // } |
| | | |
| | | |
| | | |
| | | // 获取飞行器信息 |
| | | const isShowAircraftInfo = ref(false) |
| | | // const isShowAircraftInfo = ref(false) |
| | | const aircraftInfoList = ref([]) |
| | | function getAircraftInfo() { |
| | | aircraftInfoPageInfoOfMyApi({ |
| | |
| | | })) |
| | | }) |
| | | } |
| | | const onPickerAircraftInfo = (e) => { |
| | | const selected = e.value[0] |
| | | formParams.value.aircraftId = selected.value |
| | | formParams.value.aircraftText = selected.label |
| | | isShowAircraftInfo.value = false |
| | | } |
| | | // const onPickerAircraftInfo = (e) => { |
| | | // const selected = e.value[0] |
| | | // formParams.value.aircraftId = selected.value |
| | | // formParams.value.aircraftText = selected.label |
| | | // isShowAircraftInfo.value = false |
| | | // } |
| | | // 获取飞手信息 |
| | | const isShowPilotInfo = ref(false) |
| | | const pilotInfoList = ref([]) |
| | | function getPilotInfo() { |
| | | pilotInfoPageInfoOfMyApi({ |
| | |
| | | }) |
| | | } |
| | | // 获取空域信息 |
| | | const isShowAirspaceInfo = ref(false) |
| | | const airspaceInfoList = ref([]) |
| | | function getAirspaceInfo() { |
| | | flightAirspacePageInfoApi({ |
| | |
| | | }) |
| | | } |
| | | // 获取航线信息 |
| | | const isShowFlightRouteInfo = ref(false) |
| | | const flightRouteInfoList = ref([]) |
| | | function getFlightRouteInfo() { |
| | | flightRoutePageInfoApi({ |
| | |
| | | }) |
| | | } |
| | | |
| | | // 获取任务类型 |
| | | function getTaskType() { |
| | | flightTaskApi().then(res => { |
| | | actionsFlightTaskType.value = res.data.data.map(item => ({ |
| | | ...item, |
| | | label: item.dictLabel || '暂无', |
| | | value: item.dictCode || '暂无', |
| | | })) |
| | | }) |
| | | } |
| | | // 获取飞行模式 |
| | | function getFlightMode() { |
| | | flightModeApi().then(res => { |
| | | actionsFlightMode.value = res.data.data.map(item => ({ |
| | | ...item, |
| | | label: item.dictLabel || '暂无', |
| | | value: item.dictCode || '暂无', |
| | | })) |
| | | }) |
| | | } |
| | | // 获取飞行规则 |
| | | function getFlightRules() { |
| | | flightRulesApi().then(res => { |
| | | actionsFlightRule.value = res.data.data.map(item => ({ |
| | | ...item, |
| | | label: item.dictLabel || '暂无', |
| | | value: item.dictCode || '暂无', |
| | | })) |
| | | }) |
| | | } |
| | | // 获取飞行计划 |
| | | function getFlightPlan() { |
| | | flightPlanApi().then(res => { |
| | | actionsPlanType.value = res.data.data.map(item => ({ |
| | | ...item, |
| | | label: item.dictLabel || '暂无', |
| | | value: item.dictCode || '暂无', |
| | | })) |
| | | }) |
| | | } |
| | | |
| | | onLoad((options) => { |
| | | flightPlanDetailsApi(options.id).then(res => { |
| | | console.log(res.data.data, '789') |
| | | // return |
| | | formParams.value = res.data.data |
| | | formParams.value.routeId = res.data.data.routeInfo.name |
| | | formParams.value.airspaceId = res.data.data.airspaceInfo.taskName |
| | | formParams.value.aircraftId = res.data.data.airspaceInfo.aircraftInfoList.map(item => item.name).join(',') |
| | | formParams.value.pilotId = res.data.data.operatorInfoList.map(item => item.name).join(',') |
| | | formParams.value.flightRule = actionsFlightRule.value.find(item => item.dictValue === res.data.data.flightRule)?.dictLabel || '' |
| | | formParams.value.flightMode = actionsFlightMode.value.find(item => item.dictValue === res.data.data.flightMode)?.dictLabel || '' |
| | | formParams.value.planType = actionsPlanType.value.find(item => item.dictValue === res.data.data.planType)?.dictLabel || '' |
| | | formParams.value.flightTaskType = actionsFlightTaskType.value.find(item => item.dictValue === res.data.data.flightTaskType)?.dictLabel || '' |
| | | const result = res.data.data |
| | | formParams.value = result |
| | | formParams.value.routeId = result.routeInfo.name |
| | | formParams.value.airspaceId = result.airspaceInfo.taskName || '无' |
| | | formParams.value.aircraftId = result.airspaceInfo.aircraftInfoList.map(item => item.name).join(',') || '无' |
| | | formParams.value.pilotId = result.operatorInfoList.map(item => item.name).join(',') || '无' |
| | | // 字典 |
| | | formParams.value.flightRule = actionsFlightRule.value.find(item => item.dictValue === result.flightRule)?.dictLabel || '无' |
| | | formParams.value.flightMode = actionsFlightMode.value.find(item => item.dictValue === result.flightMode)?.dictLabel || '无' |
| | | formParams.value.planType = actionsPlanType.value.find(item => item.dictValue === result.planType)?.dictLabel || '无' |
| | | formParams.value.flightTaskType = actionsFlightTaskType.value.find(item => item.dictValue === result.flightTaskType)?.dictLabel || '无' |
| | | }) |
| | | }) |
| | | onMounted(() => { |
| | | getTaskType() |
| | | getFlightMode() |
| | | getFlightRules() |
| | | getFlightPlan() |
| | | // getAircraftInfo() |
| | | // getPilotInfo() |
| | | // getAirspaceInfo() |
| | | // getFlightRouteInfo() |
| | | getAircraftInfo() |
| | | getPilotInfo() |
| | | getAirspaceInfo() |
| | | getFlightRouteInfo() |
| | | }) |
| | | </script> |
| | | <style scoped lang="scss"> |
| | |
| | | .select-wrapper { |
| | | position: relative; |
| | | width: 100%; |
| | | |
| | | |
| | | .select-icon { |
| | | position: absolute; |
| | | right: 20rpx; |
| | |
| | | border-radius: 8rpx; |
| | | padding: 0 20rpx; |
| | | background-color: #f5f5f5; |
| | | |
| | | |
| | | &::placeholder { |
| | | font-family: Source Han Sans CN, Source Han Sans CN; |
| | | font-weight: 400; |
| | |
| | | color: #D2D2D2; |
| | | } |
| | | } |
| | | |
| | | |
| | | .clickable-input { |
| | | width: 100%; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | |
| | | :deep(.u-form-item__label) { |
| | | margin-bottom: 20rpx; |
| | | // font-weight: bold; |
| | |
| | | font-size: 30rpx; |
| | | color: #222324; |
| | | } |
| | | |
| | | |
| | | :deep(.u-form-item__required) { |
| | | color: #FF2600; |
| | | margin-right: 8rpx; |