Merge branch 'main' into dev_20260130_RemoveRedis

This commit is contained in:
longguancheng 2026-03-10 11:25:02 +08:00
commit d8182a14f2
9 changed files with 275 additions and 147 deletions

View File

@ -41,9 +41,3 @@ export const uavUpdate = params =>
// #endregion
export const getLastStatus = params =>
req('get', '/skyeye/payload/getLastStatus', params)
// 雷达开启
export const deviceControlTurnon = params =>
req('post', '/sar/control/turnon', params)
// 雷达关闭
export const deviceControlEndall = params =>
req('post', '/sar/control/endall', params)

View File

@ -90,3 +90,9 @@ export const changeJobStatus = params =>
export const execBrightnessexport = params =>
req('post', '/jm/job/exec/brightness', params)
// 雷达开启
export const deviceControlTurnon = params =>
req('post', '/sar/control/turnon', params)
// 雷达关闭
export const deviceControlEndall = params =>
req('post', '/sar/control/endall', params)

View File

@ -88,6 +88,7 @@ export default {
noExecutingTasks: 'No executing tasks',
endTask: 'Ended Task',
fly: {
isPowerOn: 'Is Power On',
statusInfo: 'Flight Status Information',
height: 'Height',
speed: 'Speed',
@ -171,6 +172,8 @@ export default {
stopTaskConfirm: 'Are you sure you want to stop this task?',
stopTaskSuccess: 'Task stopped successfully!',
planArea: 'Planning Area',
startScan: 'Start Scan',
endScan: 'End Scan',
direction: {
left: 'Left',
right: 'Right',
@ -189,6 +192,8 @@ export default {
loaderType: 'Please select loader type',
ratio: 'Please enter ratio',
},
radarTurnOnSuccess: 'Radar turned on successfully',
radarEndConfirm: 'Are you sure you want to end scan?',
},
device1Manage: {
uav: 'UAV',

View File

@ -87,6 +87,7 @@ export default {
noExecutingTasks: '暂无执行中的任务',
endTask: '结束任务',
fly: {
isPowerOn: '是否开机',
statusInfo: '飞行状态信息',
height: '高度',
speed: '速度',
@ -176,6 +177,8 @@ export default {
},
uavline: "航线",
createAirline: '创建航线',
startScan: '开始扫描',
endScan: '结束扫描',
rules: {
inputTaskName: '请输入任务名称',
startAltitude: '请输入起飞点高度',
@ -188,6 +191,8 @@ export default {
loaderType: '请选择载荷类型',
ratio: '请输入比例',
},
radarTurnOnSuccess: '已开始扫描',
radarEndConfirm: '确定要结束结束扫描?',
},
device1Manage: {
uav: '无人机',

View File

@ -83,15 +83,25 @@
height="100%"
>
<template v-if="queryForm.type === 'payload'">
<el-table-column prop="name" :label="$t('device1Manage.radarName')"> </el-table-column>
<el-table-column prop="type" :label="$t('device1Manage.radarType')"> </el-table-column>
<el-table-column prop="ip" :label="$t('device1Manage.ip')"> </el-table-column>
<el-table-column prop="name" :label="$t('device1Manage.radarName')">
</el-table-column>
<el-table-column prop="type" :label="$t('device1Manage.radarType')">
</el-table-column>
<el-table-column prop="ip" :label="$t('device1Manage.ip')">
</el-table-column>
</template>
<template v-else>
<el-table-column prop="name" :label="$t('device1Manage.uavName')"> </el-table-column>
<el-table-column prop="code" :label="$t('device1Manage.uavCode')"> </el-table-column>
<el-table-column prop="ip" :label="$t('device1Manage.ip')"> </el-table-column>
<el-table-column prop="createTime" :label="$t('device1Manage.createTime')"> </el-table-column>
<el-table-column prop="name" :label="$t('device1Manage.uavName')">
</el-table-column>
<el-table-column prop="code" :label="$t('device1Manage.uavCode')">
</el-table-column>
<el-table-column prop="ip" :label="$t('device1Manage.ip')">
</el-table-column>
<el-table-column
prop="createTime"
:label="$t('device1Manage.createTime')"
>
</el-table-column>
</template>
<el-table-column :label="$t('device1Manage.operation')" width="200">
@ -111,7 +121,7 @@
@click="editDevice(scope.row)"
></el-button>
</el-tooltip>
<template v-if="queryForm.type === 'payload'">
<!-- <template v-if="queryForm.type === 'payload'">
<el-tooltip
class="item"
effect="light"
@ -142,7 +152,7 @@
@click="handleRadar(scope.row, 2)"
></el-button>
</el-tooltip>
</template>
</template> -->
<el-tooltip
class="item"
effect="light"
@ -236,10 +246,12 @@
</el-form>
</div>
<div class="btns" slot="footer">
<el-button @click="close" size="mini">{{ $t('common.cancel') }}</el-button>
<el-button type="primary" size="mini" @click="submitDevice"
>{{ $t('common.confirm') }}</el-button
>
<el-button @click="close" size="mini">{{
$t('common.cancel')
}}</el-button>
<el-button type="primary" size="mini" @click="submitDevice">{{
$t('common.confirm')
}}</el-button>
</div>
</dt-dialog>
</dt-card>

View File

@ -12,21 +12,16 @@ import * as DT from 'dt-sdk'
import moment from 'moment'
import { connectWebSocket, disconnectWebSocket } from '@/utils/web-socket'
import { ICON_MODE } from '@/enum'
import { AmapImageryProvider, TencentImageryProvider } from '@/utils/map-provider'
import { getResourceList } from '@/api/home'
import { removeRefreshToken, removeToken } from '@/utils/auth'
import { getWeatherInfo } from '@/api/user'
import {
flyTaskUavCommand,
getRadarListData,
getTaskItemDetail,
getTaskListData,
getUavListData,
reRunTask,
stopTaskFly,
getExecJobs,
execBrightnessexport,
changeJobStatus
deviceControlTurnon,
deviceControlEndall,
} from '@/api/task'
import UavTarget from './uavTarget'
import PicturesUpload from '../pictures-upload/index.vue'
@ -58,6 +53,7 @@ let radarSceneEntity = {}
let sceneEntity = {}
let taskListResource = []
let orthoManager = null
let socketPositionIndex = 0
const lang = window.localStorage.getItem('locale') || 'zh_CN'
export default {
name: 'TwinSituation',
@ -214,7 +210,7 @@ export default {
longitude: 123.232312,
latitude: 23.232312,
},
activeNames: ['3', '4'],
activeNames: [1, 4],
activeTab: 'DEV',
basicsInfo: {
name: '无人机1',
@ -246,22 +242,7 @@ export default {
taskTime: '2024-12-27 15:00:00'
},
],
statusInfo: {
dev: [],
gps: [],
imu: [],
dev2: {
isWork: true,
isLock: true,
cpuTemperature: 40,
spTemperature: 40,
txTemperature: 40,
ypTemperature: 40,
fpgaTemperature: 40,
storage: 80,
memory: 80,
}
},
statusInfo: [],
chart: {
data: [
{
@ -422,6 +403,10 @@ export default {
},
immediate: true,
},
'imageInfos.brightness'(nv) {
// console.log(nv, 8899999);
},
visibleLocale(nv) {
if (!nv) {
this.$emit('update:visible', false)
@ -495,6 +480,7 @@ export default {
beforeDestroy() {
this.SET_SPLIT_VISIBLE(false)
this.removePictureHandle()
socketPositionIndex = 0
if (orthoManager) {
orthoManager.clearAll()
orthoManager = null
@ -577,9 +563,34 @@ export default {
return '#336dff'
}
},
// 操作雷达
async handleRadar(row, type) {
console.log(row, 8888);
if (type === 1) {
deviceControlTurnon({ payloadId: row.ip }).then(res => {
if (res.data.code === 200) {
this.$message.success(res.data.message)
}
})
} else if (type === 2) {
const bool = await this.$confirm(this.$t('task.radarEndConfirm'), this.$t('task.tip'), {
customClass: 'confirm-light',
confirmButtonText: this.$t('common.confirm'),
cancelButtonText: this.$t('common.cancel'),
type: 'warning'
})
if (!bool) return;
deviceControlEndall({ payloadId: row.ip }).then(res => {
if (res.data.code === 200) {
this.$message.success(this.$t('task.radarEndSuccess'))
}
})
}
},
// 亮度设置变化
onLightChange: debounce(function (val) {
const imageInfos = { ...this.imageInfos }
// const imageInfos = { ...this.imageInfos }
orthoManager.setBrightness(val)
// execBrightnessexport(imageInfos).then(res => {
// console.log('亮度调整成功');
@ -1087,7 +1098,7 @@ export default {
console.log('任务列表', res.data.data)
let data = res.data.data
let list = []
socketPositionIndex = 0
data.forEach(item => {
// item.check = item.status === 1 || item.status === 3
item.check = false
@ -1102,10 +1113,12 @@ export default {
let uav = undefined
let sar = undefined
let ip = undefined
if (item.uavList.length) {
uav = item.uavList[0].uavName
if (item.uavList[0].payloadList.length) {
sar = item.uavList[0].payloadList[0].payloadName
ip = item.uavList[0].ip
}
}
list.push({
@ -1119,6 +1132,7 @@ export default {
statusName: item.statusName,
uav,
sar,
ip,
stopTooltipVisible: false
})
// TODO
@ -1141,7 +1155,7 @@ export default {
this.taskList.data = list
if (this.taskList.data.length) {
this.taskList.data[0].check = true
if (this.menusChose === '1') {
if (this.menusChose === '1' && data[0].mode !== 2) {
this.addUavToScene(data[0])
this.addTaskPlanArea(data[0].pointList, data[0].id, data[0].name)
}
@ -1542,8 +1556,6 @@ export default {
},
toggleTaskSceneShow(info, index) {
console.log(info, 12312123);
// console.log('切换的info', info)
// console.log('无人机详情面板', this.detailInfo)
if (info.check) {
@ -1569,6 +1581,7 @@ export default {
// currentPicture = null
// }
this.removeTaskTarget(info.id);
socketPositionIndex = 0
if (orthoManager) {
orthoManager.clearAll()
orthoManager = null
@ -1601,6 +1614,7 @@ export default {
viewer.entities.remove(item)
}
})
socketPositionIndex = 0
if (orthoManager) {
orthoManager.clearAll()
orthoManager = null
@ -2551,11 +2565,6 @@ export default {
radarViewer.cesiumViewer.resolutionScale = vtxf_dpr
radarLayer = new DT.LODSceneLayer()
radarViewer.addLayer(radarLayer)
// radarViewer.cesiumViewer.scene.screenSpaceCameraController.enableTranslate = false
// radarViewer.cesiumViewer.scene.screenSpaceCameraController.enableRotate = false
// radarViewer.cesiumViewer.scene.screenSpaceCameraController.enableZoom = false
// radarViewer.cesiumViewer.scene.screenSpaceCameraController.enableTilt = false
// radarViewer.cesiumViewer.scene.screenSpaceCameraController.tiltEventTypes = []
// 去掉版权
radarViewer.cesiumViewer._innerCreditContainer.style.display = 'none'
radarViewer.cesiumViewer.scene.camera.flyTo({
@ -2673,7 +2682,7 @@ export default {
let find = taskUavCollection[item.jobId].find(child => child.uavId + '' === item.uavId + '')
if (find) {
let position = DT.Cesium.Cartesian3.fromDegrees(item.payloadList[0].longitude, item.payloadList[0].latitude, item.payloadList[0].altitude)
find.updateCurrentPosition(position)
// find.updateCurrentPosition(position)
}
}
// 位置信息更新到列表
@ -2719,12 +2728,16 @@ export default {
})
},
updateUavInfo(data) {
this.detailUav.statusInfo = []
this.detailUav.baseInfo.flyHeight = Math.round(data.altitude * 10) / 10
this.detailUav.baseInfo.longitude = data.longitude.toFixed(3)
this.detailUav.baseInfo.latitude = data.latitude.toFixed(3)
this.detailUav.baseInfo.status = data.connected
this.detailUav.statusInfo.dev = [
// { name: '是否开机', value: this.sarWorkStatus[data.dIsBoot], unit: '' },
this.detailUav.statusInfo.push(
{
label: 'dev',
children: [
{ name: '是否开机', value: this.sarWorkStatus[data.dIsBoot], unit: '' },
{ name: this.$t('task.fly.clockLock'), value: this.successStatus[data.clockLock], unit: '' },
// { name: 'GPU温度', value: '正常', unit: '' },
{ name: this.$t('task.fly.cpuTemp'), value: data.cpuC, unit: '℃' },
@ -2735,7 +2748,12 @@ export default {
{ name: this.$t('task.fly.diskCapacity'), value: data.diskUtilization, unit: '%' },
{ name: this.$t('task.fly.memoryCapacity'), value: data.memoryCapacity, unit: 'MB' },
]
this.detailUav.statusInfo.gps = [
}
)
this.detailUav.statusInfo.push(
{
label: 'gps',
children: [
// { name: '定位状态', value: '正常', unit: '' },
// { name: '定向状态', value: '正常', unit: '' },
{ name: this.$t('task.fly.rtkStatus'), value: data.rtkStatusLabel, unit: '' },
@ -2746,7 +2764,12 @@ export default {
{ name: this.$t('task.fly.latitude'), value: data.latitude, unit: '°' },
{ name: this.$t('task.fly.height'), value: data.altitude, unit: 'm' },
]
this.detailUav.statusInfo.imu = [
}
)
this.detailUav.statusInfo.push(
{
label: 'imu',
children: [
{ name: this.$t('task.fly.configStatus'), value: '正常', unit: '' },
{ name: this.$t('task.fly.antennaAzimuth'), value: data.antennaAzimuth, unit: '°' },
{ name: this.$t('task.fly.antennaPitch'), value: data.antennaPitch, unit: '°' },
@ -2757,10 +2780,14 @@ export default {
{ name: this.$t('task.fly.rollAngle'), value: data.angleRoll, unit: '°' },
{ name: this.$t('task.fly.yawAngle'), value: data.angleYaw, unit: '°' },
]
}
)
// 更新场景中数据
// this.updateSceneUav(data)
this.updateSceneUav(data)
},
updateSceneUav(data) {
console.log(data, 44444);
let position = DT.Cesium.Cartesian3.fromDegrees(data.longitude, data.latitude, data.altitude)
let entity = viewer.entities.getById('uav-' + data.id)
if (entity) {
@ -2770,16 +2797,38 @@ export default {
id: 'uav-' + data.id,
position: position,
label: {
text: '无人机' + data.id,
text: '无人机',
font: '14px sans-serif',
fillColor: DT.Cesium.Color.WHITE,
horizontalOrigin: DT.Cesium.HorizontalOrigin.LEFT,
outlineColor: DT.Cesium.Color.BLACK,
outlineWidth: 2,
pixelOffset: new DT.Cesium.Cartesian2(5, -4),
disableDepthTestDistance: 10000
verticalOrigin: DT.Cesium.VerticalOrigin.CENTER,
disableDepthTestDistance: 100000,
pixelOffset: new DT.Cesium.Cartesian2(10, 0),
showBackground: true,
scaleByDistance: new DT.Cesium.NearFarScalar(0, 1, 1, 0.8),
distanceDisplayCondition: new DT.Cesium.DistanceDisplayCondition(0, 20000),
backgroundColor: DT.Cesium.Color.fromCssColorString('rgba(0,0,0,0.7)'),
style: DT.Cesium.LabelStyle.FILL_AND_OUTLINE,
},
billboard: {
image: process.env.BASE_URL + 'static/img/icon_wrj.png',
disableDepthTestDistance: 10000
model: {
uri: process.env.BASE_URL + 'model/uav.gltf',
minimumPixelSize: 64,
maximumScale: 128,
},
// point: {
// pixelSize: 40,
// color: DT.Cesium.Color.RED,
// disableDepthTestDistance: 10000
// },
polyline: {
positions: new DT.Cesium.CallbackProperty(function () {
return this.positions
}, false),
width: 8,
zIndex: 600,
material: DT.Cesium.Color.BLACK,
depthFailMaterial: DT.Cesium.Color.CYAN,
arcType: DT.Cesium.ArcType.NONE
}
})
}
@ -2808,7 +2857,7 @@ export default {
this.detailUav.chart.data[1].data = channel1Real
this.detailUav.chart.data[2].data = channel2False
this.detailUav.chart.data[3].data = channel2Real
if (this.detailUav.activeNames.includes('4')) {
if (this.detailUav.activeNames.includes(4)) {
if (this.$refs.uavDetailChart) {
this.$refs.uavDetailChart.updateData(this.detailUav.chart.data)
}
@ -3040,12 +3089,19 @@ export default {
viewer.entities.remove(item)
}
})
socketPositionIndex = 0
if (orthoManager) {
orthoManager.clearAll()
orthoManager = null
}
}
if (data.jobStatus === 1 && this.detailUav.id === data.jobId) {
const job = this.taskList.data.find(el => el.id === data.jobId)
// 巡航模式没有指定的任务区域所以按照socket返回的第一个位置信息来调整相机位置
socketPositionIndex++
if (job && job.mode === 2 && socketPositionIndex === 1) {
this.flyToTarget(data.sarStatus.longitude, data.sarStatus.latitude)
}
this.updateUavInfo(data.sarStatus)
}
this.taskList.data[findIndex].status = data.jobStatus

View File

@ -301,7 +301,7 @@
position: fixed;
top: 60px;
right: 10px;
height: calc(100vh - 220px);
height: calc(100vh - 110px);
}
.detail-info {
@ -1045,13 +1045,10 @@
.detail-uav {
width: 410px;
height: calc(100vh - 220px);
height: calc(100vh - 110px);
transition: 0.2s ease-in-out;
z-index: 2;
::v-deep .dt-card__header {
display: none;
}
.detail-uav__content {
padding-right: 8px;
@ -1300,7 +1297,7 @@
}
&__right {
width: 40px;
width: 78px;
height: 100%;
display: flex;
justify-content: space-between;
@ -1354,3 +1351,12 @@
}
}
}
::v-deep .el-collapse-item__content {
padding-bottom: 10px !important;
}
::v-deep .el-collapse-item__header {
height: 40px !important;
line-height: 40px !important;
}

View File

@ -64,6 +64,30 @@
@click.stop="stopTask(item, index)"
></i>
</el-tooltip>
<el-tooltip
effect="dark"
:content="$t('task.startScan')"
placement="top"
:hide-after="1000"
v-if="item.status === 1"
>
<i
class="el-icon-switch-button"
@click.stop="handleRadar(item, 1)"
></i>
</el-tooltip>
<el-tooltip
effect="dark"
:content="$t('task.endScan')"
placement="top"
:hide-after="1000"
v-if="item.status === 1"
>
<i
class="el-icon-close"
@click.stop="handleRadar(item, 2)"
></i>
</el-tooltip>
</div>
</div>
<p>{{ $t('task.uavName') }}: {{ item.uav }}</p>
@ -236,8 +260,8 @@
v-if="detailUav.visible"
:visible.sync="detailUav.visible"
:scroll="true"
:showClose="true"
:showDivider="false"
:showClose="false"
:showDivider="true"
>
<div class="detail-uav__content">
<div class="other-info">
@ -245,41 +269,25 @@
v-model="detailUav.activeNames"
@change="handleUavDetailCollapse"
>
<el-collapse-item :title="$t('task.statusInfo')" name="3">
<el-tabs v-model="detailUav.activeTab">
<el-tab-pane :label="$t('task.dev')" name="DEV">
<el-collapse-item
v-for="(item, index) in detailUav.statusInfo"
:key="item.label"
:title="item.label"
:name="index + 1"
>
<div
class="uav-span-wrap"
v-for="item in detailUav.statusInfo.dev"
:key="item.name"
v-for="state in item.children"
:key="state.name"
>
<span>{{ item.name }}</span>
<span>{{ item.value }}{{ item.unit }}</span>
<span>{{ state.name }}</span>
<span>{{ state.value }}{{ state.unit }}</span>
</div>
</el-tab-pane>
<el-tab-pane label="GPS" name="GPS">
<div
class="uav-span-wrap"
v-for="item in detailUav.statusInfo.gps"
:key="item.name"
>
<span>{{ item.name }}</span>
<span>{{ item.value }}{{ item.unit }}</span>
</div>
</el-tab-pane>
<el-tab-pane label="IMU" name="IMU">
<div
class="uav-span-wrap"
v-for="item in detailUav.statusInfo.imu"
:key="item.name"
>
<span>{{ item.name }}</span>
<span>{{ item.value }}{{ item.unit }}</span>
</div>
</el-tab-pane>
</el-tabs>
</el-collapse-item>
<el-collapse-item :title="$t('task.waveInfo')" name="4">
<el-collapse-item
:title="$t('task.waveInfo')"
:name="detailUav.statusInfo.length + 1"
>
<div class="wave-chart">
<dt-multiple-analysis
ref="uavDetailChart"

View File

@ -17,11 +17,44 @@ export default class UavTarget {
this.startAltitude = options.startAltitude
this.lang = window.localStorage.getItem('locale') || 'zh_CN'
this.addPlanLine(options.airlineList)
console.log(options, '飞机数据');
if (options.startLon) {
this.addUav(options)
// this.addUav(options)
}
this.addUavLoader(options.payloadList)
this.addFlightStartEndPoint(options)
}
addFlightStartEndPoint(info) {
const airline = info.airlineList[0]
const startPointPosition = DT.Cesium.Cartesian3.fromDegrees(airline.flightStartLon, airline.flightStartLat, airline.flightStartHeight)
let id1 = `${info.jobId}-start-point`
this.addPoint(id1, startPointPosition, '开机点')
const endPointPosition = DT.Cesium.Cartesian3.fromDegrees(airline.flightEndLon, airline.flightEndLat, airline.flightEndHeight)
let id2 = `${info.jobId}-end-point`
this.addPoint(id2, endPointPosition, '关机点')
}
addPoint(id, position, text) {
this.viewer.entities.add({
id,
position,
label: {
text,
font: '14px sans-serif',
fillColor: DT.Cesium.Color.WHITE,
horizontalOrigin: DT.Cesium.HorizontalOrigin.LEFT,
verticalOrigin: DT.Cesium.VerticalOrigin.CENTER,
disableDepthTestDistance: 100000,
pixelOffset: new DT.Cesium.Cartesian2(10, 0),
showBackground: true,
scaleByDistance: new DT.Cesium.NearFarScalar(0, 1, 1, 0.8),
distanceDisplayCondition: new DT.Cesium.DistanceDisplayCondition(0, 20000),
style: DT.Cesium.LabelStyle.FILL_AND_OUTLINE,
},
point: {
pixelSize: 8,
color: DT.Cesium.Color.fromCssColorString('#2bc20c'),
disableDepthTestDistance: 10000
},
})
}
addUav(info) {
let that = this
@ -36,7 +69,6 @@ export default class UavTarget {
}
let currentPosition = this.positions[this.positions.length - 1].clone()
let id = `${this.jobId}~${this.uavId}-uav`
this.uavEntity = this.viewer.entities.add({
id,
position: currentPosition,
@ -46,7 +78,7 @@ export default class UavTarget {
fillColor: DT.Cesium.Color.WHITE,
horizontalOrigin: DT.Cesium.HorizontalOrigin.LEFT,
verticalOrigin: DT.Cesium.VerticalOrigin.CENTER,
disableDepthTestDistance: 10000,
disableDepthTestDistance: 100000,
pixelOffset: new DT.Cesium.Cartesian2(10, 0),
showBackground: true,
scaleByDistance: new DT.Cesium.NearFarScalar(0, 1, 1, 0.8),
@ -56,10 +88,14 @@ export default class UavTarget {
},
model: {
uri: process.env.BASE_URL + 'model/uav.gltf',
// scale: 1,
minimumPixelSize: 32,
maximumScale: 128,
minimumPixelSize: 128,
maximumScale: 256,
},
// point: {
// pixelSize: 40,
// color: DT.Cesium.Color.RED,
// disableDepthTestDistance: 10000
// },
polyline: {
positions: new DT.Cesium.CallbackProperty(function () {
return that.positions