Sfoglia il codice sorgente

map change

tags/v1.2.0
lixin 1 anno fa
parent
commit
7e589d8cf7
4 ha cambiato i file con 70 aggiunte e 13 eliminazioni
  1. +1
    -1
      src/api/dashboard/index.js
  2. +3
    -1
      src/views/dashboard/components/OneMap.vue
  3. +2
    -2
      src/views/dashboard/components/SuppliesInfo.vue
  4. +64
    -9
      src/views/dashboard/components/WarningDrawer.vue

+ 1
- 1
src/api/dashboard/index.js Vedi File

@@ -106,7 +106,7 @@ export function getQuestionList(data) {
// 预警列表
export function getWarning() {
return request({
url: `/warning/list?status=1`,
url: `/warning/list?status=1&flag=0`,
method: 'GET'
})
}

+ 3
- 1
src/views/dashboard/components/OneMap.vue Vedi File

@@ -504,6 +504,7 @@ export default {
const addWarninglayer = (warningList) => {
const Features = []
warningList?.map((item) => {
// if (item.flag === 0) {
const lngLat =
[parseFloat(item.lng),
parseFloat(item.lat)]
@@ -513,7 +514,7 @@ export default {
// 要素设置样式
feature.setStyle(
new Style({
// 图标
// 图标
image: new Icon({
src: warningIcon,
crossOrigin: 'anonymous'
@@ -528,6 +529,7 @@ export default {
props: item
})
Features.push(feature)
// }
})

// 添加图层

+ 2
- 2
src/views/dashboard/components/SuppliesInfo.vue Vedi File

@@ -7,11 +7,11 @@
</div>

<p class="supplies-type">
<img :src="`../src/assets/gis/images/toLeft.png`" @click="deSuppliesIndex">
<img src="@/assets/gis/images/toLeft.png" @click="deSuppliesIndex">
<span v-for="(item ,index) in MATERIAL_TYPE" v-show="item.value === suppliesType" :key="index">
{{ item.label }}
</span>
<img :src="`../src/assets/gis/images/toRight.png`" @click="inSuppliesIndex">
<img src="@/assets/gis/images/toRight.png" @click="inSuppliesIndex">
</p>

<div class="supplies-table">

+ 64
- 9
src/views/dashboard/components/WarningDrawer.vue Vedi File

@@ -61,8 +61,15 @@
<VideoPlayer
id="emergency-video"
ref="emergencyVideo"
style="position: absolute;left: 0;top: 0"
/>
:use-empty="true"
>
<template #empty>
<div class="video__item--empty">
<img src="@/assets/images/lose-control.png">
<p>暂无信号</p>
</div>
</template>
</VideoPlayer>
</div>
</n-drawer-content>
</n-drawer>
@@ -75,7 +82,7 @@ import ControlPanel from './ControlPanel.vue'
import SpeedChart from './SpeedChart.vue'
import { useInspectionStore } from '@/store/modules/inspection.js'
import VideoPlayer from '@/components/VideoPlayer/index.vue'
import { controlAir, emergencyRecord, uavInfo } from '@/api/task/index.js'
import { controlAir, emergencyRecord, uavInfo, getTaskDetail } from '@/api/task/index.js'

export default defineComponent({
name: 'WarningDrawer',
@@ -114,7 +121,9 @@ export default defineComponent({
operate: '悬停',
control: '手动控制',
chartData: {},
uavFireDis: null
uavFireDis: null,
chartTimer: null,
liveTimer: null
})

/* 获取抽屉的信息 */
@@ -134,6 +143,8 @@ export default defineComponent({
// 关闭视频播放
emergencyVideo.value?.disposeVideo()
// inspectionStore.resetList()
// 关闭定时器
clearTimer()
}

const getEmergencyRecord = async(id) => {
@@ -189,14 +200,24 @@ export default defineComponent({
if (value) {
// 获取无人机实时数据,绘制表格
// if (value.airportId) {
// setInterval(() => {
// data.chartTimer = setInterval(() => {
// getUavInfo(value.airportId)
// }, 2000)
// }
// console.log(value)
// setTimeout(() => {
// initOriginPlayer(value)
// }, 3000)
data.liveTimer = setInterval(async() => {
const res = await getTaskDetail(value.id)
if (res.code === 0) {
console.log(res.data)
if (res.data.aiplayUrl) {
console.log('有流了')
clearInterval(data.liveTimer)
data.liveTimer = null
setTimeout(() => {
initOriginPlayer(value)
}, 3000)
}
}
}, 2000)
}
})

@@ -290,6 +311,7 @@ export default defineComponent({

if (res.code === 0) {
console.log('返航成功')
data.operate = '悬停'
}
}

@@ -310,8 +332,20 @@ export default defineComponent({
}
}

const clearTimer = () => {
if (data.chartTimer) {
clearInterval(data.chartTimer)
data.chartTimer = null
}
if (data.liveTimer) {
clearInterval(data.liveTimer)
data.liveTimer = null
}
}

onBeforeUnmount(() => {
emergencyVideo.value?.disposeVideo()
clearTimer()
})

return {
@@ -447,4 +481,25 @@ export default defineComponent({
transform-origin:100% 0;
}
}

.video__item--empty{
position: absolute;
width: 100%;
height: 100%;
background: rgba(3, 3, 3, 1);
img{
position: absolute;
left: 50%;
top: 45%;
transform: translate(-50%,-50%);
}
p{
position: absolute;
left: 50%;
top: 60%;
transform: translate(-50%,-50%);
font-size: 12px;
color: rgba(255, 255, 255, 1);
}
}
</style>

Loading…
Annulla
Salva