@@ -170,16 +170,16 @@ export default defineComponent({ | |||
{ yuntai: '03' } | |||
], | |||
locusList: [ | |||
{ list: { yaogan: '08', pwm: '' }, key: 'up' }, | |||
{ list: { yaogan: '11', pwm: '' }, key: 'redo' }, | |||
{ list: { yaogan: '09', pwm: '' }, key: 'down' }, | |||
{ list: { yaogan: '10', pwm: '' }, key: 'redo' } | |||
{ list: { yaogan: '08', PWM: '' }, key: 'up' }, | |||
{ list: { yaogan: '05', PWM: '' }, key: 'redo' }, | |||
{ list: { yaogan: '09', PWM: '' }, key: 'down' }, | |||
{ list: { yaogan: '04', PWM: '' }, key: 'redo' } | |||
], | |||
moveList: [ | |||
{ list: { yaogan: '06', pwm: '' }, key: 'move' }, | |||
{ list: { yaogan: '05', pwm: '' }, key: 'move' }, | |||
{ list: { yaogan: '07', pwm: '' }, key: 'move' }, | |||
{ list: { yaogan: '04', pwm: '' }, key: 'move' } | |||
{ list: { yaogan: '06', PWM: '' }, key: 'move' }, | |||
{ list: { yaogan: '11', PWM: '' }, key: 'move' }, | |||
{ list: { yaogan: '07', PWM: '' }, key: 'move' }, | |||
{ list: { yaogan: '10', PWM: '' }, key: 'move' } | |||
], | |||
hasEvent: false | |||
}) | |||
@@ -191,8 +191,8 @@ export default defineComponent({ | |||
const handleEvent = (event, params, key) => { | |||
let reset = {} | |||
if (key) { | |||
params.pwm = data.config[key] | |||
reset = { yaogan: '12', pwm: data.config.move } | |||
params.PWM = data.config[key] | |||
reset = { yaogan: '12', PWM: data.config.move } | |||
} else { | |||
reset = { yuntai: '09' } | |||
} |
@@ -200,8 +200,14 @@ export default { | |||
const queryTaskList = async() => { | |||
const res = await getMissionList(task.taskParams) | |||
if (res.code === 0) { | |||
task.taskList = res.data.records | |||
task.pageTotal = res.data.total | |||
var taskCount = 0 | |||
res.data?.records?.map((item) => { | |||
if (item.type === 1) { | |||
task.taskList.push(item) | |||
taskCount++ | |||
} | |||
}) | |||
task.pageTotal = taskCount | |||
} | |||
} | |||
@@ -181,24 +181,26 @@ export default { | |||
var status = '' | |||
var statusNum = 0 | |||
record?.data?.map((item) => { | |||
TASK_STATUS?.forEach((val) => { | |||
if (val.value === item.status) { | |||
status = val.label | |||
statusNum = item.status | |||
} | |||
}) | |||
data.recoedList.push({ | |||
if (item?.status !== 3 || item?.status !== 1) { | |||
TASK_STATUS?.forEach((val) => { | |||
if (val.value === item.status) { | |||
status = val.label | |||
statusNum = item.status | |||
} | |||
}) | |||
data.recoedList.push({ | |||
// 应急任务创建时间 | |||
time: item.createTime, | |||
// 应急任务名称 | |||
name: item.name, | |||
// 状态 | |||
status: status, | |||
// 状态编号 | |||
statusNum: statusNum, | |||
// 应急任务id | |||
emergencyMissionId: item.emergencyMissionId | |||
}) | |||
time: item.createTime, | |||
// 应急任务名称 | |||
name: item.name, | |||
// 状态 | |||
status: status, | |||
// 状态编号 | |||
statusNum: statusNum, | |||
// 应急任务id | |||
emergencyMissionId: item.emergencyMissionId | |||
}) | |||
} | |||
}) | |||
} | |||
@@ -219,16 +221,37 @@ export default { | |||
airportFind = true | |||
} | |||
const airLngLat = turf.point([parseFloat(item.longitude), parseFloat(item.latitude)]) | |||
data.usableAirport.push({ | |||
id: item.id, | |||
airName: item.name, | |||
distance: turf.distance(warningLngLat, airLngLat).toFixed(2), | |||
find: airportFind | |||
}) | |||
data.airpotOptions.push({ | |||
value: item.id, | |||
label: item.name | |||
}) | |||
const distance = turf.distance(warningLngLat, airLngLat).toFixed(2) | |||
// 根据机场最大里程过滤机场 | |||
if (parseInt(item.coverage) > distance) { | |||
// 无人机是否处于空闲状态 | |||
if (parseInt(item.status) === 1) { | |||
data.usableAirport.push({ | |||
id: item.id, | |||
airName: item.name, | |||
distance: distance, | |||
find: airportFind | |||
}) | |||
data.airpotOptions.push({ | |||
value: item.id, | |||
label: item.name | |||
}) | |||
} else { | |||
// 无人机不是空闲 但是发现此预警的内容 | |||
if (data.warningInfo?.airportId === item.id) { | |||
data.usableAirport.push({ | |||
id: item.id, | |||
airName: item.name, | |||
distance: distance, | |||
find: airportFind | |||
}) | |||
data.airpotOptions.push({ | |||
value: item.id, | |||
label: item.name | |||
}) | |||
} | |||
} | |||
} | |||
} | |||
}) | |||
data.airportId = data.airpotOptions[0]?.value || null | |||
@@ -269,6 +292,7 @@ export default { | |||
getRecord(parseInt(data.warningInfo?.id)) | |||
handleExecute(res.data?.emergencyMissionId) | |||
} | |||
return false | |||
} | |||
// 忽略预警 |
@@ -45,7 +45,7 @@ import TileWMS from 'ol/source/TileWMS.js' | |||
import WMTSTileGrid from 'ol/tilegrid/WMTS.js' | |||
import { Tile, Vector as VectorLayer } from 'ol/layer' | |||
import { transform, fromLonLat } from 'ol/proj' | |||
import { Style, Icon, Text, Fill } from 'ol/style' | |||
import { Style, Icon, Text, Fill, Circle } from 'ol/style' | |||
import * as control from 'ol/control' | |||
import uav_icon from '@/assets/images/airport.png' | |||
import warningIcon from '@/assets/gis/images/fire.png' | |||
@@ -121,6 +121,74 @@ export default { | |||
} | |||
}) | |||
// 点击展示属性 | |||
const click2ShowInfo = (e) => { | |||
// 防止冒泡 | |||
e.stopPropagation() | |||
// 点击位置的经纬度 | |||
var feature = data.map.forEachFeatureAtPixel(e.pixel, (feature) => { | |||
return feature | |||
}) | |||
if (feature) { | |||
const properties = feature.getProperties() | |||
// 要素类别为机场 | |||
if (properties.type === 'airport') { | |||
data.airDetail = properties | |||
// 为了overlay位置更加精确 | |||
const coord = properties.coordinate | |||
data.map.addOverlay(data.airOverlay) | |||
data.airOverlay.setPosition(coord) | |||
// 设置z-index | |||
data.airOverlay.getElement().parentElement.style.zIndex = getMaxZOverlay() + 1 | |||
} | |||
// 监控视频 | |||
if (properties.type === 'camera') { | |||
const coord = properties.geometry.flatCoordinates | |||
data.map.addOverlay(data.monitorOverlay) | |||
data.monitorOverlay.setPosition(coord) | |||
// 设置属性 | |||
data.monitorOverlay.setProperties({ 'type': properties.type }) | |||
data.montiorName = properties.props.cameraName | |||
monitorVideo.value?.init({ | |||
id: 'monitor-video', | |||
width: '467px', | |||
height: '260px', | |||
source: properties.props.flvUrl, | |||
isLive: true | |||
}) | |||
// 设置z-index | |||
data.monitorOverlay.getElement().parentElement.style.zIndex = getMaxZOverlay() + 1 | |||
} | |||
// 监控视频 | |||
if (properties.type === 'materials') { | |||
const coord = properties.geometry.flatCoordinates | |||
data.suppliesDetail = properties.props | |||
data.map.addOverlay(data.suppliesOverlay) | |||
data.suppliesOverlay.setPosition(coord) | |||
// 设置属性 | |||
data.suppliesOverlay.setProperties({ 'type': properties.type }) | |||
// 设置z-index | |||
data.suppliesOverlay.getElement().parentElement.style.zIndex = getMaxZOverlay() + 1 | |||
} | |||
// 问题 | |||
if (properties.type === 'question') { | |||
data.problemDetail = properties.props | |||
const coord = properties.geometry.flatCoordinates | |||
data.problemPopupShow = true | |||
data.map.addOverlay(data.problemOverlay) | |||
data.problemOverlay.setPosition(coord) | |||
// 设置属性 | |||
data.problemOverlay.setProperties({ 'code': properties.props.type }) | |||
// 设置z-index | |||
data.problemOverlay.getElement().parentElement.style.zIndex = getMaxZOverlay() + 1 | |||
} | |||
// 预警 | |||
if (properties.type === 'warning') { | |||
data.warningDetail = properties.props | |||
} | |||
} | |||
} | |||
/** | |||
* 初始化地图 | |||
*/ | |||
@@ -187,7 +255,7 @@ export default { | |||
}) | |||
// 地图点击事件 | |||
data.map.on('click', (evt) => { | |||
data.map.on('singleclick', (evt) => { | |||
click2ShowInfo(evt) | |||
}) | |||
@@ -282,74 +350,6 @@ export default { | |||
data.map.addLayer(data.airLayer) | |||
} | |||
// 点击展示属性 | |||
const click2ShowInfo = (e) => { | |||
// 防止冒泡 | |||
e.stopPropagation() | |||
// 点击位置的经纬度 | |||
var feature = data.map.forEachFeatureAtPixel(e.pixel, (feature) => { | |||
return feature | |||
}) | |||
if (feature) { | |||
const properties = feature.getProperties() | |||
// 要素类别为机场 | |||
if (properties.type === 'airport') { | |||
data.airDetail = properties | |||
// 为了overlay位置更加精确 | |||
const coord = properties.coordinate | |||
data.map.addOverlay(data.airOverlay) | |||
data.airOverlay.setPosition(coord) | |||
// 设置z-index | |||
data.airOverlay.getElement().parentElement.style.zIndex = getMaxZOverlay() + 1 | |||
} | |||
// 监控视频 | |||
if (properties.type === 'camera') { | |||
const coord = properties.geometry.flatCoordinates | |||
data.map.addOverlay(data.monitorOverlay) | |||
data.monitorOverlay.setPosition(coord) | |||
// 设置属性 | |||
data.monitorOverlay.setProperties({ 'type': properties.type }) | |||
data.montiorName = properties.props.cameraName | |||
monitorVideo.value?.init({ | |||
id: 'monitor-video', | |||
width: '467px', | |||
height: '260px', | |||
source: properties.props.flvUrl, | |||
isLive: true | |||
}) | |||
// 设置z-index | |||
data.monitorOverlay.getElement().parentElement.style.zIndex = getMaxZOverlay() + 1 | |||
} | |||
// 监控视频 | |||
if (properties.type === 'materials') { | |||
const coord = properties.geometry.flatCoordinates | |||
data.suppliesDetail = properties.props | |||
data.map.addOverlay(data.suppliesOverlay) | |||
data.suppliesOverlay.setPosition(coord) | |||
// 设置属性 | |||
data.suppliesOverlay.setProperties({ 'type': properties.type }) | |||
// 设置z-index | |||
data.suppliesOverlay.getElement().parentElement.style.zIndex = getMaxZOverlay() + 1 | |||
} | |||
// 问题 | |||
if (properties.type === 'question') { | |||
data.problemDetail = properties.props | |||
const coord = properties.geometry.flatCoordinates | |||
data.problemPopupShow = true | |||
data.map.addOverlay(data.problemOverlay) | |||
data.problemOverlay.setPosition(coord) | |||
// 设置属性 | |||
data.problemOverlay.setProperties({ 'code': properties.props.type }) | |||
// 设置z-index | |||
data.problemOverlay.getElement().parentElement.style.zIndex = getMaxZOverlay() + 1 | |||
} | |||
// 预警 | |||
if (properties.type === 'warning') { | |||
data.warningDetail = properties.props | |||
} | |||
} | |||
} | |||
/** | |||
* 获取打开overlay中最大的 z-index | |||
*/ | |||
@@ -512,15 +512,26 @@ export default { | |||
geometry: new Point(fromLonLat(lngLat)) | |||
}) | |||
// 要素设置样式 | |||
feature.setStyle( | |||
feature.setStyle([ | |||
new Style({ | |||
// 图标 | |||
image: new Icon({ | |||
src: warningIcon, | |||
crossOrigin: 'anonymous' | |||
}) | |||
}), | |||
new Style({ | |||
// 将点设置成圆形样式 | |||
image: new Circle({ | |||
// 点的颜色 | |||
fill: new Fill({ | |||
color: 'rgba(0,0,0,0)' | |||
}), | |||
// 圆形半径 | |||
radius: 20 | |||
}) | |||
}) | |||
) | |||
]) | |||
// 要素设置属性 | |||
feature.setProperties({ | |||
// 类型设为 预警 |
@@ -9,7 +9,7 @@ | |||
<p class="side__title">操作</p> | |||
<div class="side__control"> | |||
<n-button>抛投</n-button> | |||
<n-button @click="fanhang">喊话</n-button> | |||
<n-button>喊话</n-button> | |||
<n-button @click="handleOperate">{{ operate }}</n-button> | |||
<n-button @click="handleControl">{{ control }}</n-button> | |||
<n-button class="control__special" round @click="handleBack">返航</n-button> | |||
@@ -58,18 +58,7 @@ | |||
<Underlay ref="baseMap" @distance="calcDistance" /> | |||
</div> | |||
<div ref="videoRef" class="inner"> | |||
<VideoPlayer | |||
id="emergency-video" | |||
ref="emergencyVideo" | |||
:use-empty="true" | |||
> | |||
<template #empty> | |||
<div class="video__item--empty"> | |||
<img src="@/assets/images/lose-control.png"> | |||
<p>暂无信号</p> | |||
</div> | |||
</template> | |||
</VideoPlayer> | |||
<VideoPlayer id="emergency-video" ref="emergencyVideo" @video-status="handleVideoStatus" /> | |||
</div> | |||
</n-drawer-content> | |||
</n-drawer> | |||
@@ -123,7 +112,11 @@ export default defineComponent({ | |||
chartData: {}, | |||
uavFireDis: null, | |||
chartTimer: null, | |||
liveTimer: null | |||
liveTimer: null, | |||
videoInfo: { | |||
url: null, | |||
status: 'init' | |||
} | |||
}) | |||
/* 获取抽屉的信息 */ | |||
@@ -141,6 +134,10 @@ export default defineComponent({ | |||
// 结束直播飞行 | |||
baseMap.value?.endLiveFly() | |||
// 关闭视频播放 | |||
data.videoInfo = { | |||
url: null, | |||
status: 'init' | |||
} | |||
emergencyVideo.value?.disposeVideo() | |||
// inspectionStore.resetList() | |||
// 关闭定时器 | |||
@@ -172,13 +169,6 @@ export default defineComponent({ | |||
window.dispatchEvent(new Event('resize')) | |||
} | |||
const fanhang = () => { | |||
data.chartData = { | |||
speed: [300, 200], | |||
alt: [500, 510] | |||
} | |||
} | |||
const sendControl = (params) => { | |||
airControl(params) | |||
} | |||
@@ -207,13 +197,10 @@ export default defineComponent({ | |||
data.liveTimer = setInterval(async() => { | |||
const res = await getTaskDetail(value.id) | |||
if (res.code === 0) { | |||
if (res.data.aiplayUrl) { | |||
console.log('有流了') | |||
if (res.data.playUrl) { | |||
clearInterval(data.liveTimer) | |||
data.liveTimer = null | |||
setTimeout(() => { | |||
initOriginPlayer(value) | |||
}, 3000) | |||
initOriginPlayer(value) | |||
} | |||
} | |||
}, 2000) | |||
@@ -229,13 +216,19 @@ export default defineComponent({ | |||
/* 初始化播放器 */ | |||
function initOriginPlayer(value) { | |||
data.videoInfo.status = 'init' | |||
const origin = { | |||
width: '100%', | |||
height: '100%', | |||
source: value.aiplayUrl, | |||
source: value.playUrl, | |||
isLive: true | |||
} | |||
emergencyVideo.value?.init(origin) | |||
setTimeout(() => { | |||
if (data.videoInfo.status === 'init') { | |||
initOriginPlayer() | |||
} | |||
}, 30000) | |||
} | |||
const calcDistance = (dis) => { | |||
@@ -315,19 +308,17 @@ export default defineComponent({ | |||
} | |||
const airControl = async(params) => { | |||
for (const key in params) { | |||
const res = await controlAir({ | |||
value: { | |||
key: params[key], | |||
'taskId': inspectionStore.getList?.id, | |||
'airportId': inspectionStore.getList?.airportId, | |||
'msg': '飞行任务' | |||
} | |||
}) | |||
if (res.code === 0) { | |||
console.log('成功') | |||
const res = await controlAir({ | |||
value: { | |||
...params, | |||
'taskId': inspectionStore.getList?.id, | |||
'airportId': inspectionStore.getList?.airportId, | |||
'msg': '飞行任务' | |||
} | |||
}) | |||
if (res.code === 0) { | |||
console.log('成功') | |||
} | |||
} | |||
@@ -342,6 +333,13 @@ export default defineComponent({ | |||
} | |||
} | |||
function handleVideoStatus(status) { | |||
data.videoInfo = { | |||
...data.videoInfo, | |||
status: status | |||
} | |||
} | |||
onBeforeUnmount(() => { | |||
emergencyVideo.value?.disposeVideo() | |||
clearTimer() | |||
@@ -359,11 +357,11 @@ export default defineComponent({ | |||
handleOperate, | |||
handleControl, | |||
handleBack, | |||
fanhang, | |||
sendControl, | |||
baseMap, | |||
emergencyVideo, | |||
calcDistance | |||
calcDistance, | |||
handleVideoStatus | |||
} | |||
} | |||
}) |