| | |
| | | @cancel="isShowFlightRouteInfo = false" |
| | | /> |
| | | </u-form> |
| | | <u-button @click="submitForm" color="#1D6FE9">飞行申请</u-button> |
| | | <u-button :disabled="isSubmitDisabled" @click="submitForm" color="#1D6FE9">飞行申请</u-button> |
| | | <!-- 飞任务类型 --> |
| | | <view class="attention"> |
| | | 注:新增空域/航线/飞手等前往吉安市低空经济服务一体化 |
| | |
| | | </view> |
| | | </template> |
| | | <script setup> |
| | | import { flightPlanSaveApi, flightRoutePageInfoApi, aircraftInfoPageInfoOfMyApi, pilotInfoPageInfoOfMyApi, flightAirspacePageInfoApi, uploadFileApi } from '@/api/index' |
| | | import { flightPlanSaveApi, |
| | | flightRoutePageInfoApi, |
| | | aircraftInfoPageInfoOfMyApi, |
| | | pilotInfoPageInfoOfMyApi, |
| | | droneFlightTaskApi, |
| | | uploadFileApi, |
| | | flightTaskApi,flightRulesApi,flightModeApi,flightPlanApi |
| | | } from '@/api/index' |
| | | import { ref, computed, onMounted } from 'vue' |
| | | import dayjs from 'dayjs' |
| | | |
| | |
| | | planType: '', // 计划类型 |
| | | planTypeText: '', // 计划类型文本 |
| | | contactPerson: '', // 联系人 |
| | | contactPhon: '', // 联系人电话 |
| | | contactPhone: '', // 联系人电话 |
| | | undertaker: '', // 承办人 |
| | | undertakerPhone: '', // 承办人电话 |
| | | timeRange: '', // 时间范围 |
| | |
| | | contactPerson: [ |
| | | { required: true, message: '请输入联系人', trigger: 'blur' } |
| | | ], |
| | | contactPhon: [ |
| | | contactPhone: [ |
| | | // 验证手机号码 |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | const reg = /^1[3456789]\d{9}$/ |
| | | if (!reg.test(value)) { |
| | | callback(new Error('请输入正确的手机号码')) |
| | | } else { |
| | | callback() |
| | | } |
| | | }, |
| | | trigger: 'blur' |
| | | }, |
| | | { required: true, message: '请输入联系人电话', trigger: 'blur' } |
| | | ], |
| | | undertaker: [ |
| | | { required: true, message: '请输入承办人', trigger: 'blur' } |
| | | ], |
| | | undertakerPhone: [ |
| | | // 验证手机号码 |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | const reg = /^1[3456789]\d{9}$/ |
| | | if (!reg.test(value)) { |
| | | callback(new Error('请输入正确的手机号码')) |
| | | } else { |
| | | callback() |
| | | } |
| | | }, |
| | | trigger: 'blur' |
| | | }, |
| | | { required: true, message: '请输入承办人联系电话', trigger: 'blur' } |
| | | ], |
| | | startTime: [ |
| | |
| | | }) |
| | | // 任务类型 |
| | | const isShowFlightTaskType = ref(false) |
| | | const actionsFlightTaskType = [ |
| | | { |
| | | label: '警务', |
| | | value: '警务', |
| | | }, |
| | | { |
| | | label: '文旅', |
| | | value: '文旅', |
| | | }, |
| | | { |
| | | label: '航拍', |
| | | value: '航拍', |
| | | }, |
| | | { |
| | | label: '物流', |
| | | value: '物流', |
| | | }, |
| | | { |
| | | label: '巡检', |
| | | value: '巡检', |
| | | }, |
| | | { |
| | | label: '植保', |
| | | value: '植保', |
| | | }, |
| | | ] |
| | | const actionsFlightTaskType = ref([]) |
| | | const onPickerFlightTaskType = (e) => { |
| | | const selected = e.value[0] |
| | | formParams.value.flightTaskType = selected.value |
| | |
| | | |
| | | // 飞行规则 |
| | | const isShowFlightRule = ref(false) |
| | | const actionsFlightRule = [ |
| | | { |
| | | label: '目视餡相飞行规则(VFR)', |
| | | value: '目视餡相飞行规则(VFR)', |
| | | }, |
| | | { |
| | | label: '仪表飞行规则(IFR)', |
| | | value: '仪表飞行规则(IFR)', |
| | | }, |
| | | ] |
| | | const actionsFlightRule = ref([]) |
| | | const onPickerFlightRule = (e) => { |
| | | const selected = e.value[0] |
| | | formParams.value.flightRule = selected.value |
| | |
| | | } |
| | | // 飞行方式 |
| | | const isShowFlightMode = ref(false) |
| | | const actionsFlightMode = [ |
| | | { |
| | | label: '视距内飞行 (VLOS)', |
| | | value: '视距内飞行 (VLOS)', |
| | | }, |
| | | { |
| | | label: '超视距飞行(BVLOS)', |
| | | value: '超视距飞行(BVLOS)', |
| | | }, |
| | | ] |
| | | const actionsFlightMode = ref([]) |
| | | const onPickerFlightMode = (e) => { |
| | | const selected = e.value[0] |
| | | formParams.value.flightMode = selected.value |
| | |
| | | } |
| | | // 计划类型 |
| | | const isShowPlanType = ref(false) |
| | | const actionsPlanType = [ |
| | | { |
| | | label: '一般', |
| | | value: '0', |
| | | }, |
| | | { |
| | | label: '紧急', |
| | | value: '1', |
| | | } |
| | | ] |
| | | const actionsPlanType = ref([]) |
| | | const onPickerPlanType = (e) => { |
| | | const selected = e.value[0] |
| | | formParams.value.planType = selected.value |
| | |
| | | const isShowAirspaceInfo = ref(false) |
| | | const airspaceInfoList = ref([]) |
| | | function getAirspaceInfo() { |
| | | flightAirspacePageInfoApi({ |
| | | droneFlightTaskApi({ |
| | | current: 1, |
| | | size: 1000, |
| | | }).then(res => { |
| | | airspaceInfoList.value = res.data.data.records.map(item => ({ |
| | | label: item.airspaceName || '暂无', |
| | | label: item.taskName || '暂无', |
| | | value: item.id, |
| | | })) |
| | | }) |
| | |
| | | current: 1, |
| | | size: 1000, |
| | | }).then(res => { |
| | | console.log(res.data.data, '0000') |
| | | flightRouteInfoList.value = res.data.data.records.map(item => ({ |
| | | label: item.name, |
| | | value: item.id, |
| | |
| | | }); |
| | | }); |
| | | }; |
| | | const isSubmitDisabled = ref(false) |
| | | // 提交表单 |
| | | const submitForm = async () => { |
| | | await formRef.value.validate() |
| | | |
| | | isSubmitDisabled.value = true |
| | | flightPlanSaveApi(formParams.value).then(res => { |
| | | if (res.data.code === 200) { |
| | | isSubmitDisabled.value = true |
| | | uni.showToast({ |
| | | title: '提交成功', |
| | | icon: 'success', |
| | |
| | | } |
| | | }) |
| | | } |
| | | // 获取任务类型 |
| | | function getTaskType() { |
| | | flightTaskApi().then(res => { |
| | | actionsFlightTaskType.value = res.data.data.map(item => ({ |
| | | ...item, |
| | | label: item.dictLabel || '暂无', |
| | | value: item.dictValue || '暂无', |
| | | })) |
| | | }) |
| | | } |
| | | // 获取飞行模式 |
| | | function getFlightMode() { |
| | | flightModeApi().then(res => { |
| | | actionsFlightMode.value = res.data.data.map(item => ({ |
| | | ...item, |
| | | label: item.dictLabel || '暂无', |
| | | value: item.dictValue || '暂无', |
| | | })) |
| | | }) |
| | | } |
| | | // 获取飞行规则 |
| | | function getFlightRules() { |
| | | flightRulesApi().then(res => { |
| | | actionsFlightRule.value = res.data.data.map(item => ({ |
| | | ...item, |
| | | label: item.dictLabel || '暂无', |
| | | value: item.dictValue || '暂无', |
| | | })) |
| | | }) |
| | | } |
| | | // 获取飞行计划 |
| | | function getFlightPlan() { |
| | | flightPlanApi().then(res => { |
| | | actionsPlanType.value = res.data.data.map(item => ({ |
| | | ...item, |
| | | label: item.dictLabel || '暂无', |
| | | value: item.dictValue || '暂无', |
| | | })) |
| | | }) |
| | | } |
| | | onMounted(() => { |
| | | // getProTypeApi() |
| | | getTaskType() |
| | | getFlightMode() |
| | | getFlightRules() |
| | | getFlightPlan() |
| | | getAircraftInfo() |
| | | getPilotInfo() |
| | | getAirspaceInfo() |