@@ -105,10 +105,51 @@ | |||
<div v-if="current === 5" class="cont"> | |||
<div class="title">飞行文件</div> | |||
<UploadVod v-if="data.photographyWay === 1" ref="videoRefs" :auto-upload="true" :upload-name="'选择【视频】'" :limit="1" @upload-status="vodStatusVideo" /> | |||
<fileOss v-if="data.photographyWay === 1" ref="srtRefs" :file-type="'srt'" :key-name="'srtUrl'" :btn-name="'选择【轨迹】'" :limit="1" :default-list="data.srtUrl" @upload-status="vodStatusSRT" /> | |||
<fileOss v-if="data.photographyWay === 2" ref="ortRefs" :file-type="'tif'" :key-name="'orthoUrl'" :btn-name="'选择【正射影像】'" :limit="9" :default-list="data.orthoUrl" @upload-status="vodStatusZS" /> | |||
<fileOss v-if="data.photographyWay === 3" ref="inclinedRefs" :file-type="'tif'" :key-name="'inclinedUrl'" :btn-name="'选择【倾斜影像】'" :limit="9" :default-list="data.inclinedUrl" @upload-status="vodStatusQX" /> | |||
<UploadVod | |||
v-if="data.photographyWay === 1 && isAdmin" | |||
ref="videoRefs" | |||
:auto-upload="true" | |||
:upload-name="'选择【视频】'" | |||
:limit="1" | |||
@upload-status="vodStatusVideo" | |||
/> | |||
<fileOss | |||
v-if="data.photographyWay === 1 && !isAdmin" | |||
:file-type="'video'" | |||
:btn-name="'选择【视频111】'" | |||
:limit="1" | |||
:default-list="data.videoUrl" | |||
@upload-status="vodStatusVideo" | |||
/> | |||
<fileOss | |||
v-if="data.photographyWay === 1" | |||
ref="srtRefs" | |||
:file-type="'srt'" | |||
:key-name="'srtUrl'" | |||
:btn-name="'选择【轨迹】'" | |||
:limit="1" | |||
:default-list="data.srtUrl" | |||
@upload-status="vodStatusSRT" | |||
/> | |||
<fileOss | |||
v-if="data.photographyWay === 2" | |||
ref="ortRefs" | |||
:file-type="'tif'" | |||
:key-name="'orthoUrl'" | |||
:btn-name="'选择【正射影像】'" | |||
:limit="9" | |||
:default-list="data.orthoUrl" | |||
/> | |||
<fileOss | |||
v-if="data.photographyWay === 3" | |||
ref="inclinedRefs" | |||
:file-type="'tif'" | |||
:key-name="'inclinedUrl'" | |||
:btn-name="'选择【倾斜影像】'" | |||
:limit="9" | |||
:default-list="data.inclinedUrl" | |||
/> | |||
<n-button v-if="isAdmin" type="primary" class="btn" :loading="loading" @click="submitFile"> | |||
<n-icon> | |||
@@ -160,6 +201,7 @@ const executionInfo = execution(data) // 执行中信息 | |||
const videoUrl = ref('') // 视频文件 | |||
const videoId = ref('') // 视频文件 | |||
const videoStatus = ref('') // 视频文件 | |||
const srtUrl = ref('') // srt文件 | |||
// const inclinedUrl = ref('') // 倾斜摄影 | |||
// const orthoUrl = ref('') // 正射影像 | |||
@@ -233,6 +275,7 @@ const endFly = () => { | |||
// 上传 - 视频 | |||
const vodStatusVideo = ({ status, list, videoIds }) => { | |||
console.log(status, list, videoIds) | |||
videoStatus.value = status | |||
const arr = [] | |||
for (var key in list) { | |||
arr.push(list[key].url) | |||
@@ -246,14 +289,6 @@ const vodStatusVideo = ({ status, list, videoIds }) => { | |||
const vodStatusSRT = async(status) => { | |||
srtUrl.value = status | |||
console.log('srtUrl: ---------------', srtUrl.value, status) | |||
// const res = await srtRefs.value.startUpload() | |||
// console.log('status: ', status) | |||
// console.log(res) | |||
// if (status === 'success' && res.includes('error')) { | |||
// $message.error('上传失败,请稍后重试') | |||
// } else if (status === 'success') { | |||
// srtUrl.value = res.join() | |||
// } | |||
} | |||
// watchEffect(() => [videoUrl, srtUrl], ([videoVal], [srtVal]) => { | |||
@@ -270,13 +305,13 @@ const submitFile = () => { | |||
if (data.photographyWay === 1) { // 视频 和 srt | |||
// videoRefs.value.data.uploader.startUpload() | |||
srtRefs.value?.startUpload().then(res => { | |||
console.log('res:', res) | |||
console.log('srtRefs - res:', res) | |||
if (!res.includes('error')) { | |||
uploadFlightUrl({ | |||
id: data.id, | |||
videoUrl: videoUrl.value, | |||
videoId: videoId.value, | |||
...res | |||
...res[0] | |||
}).then(({ code }) => { | |||
if (code === 0) { | |||
emit('close') |
@@ -1,6 +1,6 @@ | |||
<template> | |||
<div class="mapComp" id="mapComp"></div> | |||
<input id="pickerInput" type="text" placeholder="输入关键字选取地点" /> | |||
<div id="mapComp" class="mapComp" /> | |||
<input id="pickerInput" type="text" placeholder="输入关键字选取地点"> | |||
</template> | |||
@@ -8,42 +8,41 @@ | |||
import GMap from '@/utils/map/GMap' | |||
const emit = defineEmits(['mapEmit']) | |||
let marker = null | |||
GMap.then((AMap) => { | |||
let map = new AMap.Map('mapComp', { | |||
const map = new AMap.Map('mapComp', { | |||
zoom: 13, | |||
center: [118.773319, 31.828123], | |||
}); | |||
center: [118.773319, 31.828123] | |||
}) | |||
// 添加缩放工具 | |||
const toolbar = new AMap.ToolBar(); | |||
map.addControl(toolbar); | |||
const toolbar = new AMap.ToolBar() | |||
map.addControl(toolbar) | |||
// 搜索 | |||
AMapUI.loadUI(['misc/PoiPicker'], function (PoiPicker) { | |||
AMapUI.loadUI(['misc/PoiPicker'], function(PoiPicker) { | |||
const poiPicker = new PoiPicker({ | |||
input: 'pickerInput' | |||
}); | |||
}) | |||
poiPicker.on('poiPicked', ({ item }) => { | |||
let inp = document.getElementById('pickerInput'); | |||
inp.value = item.name; | |||
const marker = new AMap.Marker({ | |||
title: item.address | |||
}); | |||
marker.setMap(map); | |||
marker.setPosition(item.location); | |||
map.setCenter(marker.getPosition()); | |||
emit('mapEmit', item); | |||
const inp = document.getElementById('pickerInput') | |||
inp.value = item.name | |||
map.setCenter(item.location) // 移动到中心位置 | |||
}) | |||
}) | |||
map.on('click', ({ lnglat }) => { | |||
console.log(lnglat) | |||
if (marker) map.remove(marker) // 只取一次maker点 | |||
marker = new AMap.Marker({ | |||
position: new AMap.LngLat(lnglat.lng, lnglat.lat), | |||
offset: new AMap.Pixel(-10, -10), | |||
icon: '//vdata.amap.com/icons/b18/1/2.png' | |||
}) | |||
}); | |||
map.add(marker) | |||
emit('mapEmit', lnglat) | |||
}) | |||
}).catch(e => console.log(e)) | |||
</script> | |||
@@ -70,4 +69,4 @@ GMap.then((AMap) => { | |||
.amap_lib_placeSearch .poi-more { | |||
display: none !important; | |||
} | |||
</style> | |||
</style> |
@@ -168,11 +168,12 @@ export default defineComponent({ | |||
data.userForm.imageStatus = status | |||
} | |||
let Gmap = null | |||
let geocoder = null | |||
let AMaps = null | |||
// 地图 | |||
GMap.then((AMap) => { | |||
let Gmap = null | |||
AMaps = AMap | |||
// 坐标求地址 | |||
geocoder = new AMap.Geocoder() | |||
@@ -224,9 +225,7 @@ export default defineComponent({ | |||
const endVal = ref(null) | |||
// 起点地图 确定事件 | |||
const startHandle = e => { | |||
const { location: { lat }} = e | |||
const { location: { lng }} = e | |||
const startHandle = ({ lng, lat }) => { | |||
geocoder.getAddress([lng, lat], function(status, result) { | |||
if (status === 'complete' && result.info === 'OK') { | |||
startVal.value = result.regeocode.formattedAddress | |||
@@ -234,11 +233,10 @@ export default defineComponent({ | |||
data.userForm.startLatitude = String(lat) | |||
} | |||
}) | |||
mapHandle('起点', [lng, lat]) | |||
} | |||
// 终点地图 确定事件 | |||
const endHandle = e => { | |||
const { location: { lat }} = e | |||
const { location: { lng }} = e | |||
const endHandle = ({ lng, lat }) => { | |||
geocoder.getAddress([lng, lat], function(status, result) { | |||
if (status === 'complete' && result.info === 'OK') { | |||
endVal.value = result.regeocode.formattedAddress | |||
@@ -246,6 +244,18 @@ export default defineComponent({ | |||
data.userForm.endLatitude = String(lat) | |||
} | |||
}) | |||
mapHandle('终点', [lng, lat]) | |||
} | |||
// 地图marker点 | |||
const mapHandle = (type, arr) => { | |||
const marker = new AMaps.Marker({ | |||
title: type, | |||
icon: '//vdata.amap.com/icons/b18/1/2.png' | |||
}) | |||
marker.setMap(Gmap) | |||
marker.setPosition(arr) | |||
Gmap.setCenter(marker.getPosition()) | |||
} | |||
function handleConfirm() { |
@@ -34,6 +34,10 @@ export default function(data) { | |||
label: '期望执行时间', | |||
value: data.taskStartTime | |||
}, | |||
{ | |||
label: '是否直播', | |||
value: data.isLive === 0 ? '否' : '是' | |||
}, | |||
{ | |||
label: '备注', | |||
value: data.remark |
@@ -30,13 +30,13 @@ export const form = reactive({ | |||
{ type: 'select', key: 'flightHandId', label: '飞手', props: { options: pilotList, placeholder: '请选择飞手', clearable: true }}, | |||
{ type: 'select', key: 'equipmentId', label: '执飞无人机', props: { options: equipmentList, placeholder: '请选择执飞无人机', clearable: true }}, | |||
{ type: 'select', key: 'equipmentMountId', label: '挂载设备', props: { options: equipmentMountList, placeholder: '请选择挂载设备', clearable: true }}, | |||
{ type: 'select', key: 'cloudBoxId', label: '挂载盒子', isLive: 1, props: { options: cloudList, placeholder: '请选择盒子', clearable: true }}, | |||
{ type: 'select', key: 'cloudBoxId', label: '挂载盒子', isLive: 0, props: { options: cloudList, placeholder: '请选择盒子', clearable: true }}, | |||
{ type: 'select', key: 'photographyWay', label: '拍摄方式', props: { options: PHOTOGRAPHY_WAY, placeholder: '请选择拍摄方式', clearable: true }} | |||
], | |||
// 飞手接单 - 校验 | |||
userRulesOrder: { | |||
equipmentId: [{ required: true, message: '请选择执飞无人机', trigger: 'blur' }], | |||
photographyWay: [{ required: true, message: '请选择摄影方式', trigger: 'blur' }], | |||
photographyWay: [{ required: true, message: '请选择摄影方式', type: 'number', trigger: 'blur' }], | |||
equipmentMountId: [{ required: true, message: '请选择挂载设备', trigger: 'blur' }] | |||
}, | |||
// 飞手接单 - 表单 |
@@ -123,7 +123,7 @@ const data = reactive({ | |||
text: true, | |||
onClick: editHandle.bind(null, row, 'update'), | |||
style: { | |||
display: row.status > 10 ? 'none' : '' | |||
display: row.status > 10 || row.inspectionType !== 1 ? 'none' : '' | |||
} | |||
}, | |||
auth: 'basic_list' | |||
@@ -140,7 +140,7 @@ const data = reactive({ | |||
text: true, | |||
type: 'primary', | |||
style: { | |||
display: row.status > 10 ? 'none' : '' | |||
display: row.status > 10 || row.inspectionType !== 1 ? 'none' : '' | |||
} | |||
} | |||
} |