Compare commits

...

6 Commits

14 changed files with 420 additions and 101 deletions

View File

@ -7,6 +7,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
/** /**
* 雷达控制链路 * 雷达控制链路
@ -18,6 +20,8 @@ public class SarControlController {
@Autowired @Autowired
private ISarControlService controlInfoService; private ISarControlService controlInfoService;
@Autowired
private ObjectMapper objectMapper;
/** /**
* 发送控制指令 * 发送控制指令
* @param param * @param param
@ -37,7 +41,26 @@ public class SarControlController {
*/ */
@RequestMapping("/turnon") @RequestMapping("/turnon")
public Result turnOn(@RequestBody String ip) { public Result turnOn(@RequestBody String ip) {
controlInfoService.turnOn(ip); String ipVal = "";
try {
// 1. 使用 ObjectMapper JSON 字符串解析成一个 JsonNode
JsonNode rootNode = objectMapper.readTree(ip);
// 2. 从树中获取 "payloadId" 节点并将其值转换为文本
ipVal = rootNode.path("payloadId").asText();
// 检查是否成功获取
if (ipVal == null || ipVal.isEmpty()) {
// 根据你的业务逻辑返回错误例如
return Result.error("请求体中缺少 'payloadId' 或其值为空");
}
} catch (Exception e) {
// 处理JSON解析异常
// 记录日志 e.g., log.error("Failed to parse turnOn payload", e);
return Result.error("请求体JSON格式错误");
}
// 3. 调用服务层
controlInfoService.turnOn(ipVal);
return Result.successData("发送成功"); return Result.successData("发送成功");
} }
@ -48,7 +71,27 @@ public class SarControlController {
*/ */
@RequestMapping("/endall") @RequestMapping("/endall")
public Result endAll(@RequestBody String ip) { public Result endAll(@RequestBody String ip) {
controlInfoService.endAll(ip); String ipVal = "";
try {
// 1. 使用 ObjectMapper JSON 字符串解析成一个 JsonNode
JsonNode rootNode = objectMapper.readTree(ip);
// 2. 从树中获取 "payloadId" 节点并将其值转换为文本
ipVal = rootNode.path("payloadId").asText();
// 检查是否成功获取
if (ipVal == null || ipVal.isEmpty()) {
// 根据你的业务逻辑返回错误例如
return Result.error("请求体中缺少 'payloadId' 或其值为空");
}
} catch (Exception e) {
// 处理JSON解析异常
// 记录日志 e.g., log.error("Failed to parse turnOn payload", e);
return Result.error("请求体JSON格式错误");
}
// 3. 调用服务层
controlInfoService.endAll(ipVal);
return Result.successData("发送成功"); return Result.successData("发送成功");
} }
} }

View File

@ -1,10 +1,9 @@
window.config = { window.config = {
env: 'offline', //online env: 'offline', //online
//api: 'http://127.0.0.1:9116/', // 外网服务器, //api: 'http://127.0.0.1:9116/', // 外网服务器,
api: 'http://127.0.0.1:9116', api: 'http://182.92.203.107:9116',
socket: 'http://127.0.0.1:9116', //外网服务器, socket: 'http://182.92.203.107:9116', //外网服务器,
imagePath: 'http://192.168.112.181:9000/files', imagePath: 'http://182.92.203.107:8080/files',
// imagePath: 'http://127.0.0.1:8080/files',
arithmeticPath: 'http://127.0.0.1:18090/ktkx/UavPlanning/SAR', arithmeticPath: 'http://127.0.0.1:18090/ktkx/UavPlanning/SAR',
tokenKey: 'accessToken', tokenKey: 'accessToken',
refreshTokenKey: 'refreshToken', refreshTokenKey: 'refreshToken',

View File

@ -86,7 +86,7 @@ export const changePayloadRadarOpenState = params =>
export const changeJobStatus = params => export const changeJobStatus = params =>
req('post', '/sar/job/status', params) req('post', '/sar/job/status/selectTask', params)
export const execBrightnessexport = params => export const execBrightnessexport = params =>
req('post', '/jm/job/exec/brightnessexport', params) req('post', '/jm/job/exec/brightness', params)

View File

@ -353,7 +353,7 @@ export function decimalLastNonZeroDecimal(num) {
/** /**
* 数值经度或纬度转度分秒 * 数值经度或纬度转度分秒
* @param {any} decimal * @param {any} decimal
* @param {any} type lon | lat 经度 or * @param {any} type lon | lat 经度 or
* @returns {any} * @returns {any}
*/ */
export function decimalToDMS(decimal, type) { export function decimalToDMS(decimal, type) {

View File

@ -252,7 +252,7 @@ export default {
{ name: '惯导状态', value: '位置+速度+航向', unit: '' }, { name: '惯导状态', value: '位置+速度+航向', unit: '' },
{ name: '年月日', value: moment().format('YYYY-MM-DD'), unit: '' }, { name: '年月日', value: moment().format('YYYY-MM-DD'), unit: '' },
{ name: '经度', value: '120.34534', unit: '°' }, { name: '经度', value: '120.34534', unit: '°' },
{ name: '度', value: '40.34534', unit: '°' }, { name: '度', value: '40.34534', unit: '°' },
{ name: '高度', value: 45002, unit: 'm' }, { name: '高度', value: 45002, unit: 'm' },
], ],
imu: [ imu: [
@ -2674,7 +2674,7 @@ export default {
{ name: '惯导状态', value: this.imuStatus[data.imuStatus], unit: '' }, { name: '惯导状态', value: this.imuStatus[data.imuStatus], unit: '' },
{ name: '年月日', value: data.date, unit: '' }, { name: '年月日', value: data.date, unit: '' },
{ name: '经度', value: data.longitude, unit: '°' }, { name: '经度', value: data.longitude, unit: '°' },
{ name: '度', value: data.latitude, unit: '°' }, { name: '度', value: data.latitude, unit: '°' },
{ name: '高度', value: data.altitude, unit: 'm' }, { name: '高度', value: data.altitude, unit: 'm' },
] ]
this.detailUav.statusInfo.imu = [ this.detailUav.statusInfo.imu = [

View File

@ -128,7 +128,7 @@ export default {
// 操作雷达 // 操作雷达
async handleRadar(row, type) { async handleRadar(row, type) {
if (type === 1) { if (type === 1) {
deviceControlTurnon({ payloadId: row.id }).then(res => { deviceControlTurnon({ payloadId: row.ip }).then(res => {
if (res.data.code === 200) { if (res.data.code === 200) {
this.$message.success('雷达开机成功') this.$message.success('雷达开机成功')
} }
@ -141,7 +141,7 @@ export default {
type: 'warning' type: 'warning'
}) })
if (!bool) return; if (!bool) return;
deviceControlEndall({ payloadId: row.id }).then(res => { deviceControlEndall({ payloadId: row.ip }).then(res => {
if (res.data.code === 200) { if (res.data.code === 200) {
this.$message.success('雷达关机成功') this.$message.success('雷达关机成功')
} }

View File

@ -101,6 +101,7 @@
effect="light" effect="light"
content="修改" content="修改"
placement="top" placement="top"
:hide-after="1000"
> >
<el-button <el-button
type="primary" type="primary"
@ -116,6 +117,7 @@
effect="light" effect="light"
content="手动开机" content="手动开机"
placement="top" placement="top"
:hide-after="1000"
> >
<el-button <el-button
icon="el-icon-switch-button" icon="el-icon-switch-button"
@ -136,6 +138,7 @@
icon="el-icon-close" icon="el-icon-close"
size="mini" size="mini"
circle circle
:hide-after="1000"
@click="handleRadar(scope.row, 2)" @click="handleRadar(scope.row, 2)"
></el-button> ></el-button>
</el-tooltip> </el-tooltip>
@ -145,6 +148,7 @@
effect="light" effect="light"
content="删除" content="删除"
placement="top" placement="top"
:hide-after="1000"
> >
<el-button <el-button
type="danger" type="danger"

View File

@ -987,7 +987,6 @@ export default {
let list = [] let list = []
data.forEach(item => { data.forEach(item => {
item.statusName = this.jobStatus[item.status + ''] item.statusName = this.jobStatus[item.status + '']
console.log(item, 33333333333);
let uav = undefined let uav = undefined
let sar = undefined let sar = undefined
if (item.uavList.length) { if (item.uavList.length) {

View File

@ -20,7 +20,12 @@
</span> </span>
</template> </template>
<template v-slot:command> <template v-slot:command>
<el-tooltip effect="dark" content="新增任务" placement="top"> <el-tooltip
effect="dark"
content="新增任务"
placement="top"
:hide-after="1000"
>
<i class="ri-add-circle-line" @click="openAddForm"></i> <i class="ri-add-circle-line" @click="openAddForm"></i>
</el-tooltip> </el-tooltip>
</template> </template>
@ -48,6 +53,7 @@
effect="dark" effect="dark"
:content="item.check ? '隐藏' : '显示'" :content="item.check ? '隐藏' : '显示'"
placement="top" placement="top"
:hide-after="1000"
> >
<i <i
:class="item.check ? 'ri-eye-off-line' : 'ri-eye-line'" :class="item.check ? 'ri-eye-off-line' : 'ri-eye-line'"
@ -59,6 +65,7 @@
effect="dark" effect="dark"
content="执行" content="执行"
placement="top" placement="top"
:hide-after="1000"
> >
<i <i
class="ri-arrow-up-circle-line" class="ri-arrow-up-circle-line"
@ -70,6 +77,7 @@
content="重新执行" content="重新执行"
placement="top" placement="top"
v-if="item.status === 2" v-if="item.status === 2"
:hide-after="1000"
> >
<i <i
class="ri-restart-line" class="ri-restart-line"

View File

@ -0,0 +1,139 @@
// /src/utils/OrthoImageryManager.js
export default class OrthoImageryManager {
constructor(viewer, Cesium, options = {}) {
this.viewer = viewer;
this.Cesium = Cesium;
this.layerMap = new Map(); // key -> layer
this.layerQueue = []; // 先进先出控制数量
this.maxLayers = options.maxLayers || 400;
// 全局亮度与透明度
this.globalBrightness = options.brightness ?? 1.0;
this.globalAlpha = options.alpha ?? 1.0;
}
/**
* 添加或更新新推送的图片
*/
add(data) {
const key = `${data.jobId}-${data.uavId}~${data.fileId}`;
// 已存在则跳过
if (this.layerMap.has(key)) return;
const rectangle = this.Cesium.Rectangle.fromDegrees(
Math.min(data.left1Lon, data.right2Lon),
Math.min(data.left1Lat, data.right2Lat),
Math.max(data.left1Lon, data.right2Lon),
Math.max(data.left1Lat, data.right2Lat)
);
const provider = new this.Cesium.SingleTileImageryProvider({
url: window.config.imagePath + data.relativePath,
rectangle
});
const layer = this.viewer.cesiumViewer.imageryLayers.addImageryProvider(provider);
// ✅ 使用全局亮度和透明度,保证新图生效
layer.brightness = this.globalBrightness;
layer.alpha = this.globalAlpha;
this.layerMap.set(key, layer);
this.layerQueue.push(key);
this._checkLimit();
}
/**
* 设置全局亮度影响所有已有图片和未来新推送的图片
*/
setBrightness(value) {
this.globalBrightness = value;
this.layerMap.forEach(layer => {
layer.brightness = value;
});
}
/**
* 设置全局透明度
*/
setAlphaAll(value) {
this.globalAlpha = value;
this.layerMap.forEach(layer => {
layer.alpha = value;
});
}
/**
* 对单张图片单独设置亮度不影响全局
*/
setBrightnessForFile(fileId, value) {
const key = [...this.layerMap.keys()].find(k => k.includes(fileId));
if (!key) return;
const layer = this.layerMap.get(key);
if (layer) {
layer.brightness = value;
}
}
/**
* 对单张图片单独设置透明度
*/
setAlphaForFile(fileId, value) {
const key = [...this.layerMap.keys()].find(k => k.includes(fileId));
if (!key) return;
const layer = this.layerMap.get(key);
if (layer) {
layer.alpha = value;
}
}
/**
* 清理超过最大图层数
*/
_checkLimit() {
while (this.layerQueue.length > this.maxLayers) {
const oldestKey = this.layerQueue.shift();
const layer = this.layerMap.get(oldestKey);
if (layer) {
this.viewer.imageryLayers.remove(layer);
this.layerMap.delete(oldestKey);
}
}
}
/**
* 删除单张图片
*/
remove(fileId) {
const key = [...this.layerMap.keys()].find(k => k.includes(fileId));
if (!key) return;
const layer = this.layerMap.get(key);
if (layer) {
this.viewer.imageryLayers.remove(layer);
this.layerMap.delete(key);
// 也从队列里移除
const index = this.layerQueue.indexOf(key);
if (index > -1) this.layerQueue.splice(index, 1);
}
}
/**
* 清空所有图片
*/
clearAll() {
this.layerMap.forEach(layer => {
this.viewer.cesiumViewer.imageryLayers.remove(layer);
});
this.layerMap.clear();
this.layerQueue = [];
}
}

View File

@ -0,0 +1,94 @@
// src/cesium/layers/OrthoManager.js
export default class OrthoManager {
constructor(viewer, Cesium) {
this.viewer = viewer
this.Cesium = Cesium
this.entityMap = new Map()
this.currentBrightness = 1.0
}
/**
* 添加正射影像
*/
add(data) {
const key = `${data.jobId}-${data.uavId}~${data.fileId}`
if (this.entityMap.has(key)) return
const C = this.Cesium
let cby_bg_data = [
data.left1Lon, data.left1Lat,
data.left2Lon, data.left2Lat,
data.right2Lon, data.right2Lat,
data.right1Lon, data.right1Lat,
]
const positions = C.Cartesian3.fromDegreesArray(cby_bg_data)
const entity = this.viewer.entities.add({
id: key,
polygon: {
hierarchy: positions,
perPositionHeight: true,
material: new C.ImageMaterialProperty({
image: window.config.imagePath + data.relativePath,
transparent: false,
color: new C.Color(
this.currentBrightness,
this.currentBrightness,
this.currentBrightness,
1
)
})
}
})
this.entityMap.set(key, entity)
}
/**
* 设置全局亮度
*/
setBrightness(value) {
this.currentBrightness = value
const C = this.Cesium
this.entityMap.forEach(entity => {
entity.polygon.material.color =
new C.Color(value, value, value, 1)
})
}
/**
* 清除全部影像
*/
clearAll() {
this.entityMap.forEach(entity => {
this.viewer.entities.remove(entity)
})
this.entityMap.clear()
}
/**
* 清除某个任务(jobId-uavId)
*/
clearByTask(jobId, uavId) {
const prefix = `${jobId}-${uavId}`
this.entityMap.forEach((entity, key) => {
if (key.startsWith(prefix)) {
this.viewer.entities.remove(entity)
this.entityMap.delete(key)
}
})
}
/**
* 清除单张图片
*/
clearByFile(jobId, uavId, fileId) {
const key = `${jobId}-${uavId}~${fileId}`
if (this.entityMap.has(key)) {
this.viewer.entities.remove(this.entityMap.get(key))
this.entityMap.delete(key)
}
}
}

View File

@ -1,5 +1,6 @@
import { lodLayer, viewer } from '@/components/dt-scene/index.vue' import { lodLayer, viewer } from '@/components/dt-scene/index.vue'
import OrthoImageryManager from './OrthoImageryManager'
import OrthoManager from './OrthoManager'
// 新增空间态势统计 // 新增空间态势统计
// 台风列表 // 台风列表
@ -21,7 +22,11 @@ import {
getTaskItemDetail, getTaskItemDetail,
getTaskListData, getTaskListData,
getUavListData, getUavListData,
reRunTask, stopTaskFly, getExecJobs, execBrightnessexport reRunTask,
stopTaskFly,
getExecJobs,
execBrightnessexport,
changeJobStatus
} from '@/api/task' } from '@/api/task'
import UavTarget from './uavTarget' import UavTarget from './uavTarget'
import PicturesUpload from '../pictures-upload/index.vue' import PicturesUpload from '../pictures-upload/index.vue'
@ -51,6 +56,7 @@ let taskPlanAreaCollection = {}
let radarSceneEntity = {} let radarSceneEntity = {}
let sceneEntity = {} let sceneEntity = {}
let taskListResource = [] let taskListResource = []
let orthoManager = null
export default { export default {
name: 'TwinSituation', name: 'TwinSituation',
props: { props: {
@ -259,7 +265,7 @@ export default {
{ name: '惯导状态', value: '位置+速度+航向', unit: '' }, { name: '惯导状态', value: '位置+速度+航向', unit: '' },
{ name: '年月日', value: moment().format('YYYY-MM-DD'), unit: '' }, { name: '年月日', value: moment().format('YYYY-MM-DD'), unit: '' },
{ name: '经度', value: '', unit: '°' }, { name: '经度', value: '', unit: '°' },
{ name: '度', value: '', unit: '°' }, { name: '度', value: '', unit: '°' },
{ name: '高度', value: '', unit: 'm' }, { name: '高度', value: '', unit: 'm' },
], ],
imu: [ imu: [
@ -397,7 +403,9 @@ export default {
emptyImg: require('@/assets/img/common/empty.svg'), emptyImg: require('@/assets/img/common/empty.svg'),
lightPercent: 0, lightPercent: 0,
contrastPercent: 10, contrastPercent: 10,
imageInfos: undefined imageInfos: {
brightness: 10
},
} }
}, },
computed: { computed: {
@ -502,12 +510,24 @@ export default {
// this.resourceClick(this.resourceList.data[0]) // this.resourceClick(this.resourceList.data[0])
this.handleSceneComplete() this.handleSceneComplete()
this.getTaskList() this.getTaskList()
// orthoManager = new OrthoManager(
// viewer,
// DT.Cesium
// )
orthoManager = new OrthoImageryManager(viewer, DT.Cesium, {
maxLayers: 400,
brightness: 1.2, // 默认亮度
alpha: 1.0 // 默认透明度
})
// this.startTest() // this.startTest()
}, },
beforeDestroy() { beforeDestroy() {
this.SET_SPLIT_VISIBLE(false) this.SET_SPLIT_VISIBLE(false)
this.removePictureHandle() this.removePictureHandle()
if (orthoManager) {
orthoManager.clearAll()
orthoManager = null
}
// 移除任务区域 // 移除任务区域
for (let key in taskPlanAreaCollection) { for (let key in taskPlanAreaCollection) {
if (taskPlanAreaCollection[key]) { if (taskPlanAreaCollection[key]) {
@ -515,7 +535,6 @@ export default {
viewer.entities.remove(item) viewer.entities.remove(item)
}) })
} }
} }
for (let key in taskUavCollection) { for (let key in taskUavCollection) {
if (taskUavCollection[key]) { if (taskUavCollection[key]) {
@ -588,9 +607,9 @@ export default {
} }
}, },
// 亮度设置变化 // 亮度设置变化
onLightChange: debounce(function (value) { onLightChange: debounce(function (val) {
const imageInfos = { ...this.imageInfos } const imageInfos = { ...this.imageInfos }
imageInfos.brightness = value orthoManager.setBrightness(val / 10)
execBrightnessexport(imageInfos).then(res => { execBrightnessexport(imageInfos).then(res => {
console.log('亮度调整成功'); console.log('亮度调整成功');
// this.$message.success('亮度调整成功') // this.$message.success('亮度调整成功')
@ -1128,7 +1147,8 @@ export default {
status: item.status, status: item.status,
statusName: item.statusName, statusName: item.statusName,
uav, uav,
sar sar,
stopTooltipVisible: false
}) })
// TODO // TODO
// item.pointList = [item.pointList] // item.pointList = [item.pointList]
@ -1141,10 +1161,7 @@ export default {
// this.addUavToScene(item) // this.addUavToScene(item)
}) })
if (data.length) { if (data.length) {
this.detailUav.chart.data[0].data = [] this.resetChartData()
this.detailUav.chart.data[1].data = []
this.detailUav.chart.data[2].data = []
this.detailUav.chart.data[3].data = []
this.detailUav.id = data.length ? data[0].id : 1 this.detailUav.id = data.length ? data[0].id : 1
this.detailUav.visible = data.length ? true : false this.detailUav.visible = data.length ? true : false
} }
@ -1342,14 +1359,11 @@ export default {
}, },
addJobLine(info, isFinish) { addJobLine(info, isFinish) {
// 参数和数据校验 // 参数和数据校验
console.log(info, info.uavList, 777777777777);
if (!info || !Array.isArray(info.uavList) || info.uavList.length === 0) return; if (!info || !Array.isArray(info.uavList) || info.uavList.length === 0) return;
const uav = info.uavList[0]; const uav = info.uavList[0];
if (!Array.isArray(uav.airlineList) || uav.airlineList.length === 0) return; if (!Array.isArray(uav.airlineList) || uav.airlineList.length === 0) return;
const key = `${info.id}-${uav.uavId}`; const key = `${info.id}-${uav.uavId}`;
let load = renderTaskInfo[key]; let load = renderTaskInfo[key];
console.log(load, key, 3333333);
if (load) { if (load) {
return; return;
@ -1555,6 +1569,8 @@ export default {
}, },
toggleTaskSceneShow(info, index) { toggleTaskSceneShow(info, index) {
console.log(info, 12312123);
// console.log('切换的info', info) // console.log('切换的info', info)
// console.log('无人机详情面板', this.detailInfo) // console.log('无人机详情面板', this.detailInfo)
if (info.check) { if (info.check) {
@ -1580,6 +1596,10 @@ export default {
// currentPicture = null // currentPicture = null
// } // }
this.removeTaskTarget(info.id); this.removeTaskTarget(info.id);
if (orthoManager) {
orthoManager.clearAll()
orthoManager = null
}
} else { } else {
this.addUavToScene(taskListResource[index]) this.addUavToScene(taskListResource[index])
this.addTaskPlanArea(taskListResource[index].pointList, info.id, info.name) this.addTaskPlanArea(taskListResource[index].pointList, info.id, info.name)
@ -1608,12 +1628,15 @@ export default {
viewer.entities.remove(item) viewer.entities.remove(item)
} }
}) })
if (orthoManager) {
orthoManager.clearAll()
orthoManager = null
}
} else { } else {
this.$message.error(res.data.message) this.$message.error(res.data.message)
} }
}) })
}) })
}, },
/** /**
* 重新执行 * 重新执行
@ -2747,7 +2770,7 @@ export default {
{ name: '惯导状态', value: this.imuStatus[data.imuStatus], unit: '' }, { name: '惯导状态', value: this.imuStatus[data.imuStatus], unit: '' },
{ name: '年月日', value: data.date, unit: '' }, { name: '年月日', value: data.date, unit: '' },
{ name: '经度', value: data.longitude, unit: '°' }, { name: '经度', value: data.longitude, unit: '°' },
{ name: '度', value: data.latitude, unit: '°' }, { name: '度', value: data.latitude, unit: '°' },
{ name: '高度', value: data.altitude, unit: 'm' }, { name: '高度', value: data.altitude, unit: 'm' },
] ]
this.detailUav.statusInfo.imu = [ this.detailUav.statusInfo.imu = [
@ -2789,9 +2812,8 @@ export default {
} }
}, },
handleWebsocketWave(info) { handleWebsocketWave(info) {
console.log('SAR波形', JSON.parse(info.body)) // console.log('SAR波形', JSON.parse(info.body))
let data = JSON.parse(info.body) let data = JSON.parse(info.body)
console.log('id对比', this.detailUav.id, data.payloadId);
if (this.detailUav.visible && this.detailUav.id === data.jobId) { if (this.detailUav.visible && this.detailUav.id === data.jobId) {
let channel1False = [] let channel1False = []
let channel1Real = [] let channel1Real = []
@ -2813,8 +2835,6 @@ export default {
this.detailUav.chart.data[1].data = channel1Real this.detailUav.chart.data[1].data = channel1Real
this.detailUav.chart.data[2].data = channel2False this.detailUav.chart.data[2].data = channel2False
this.detailUav.chart.data[3].data = channel2Real this.detailUav.chart.data[3].data = channel2Real
console.log(this.detailUav.chart.data, 'ssssssssssssssss');
if (this.detailUav.activeNames.includes('4')) { if (this.detailUav.activeNames.includes('4')) {
if (this.$refs.uavDetailChart) { if (this.$refs.uavDetailChart) {
this.$refs.uavDetailChart.updateData(this.detailUav.chart.data) this.$refs.uavDetailChart.updateData(this.detailUav.chart.data)
@ -2825,17 +2845,19 @@ export default {
handleWebsocketImage(info) { handleWebsocketImage(info) {
// console.log('SAR图像', info.body) // console.log('SAR图像', info.body)
let data = JSON.parse(info.body) let data = JSON.parse(info.body)
this.imageInfos = data this.imageInfos = Object.assign({}, this.imageInfos, data)
this.imageInfos.brightness = data.brightness
console.log('SAR图像2', data) console.log('SAR图像2', data)
this.addMarkPicture2(data) orthoManager.add(data)
// this.addMarkPicture2(data)
// console.log('灭有匹配到吗taskUavCollection', taskUavCollection, taskUavCollection[data.jobId]) // console.log('灭有匹配到吗taskUavCollection', taskUavCollection, taskUavCollection[data.jobId])
if (taskUavCollection[data.jobId]) { // if (taskUavCollection[data.jobId]) {
let find = taskUavCollection[data.jobId].find(item => item.uavId + '' === data.uavId + '') // let find = taskUavCollection[data.jobId].find(item => item.uavId + '' === data.uavId + '')
// console.log('找到添加图片的对象', find) // // console.log('找到添加图片的对象', find)
if (find) { // if (find) {
find.appendLoaderPicture(data) // find.appendLoaderPicture(data)
} // }
} // }
// 更新列表里的数据 // 更新列表里的数据
let find = taskListResource.find(item => item.id === data.jobId) let find = taskListResource.find(item => item.id === data.jobId)
if (find) { if (find) {
@ -2876,8 +2898,6 @@ export default {
// })); // }));
// if (this.tempAdd) return // if (this.tempAdd) return
// this.tempAdd = true // this.tempAdd = true
console.log(data, renderTaskInfo, 'tupiantupian');
let id = `${data.jobId}-${data.uavId}` let id = `${data.jobId}-${data.uavId}`
// let target = renderTaskInfo[id] // let target = renderTaskInfo[id]
// if (target) { // if (target) {
@ -2896,49 +2916,49 @@ export default {
material: new DT.Cesium.ImageMaterialProperty({ material: new DT.Cesium.ImageMaterialProperty({
image: window.config.imagePath + data.relativePath, image: window.config.imagePath + data.relativePath,
}), }),
outline: true, outline: false,
outlineColor: DT.Cesium.Color.WHITE, outlineColor: DT.Cesium.Color.RED,
outlineWidth: 2, //很多电脑当宽度>1时没用 outlineWidth: 0, //很多电脑当宽度>1时没用
} }
}) })
let markLineArr = [] let markLineArr = []
if (data.itemList) { if (data.itemList) {
data.itemList.forEach((item) => { // data.itemList.forEach((item) => {
let markId = `${data.jobId}-${data.uavId}-${data.fileId}-${item.id}~mark` // let markId = `${data.jobId}-${data.uavId}-${data.fileId}-${item.id}~mark`
let markPosition = DT.Cesium.Cartesian3.fromDegrees(item.left1Lon, item.left1Lat, 1) // let markPosition = DT.Cesium.Cartesian3.fromDegrees(item.left1Lon, item.left1Lat, 1)
let markArr = [ // let markArr = [
item.left1Lon, item.left1Lat, 1, // item.left1Lon, item.left1Lat, 1,
item.left2Lon, item.left2Lat, 1, // item.left2Lon, item.left2Lat, 1,
item.right2Lon, item.right2Lat, 1, // item.right2Lon, item.right2Lat, 1,
item.right1Lon, item.right1Lat, 1, // item.right1Lon, item.right1Lat, 1,
item.left1Lon, item.left1Lat, 1, // item.left1Lon, item.left1Lat, 1,
] // ]
let markLine = viewer.entities.add({ // let markLine = viewer.entities.add({
id: markId, // id: markId,
show: false, // show: false,
position: markPosition, // position: markPosition,
label: { // label: {
text: this.detectType[item.type], // text: this.detectType[item.type],
font: '12px sans-serif', // font: '12px sans-serif',
fillColor: DT.Cesium.Color.RED, // fillColor: DT.Cesium.Color.RED,
horizontalOrigin: DT.Cesium.HorizontalOrigin.LEFT, // horizontalOrigin: DT.Cesium.HorizontalOrigin.LEFT,
verticalOrigin: DT.Cesium.VerticalOrigin.TOP, // verticalOrigin: DT.Cesium.VerticalOrigin.TOP,
disableDepthTestDistance: 10000, // disableDepthTestDistance: 10000,
showBackground: false, // showBackground: false,
backgroundColor: DT.Cesium.Color.BLACK, // backgroundColor: DT.Cesium.Color.BLACK,
style: DT.Cesium.LabelStyle.FILL_AND_OUTLINE, // style: DT.Cesium.LabelStyle.FILL_AND_OUTLINE,
}, // },
polyline: { // polyline: {
positions: DT.Cesium.Cartesian3.fromDegreesArrayHeights(markArr), // positions: DT.Cesium.Cartesian3.fromDegreesArrayHeights(markArr),
// positions: DT.Cesium.Cartesian3.fromDegreesArray(markArr), // // positions: DT.Cesium.Cartesian3.fromDegreesArray(markArr),
width: 1, // width: 1,
material: DT.Cesium.Color.RED, // material: DT.Cesium.Color.RED,
depthFailMaterial: DT.Cesium.Color.RED, // depthFailMaterial: DT.Cesium.Color.RED,
zIndex: 3, // zIndex: 3,
} // }
}) // })
markLineArr.push(markLine) // markLineArr.push(markLine)
}) // })
} }
// target.picture[`${data.fileId}-picture`] = { // target.picture[`${data.fileId}-picture`] = {
// pictureEntity: entity, // pictureEntity: entity,
@ -3038,10 +3058,7 @@ export default {
taskListResource.splice(findIndex, 1) taskListResource.splice(findIndex, 1)
this.getTaskList() this.getTaskList()
this.removeTaskTarget(data.jobId) this.removeTaskTarget(data.jobId)
this.detailUav.chart.data[0].data = [] this.resetChartData()
this.detailUav.chart.data[1].data = []
this.detailUav.chart.data[2].data = []
this.detailUav.chart.data[3].data = []
this.detailUav.id = '' this.detailUav.id = ''
this.detailUav.visible = false this.detailUav.visible = false
let entitys = [...viewer.entities.values] let entitys = [...viewer.entities.values]
@ -3110,6 +3127,9 @@ export default {
//#endregion //#endregion
// 打开状态和波形信息展示 // 打开状态和波形信息展示
openSarStatusDetail(data) { openSarStatusDetail(data) {
// changeJobStatus(data.id).then(() => {
// this.$message.success('已切换到状态展示')
// })
let entitys = [...viewer.entities.values] let entitys = [...viewer.entities.values]
entitys.forEach(item => { entitys.forEach(item => {
if (item.id.includes(this.detailUav.id)) { if (item.id.includes(this.detailUav.id)) {
@ -3126,14 +3146,21 @@ export default {
this.toggleTaskSceneShow(item, index) this.toggleTaskSceneShow(item, index)
} }
}) })
this.resetChartData()
this.detailUav.id = data.id
this.detailUav.visible = true
},
resetChartData() {
this.detailUav.chart.data[0].data = [] this.detailUav.chart.data[0].data = []
this.detailUav.chart.data[1].data = [] this.detailUav.chart.data[1].data = []
this.detailUav.chart.data[2].data = [] this.detailUav.chart.data[2].data = []
this.detailUav.chart.data[3].data = [] this.detailUav.chart.data[3].data = []
this.detailUav.id = data.id if (this.detailUav.activeNames.includes('4')) {
this.detailUav.visible = true if (this.$refs.uavDetailChart) {
this.$refs.uavDetailChart.updateData(this.detailUav.chart.data)
}
}
}, },
//#region //#region
handleUavDetailCollapse(actives) { handleUavDetailCollapse(actives) {
console.log('展开的', actives) console.log('展开的', actives)
@ -3151,11 +3178,8 @@ export default {
//#region 航线详情 //#region 航线详情
openTaskLineDetail(info) { openTaskLineDetail(info) {
this.taskLineDetail.visible = false this.taskLineDetail.visible = false
console.log(taskListResource, 555);
let find = taskListResource.find(item => item.id === info.id) let find = taskListResource.find(item => item.id === info.id)
console.log('信息', find)
if (find && find.uavList) { if (find && find.uavList) {
let line = [] let line = []
find.uavList.forEach(item => { find.uavList.forEach(item => {

View File

@ -95,6 +95,7 @@
effect="dark" effect="dark"
:content="item.check ? '隐藏' : '显示'" :content="item.check ? '隐藏' : '显示'"
placement="top" placement="top"
:hide-after="1000"
> >
<i <i
:class="item.check ? 'ri-eye-line' : 'ri-eye-off-line'" :class="item.check ? 'ri-eye-line' : 'ri-eye-off-line'"
@ -105,6 +106,7 @@
effect="dark" effect="dark"
content="结束任务" content="结束任务"
placement="top" placement="top"
:hide-after="1000"
v-if="item.status === 1" v-if="item.status === 1"
> >
<i <i
@ -134,17 +136,23 @@
</left-slide> </left-slide>
<div <div
class="image-set" class="image-set"
v-if="taskList.visible && taskList.data.length && imageInfos" v-if="
taskList.visible &&
taskList.data.length &&
imageInfos.brightness !== null
"
> >
<div class="image-set__item"> <div class="image-set__item">
<div class="is-label">亮度</div> <div class="is-label">亮度</div>
<el-slider <el-slider
v-model="lightPercent" v-model="imageInfos.brightness"
show-input show-input
max="30" :min="1"
:max="30"
:step="1"
input-size="mini" input-size="mini"
:show-input-controls="false" :show-input-controls="false"
@input="onLightChange" @change="onLightChange"
> >
</el-slider> </el-slider>
</div> </div>

View File

@ -76,6 +76,7 @@ export default class UavTarget {
this.positions.push(position.clone()) this.positions.push(position.clone())
} }
addUavLoader(data) { addUavLoader(data) {
return;
let loaderPicture = {} let loaderPicture = {}
data.forEach(loader => { data.forEach(loader => {
loaderPicture[loader.payloadId] = [] loaderPicture[loader.payloadId] = []