Browse Source

map change

tags/v1.2.0
lixin 1 year ago
parent
commit
c5ac711f5a
8 changed files with 60 additions and 25 deletions
  1. +2
    -1
      src/api/dashboard/index.js
  2. +3
    -3
      src/api/task/index.js
  3. +15
    -0
      src/views/dashboard/components/ControlPanel.vue
  4. +1
    -2
      src/views/dashboard/components/FireAlarm.vue
  5. +12
    -8
      src/views/dashboard/components/SuppliesInfo.vue
  6. +13
    -7
      src/views/dashboard/components/Underlay.vue
  7. +13
    -0
      src/views/dashboard/components/WarningDrawer.vue
  8. +1
    -4
      src/views/dashboard/index.vue

+ 2
- 1
src/api/dashboard/index.js View File

return request({ return request({
url: `/airport/pointflight`, url: `/airport/pointflight`,
method: 'POST', method: 'POST',
params
params,
hideMessage: true
}) })
} }



+ 3
- 3
src/api/task/index.js View File

return request({ return request({
url: `/airport/drone/control`, url: `/airport/drone/control`,
method: 'POST', method: 'POST',
params
params,
hideMessage: true
}) })
} }


export function uavInfo(id) { export function uavInfo(id) {
return request({ return request({
url: `/airport/drone/data/${id}`, url: `/airport/drone/data/${id}`,
method: 'GET',
hideMessage: true
method: 'GET'
}) })
} }

+ 15
- 0
src/views/dashboard/components/ControlPanel.vue View File

<template> <template>
<div v-if="getMode.includes('camera')" class="control__container camera__panel" :class="[cameraShow ? 'open': 'closed']"> <div v-if="getMode.includes('camera')" class="control__container camera__panel" :class="[cameraShow ? 'open': 'closed']">
<p v-if="cameraShow" class="panel-text">云台控制</p>
<n-icon class="control__close" size="20" color="#fff" @click="cameraShow = true"> <n-icon class="control__close" size="20" color="#fff" @click="cameraShow = true">
<DoubleLeftOutlined /> <DoubleLeftOutlined />
</n-icon> </n-icon>
</div> </div>


<div v-if="getMode.includes('locus')" class="control__container locus__panel" :class="[locusShow ? 'open': 'closed']"> <div v-if="getMode.includes('locus')" class="control__container locus__panel" :class="[locusShow ? 'open': 'closed']">
<p v-if="locusShow" class="panel-text">姿态控制</p>
<p v-if="locusShow" class="panel-text" style="left: 190px">平移控制</p>
<n-icon class="control__close" size="20" color="#fff" @click="locusShow = true"> <n-icon class="control__close" size="20" color="#fff" @click="locusShow = true">
<DoubleLeftOutlined /> <DoubleLeftOutlined />
</n-icon> </n-icon>
} }
} }
} }

.panel-text {
width: 90px;
height: 30px;
line-height: 30px;
position: absolute;
color: white;
top: 2px;
left: 0;
padding-left: 10px;
}

.square__panel{ .square__panel{
width: 60px; width: 60px;
height: 180px; height: 180px;

+ 1
- 2
src/views/dashboard/components/FireAlarm.vue View File

right: 20px; right: 20px;
top: 10px; top: 10px;
width: 407px; width: 407px;
height: 925px;
height: 860px;
opacity: 0.85; opacity: 0.85;
border-radius: 1px; border-radius: 1px;
background: rgba(0, 0, 0, 1); background: rgba(0, 0, 0, 1);
.verify-btns { .verify-btns {
width: 100%; width: 100%;
height: 32px; height: 32px;
margin-top: 30px;
span { span {
width: 162px; width: 162px;
height: 32px; height: 32px;

+ 12
- 8
src/views/dashboard/components/SuppliesInfo.vue View File

<div class="supplies-table"> <div class="supplies-table">
<ul class="table-title"> <ul class="table-title">
<li> <li>
<span>序号</span>
<span>物资名称</span>
<span>作用</span>
<span style="width: 60px">序号</span>
<span style="width: 105px">物资名称</span>
<span style="width: 105px">作用</span>
</li> </li>
</ul> </ul>
<ul class="table-content"> <ul class="table-content">
<li v-for="(item, index) in goodsFeaturesByType" :key="index"> <li v-for="(item, index) in goodsFeaturesByType" :key="index">
<span>{{ index + 1 }}</span>
<span>{{ item.goodsName }}</span>
<span>{{ item.goodsAction }}</span>
<span style="width: 60px">{{ index + 1 }}</span>
<span style="width: 105px">{{ item.goodsName }}</span>
<span
style="width: 105px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;"
>{{ item.goodsAction }}</span>
</li> </li>
</ul> </ul>
</div> </div>
line-height: 30px; line-height: 30px;


span { span {
width: 90px;
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
display: inline-block;
float: left;
color: #fff; color: #fff;
font-size: 12px; font-size: 12px;
text-align: center; text-align: center;

+ 13
- 7
src/views/dashboard/components/Underlay.vue View File



/* 获取轨迹数据 */ /* 获取轨迹数据 */
const getTrackData = async function() { const getTrackData = async function() {
const res = await getTrackList(inspectionStore.getList.id)
const trackList = res.data
data.trackList = trackList
return Promise.resolve({
trackList
})
if (inspectionStore.getList?.id) {
const res = await getTrackList(inspectionStore.getList.id)
const trackList = res.data
data.trackList = trackList
return Promise.resolve({
trackList
})
}
} }


const drawAirport = async(id) => { const drawAirport = async(id) => {
} }
} }


if (inspectionStore.getList.id) {
if (inspectionStore.getList?.id) {
if (!data.map) { if (!data.map) {
data.trackTimer = setInterval(() => { data.trackTimer = setInterval(() => {
getTrackData().then(({ trackList }) => { getTrackData().then(({ trackList }) => {
clearInterval(data.socket) clearInterval(data.socket)
data.socket = null data.socket = null
} }
if (data.trackTimer) {
clearInterval(data.trackTimer)
data.trackTimer = null
}
}) })


return { return {

+ 13
- 0
src/views/dashboard/components/WarningDrawer.vue View File

data.chartTimer = setInterval(() => { data.chartTimer = setInterval(() => {
getUavInfo(value.airportId) getUavInfo(value.airportId)
}, 2000) }, 2000)
getUavStatus(value.airportId)
} }
data.liveTimer = setInterval(async() => { data.liveTimer = setInterval(async() => {
const res = await getTaskDetail(value.id) const res = await getTaskDetail(value.id)
} }
}) })


// 获取无人机信息
const getUavInfo = async(id) => { const getUavInfo = async(id) => {
const res = await uavInfo(id) const res = await uavInfo(id)
if (res.code === 0) { if (res.code === 0) {
} }
} }


const getUavStatus = async(id) => {
const res = await uavInfo(id)
if (res.code === 0) {
if (res.data?.length) {
if (res.data[res.data.length - 1]?.mode === 'loiter') {
data.operate = '继续飞行'
}
}
}
}

/* 初始化播放器 */ /* 初始化播放器 */
function initOriginPlayer(playUrl) { function initOriginPlayer(playUrl) {
data.videoInfo.status = 'init' data.videoInfo.status = 'init'

+ 1
- 4
src/views/dashboard/index.vue View File

<div class="basic"> <div class="basic">
<OneMap ref="Map" /> <OneMap ref="Map" />
<Extend ref="extendRef" class="extend" @send="getmessage" /> <Extend ref="extendRef" class="extend" @send="getmessage" />

<!-- <ControlPanel @instruct="handleInstruct" /> -->
</div> </div>
</template> </template>


import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import OneMap from './components/OneMap.vue' import OneMap from './components/OneMap.vue'
import Extend from './components/Extend.vue' import Extend from './components/Extend.vue'
import ControlPanel from './components/ControlPanel.vue'
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
export default { export default {
name: 'HomePage', name: 'HomePage',
components: { OneMap, Extend, ControlPanel },
components: { OneMap, Extend },
setup(props) { setup(props) {
const router = useRouter() const router = useRouter()
const extendRef = ref() const extendRef = ref()

Loading…
Cancel
Save