|
@@ -23,7 +23,7 @@
|
|
|
</div>
|
|
|
|
|
|
<Transition name="emerge-left">
|
|
|
- <FloatPanelUav class="uav-demo" v-if="uavInfoShow" :alert="alertInfo" @close="uavInfoShow = false" />
|
|
|
+ <FloatPanelUav class="uav-demo" v-if="uavInfoShow" :alert="alertInfo" :base="baseInfo" @close="handleCloseInfo" />
|
|
|
</Transition>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -31,17 +31,19 @@
|
|
|
<script setup>
|
|
|
import { GetRouteList } from '@/service/http'
|
|
|
import useLayoutStore from '@/store/layout'
|
|
|
+import usePanelStore from '@/store/panel'
|
|
|
import useUeStore from '@/store/ue'
|
|
|
import { getAssetsFile } from '@/utils/require'
|
|
|
-import { clearAllShapes, startSceneDemo, toggleUav } from '@/utils/ueActions'
|
|
|
+import { hexToRgb } from '@/utils/tools'
|
|
|
+import { clearAllShapes, startSceneDemo, toggleUav, initSceneDemo, setWeather } from '@/utils/ueActions'
|
|
|
import { getCurrentInstance, onBeforeMount, onBeforeUnmount, reactive, ref, watch } from 'vue'
|
|
|
import FloatPanelUav from './FloatPanelUav.vue'
|
|
|
-import { hexToRgb } from '@/utils/tools'
|
|
|
|
|
|
const { proxy } = getCurrentInstance()
|
|
|
|
|
|
const ueStore = useUeStore()
|
|
|
const layoutStore = useLayoutStore()
|
|
|
+const panelStore = usePanelStore()
|
|
|
|
|
|
const uavInfoShow = ref(false)
|
|
|
|
|
@@ -54,13 +56,16 @@ const listData = ref([
|
|
|
])
|
|
|
|
|
|
function handleDemo(item) {
|
|
|
+ layoutStore.sceneLoading = true
|
|
|
startSceneDemo(item.value)
|
|
|
- uavInfoShow.value = true
|
|
|
+ panelStore.setWeather('Clear Skies')
|
|
|
+ uavInfoShow.value = false
|
|
|
+ alertInfo.value = {}
|
|
|
}
|
|
|
|
|
|
const options = reactive({
|
|
|
- airLine: true,
|
|
|
- track: true,
|
|
|
+ airLine: false,
|
|
|
+ track: false,
|
|
|
})
|
|
|
|
|
|
function toggleOption(target) {
|
|
@@ -99,13 +104,13 @@ function getData() {
|
|
|
GetRouteList()
|
|
|
.then((res) => {
|
|
|
if (!Array.isArray(res.data.data)) {
|
|
|
- showWarning('航线信息查询失败')
|
|
|
+ ElMessage({ offset: 90, type: 'warning', message: '航线信息查询失败' })
|
|
|
return
|
|
|
}
|
|
|
routeList = res.data.data
|
|
|
})
|
|
|
.catch(() => {
|
|
|
- showWarning('航线信息查询失败')
|
|
|
+ ElMessage({ offset: 90, type: 'warning', message: '航线信息查询失败' })
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -119,46 +124,94 @@ watch(
|
|
|
{ immediate: true }
|
|
|
)
|
|
|
|
|
|
-const alertInfo = ref({
|
|
|
- collision: {
|
|
|
- distance: 20,
|
|
|
- },
|
|
|
- offCourse: {
|
|
|
- distance: 20,
|
|
|
- lineCode: 'MG22100WRJ',
|
|
|
- },
|
|
|
- power: {
|
|
|
- battery: 27,
|
|
|
- distance: 310,
|
|
|
- estimation: 720,
|
|
|
- },
|
|
|
- area: {
|
|
|
- type: '禁飞区',
|
|
|
- name: '禁飞区11',
|
|
|
- },
|
|
|
- weather: {
|
|
|
- type: '',
|
|
|
- },
|
|
|
+const baseInfo = ref({
|
|
|
+ name: '美团001',
|
|
|
+ seriesCode: '1581F5FHD23CT00D9F73',
|
|
|
+ regCode: 'UAS03647299',
|
|
|
+ manufacturer: '深圳市大疆创新科技有限公司',
|
|
|
+ size: '小型',
|
|
|
+ type: '多桨或多轴航空器',
|
|
|
+ model: 'M3E',
|
|
|
+
|
|
|
+ status: '正常',
|
|
|
+ battery: '70%',
|
|
|
+ height: '110m',
|
|
|
+ velocity: '10m/s',
|
|
|
+ taskType: '城配物流',
|
|
|
+ updateTime: '2025-02-20 14:48',
|
|
|
+
|
|
|
+ unit: '深圳市大疆创新科技有限公司',
|
|
|
+ manager: '深圳市大疆创新科技有限公司',
|
|
|
+ tel: '18000000000',
|
|
|
})
|
|
|
|
|
|
+const alertInfo = ref({})
|
|
|
+
|
|
|
+function handleCloseInfo() {
|
|
|
+ uavInfoShow.value = false
|
|
|
+ initSceneDemo()
|
|
|
+ panelStore.setWeather('Clear Skies')
|
|
|
+}
|
|
|
+
|
|
|
onBeforeMount(() => {
|
|
|
getData()
|
|
|
proxy.$bus.on('ueMsgReceived', (msg) => {
|
|
|
if (msg.ModuleName !== 'DemoScene') return
|
|
|
switch (msg.ActionName) {
|
|
|
case 'AlarmDetail': {
|
|
|
+ baseInfo.value.name = msg.Data.name
|
|
|
+ baseInfo.value.seriesCode = msg.Data.flightIdentify
|
|
|
+ baseInfo.value.type = msg.Data.type
|
|
|
+ baseInfo.value.battery = msg.Data.electricity
|
|
|
+ baseInfo.value.height = msg.Data.height.toFixed(2) + 'm'
|
|
|
+ baseInfo.value.velocity = msg.Data.speed.toFixed(2) + 'm/s'
|
|
|
+ if (msg.Data.overall !== 'SAFE') {
|
|
|
+ const { electricityWarning, weatherWarning, collision, noFlyZone, clearZone, nearstAircraft, routeDeviate } =
|
|
|
+ msg.Data.flightDataStatus
|
|
|
+ if (electricityWarning !== 'SAFE' && !('power' in alertInfo.value)) {
|
|
|
+ alertInfo.value.power = {}
|
|
|
+ }
|
|
|
+ if (weatherWarning !== 'SAFE' && !('weather' in alertInfo.value)) {
|
|
|
+ alertInfo.value.weather = {}
|
|
|
+ }
|
|
|
+ if ((nearstAircraft !== 'SAFE' || collision !== 'SAFE') && !('collision' in alertInfo.value)) {
|
|
|
+ alertInfo.value.collision = {}
|
|
|
+ }
|
|
|
+ if ((noFlyZone !== 'SAFE' || clearZone !== 'SAFE') && !('area' in alertInfo.value)) {
|
|
|
+ alertInfo.value.area = {}
|
|
|
+ }
|
|
|
+ if (routeDeviate === true && !('offCourse' in alertInfo.value)) {
|
|
|
+ alertInfo.value.offCourse = {}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!uavInfoShow.value) uavInfoShow.value = true
|
|
|
+ if (layoutStore.sceneLoading) layoutStore.sceneLoading = false
|
|
|
break
|
|
|
}
|
|
|
case 'Weather': {
|
|
|
- alertInfo.value.weather.type = msg.data.weather
|
|
|
+ alertInfo.value.weather.type = msg.Data.weather
|
|
|
+ panelStore.setWeather('Light Rain')
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'BuildingDistance':
|
|
|
+ case 'Near': {
|
|
|
+ alertInfo.value.collision.distance = msg.Data
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'YawDistance': {
|
|
|
+ alertInfo.value.offCourse.distance = msg.Data
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'BreakInto': {
|
|
|
+ alertInfo.value.area.name = msg.Data.name
|
|
|
break
|
|
|
}
|
|
|
case 'Electricity': {
|
|
|
- const { battery, distance, destination } = msg.data
|
|
|
+ const { battery, distance, flightDistance } = msg.Data
|
|
|
alertInfo.value.power = {
|
|
|
battery: battery,
|
|
|
- estimation: distance,
|
|
|
- distance: destination,
|
|
|
+ estimation: flightDistance.toFixed(2),
|
|
|
+ distance: distance.toFixed(2),
|
|
|
}
|
|
|
break
|
|
|
}
|
|
@@ -169,6 +222,7 @@ onBeforeMount(() => {
|
|
|
onBeforeUnmount(() => {
|
|
|
toggleUav(false)
|
|
|
clearAllShapes()
|
|
|
+ panelStore.setWeather('Clear Skies')
|
|
|
})
|
|
|
</script>
|
|
|
|