|
|
@@ -105,15 +105,12 @@ |
|
|
|
<div v-if="current === 5" class="cont"> |
|
|
|
<div class="title">飞行文件</div> |
|
|
|
|
|
|
|
<UploadVod v-if="data.photographyWay === 1" :auto-upload="true" :upload-name="'选择【视频】'" :limit="1" @upload-status="vodStatusVideo" /> |
|
|
|
<fileOss v-if="data.photographyWay === 1" ref="srtRefs" :file-type="'srt'" :btn-name="'选择【轨迹】'" :limit="1" :default-list="data.srtUrl" @upload-status="vodStatusSRT" /> |
|
|
|
<fileOss v-if="data.photographyWay !== 1" ref="ortRefs" :file-type="'tif'" :btn-name="'选择【正射影像】'" :limit="9" :default-list="data.orthoUrl" @upload-status="vodStatusZS" /> |
|
|
|
<fileOss v-if="data.photographyWay !== 1" ref="inclinedRefs" :file-type="'tif'" :btn-name="'选择【倾斜影像】'" :limit="9" :default-list="data.inclinedUrl" @upload-status="vodStatusQX" /> |
|
|
|
|
|
|
|
<!-- <UploadVod v-if="data.photographyWay === 1" :auto-upload="true" :upload-name="'选择【轨迹】'" :limit="1" @upload-status="vodStatusSRT" /> |
|
|
|
<UploadVod v-if="data.photographyWay !== 1" :auto-upload="true" :upload-name="'选择【正射影像】tif文件'" @upload-status="vodStatusZS" /> |
|
|
|
<UploadVod v-if="data.photographyWay !== 1" :auto-upload="true" :upload-name="'选择【倾斜影像】tif文件'" @upload-status="vodStatusQX" /> --> |
|
|
|
<n-button type="primary" class="btn" @click="submitFile"> |
|
|
|
<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" /> |
|
|
|
|
|
|
|
<n-button v-if="isAdmin" type="primary" class="btn" :loading="loading" @click="submitFile"> |
|
|
|
<n-icon> |
|
|
|
<UploadOutlined /> |
|
|
|
</n-icon> |
|
|
@@ -124,7 +121,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup name="DrawComp"> |
|
|
|
import { ref, defineProps, reactive, defineEmits } from 'vue' |
|
|
|
import { ref, defineProps, reactive, defineEmits, watchEffect } from 'vue' |
|
|
|
import { TASK_STATUS } from '@/utils/dictionary' |
|
|
|
import { distributionPilot, pilotOrder, pilotStart, pilotEnd, uploadFlightUrl } from '@/api/task/index.js' |
|
|
|
import { form, getPilotList, getEquipment, getEquipmentMount, getCloudMount } from '../tools/drawForm' |
|
|
@@ -162,14 +159,19 @@ const equipmentInfo = equipment(data) // 设备/影响基本信息 |
|
|
|
const executionInfo = execution(data) // 执行中信息 |
|
|
|
|
|
|
|
const videoUrl = ref('') // 视频文件 |
|
|
|
const videoId = ref('') // 视频文件 |
|
|
|
const srtUrl = ref('') // srt文件 |
|
|
|
const inclinedUrl = ref('') // 倾斜摄影 |
|
|
|
const orthoUrl = ref('') // 正射影像 |
|
|
|
// const inclinedUrl = ref('') // 倾斜摄影 |
|
|
|
// const orthoUrl = ref('') // 正射影像 |
|
|
|
|
|
|
|
const videoRefs = ref(null) // video refs |
|
|
|
const srtRefs = ref(null) // srt refs |
|
|
|
const ortRefs = ref(null) // 正射 refs |
|
|
|
const inclinedRefs = ref(null) // 倾斜 refs |
|
|
|
|
|
|
|
const loading = ref(false) |
|
|
|
const isBtn = ref(false) |
|
|
|
|
|
|
|
const emit = defineEmits(['close']) |
|
|
|
|
|
|
|
// 分配飞手 |
|
|
@@ -229,60 +231,84 @@ const endFly = () => { |
|
|
|
} |
|
|
|
|
|
|
|
// 上传 - 视频 |
|
|
|
const vodStatusVideo = ({ status, list }) => { |
|
|
|
const vodStatusVideo = ({ status, list, videoIds }) => { |
|
|
|
console.log(status, list, videoIds) |
|
|
|
const arr = [] |
|
|
|
for (var key in list) { |
|
|
|
arr.push(list[key].url) |
|
|
|
} |
|
|
|
if (status === 'success') { |
|
|
|
videoUrl.value = arr.join(',') |
|
|
|
videoId.value = videoIds |
|
|
|
} |
|
|
|
} |
|
|
|
// 上传 - SRT |
|
|
|
const vodStatusSRT = async(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() |
|
|
|
} |
|
|
|
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() |
|
|
|
// } |
|
|
|
} |
|
|
|
|
|
|
|
// 上传 - 倾斜 |
|
|
|
const vodStatusQX = async(status) => { |
|
|
|
const res = await inclinedRefs.value.startUpload() |
|
|
|
if (status === 'success' && res.includes('error')) { |
|
|
|
$message.error('上传失败,请稍后重试') |
|
|
|
} else if (status === 'success') { |
|
|
|
inclinedUrl.value = res.join() |
|
|
|
} |
|
|
|
} |
|
|
|
// 上传 - 正射 |
|
|
|
const vodStatusZS = async(status) => { |
|
|
|
const res = await ortRefs.value.startUpload() |
|
|
|
if (status === 'success' && res.includes('error')) { |
|
|
|
$message.error('上传失败,请稍后重试') |
|
|
|
} else if (status === 'success') { |
|
|
|
orthoUrl.value = res.join() |
|
|
|
} |
|
|
|
} |
|
|
|
// watchEffect(() => [videoUrl, srtUrl], ([videoVal], [srtVal]) => { |
|
|
|
// console.log('watchEffect-videoVal:', videoVal) |
|
|
|
// console.log('watchEffect-srtVal:', srtVal) |
|
|
|
// if (videoUrl.value === 'success' && srtVal === 'success') { |
|
|
|
// console.log('watchEffect-success all') |
|
|
|
// isBtn.value = true |
|
|
|
// } |
|
|
|
// }) |
|
|
|
|
|
|
|
// 上传 |
|
|
|
const submitFile = () => { |
|
|
|
uploadFlightUrl({ |
|
|
|
id: data.id, |
|
|
|
videoUrl: videoUrl.value ? videoUrl.value : data.videoUrl, |
|
|
|
srtUrl: srtUrl.value ? srtUrl.value : data.srtUrl, |
|
|
|
inclinedUrl: data.inclinedUrl + ',' + inclinedUrl.value, |
|
|
|
orthoUrl: data.orthoUrl + ',' + orthoUrl.value |
|
|
|
}).then(({ code }) => { |
|
|
|
console.log(code) |
|
|
|
if (code === 0) { |
|
|
|
emit('close') |
|
|
|
} |
|
|
|
}) |
|
|
|
if (data.photographyWay === 1) { // 视频 和 srt |
|
|
|
// videoRefs.value.data.uploader.startUpload() |
|
|
|
srtRefs.value?.startUpload().then(res => { |
|
|
|
console.log('res:', res) |
|
|
|
if (!res.includes('error')) { |
|
|
|
uploadFlightUrl({ |
|
|
|
id: data.id, |
|
|
|
videoUrl: videoUrl.value, |
|
|
|
videoId: videoId.value, |
|
|
|
...res |
|
|
|
}).then(({ code }) => { |
|
|
|
if (code === 0) { |
|
|
|
emit('close') |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
loading.value = true |
|
|
|
const queue = [] |
|
|
|
// queue.push(videoRefs.value?.data.uploader.startUpload()) |
|
|
|
// queue.push(srtRefs.value?.startUpload()) |
|
|
|
queue.push(inclinedRefs.value?.startUpload()) |
|
|
|
queue.push(ortRefs.value?.startUpload()) |
|
|
|
Promise.all(queue).then(res => { |
|
|
|
loading.value = false |
|
|
|
const params = {} |
|
|
|
res.filter(it => it).forEach(el => { |
|
|
|
Object.keys(el).map(dom => { |
|
|
|
params[dom] = el[dom] |
|
|
|
}) |
|
|
|
}) |
|
|
|
uploadFlightUrl({ |
|
|
|
id: data.id, |
|
|
|
...params |
|
|
|
}).then(({ code }) => { |
|
|
|
if (code === 0) { |
|
|
|
emit('close') |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
</script> |
|
|
@@ -306,8 +332,8 @@ const submitFile = () => { |
|
|
|
} |
|
|
|
|
|
|
|
.btn { |
|
|
|
width: 90px; |
|
|
|
margin-left: calc(50% - 45px); |
|
|
|
width: 110px; |
|
|
|
margin-left: calc(50% - 55px); |
|
|
|
margin-top: 10px; |
|
|
|
margin-bottom: 30px; |
|
|
|
} |