diff --git a/frontend/Skyeye-sys-ui/src/api/device.js b/frontend/Skyeye-sys-ui/src/api/device.js index c9fa317..fb9541c 100644 --- a/frontend/Skyeye-sys-ui/src/api/device.js +++ b/frontend/Skyeye-sys-ui/src/api/device.js @@ -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) diff --git a/frontend/Skyeye-sys-ui/src/api/task.js b/frontend/Skyeye-sys-ui/src/api/task.js index 923e965..5218c3e 100644 --- a/frontend/Skyeye-sys-ui/src/api/task.js +++ b/frontend/Skyeye-sys-ui/src/api/task.js @@ -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) diff --git a/frontend/Skyeye-sys-ui/src/lang/en.js b/frontend/Skyeye-sys-ui/src/lang/en.js index c847c02..5ced186 100644 --- a/frontend/Skyeye-sys-ui/src/lang/en.js +++ b/frontend/Skyeye-sys-ui/src/lang/en.js @@ -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', diff --git a/frontend/Skyeye-sys-ui/src/lang/zh.js b/frontend/Skyeye-sys-ui/src/lang/zh.js index 4047d55..cbce1a5 100644 --- a/frontend/Skyeye-sys-ui/src/lang/zh.js +++ b/frontend/Skyeye-sys-ui/src/lang/zh.js @@ -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: '无人机', diff --git a/frontend/Skyeye-sys-ui/src/views/home/components/device1-manage/index.vue b/frontend/Skyeye-sys-ui/src/views/home/components/device1-manage/index.vue index d47c229..84e8a73 100644 --- a/frontend/Skyeye-sys-ui/src/views/home/components/device1-manage/index.vue +++ b/frontend/Skyeye-sys-ui/src/views/home/components/device1-manage/index.vue @@ -83,15 +83,25 @@ height="100%" > - - - + + + + + + - - - - + + + + + + + + @@ -111,7 +121,7 @@ @click="editDevice(scope.row)" > - + - {{ $t('common.cancel') }} - {{ $t('common.confirm') }} + {{ + $t('common.cancel') + }} + {{ + $t('common.confirm') + }} diff --git a/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.js b/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.js index 4aed69b..db148d8 100644 --- a/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.js +++ b/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.js @@ -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) } @@ -1569,6 +1583,7 @@ export default { // currentPicture = null // } this.removeTaskTarget(info.id); + socketPositionIndex = 0 if (orthoManager) { orthoManager.clearAll() orthoManager = null @@ -1601,6 +1616,7 @@ export default { viewer.entities.remove(item) } }) + socketPositionIndex = 0 if (orthoManager) { orthoManager.clearAll() orthoManager = null @@ -2551,11 +2567,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 +2684,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,48 +2730,66 @@ 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: '' }, - { 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: '℃' }, - { name: this.$t('task.fly.rfTemp'), value: data.rfC, unit: '℃' }, - { name: this.$t('task.fly.antennaTemp'), value: data.antC, unit: '℃' }, - { name: this.$t('task.fly.diskTemp'), value: data.diskC, unit: '℃' }, - { name: this.$t('task.fly.fpgaTemp'), value: data.fpgaC, unit: '℃' }, - { 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 = [ - // { name: '定位状态', value: '正常', unit: '' }, - // { name: '定向状态', value: '正常', unit: '' }, - { name: this.$t('task.fly.rtkStatus'), value: data.rtkStatusLabel, unit: '' }, - { name: this.$t('task.fly.satelliteNum'), value: data.satelliteNum, unit: '' }, - { name: this.$t('task.fly.imuStatus'), value: this.imuStatus[data.imuStatus], unit: '' }, - { name: this.$t('task.fly.date'), value: data.date, unit: '' }, - { name: this.$t('task.fly.longitude'), value: data.longitude, unit: '°' }, - { 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 = [ - { 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: '°' }, - { name: this.$t('task.fly.eastwardSpeed'), value: data.eastVelocity, unit: 'm/s' }, - { name: this.$t('task.fly.northwardSpeed'), value: data.northVelocity, unit: 'm/s' }, - { name: this.$t('task.fly.upwardSpeed'), value: data.skyVelocity, unit: 'm/s' }, - { name: this.$t('task.fly.pitchAngle'), value: data.anglePitch, unit: '°' }, - { name: this.$t('task.fly.rollAngle'), value: data.angleRoll, unit: '°' }, - { name: this.$t('task.fly.yawAngle'), value: data.angleYaw, 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: '℃' }, + { name: this.$t('task.fly.rfTemp'), value: data.rfC, unit: '℃' }, + { name: this.$t('task.fly.antennaTemp'), value: data.antC, unit: '℃' }, + { name: this.$t('task.fly.diskTemp'), value: data.diskC, unit: '℃' }, + { name: this.$t('task.fly.fpgaTemp'), value: data.fpgaC, unit: '℃' }, + { name: this.$t('task.fly.diskCapacity'), value: data.diskUtilization, unit: '%' }, + { name: this.$t('task.fly.memoryCapacity'), value: data.memoryCapacity, unit: 'MB' }, + ] + } + ) + this.detailUav.statusInfo.push( + { + label: 'gps', + children: [ + // { name: '定位状态', value: '正常', unit: '' }, + // { name: '定向状态', value: '正常', unit: '' }, + { name: this.$t('task.fly.rtkStatus'), value: data.rtkStatusLabel, unit: '' }, + { name: this.$t('task.fly.satelliteNum'), value: data.satelliteNum, unit: '' }, + { name: this.$t('task.fly.imuStatus'), value: this.imuStatus[data.imuStatus], unit: '' }, + { name: this.$t('task.fly.date'), value: data.date, unit: '' }, + { name: this.$t('task.fly.longitude'), value: data.longitude, unit: '°' }, + { name: this.$t('task.fly.latitude'), value: data.latitude, unit: '°' }, + { name: this.$t('task.fly.height'), value: data.altitude, unit: 'm' }, + ] + } + ) + 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: '°' }, + { name: this.$t('task.fly.eastwardSpeed'), value: data.eastVelocity, unit: 'm/s' }, + { name: this.$t('task.fly.northwardSpeed'), value: data.northVelocity, unit: 'm/s' }, + { name: this.$t('task.fly.upwardSpeed'), value: data.skyVelocity, unit: 'm/s' }, + { name: this.$t('task.fly.pitchAngle'), value: data.anglePitch, unit: '°' }, + { 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 +2799,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 +2859,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 +3091,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 diff --git a/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.scss b/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.scss index f223a2a..54b6fd7 100644 --- a/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.scss +++ b/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.scss @@ -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; +} diff --git a/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.vue b/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.vue index 37b4d19..a9e2e14 100644 --- a/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.vue +++ b/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.vue @@ -64,6 +64,30 @@ @click.stop="stopTask(item, index)" > + + + + + + {{ $t('task.uavName') }}: {{ item.uav }} @@ -236,8 +260,8 @@ v-if="detailUav.visible" :visible.sync="detailUav.visible" :scroll="true" - :showClose="true" - :showDivider="false" + :showClose="false" + :showDivider="true" > @@ -245,41 +269,25 @@ v-model="detailUav.activeNames" @change="handleUavDetailCollapse" > - - - - - {{ item.name }}: - {{ item.value }}{{ item.unit }} - - - - - {{ item.name }}: - {{ item.value }}{{ item.unit }} - - - - - {{ item.name }}: - {{ item.value }}{{ item.unit }} - - - + + + {{ state.name }}: + {{ state.value }}{{ state.unit }} + - +
{{ $t('task.uavName') }}: {{ item.uav }}