预警数据卡顿问题、O4默认入侵
This commit is contained in:
parent
5dc45ea340
commit
18da5b9d48
|
|
@ -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({
|
||||||
|
|
|
||||||
|
|
@ -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),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue