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

This commit is contained in:
zengmingjie 2025-08-24 11:53:14 +08:00
parent 5dc45ea340
commit 18da5b9d48
2 changed files with 64 additions and 27 deletions

View File

@ -12,6 +12,7 @@
<script> <script>
"use script"; "use script";
import moment from "moment";
export default { export default {
name: "myMars", name: "myMars",
props: { props: {
@ -98,6 +99,18 @@ export default {
}, 100); }, 100);
}, },
onProcessTraceability(mapList) { 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 // eslint-disable-next-line no-undef
const property = new Cesium.SampledPositionProperty(); const property = new Cesium.SampledPositionProperty();
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
@ -109,43 +122,56 @@ export default {
let start; let start;
let stop; 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++) { for (let i = 0, len = mapList.length; i < len; i++) {
const item = mapList[i]; const item = mapList[i];
const lng = Number(item.lon); // const lng = Number(item.lon); //
const lat = Number(item.lat); // const lat = Number(item.lat); //
const app_lng = Number(item.app_lon); // const app_lng = Number(item.app_lon); //
const app_lat = Number(item.app_lat); // 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 outputDate = item.createTime.replace(" ", "T");
const time = outputDate; // const time = outputDate; //
let position = null; let position = null;
let app_position = null; let app_position = null;
if (lng !== 0 && lat !== 0) { if (lng && lat) {
if (lng && lat) { // eslint-disable-next-line no-undef
// eslint-disable-next-line no-undef position = Cesium.Cartesian3.fromDegrees(lng, lat, height);
position = Cesium.Cartesian3.fromDegrees(lng, lat, height); app_position = Cesium.Cartesian3.fromDegrees(app_lng, app_lat, 0);
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 (i === 0) { let juliaDate = null;
start = juliaDate; if (time) {
} else if (i === len - 1) { // eslint-disable-next-line no-undef
stop = juliaDate; juliaDate = Cesium.JulianDate.fromIso8601(time);
} }
} else { if (position && juliaDate) {
console.log("经纬度为0忽略该数据"); 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(); this.clearDraw();
// //
console.log(property, "property");
let pathEntity = this.graphicLayer.getGraphicById("pathIdsss"); let pathEntity = this.graphicLayer.getGraphicById("pathIdsss");
if (!pathEntity) { if (!pathEntity) {
pathEntity = new mars3d.graphic.ModelEntity({ pathEntity = new mars3d.graphic.ModelEntity({

View File

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