Browse Source

change api

tags/v1.0.0^2
zhangtao 2 years ago
parent
commit
2d6e05ee5f
6 changed files with 26 additions and 18 deletions
  1. BIN
      src/assets/images/no-task.png
  2. +3
    -3
      src/views/dashboard/components/AirCard.vue
  3. +8
    -5
      src/views/dashboard/components/TaskCard.vue
  4. +4
    -2
      src/views/dashboard/components/VideoCard.vue
  5. +2
    -2
      src/views/report-manage/all-report/components/ReportDrawer.vue
  6. +9
    -6
      src/views/task-manage/all-task/components/DemandDrawer.vue

BIN
src/assets/images/no-task.png View File

Before After
Width: 116  |  Height: 86  |  Size: 4.9KB

+ 3
- 3
src/views/dashboard/components/AirCard.vue View File

<div class="video__item"> <div class="video__item">
<div class="item__weather"> <div class="item__weather">
<ul> <ul>
<li v-for="(item,index) in weatherList" :key="index">{{ item.label }}:{{ item.value }}</li>
<li v-for="(item,index) in weatherList" :key="index">&nbsp;{{ item.label }}:&nbsp;{{ item.value }}&nbsp;</li>
</ul> </ul>
</div> </div>
<!-- <VideoPlayer :options="getVideoOptions.outer" /> --> <!-- <VideoPlayer :options="getVideoOptions.outer" /> -->
const parm = res.data.wth?.parm || [] const parm = res.data.wth?.parm || []
data.weatherList = parm.length !== 0 ? [ data.weatherList = parm.length !== 0 ? [
// { label: '天气', value: '' }, // { label: '天气', value: '' },
{ label: '气温', value: parm.tmp + '℃' },
{ label: '湿度', value: parm.hum + 'RH' },
{ label: '气温', value: (parm.tmp / 10) + '℃' },
{ label: '湿度', value: (parm.hum / 10) + 'RH' },
{ label: '风度', value: parm.wspd + 'm/s' }, { label: '风度', value: parm.wspd + 'm/s' },
{ label: '风向', value: parm.wdir } { label: '风向', value: parm.wdir }
] : [] ] : []

+ 8
- 5
src/views/dashboard/components/TaskCard.vue View File

<p class="card__title--left">待飞行任务</p> <p class="card__title--left">待飞行任务</p>
<p class="card__title--right" @click="handlePreviewMore">查看更多<SvgIcon icon-class="arrow" /></p> <p class="card__title--right" @click="handlePreviewMore">查看更多<SvgIcon icon-class="arrow" /></p>
</div> </div>
<div>
<div class="card__table">
<n-data-table <n-data-table
:bordered="false" :bordered="false"
:single-column="true" :single-column="true"
:columns="columns" :columns="columns"
:data="tableData" :data="tableData"
:pagination="false" :pagination="false"
:max-heght="350"
> >
<template #empty> <template #empty>
无数据
<img src="@/assets/images/no-task.png" alt="">
</template> </template>
</n-data-table> </n-data-table>
</div> </div>
}, },
{ {
title: '创建人', title: '创建人',
key: 'inspectionType',
key: 'createUser',
align: 'center' align: 'center'
} }
] ]
* @return {*} * @return {*}
*/ */
const loadDataTable = (async function() { const loadDataTable = (async function() {
const res = await getTaskList({ page: 1, limit: 6 })
const res = await getTaskList({ page: 1, limit: 6, status: 1 })
if (res.code === 0) { if (res.code === 0) {
data.tableData = res.data.records data.tableData = res.data.records
} }
} }
} }
} }

.card__table{
height: calc(100% - 40px);
}
::v-deep(.n-data-table){ ::v-deep(.n-data-table){
.n-data-table-tr{ .n-data-table-tr{
.n-data-table-th{ .n-data-table-th{

+ 4
- 2
src/views/dashboard/components/VideoCard.vue View File

function handleAirportChange(value) { function handleAirportChange(value) {
if (value === data.airportIdBack) return if (value === data.airportIdBack) return
data.airportIdBack = value data.airportIdBack = value
data.videoForm.taskId = null
missionLive(value) missionLive(value)
.then(res => { .then(res => {
if (res.code === 0) { if (res.code === 0) {
} }


function handleVideoChange(value) { function handleVideoChange(value) {
const row = data.taskOptions.find((item) => { return item.id === value })
if (!value) { if (!value) {
data.liveUrl = { ...data.airportUrl } data.liveUrl = { ...data.airportUrl }
} else { } else {
data.liveUrl = { data.liveUrl = {
origin: 'http://101.43.84.72:8080/live/34020000001320000001@34020000001320000001.flv',
analyse: 'http://101.43.84.72:8080/live/34020000001320000001@34020000001320000001.flv'
origin: row.videoUrl,
analyse: row.aiVideoUrl
} }
} }
} }

+ 2
- 2
src/views/report-manage/all-report/components/ReportDrawer.vue View File

<n-gi><span>林场名称</span></n-gi> <n-gi><span>林场名称</span></n-gi>
<n-gi><span>{{ reportDetail.lcName }}</span></n-gi> <n-gi><span>{{ reportDetail.lcName }}</span></n-gi>
<n-gi><span>巡查里程</span></n-gi> <n-gi><span>巡查里程</span></n-gi>
<n-gi><span>{{ reportDetail?.mission?.mileage/1000 }}公里</span></n-gi>
<n-gi><span>{{ reportDetail?.mission?.mileage / 1000 }}公里</span></n-gi>
</n-grid> </n-grid>
</div> </div>
</div> </div>
<div> <div>
<n-grid :cols="2"> <n-grid :cols="2">
<n-gi><span>气象信息</span></n-gi> <n-gi><span>气象信息</span></n-gi>
<n-gi><span v-for="(item,index) in weatherList" :key="index">&nbsp;{{ item.label }}: {{ item.value }}&nbsp;</span></n-gi>
<n-gi><span v-for="(item,index) in weatherList" :key="index">&nbsp;{{ item.label }}:&nbsp;{{ item.value }}&nbsp;</span></n-gi>
<n-gi><span>巡检方式</span></n-gi> <n-gi><span>巡检方式</span></n-gi>
<n-gi><span>{{ reportDetail.lcName }}</span></n-gi> <n-gi><span>{{ reportDetail.lcName }}</span></n-gi>
<n-gi><span>巡检设备</span></n-gi> <n-gi><span>巡检设备</span></n-gi>

+ 9
- 6
src/views/task-manage/all-task/components/DemandDrawer.vue View File

</template> </template>


<script> <script>
import { defineComponent, computed, reactive, toRefs, ref, watch } from 'vue'
import { defineComponent, computed, reactive, toRefs, ref, watch, nextTick } from 'vue'
import { Map, View, Feature } from 'ol' import { Map, View, Feature } from 'ol'
import 'ol/ol.css' import 'ol/ol.css'
import { Tile, Vector as VectorLayer } from 'ol/layer' import { Tile, Vector as VectorLayer } from 'ol/layer'
} }
const len = Math.abs(params.currentTime - data.aiVideoInfo.currentTime) const len = Math.abs(params.currentTime - data.aiVideoInfo.currentTime)
if ((params.status === 'skip' || len > 3) && data.canSkip) { if ((params.status === 'skip' || len > 3) && data.canSkip) {
aiVideoRef.value.seekTime(params.currentTime + 0.1)
aiVideoRef.value?.seekTime(params.currentTime + 0.1)
data.canSkip = false data.canSkip = false
setTimeout(() => { setTimeout(() => {
data.canSkip = true data.canSkip = true
} }
const len = Math.abs(params.currentTime - data.videoInfo.currentTime) const len = Math.abs(params.currentTime - data.videoInfo.currentTime)
if ((params.status === 'skip' || len > 3) && data.canSkip) { if ((params.status === 'skip' || len > 3) && data.canSkip) {
videoRef.value.seekTime(params.currentTime + 0.1)
videoRef.value?.seekTime(params.currentTime + 0.1)
data.canSkip = false data.canSkip = false
setTimeout(() => { setTimeout(() => {
data.canSkip = true data.canSkip = true


watch([() => props.visible, () => data.videoStatus], ([visible, status]) => { watch([() => props.visible, () => data.videoStatus], ([visible, status]) => {
if (visible) { if (visible) {
// initTrack(formatTradeList(data.trackList), 'route')
nextTick(() => {
if (!data.mapData) {
initMap()
initTrack(formatTradeList(data.trackList), 'route')
}
})
} }
if (status.status === 'ready' && status.aiStatus === 'ready') { if (status.status === 'ready' && status.aiStatus === 'ready') {
startAllVideo() startAllVideo()
initMap()
initTrack(formatTradeList(data.trackList), 'route')
} }
}, { deep: true }) }, { deep: true })



Loading…
Cancel
Save