预警一条数据卡顿问题O4默认入侵

This commit is contained in:
zengmingjie 2025-08-24 11:51:57 +08:00
parent 999ac04b25
commit d4d7b467ae
3 changed files with 65 additions and 28 deletions

View File

@ -1,3 +1,3 @@
NODE_ENV = 'development'
VUE_APP_API_URL = 'http://114.66.57.139:5002'
VUE_APP_API_URL = 'http://114.66.57.139:8088'
VUE_APP_MESSAGE_SDK_DEBUG = true

View File

@ -12,6 +12,7 @@
<script>
"use script";
import moment from "moment";
export default {
name: "myMars",
props: {
@ -98,6 +99,18 @@ export default {
}, 100);
},
onProcessTraceability(mapList) {
let newMapList = (mapList = mapList.filter(
(item) => Number(item.lon) !== 0 && Number(item.lat) !== 0
));
console.log(newMapList, "newMapList");
if (newMapList.length === 0) {
this.clearDraw();
this.$message({
message: "暂无数据",
type: "warning"
});
return;
}
// eslint-disable-next-line no-undef
const property = new Cesium.SampledPositionProperty();
// eslint-disable-next-line no-undef
@ -109,43 +122,56 @@ export default {
let start;
let stop;
//
if (newMapList.length === 1) {
const firstItem = newMapList[0];
const secondItem = { ...firstItem };
// 1 createTime
const firstTime = moment(firstItem.createTime); // 使 moment.js
secondItem.createTime = firstTime
.add(1, "seconds")
.format("YYYY-MM-DD HH:mm:ss");
newMapList.push(secondItem); //
}
for (let i = 0, len = mapList.length; i < len; i++) {
const item = mapList[i];
const lng = Number(item.lon); //
const lat = Number(item.lat); //
const app_lng = Number(item.app_lon); //
const app_lat = Number(item.app_lat); //
const height = item.alt || 5; // 5 geojson
const height = item.alt || 5; // 5 geojson
const outputDate = item.createTime.replace(" ", "T");
const time = outputDate; //
let position = null;
let app_position = null;
if (lng !== 0 && lat !== 0) {
if (lng && lat) {
// eslint-disable-next-line no-undef
position = Cesium.Cartesian3.fromDegrees(lng, lat, height);
app_position = Cesium.Cartesian3.fromDegrees(app_lng, app_lat, 0);
}
let juliaDate = null;
if (time) {
// eslint-disable-next-line no-undef
juliaDate = Cesium.JulianDate.fromIso8601(time);
}
if (position && juliaDate) {
property.addSample(juliaDate, position);
}
if (app_position && juliaDate) {
app_property.addSample(juliaDate, app_position);
}
if (lng && lat) {
// eslint-disable-next-line no-undef
position = Cesium.Cartesian3.fromDegrees(lng, lat, height);
app_position = Cesium.Cartesian3.fromDegrees(app_lng, app_lat, 0);
}
if (i === 0) {
start = juliaDate;
} else if (i === len - 1) {
stop = juliaDate;
}
} else {
console.log("经纬度为0忽略该数据");
let juliaDate = null;
if (time) {
// eslint-disable-next-line no-undef
juliaDate = Cesium.JulianDate.fromIso8601(time);
}
if (position && juliaDate) {
property.addSample(juliaDate, position);
}
if (app_position && juliaDate) {
app_property.addSample(juliaDate, app_position);
}
if (i === 0) {
start = juliaDate;
} else if (i === len - 1) {
stop = juliaDate;
}
}
//
@ -170,6 +196,7 @@ export default {
// });
this.clearDraw();
//
console.log(property, "property");
let pathEntity = this.graphicLayer.getGraphicById("pathIdsss");
if (!pathEntity) {
pathEntity = new mars3d.graphic.ModelEntity({

View File

@ -236,8 +236,14 @@ export default {
alarmList(params).then((res) => {
if (res.code === 0) {
this.tableData = res.data.items.map((item) => {
const { isWhitelist, duration, frequency, alarmLevel, ...rest } =
item;
const {
isWhitelist,
duration,
frequency,
model,
alarmLevel,
...rest
} = JSON.parse(JSON.stringify(item));
let flyStatus = "";
if (isWhitelist) {
@ -245,8 +251,12 @@ export default {
} else {
flyStatus = alarmLevel === 0 ? "防区外" : "入侵";
}
if (model === "O4") {
flyStatus = "入侵";
}
return {
...rest,
model: model,
isattacked: item.isattacked ? "是" : "否", //
duration: String(item.duration),
frequency: String(item.frequency),