Merge branch 'master' of http://139.196.74.78:10010/r/jagzwxm/ja_web
11 files modified
2 files added
| | |
| | | data |
| | | }) |
| | | } |
| | | |
| | | // 我的空域查询 |
| | | export const droneFlightTaskApi = data => { |
| | | return request({ |
| | | url: `/webservice/droneFlightTask/pageInfoOfMy`, |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | } |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import LeafletMap from '@/appComponents/LeafletMap/index.vue' |
| | | import LeafletMap from '@/appComponents/LeafletMap/indexWX.vue' |
| | | import SearchBar from './searchBar.vue' |
| | | import { useRoute } from 'vue-router' |
| | | const route = useRoute() |
| | |
| | | |
| | | <van-list v-else :finished="finished" :finished-text="finishedText"> |
| | | <div class="list-item" v-for="item in list" :key="item" @click="flyToAddress(item)"> |
| | | <div class="name">{{ item.airspaceName }}</div> |
| | | <div class="name">{{ item.taskName }}</div> |
| | | <div class="item"> |
| | | <div class="laber">空域管制时间</div> |
| | | <div class="value">{{item.createTime}}</div> |
| | | <div class="value"> |
| | | <div>{{item.plannedStartTime}}</div> |
| | | <div>{{item.plannedEndTime}}</div> |
| | | </div> |
| | | </div> |
| | | <div class="item"> |
| | | <div class="laber">空域管制类型</div> |
| | |
| | | import { showToast } from 'vant' |
| | | import _ from 'lodash' |
| | | import { searchWithPlugin } from '@/utils/util' |
| | | import { getAirspaceDetail } from '@/api/map/address' |
| | | import { droneFlightTaskApi } from '@/api/map/address' |
| | | import { useStore } from 'vuex' |
| | | import EventBus from '@/utils/eventBus' |
| | | import { gcj02ToWgs84 } from '@/utils/coordinateTransformation' |
| | |
| | | |
| | | // 使用新接口搜索地址 |
| | | const searchWithNewAPI = () => { |
| | | // 获取微信小程序带过来的头部参数 |
| | | console.log(route.query, '9999') |
| | | // 构建请求参数,搜索框为空时不传递airspaceName |
| | | const params = { |
| | | current: 1, |
| | | size: 9999 |
| | | size: 10, |
| | | taskName: route.query.taskName || '', |
| | | status: '', |
| | | // id: route.query.id || '', |
| | | } |
| | | if (searchVal.value.trim() !== '') { |
| | | params.airspaceName = searchVal.value |
| | | params.taskName = searchVal.value |
| | | } |
| | | |
| | | getAirspaceDetail(params).then(res => { |
| | | droneFlightTaskApi(params).then(res => { |
| | | const data = res.data.data.records || [] |
| | | if (data && data.length > 0) { |
| | | list.value = data |
| | |
| | | }) |
| | | } |
| | | |
| | | // 我的空域查询 |
| | | export const droneFlightTaskApi = data => { |
| | | return request({ |
| | | url: `/webservice/droneFlightTask/pageInfoOfMy`, |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | } |
| | | |
| | | // 设备列表 |
| | | export const aircraftInfoPageInfoOfMyApi = data => { |
| | | return request({ |
| | |
| | | }) |
| | | } |
| | | |
| | | // 我的设备 |
| | | export const myDevicePageInfoApi = params => { |
| | | return request({ |
| | | url: `/webservice/aircraftInfo/queryById/${params.id}`, |
| | | method: 'post', |
| | | params, |
| | | }) |
| | | } |
| | | // // 我的设备 |
| | | // export const myDevicePageInfoApi = params => { |
| | | // return request({ |
| | | // url: `/webservice/aircraftInfo/queryById/${params.id}`, |
| | | // method: 'post', |
| | | // params, |
| | | // }) |
| | | // } |
| | | |
| | | // 飞行申请列表 |
| | | export const flightPlanPageInfoApi = data => { |
| | |
| | | data, |
| | | }) |
| | | } |
| | | // 飞行申请详情 |
| | | export const flightPlanDetailsApi = id => { |
| | | return request({ |
| | | url: `/webservice/flightPlan/queryById/${id}`, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // 航空器注册 |
| | | export const aircraftInfoSaveApi = data => { |
| | |
| | | url: `/webservice/aircraftInfo/save`, |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | } |
| | | // 注册器详情 |
| | | export const aircraftInfoDetailsApi = id => { |
| | | return request({ |
| | | url: `/webservice/aircraftInfo/queryById/${id}`, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // 下拉接口数据-飞行类型 |
| | | export const proTypeApi = () => { |
| | | return request({ |
| | | url: `/system/dict/data/type/pro_type`, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | // 申报 警务 文旅 |
| | | export const flightTaskApi = () => { |
| | | return request({ |
| | | url: `/system/dict/data/type/flight_task`, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | // 飞行规则 |
| | | export const flightRulesApi = () => { |
| | | return request({ |
| | | url: `/system/dict/data/type/flight_rules`, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | // 飞行规则 视距内飞行 |
| | | export const flightModeApi = () => { |
| | | return request({ |
| | | url: `/system/dict/data/type/flight_mode`, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | // 飞行计划 一般 紧急 |
| | | export const flightPlanApi = () => { |
| | | return request({ |
| | | url: `/system/dict/data/type/flight_plan`, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // 无人机厂商 |
| | | export const manufacturerInfoApi = data => { |
| | | return request({ |
| | | url: `/webservice/webservice/manufacturerInfo/pageInfo`, |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | }, |
| | | { |
| | | "path": "flightApplication/details", |
| | | "style": { |
| | | "navigationBarTitleText": "飞行详情" |
| | | } |
| | | }, |
| | | { |
| | | "path": "deviceRegistration/add", |
| | | "style": { |
| | | "navigationBarTitleText": "飞行器注册" |
| | | } |
| | | }, |
| | | { |
| | | "path": "deviceRegistration/details", |
| | | "style": { |
| | | "navigationBarTitleText": "飞行器详情" |
| | | } |
| | | }, |
| | | { |
| | | "path": "regulationsDetail/details", |
| | | "style": { |
| | | "navigationBarTitleText": "详情" |
| | |
| | | <view class="content"> |
| | | <view class="title">飞行设备</view> |
| | | <u-list :style="{ height: 'calc(100vh - 160rpx)' }" @scrolltolower="scrolltolower" :lower-threshold="50"> |
| | | <view class="card" v-for="(item, index) in equipmentList" :key="index"> |
| | | <view class="card" v-for="(item, index) in equipmentList" :key="index" @click="handleClick(item)"> |
| | | <view class="left"> |
| | | <u-image :src="droneSvg" mode="aspectFill" :width="70" :height="90"></u-image> |
| | | </view> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { reactive, ref } from 'vue' |
| | | import { onHide, onShow, onLoad } from "@dcloudio/uni-app"; |
| | | import lbPng from '@/static/images/lb.png' |
| | | import addSvg from '@/static/images/add.png' |
| | | import droneSvg from '@/static/images/drone.png' |
| | | import { myDevicePageInfoApi, aircraftInfoPageInfoOfMyApi } from '@/api/index.js' |
| | | import { aircraftInfoPageInfoOfMyApi } from '@/api/index.js' |
| | | const equipmentList = ref([]) |
| | | const noticeTitle = ref('') |
| | | const formParams = ref({ |
| | |
| | | console.error('获取设备列表失败:', error) |
| | | } |
| | | } |
| | | // 我的设备详情 |
| | | const getMyDeviceDetail = async (id) => { |
| | | try { |
| | | const res = await myDevicePageInfoApi({ id }) |
| | | if (res.code === 200) { |
| | | // 处理设备详情数据 |
| | | } |
| | | } catch (error) { |
| | | console.error('获取我的设备详情失败:', error) |
| | | } |
| | | // 设备详情 |
| | | const handleClick = (item) => { |
| | | uni.navigateTo({ |
| | | url: '/subPackages/deviceRegistration/details?id=' + item.id, |
| | | }) |
| | | } |
| | | |
| | | // 新增设备 |
| | | const addEquipment = () => { |
| | | uni.navigateTo({ |
| | | url: '/subPackages/deviceRegistration/add', |
| | | }) |
| | | } |
| | | |
| | | function scrolltolower() { |
| | | formParams.value.current++ |
| | | // 停止不刷新 |
| | |
| | | } |
| | | getEquipmentList() |
| | | } |
| | | onMounted(() => { |
| | | // onMounted(() => { |
| | | // getEquipmentList() |
| | | // }) |
| | | onShow(() => { |
| | | // 每次页面显示时重置为第一页并重新加载数据 |
| | | formParams.value.current = 1 |
| | | getEquipmentList() |
| | | }) |
| | | </script> |
| | |
| | | import flfgPng from '@/static/images/flfg.png' |
| | | import zczdPng from '@/static/images/zczd.png' |
| | | import docSvg from '@/static/images/doc.png' |
| | | import { sysNoticePageInfoApi, flightAirspacePageInfoApi } from '@/api/index' |
| | | import { sysNoticePageInfoApi, droneFlightTaskApi } from '@/api/index' |
| | | const lbList = reactive([]); |
| | | // lbPng 轮播图 5次 |
| | | for (let i = 0; i < 5; i++) { |
| | |
| | | // 获取空域信息列表 |
| | | async function getFlightAirspaceList() { |
| | | try { |
| | | const res = await flightAirspacePageInfoApi({ |
| | | const res = await droneFlightTaskApi({ |
| | | current: 1, |
| | | size: 10, |
| | | }) |
| | | announcementList.value = res.data.data.records.slice(0, 3).map(item => ({ |
| | | ...item, |
| | | title: item.airspaceName, |
| | | title: item.taskName, |
| | | description: item.remark, |
| | | time: item.createTime, |
| | | num: item.num, |
| | |
| | | // 跳转到空域信息详情页 |
| | | function airspaceClick(item) { |
| | | uni.navigateTo({ |
| | | url: '/subPackages/regulationsDetail/details?id=' + item.id, |
| | | url: '/subPackages/airspaceInformation/index?taskName=' + item.taskName, |
| | | }) |
| | | } |
| | | // 跳转到法律政策详情页 |
| | |
| | | <script setup> |
| | | import { getWebViewUrl } from "@/utils/index.js"; |
| | | import WebViewPlus from "@/components/WebViewPlus.vue"; |
| | | import { onHide, onShow } from "@dcloudio/uni-app"; |
| | | import { onHide, onShow, onLoad } from "@dcloudio/uni-app"; |
| | | // const viewUrl = getWebViewUrl("/defaultMap"); |
| | | |
| | | let envParam = ""; |
| | |
| | | // #endif |
| | | |
| | | const updateKey = ref(0); |
| | | const viewUrl = computed(() => { |
| | | return getWebViewUrl("/airMap", { |
| | | isWeb: envParam, |
| | | updateKey: updateKey.value, |
| | | }); |
| | | }); |
| | | const viewUrl = ref('') |
| | | // computed(() => { |
| | | // return getWebViewUrl("/airMap", { |
| | | // isWeb: envParam, |
| | | // updateKey: updateKey.value, |
| | | // }); |
| | | // }); |
| | | |
| | | const onPostMessage = (data) => { |
| | | // #ifdef MP-WEIXIN |
| | | if (data.type === "scanCode") { |
| | | } else if (data.type === "jumpAddWork") { |
| | | } else if (data.type === "jumpMapNav") { |
| | | //事件导航 |
| | | } else if (data.type === "workid") { |
| | | //事件详情 |
| | | } |
| | | // #endif |
| | | |
| | | // #ifndef MP-WEIXIN |
| | | if (data.type === "scanCode") { |
| | | uni.navigateTo({ |
| | | url: "/subPackages/qrCode/index", |
| | | }); |
| | | } else if (data.type === "jumpAddWork") { |
| | | //新建任务 |
| | | const encodedData = encodeURIComponent(JSON.stringify(data.rowItem)); |
| | | uni.setStorageSync("webview_params", encodedData); |
| | | uni.navigateTo({ |
| | | url: `/subPackages/taskDetail/addTask/index`, |
| | | }); |
| | | } else if (data.type === "jumpMapNav") { |
| | | //事件导航 |
| | | uni.navigateTo({ |
| | | url: `/subPackages/workDetail/mapWork/index?currentItem=${data.eventNum}`, |
| | | }); |
| | | } else if (data.type === "workid") { |
| | | //事件详情 |
| | | uni.navigateTo({ |
| | | url: `/subPackages/workDetail/index?eventNum=${data.eventNum}`, |
| | | }); |
| | | } |
| | | // #endif |
| | | console.log('4444', data) |
| | | }; |
| | | |
| | | onShow(() => { |
| | | // #ifndef MP-WEIXIN |
| | | onShow(() => {}); |
| | | |
| | | // #endif |
| | | }); |
| | | onLoad((queryParams) => { |
| | | viewUrl.value = getWebViewUrl("/airMap", { |
| | | taskName: queryParams.taskName || '', |
| | | }); |
| | | }) |
| | | |
| | | onHide(() => { |
| | | updateKey.value = updateKey.value + 1; |
| | |
| | | <u-form-item |
| | | label="持有人" |
| | | labelWidth="200rpx" |
| | | prop="aircraftName" |
| | | prop="holder" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input |
| | | v-model="formParams.aircraftName" |
| | | v-model="formParams.holder" |
| | | border="none" |
| | | placeholder="请输入" |
| | | ></u-input> |
| | |
| | | @cancel="isShowRegion = false" |
| | | ></u-cascader> |
| | | </u-form> |
| | | <u-button @click="submitForm" color="#1D6FE9">提交</u-button> |
| | | <u-button :disabled="isSubmitDisabled" @click="submitForm" color="#1D6FE9">提交</u-button> |
| | | <!-- <u-button class="submit-button-wrapper" color="#1D6FE9" size="large" @click="submitForm"> |
| | | 注册 |
| | | </u-button> --> |
| | | </view> |
| | | </template> |
| | | <script setup> |
| | | import { aircraftInfoSaveApi,uploadFileApi,areaDataApi } from '@/api/index' |
| | | import { aircraftInfoSaveApi,uploadFileApi, areaDataApi, proTypeApi, manufacturerInfoApi } from '@/api/index' |
| | | import { ref, computed, onMounted } from 'vue' |
| | | import dayjs from 'dayjs' |
| | | |
| | |
| | | // 所属区域确认 |
| | | const onRegionConfirm = (e) => { |
| | | console.log(e,'888') |
| | | formParams.value.region = e?.join(',')[2] || '' // 用逗号分隔的区域码 |
| | | formParams.value.region = e[2] || '' // 用逗号分隔的区域码 |
| | | // 通过arrRegion的数组值为[36,3608,360824] 从areaData里面反查出名称 |
| | | const regionNames = findRegionNamesByCodes(e, areaData.value) |
| | | console.log(regionNames, '77777') |
| | | formParams.value.regionText = regionNames.join('-') || '' // 用连字符连接的区域名称 |
| | | isShowRegion.value = false |
| | | isShowRegion.value = false |
| | | } |
| | | // 是否有保险 |
| | | const actionsHasInsurance = ref([ |
| | |
| | | } |
| | | // 飞行器厂商 |
| | | const showManufacturer = ref(false); |
| | | const manufacturerList = ref([ |
| | | { |
| | | label: 'A厂商', |
| | | value: 'A厂商' |
| | | }, |
| | | { |
| | | label: 'B厂商', |
| | | value: 'B厂商' |
| | | }, |
| | | ]) |
| | | const manufacturerList = ref([]) |
| | | // 选择飞行器厂商 |
| | | const onPickerConfirmManufacturer = (e) => { |
| | | const selected = e.value[0] |
| | |
| | | } |
| | | // 飞行器型号 |
| | | const showType = ref(false); |
| | | const typeList = ref([ |
| | | { |
| | | label: 'A型号', |
| | | value: 'A型号' |
| | | }, |
| | | { |
| | | label: 'B型号', |
| | | value: 'B型号' |
| | | }, |
| | | ]) |
| | | const typeList = ref([]) |
| | | // 选择飞行器型号 |
| | | const onPickerConfirmType = (e) => { |
| | | const selected = e.value[0] |
| | |
| | | }); |
| | | } |
| | | // 提交表单 |
| | | const isSubmitDisabled = ref(false) |
| | | const submitForm = async () => { |
| | | try { |
| | | if (await formRef.value.validate()) { |
| | | isSubmitDisabled.value = true |
| | | const res = await aircraftInfoSaveApi(formParams.value) |
| | | if (res.data.code === 200) { |
| | | isSubmitDisabled.value = false |
| | | uni.showToast({ |
| | | title: '航空器注册成功', |
| | | icon: 'success' |
| | |
| | | // 这里可以添加额外的失败处理逻辑 |
| | | } |
| | | } |
| | | // 获取飞行器类型 |
| | | function getProTypeApi() { |
| | | proTypeApi().then(res => { |
| | | typeList.value = res.data.data.map(item => ({ |
| | | ...item, |
| | | label: item.dictLabel, |
| | | value: item.dictValue |
| | | })) |
| | | }) |
| | | } |
| | | // 获取无人机厂商 |
| | | function getManufacturerInfoApi() { |
| | | manufacturerInfoApi({ |
| | | current: 1, |
| | | size: 1000, |
| | | }).then(res => { |
| | | manufacturerList.value = res.data.data.records.map(item => ({ |
| | | ...item, |
| | | label: item.unitName, |
| | | value: item.id, |
| | | })) |
| | | }) |
| | | } |
| | | onMounted(async () => { |
| | | getProTypeApi() |
| | | getManufacturerInfoApi() |
| | | // 动态导入xzqhData,确保在使用前已初始化 |
| | | const { xzqhData } = await import('@/static/xzqh/index') |
| | | // console.log(xzqhData,'9999') |
| | | // xzqhData.map 循环三层 |
| | | // 第一层:省份 |
| | | // 第二层:城市 |
| | | // 第三层:区县 |
| | | areaData.value = xzqhData |
| | | // xzqhData.map(item => ({ |
| | | // label: item.name, |
| | | // value: item.code, |
| | | // children: item.children.map(child => ({ |
| | | // label: child.name, |
| | | // value: child.code, |
| | | // children: child.children?.map(district => ({ |
| | | // label: district.name, |
| | | // value: district.code |
| | | // })) || [] |
| | | // })) |
| | | // })) |
| | | // console.log(areaData.value, '8888') |
| | | |
| | | }) |
| | | </script> |
| | | <style scoped lang="scss"> |
| New file |
| | |
| | | <!-- 飞行器详情 --> |
| | | <template> |
| | | <view class="deviceRegistration"> |
| | | <u-form labelPosition="top" :model="formParams" :rules="rules" ref="formRef"> |
| | | <u-form-item |
| | | label="飞行器名称" |
| | | labelWidth="200rpx" |
| | | prop="name" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input v-model="formParams.name" border="none" placeholder="请输入"></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="SN(出厂序列号)" |
| | | labelWidth="230rpx" |
| | | prop="sn" |
| | | :borderBottom="true" |
| | | ref="item2" |
| | | > |
| | | <u-input v-model="formParams.sn" border="none" placeholder="请输入"></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="飞行器厂商" |
| | | labelWidth="230rpx" |
| | | prop="manufacturer" |
| | | :borderBottom="true" |
| | | ref="item2" |
| | | > |
| | | <u-input |
| | | v-model="formParams.manufacturer" |
| | | disabled |
| | | disabledColor="#ffffff" |
| | | placeholder="请选择飞行器厂商" |
| | | border="none" |
| | | ></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="飞行器型号" |
| | | labelWidth="200rpx" |
| | | prop="model" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input v-model="formParams.model" border="none" placeholder="请输入"></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="是否改装" |
| | | labelWidth="200rpx" |
| | | prop="isModified" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input |
| | | v-model="formParams.isModified" |
| | | disabled |
| | | disabledColor="#ffffff" |
| | | placeholder="请选择是否改装" |
| | | border="none" |
| | | ></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="飞行器类型" |
| | | labelWidth="200rpx" |
| | | prop="type" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input |
| | | v-model="formParams.type" |
| | | disabled |
| | | disabledColor="#ffffff" |
| | | placeholder="请选择飞行器类型" |
| | | border="none" |
| | | ></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="持有人" |
| | | labelWidth="200rpx" |
| | | prop="holder" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input |
| | | v-model="formParams.holder" |
| | | border="none" |
| | | placeholder="请输入" |
| | | ></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="购买日期" |
| | | labelWidth="200rpx" |
| | | prop="purchaseDate" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input v-model="formParams.purchaseDate" border="none" placeholder="请选择日期" suffixIcon="calendar"></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="有无保险" |
| | | labelWidth="230rpx" |
| | | prop="hasInsurance" |
| | | :borderBottom="true" |
| | | ref="item2" |
| | | > |
| | | <u-input |
| | | v-model="formParams.hasInsurance" |
| | | disabled |
| | | disabledColor="#ffffff" |
| | | placeholder="请选择有无保险" |
| | | border="none" |
| | | ></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="所属区域" |
| | | labelWidth="230rpx" |
| | | prop="region" |
| | | :borderBottom="true" |
| | | ref="item2" |
| | | > |
| | | <u-input |
| | | v-model="formParams.region" |
| | | disabled |
| | | disabledColor="#ffffff" |
| | | placeholder="请选择所属区域" |
| | | border="none" |
| | | ></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="民用航空器登记证书" |
| | | labelWidth="300rpx" |
| | | prop="caacRegistrationCode" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input |
| | | v-model="formParams.caacRegistrationCode" |
| | | border="none" |
| | | placeholder="请输入" |
| | | ></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="飞行器照片" |
| | | labelWidth="200rpx" |
| | | prop="deviceImage" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input |
| | | v-model="formParams.deviceImage" |
| | | border="none" |
| | | placeholder="请输入" |
| | | ></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="备注" |
| | | labelWidth="200rpx" |
| | | prop="remarks" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input |
| | | v-model="formParams.remarks" |
| | | border="none" |
| | | placeholder="请输入" |
| | | ></u-input> |
| | | </u-form-item> |
| | | </u-form> |
| | | </view> |
| | | </template> |
| | | <script setup> |
| | | import { aircraftInfoSaveApi,uploadFileApi, areaDataApi, proTypeApi, manufacturerInfoApi, aircraftInfoDetailsApi } from '@/api/index' |
| | | import { ref, computed, onMounted } from 'vue' |
| | | import dayjs from 'dayjs' |
| | | import { onHide, onShow, onLoad } from "@dcloudio/uni-app"; |
| | | |
| | | const formRef = ref(null); |
| | | const formParams = ref({ |
| | | name: '', |
| | | manufacturer: '', // 制造商 |
| | | manufacturerText: '', // 制造商文本 |
| | | model: '', // 型号 |
| | | sn: '', // sn编号 |
| | | type: '', // 航空器类型 |
| | | typeText: '', // 航空器类型文本 |
| | | holder: '', // 持有人 |
| | | pilotId: '', // 飞行员id |
| | | status: '', // 状态 飞行器状态:0-未激活,1-正常,2-维修中,3-报废: |
| | | purchaseDate: '', // 购买日期 |
| | | isModified: '', // 是否改装 0否 1是: |
| | | isModifiedText: '', // 是否改装文本 |
| | | hasInsurance: '', // 是否有保险 |
| | | hasInsuranceText: '', // 是否有保险文本 |
| | | region: '', // 所属区域 |
| | | regionCode: '', // 所属区域 |
| | | regionText: '', // 所属区域文本 |
| | | caacRegistrationCode: '', // 民用航空器登记证书 |
| | | caacRegistrationCodeText: '', // 民用航空器登记证书文本 |
| | | deviceImage: '', // 飞行器照片 |
| | | deviceImageText: '', // 飞行器照片文本 |
| | | remarks: '', // 备注 |
| | | }) |
| | | |
| | | const rules = ref({}) |
| | | // 是否改装 |
| | | const actionsModified = ref([ |
| | | { |
| | | label: '否', |
| | | value: 0 |
| | | }, |
| | | { |
| | | label: '是', |
| | | value: 1 |
| | | } |
| | | ]) |
| | | const showIsModified = ref(false); |
| | | const onPickerConfirm = (e) => { |
| | | const selected = e.value[0] |
| | | formParams.value.isModified = selected.value |
| | | formParams.value.isModifiedText = selected.label |
| | | showIsModified.value = false |
| | | } |
| | | const showPurchaseDate = ref(false); |
| | | const birthdayValue = ref(Date.now()); // 设置默认值为当前时间戳 |
| | | // 购买日期 |
| | | const onPurchaseDate = (e) => { |
| | | formParams.value.purchaseDate = dayjs(e.value).format('YYYY-MM-DD') |
| | | showPurchaseDate.value = false |
| | | } |
| | | |
| | | const findRegionNamesByCodes = (codes, areaData) => { |
| | | const result = [] |
| | | let currentData = areaData |
| | | |
| | | for (const code of codes) { |
| | | // 转换为字符串比较(因为code可能是字符串类型) |
| | | const codeStr = code.toString() |
| | | const item = currentData.find(item => item.code === codeStr) |
| | | |
| | | if (!item) { |
| | | console.warn(`未找到code为 ${codeStr} 的行政区划`) |
| | | break |
| | | } |
| | | |
| | | result.push(item.name) |
| | | currentData = item.children || [] |
| | | } |
| | | |
| | | return result |
| | | } |
| | | |
| | | // 所属区域确认 |
| | | const onRegionConfirm = (e) => { |
| | | console.log(e,'888') |
| | | formParams.value.region = e?.join(',')[2] || '' // 用逗号分隔的区域码 |
| | | // 通过arrRegion的数组值为[36,3608,360824] 从areaData里面反查出名称 |
| | | const regionNames = findRegionNamesByCodes(e, areaData.value) |
| | | console.log(regionNames, '77777') |
| | | formParams.value.regionText = regionNames.join('-') || '' // 用连字符连接的区域名称 |
| | | isShowRegion.value = false |
| | | } |
| | | // 是否有保险 |
| | | const actionsHasInsurance = ref([ |
| | | { |
| | | label: '无', |
| | | value: '0' |
| | | }, |
| | | { |
| | | label: '有', |
| | | value: '1' |
| | | } |
| | | ]) |
| | | const showHasInsurance = ref(false); |
| | | const onPickerConfirmHasInsurance = (e) => { |
| | | const selected = e.value[0] |
| | | formParams.value.hasInsurance = selected.value |
| | | formParams.value.hasInsuranceText = selected.label |
| | | showHasInsurance.value = false |
| | | } |
| | | // 飞行器厂商 |
| | | const showManufacturer = ref(false); |
| | | const manufacturerList = ref([]) |
| | | // 选择飞行器厂商 |
| | | const onPickerConfirmManufacturer = (e) => { |
| | | const selected = e.value[0] |
| | | formParams.value.manufacturer = selected.value |
| | | formParams.value.manufacturerText = selected.label |
| | | showManufacturer.value = false |
| | | } |
| | | // 飞行器型号 |
| | | const showType = ref(false); |
| | | const typeList = ref([]) |
| | | // 选择飞行器型号 |
| | | const onPickerConfirmType = (e) => { |
| | | const selected = e.value[0] |
| | | formParams.value.type = selected.value |
| | | formParams.value.typeText = selected.label |
| | | showType.value = false |
| | | } |
| | | // 获取所属单位 |
| | | const isShowRegion = ref(false) |
| | | const areaData = ref([]) |
| | | // function getAreaData() { |
| | | // areaDataApi().then(res => { |
| | | // if (res.data.code === 200) { |
| | | // areaData.value = res.data.data |
| | | // } |
| | | // }) |
| | | // } |
| | | // 获取飞行器类型 |
| | | function getProTypeApi() { |
| | | proTypeApi().then(res => { |
| | | typeList.value = res.data.data.map(item => ({ |
| | | ...item, |
| | | label: item.dictLabel, |
| | | value: item.dictValue |
| | | })) |
| | | }) |
| | | } |
| | | // 获取无人机厂商 |
| | | function getManufacturerInfoApi() { |
| | | manufacturerInfoApi({ |
| | | current: 1, |
| | | size: 1000, |
| | | }).then(res => { |
| | | manufacturerList.value = res.data.data.records.map(item => ({ |
| | | ...item, |
| | | label: item.unitName, |
| | | value: item.id, |
| | | })) |
| | | }) |
| | | } |
| | | onLoad((options) => { |
| | | aircraftInfoDetailsApi(options.id).then(res => { |
| | | formParams.value = res.data.data |
| | | formParams.value.isModified = res.data.data.isModified ? '是' : '否' |
| | | formParams.value.hasInsurance = res.data.data.hasInsurance === '1' ? '有' : '无' |
| | | formParams.value.manufacturer = manufacturerList.value.find(item => item.value === res.data.data.manufacturer)?.label || '' |
| | | formParams.value.type = typeList.value.find(item => item.value === res.data.data.type)?.label || '' |
| | | formParams.value.region = res.data.data.region |
| | | }) |
| | | |
| | | |
| | | }) |
| | | onMounted(async () => { |
| | | getProTypeApi() |
| | | getManufacturerInfoApi() |
| | | // 动态导入xzqhData,确保在使用前已初始化 |
| | | const { xzqhData } = await import('@/static/xzqh/index') |
| | | areaData.value = xzqhData |
| | | }) |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .deviceRegistration { |
| | | width: 100%; |
| | | height: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | // padding: 24rpx; |
| | | |
| | | .select-wrapper { |
| | | position: relative; |
| | | width: 100%; |
| | | |
| | | .select-icon { |
| | | position: absolute; |
| | | right: 20rpx; |
| | | top: 50%; |
| | | transform: translateY(-50%); |
| | | color: #999; |
| | | font-size: 24rpx; |
| | | pointer-events: none; |
| | | } |
| | | } |
| | | |
| | | .upload { |
| | | font-family: Source Han Sans CN, Source Han Sans CN; |
| | | font-weight: 400; |
| | | font-size: 15px; |
| | | color: #1D6FE9; |
| | | } |
| | | |
| | | :deep(.u-form) { |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | overflow-y: auto; |
| | | box-sizing: border-box; |
| | | padding: 24rpx; |
| | | } |
| | | |
| | | :deep(.u-button) { |
| | | width: 80%; |
| | | padding: 28rpx; |
| | | border-radius: 8rpx 8rpx 8rpx 8rpx; |
| | | margin-bottom: 20rpx; |
| | | } |
| | | |
| | | :deep(.u-form-item) { |
| | | margin-bottom: 40rpx; |
| | | padding: 16rpx 24rpx 18rpx 24rpx; |
| | | border-radius: 6px 6px 6px 6px; |
| | | background: white; |
| | | :deep(.u-line) { |
| | | border-bottom: 1px solid #EFEFEF; |
| | | } |
| | | :deep(.u-input) { |
| | | width: 100%; |
| | | height: 80rpx; |
| | | border-radius: 8rpx; |
| | | padding: 0 20rpx; |
| | | background-color: #f5f5f5; |
| | | |
| | | &::placeholder { |
| | | font-family: Source Han Sans CN, Source Han Sans CN; |
| | | font-weight: 400; |
| | | font-size: 30rpx; |
| | | color: #D2D2D2; |
| | | } |
| | | } |
| | | |
| | | .clickable-input { |
| | | width: 100%; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | :deep(.u-form-item__label) { |
| | | margin-bottom: 20rpx; |
| | | // font-weight: bold; |
| | | // color: #333; |
| | | font-family: Source Han Sans CN, Source Han Sans CN; |
| | | font-weight: 400; |
| | | font-size: 30rpx; |
| | | color: #222324; |
| | | } |
| | | |
| | | :deep(.u-form-item__required) { |
| | | color: #FF2600; |
| | | margin-right: 8rpx; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | @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() |
| New file |
| | |
| | | <!-- 飞行活动申请 --> |
| | | <template> |
| | | <view class="flightApplication-add"> |
| | | <view class="title"> |
| | | 基本信息 |
| | | </view> |
| | | <u-form labelPosition="top" :model="formParams" :rules="rules" ref="formRef"> |
| | | <u-form-item |
| | | label="飞行计划" |
| | | labelWidth="200rpx" |
| | | prop="flightPlanName" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input v-model="formParams.flightPlanName" border="none" placeholder="请输入飞行计划名称"></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="任务类型" |
| | | labelWidth="230rpx" |
| | | prop="flightTaskType" |
| | | :borderBottom="true" |
| | | ref="item2" |
| | | > |
| | | <u-input |
| | | v-model="formParams.flightTaskType" |
| | | disabled |
| | | disabledColor="#ffffff" |
| | | placeholder="请选择任务类型" |
| | | border="none" |
| | | ></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="飞行规则" |
| | | labelWidth="230rpx" |
| | | prop="flightRule" |
| | | :borderBottom="true" |
| | | ref="item2" |
| | | > |
| | | <u-input |
| | | v-model="formParams.flightRule" |
| | | disabled |
| | | disabledColor="#ffffff" |
| | | placeholder="请选择飞行规则" |
| | | border="none" |
| | | ></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="飞行方式" |
| | | labelWidth="200rpx" |
| | | prop="flightMode" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input |
| | | v-model="formParams.flightMode" |
| | | disabled |
| | | disabledColor="#ffffff" |
| | | placeholder="请选择飞行方式" |
| | | border="none" |
| | | ></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="飞行活动开始日期" |
| | | labelWidth="260rpx" |
| | | prop="flightStartTime" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input v-model="formParams.flightStartTime" border="none" placeholder="请选择日期" suffixIcon="calendar"></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="飞行活动结束日期" |
| | | labelWidth="260rpx" |
| | | prop="flightEndTime" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input v-model="formParams.flightEndTime" border="none" placeholder="请选择日期" suffixIcon="calendar"></u-input> |
| | | </u-form-item> |
| | | |
| | | <u-form-item |
| | | label="计划类型" |
| | | labelWidth="200rpx" |
| | | prop="planType" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input |
| | | v-model="formParams.planType" |
| | | disabled |
| | | disabledColor="#ffffff" |
| | | placeholder="请选择计划类型" |
| | | border="none" |
| | | ></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="联系人" |
| | | labelWidth="200rpx" |
| | | prop="contactPerson" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input v-model="formParams.contactPerson" border="none" placeholder="请输入"></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="联系电话" |
| | | labelWidth="200rpx" |
| | | prop="contactPhone" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input v-model="formParams.contactPhone" border="none" placeholder="请输入"></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="承办人" |
| | | labelWidth="200rpx" |
| | | prop="undertaker" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input v-model="formParams.undertaker" border="none" placeholder="请输入"></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="承办人联系电话" |
| | | labelWidth="300rpx" |
| | | prop="undertakerPhone" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input v-model="formParams.undertakerPhone" border="none" placeholder="请输入"></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="临时空域批件" |
| | | labelWidth="200rpx" |
| | | prop="aircraftName" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input v-model="formParams.tempAirspaceApproval" border="none" readonly></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="气象条件" |
| | | labelWidth="200rpx" |
| | | prop="weatherCondition" |
| | | :borderBottom="true" |
| | | ref="item1" |
| | | > |
| | | <u-input |
| | | v-model="formParams.weatherCondition" |
| | | border="none" |
| | | placeholder="请输入" |
| | | ></u-input> |
| | | </u-form-item> |
| | | <view class="title form-title">飞行器/飞手</view> |
| | | <u-form-item |
| | | label="飞行器" |
| | | labelWidth="230rpx" |
| | | prop="aircraftId" |
| | | :borderBottom="true" |
| | | ref="item2" |
| | | > |
| | | <u-input |
| | | v-model="formParams.aircraftId" |
| | | disabled |
| | | disabledColor="#ffffff" |
| | | placeholder="请选择飞行器" |
| | | border="none" |
| | | ></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="飞手" |
| | | labelWidth="230rpx" |
| | | prop="pilotId" |
| | | :borderBottom="true" |
| | | ref="item2" |
| | | > |
| | | <u-input |
| | | v-model="formParams.pilotId" |
| | | disabled |
| | | disabledColor="#ffffff" |
| | | placeholder="请选择飞手" |
| | | border="none" |
| | | ></u-input> |
| | | </u-form-item> |
| | | <view class="title form-title">空域/航线/场点</view> |
| | | <u-form-item |
| | | label="空域" |
| | | labelWidth="230rpx" |
| | | prop="airspaceId" |
| | | :borderBottom="true" |
| | | ref="item2" |
| | | > |
| | | <u-input |
| | | v-model="formParams.airspaceId" |
| | | disabled |
| | | disabledColor="#ffffff" |
| | | placeholder="请选择空域" |
| | | border="none" |
| | | ></u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | label="航线" |
| | | labelWidth="230rpx" |
| | | prop="routeId" |
| | | :borderBottom="true" |
| | | ref="item2" |
| | | > |
| | | <u-input |
| | | v-model="formParams.routeId" |
| | | disabled |
| | | disabledColor="#ffffff" |
| | | placeholder="请选择航线" |
| | | border="none" |
| | | ></u-input> |
| | | </u-form-item> |
| | | </u-form> |
| | | </view> |
| | | </template> |
| | | <script setup> |
| | | import { flightPlanSaveApi, |
| | | flightRoutePageInfoApi, |
| | | aircraftInfoPageInfoOfMyApi, |
| | | pilotInfoPageInfoOfMyApi, |
| | | flightAirspacePageInfoApi, |
| | | uploadFileApi, |
| | | flightTaskApi,flightRulesApi,flightModeApi,flightPlanApi,flightPlanDetailsApi |
| | | } from '@/api/index' |
| | | import { ref, computed, onMounted } from 'vue' |
| | | import dayjs from 'dayjs' |
| | | |
| | | const formRef = ref(null); |
| | | const formParams = ref({}) |
| | | const rules = ref({}) |
| | | // 任务类型 |
| | | const isShowFlightTaskType = ref(false) |
| | | const actionsFlightTaskType = ref([]) |
| | | |
| | | |
| | | // 飞行规则 |
| | | const isShowFlightRule = ref(false) |
| | | const actionsFlightRule = ref([]) |
| | | |
| | | // 飞行方式 |
| | | const isShowFlightMode = ref(false) |
| | | const actionsFlightMode = ref([]) |
| | | |
| | | // 计划类型 |
| | | const isShowPlanType = ref(false) |
| | | const actionsPlanType = ref([]) |
| | | |
| | | // 是否显示开始时间选择器 |
| | | const isShowStartTime = ref(false) |
| | | // 是否显示结束时间选择器 |
| | | const isShowEndTime = ref(false) |
| | | 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 isShowAircraftInfo = ref(false) |
| | | const aircraftInfoList = ref([]) |
| | | function getAircraftInfo() { |
| | | aircraftInfoPageInfoOfMyApi({ |
| | | current: 1, |
| | | size: 1000, |
| | | }).then(res => { |
| | | aircraftInfoList.value = res.data.data.records.map(item => ({ |
| | | label: item.name || '暂无', |
| | | value: item.id, |
| | | })) |
| | | }) |
| | | } |
| | | 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({ |
| | | current: 1, |
| | | size: 1000, |
| | | }).then(res => { |
| | | pilotInfoList.value = res.data.data.records.map(item => ({ |
| | | label: item.name || '暂无', |
| | | value: item.id, |
| | | })) |
| | | }) |
| | | } |
| | | // 获取空域信息 |
| | | const isShowAirspaceInfo = ref(false) |
| | | const airspaceInfoList = ref([]) |
| | | function getAirspaceInfo() { |
| | | flightAirspacePageInfoApi({ |
| | | current: 1, |
| | | size: 1000, |
| | | }).then(res => { |
| | | airspaceInfoList.value = res.data.data.records.map(item => ({ |
| | | label: item.airspaceName || '暂无', |
| | | value: item.id, |
| | | })) |
| | | }) |
| | | } |
| | | // 获取航线信息 |
| | | const isShowFlightRouteInfo = ref(false) |
| | | const flightRouteInfoList = ref([]) |
| | | function getFlightRouteInfo() { |
| | | flightRoutePageInfoApi({ |
| | | current: 1, |
| | | size: 1000, |
| | | }).then(res => { |
| | | flightRouteInfoList.value = res.data.data.records.map(item => ({ |
| | | label: item.name, |
| | | value: item.id, |
| | | })) |
| | | }) |
| | | } |
| | | |
| | | // 获取任务类型 |
| | | 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 || '' |
| | | }) |
| | | }) |
| | | onMounted(() => { |
| | | getTaskType() |
| | | getFlightMode() |
| | | getFlightRules() |
| | | getFlightPlan() |
| | | // getAircraftInfo() |
| | | // getPilotInfo() |
| | | // getAirspaceInfo() |
| | | // getFlightRouteInfo() |
| | | }) |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .flightApplication-add { |
| | | width: 100%; |
| | | height: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | .title { |
| | | font-family: Source Han Sans CN, Source Han Sans CN; |
| | | font-weight: 400; |
| | | font-size: 17px; |
| | | color: #222324; |
| | | padding-left: 24rpx; |
| | | } |
| | | .form-title { |
| | | margin-bottom: 24rpx; |
| | | padding-left: 0rpx !important; |
| | | } |
| | | :deep(.u-button) { |
| | | width: 80%; |
| | | padding: 28rpx; |
| | | border-radius: 8rpx 8rpx 8rpx 8rpx; |
| | | margin-bottom: 20rpx; |
| | | } |
| | | .attention { |
| | | font-family: Source Han Sans CN, Source Han Sans CN; |
| | | font-weight: 400; |
| | | font-size: 12px; |
| | | color: #1D6FE9; |
| | | // margin-top: 24rpx; |
| | | text-align: center; |
| | | } |
| | | .select-wrapper { |
| | | position: relative; |
| | | width: 100%; |
| | | |
| | | .select-icon { |
| | | position: absolute; |
| | | right: 20rpx; |
| | | top: 50%; |
| | | transform: translateY(-50%); |
| | | color: #999; |
| | | font-size: 24rpx; |
| | | pointer-events: none; |
| | | } |
| | | } |
| | | |
| | | .upload { |
| | | font-family: Source Han Sans CN, Source Han Sans CN; |
| | | font-weight: 400; |
| | | font-size: 15px; |
| | | color: #1D6FE9; |
| | | } |
| | | :deep(.u-form) { |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | overflow-y: auto; |
| | | box-sizing: border-box; |
| | | padding: 24rpx; |
| | | } |
| | | .submit-button-wrapper { |
| | | padding: 28rpx; |
| | | // width: 80%; |
| | | // height: 100rpx; |
| | | border-radius: 8rpx 8rpx 8rpx 8rpx; |
| | | } |
| | | :deep(.u-form-item) { |
| | | margin-bottom: 40rpx; |
| | | padding: 16rpx 24rpx 18rpx 24rpx; |
| | | border-radius: 6px 6px 6px 6px; |
| | | background: white; |
| | | :deep(.u-line) { |
| | | border-bottom: 1px solid #EFEFEF; |
| | | } |
| | | :deep(.u-input) { |
| | | width: 100%; |
| | | height: 80rpx; |
| | | border-radius: 8rpx; |
| | | padding: 0 20rpx; |
| | | background-color: #f5f5f5; |
| | | |
| | | &::placeholder { |
| | | font-family: Source Han Sans CN, Source Han Sans CN; |
| | | font-weight: 400; |
| | | font-size: 30rpx; |
| | | color: #D2D2D2; |
| | | } |
| | | } |
| | | |
| | | .clickable-input { |
| | | width: 100%; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | :deep(.u-form-item__label) { |
| | | margin-bottom: 20rpx; |
| | | // font-weight: bold; |
| | | // color: #333; |
| | | font-family: Source Han Sans CN, Source Han Sans CN; |
| | | font-weight: 400; |
| | | font-size: 30rpx; |
| | | color: #222324; |
| | | } |
| | | |
| | | :deep(.u-form-item__required) { |
| | | color: #FF2600; |
| | | margin-right: 8rpx; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | 审批记录 |
| | | </view> |
| | | <u-list :style="{ height: 'calc(100vh - 240rpx)' }" @scrolltolower="scrolltolower" :lower-threshold="50"> |
| | | <view class="approvalRecord" v-for="(approvalRecord,approvalRecordIndex) in approvalRecords" :key="approvalRecordIndex"> |
| | | <view class="approvalRecord" v-for="(approvalRecord,approvalRecordIndex) in approvalRecords" :key="approvalRecordIndex" @click="handleClick(approvalRecord)"> |
| | | <view class="name-status"> |
| | | <view class="name-image"> |
| | | <u-image :src="spSvg" class="icon" width="16" height="16"></u-image> |
| | |
| | | } |
| | | getApprovalRecords() |
| | | } |
| | | // 点击审批记录跳转详情页 |
| | | function handleClick(item) { |
| | | uni.navigateTo({ |
| | | url: '/subPackages/flightApplication/details?id=' + item.id, |
| | | }) |
| | | } |
| | | onMounted(() => { |
| | | getApprovalRecords() |
| | | }) |