Browse Source

Merge branch 'lixin' of gitadmin/tuoheng_lc_web into develop

tags/v1.2.0
lixin 1 year ago
parent
commit
bad8497930
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

@@ -150,7 +150,8 @@ export function pointflight(params) {
return request({
url: `/airport/pointflight`,
method: 'POST',
params
params,
hideMessage: true
})
}


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

@@ -173,7 +173,8 @@ export function controlAir(params) {
return request({
url: `/airport/drone/control`,
method: 'POST',
params
params,
hideMessage: true
})
}

@@ -190,7 +191,6 @@ export function emergencyRecord(params) {
export function uavInfo(id) {
return request({
url: `/airport/drone/data/${id}`,
method: 'GET',
hideMessage: true
method: 'GET'
})
}

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

@@ -1,5 +1,6 @@
<template>
<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">
<DoubleLeftOutlined />
</n-icon>
@@ -56,6 +57,8 @@
</div>

<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">
<DoubleLeftOutlined />
</n-icon>
@@ -280,6 +283,18 @@ export default defineComponent({
}
}
}

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

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

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

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

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

@@ -17,16 +17,21 @@
<div class="supplies-table">
<ul class="table-title">
<li>
<span>序号</span>
<span>物资名称</span>
<span>作用</span>
<span style="width: 60px">序号</span>
<span style="width: 105px">物资名称</span>
<span style="width: 105px">作用</span>
</li>
</ul>
<ul class="table-content">
<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>
</ul>
</div>
@@ -176,10 +181,9 @@ export default {
line-height: 30px;

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

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

@@ -103,12 +103,14 @@ export default {

/* 获取轨迹数据 */
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) => {
@@ -218,7 +220,7 @@ export default {
}
}

if (inspectionStore.getList.id) {
if (inspectionStore.getList?.id) {
if (!data.map) {
data.trackTimer = setInterval(() => {
getTrackData().then(({ trackList }) => {
@@ -360,6 +362,10 @@ export default {
clearInterval(data.socket)
data.socket = null
}
if (data.trackTimer) {
clearInterval(data.trackTimer)
data.trackTimer = null
}
})

return {

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

@@ -198,6 +198,7 @@ export default defineComponent({
data.chartTimer = setInterval(() => {
getUavInfo(value.airportId)
}, 2000)
getUavStatus(value.airportId)
}
data.liveTimer = setInterval(async() => {
const res = await getTaskDetail(value.id)
@@ -241,6 +242,7 @@ export default defineComponent({
}
})

// 获取无人机信息
const getUavInfo = async(id) => {
const res = await uavInfo(id)
if (res.code === 0) {
@@ -248,6 +250,17 @@ export default defineComponent({
}
}

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) {
data.videoInfo.status = 'init'

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

@@ -2,8 +2,6 @@
<div class="basic">
<OneMap ref="Map" />
<Extend ref="extendRef" class="extend" @send="getmessage" />

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

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

Loading…
Cancel
Save