|
@@ -1653,9 +1653,30 @@ export default {
|
|
} else {
|
|
} else {
|
|
// 每次更新
|
|
// 每次更新
|
|
const newData = data.targetAircraft[0].aircrafts;
|
|
const newData = data.targetAircraft[0].aircrafts;
|
|
|
|
+ let isHide = false,
|
|
|
|
+ targetDataKeys,
|
|
|
|
+ flagCount = 0;
|
|
|
|
+ if (this.title == "回放") {
|
|
|
|
+ targetDataKeys = Object.keys(this.targetDataR);
|
|
|
|
+ const count = targetDataKeys.length;
|
|
|
|
+ // 当存的数据大于返回数据时,证明有数据隐藏
|
|
|
|
+ if (count > newData.length) {
|
|
|
|
+ isHide = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
for (let i = 0; i < newData.length; i++) {
|
|
for (let i = 0; i < newData.length; i++) {
|
|
const id = newData[i].aircraftNumber;
|
|
const id = newData[i].aircraftNumber;
|
|
const targetUav = this.targetDataR[`${id}`];
|
|
const targetUav = this.targetDataR[`${id}`];
|
|
|
|
+ if (this.title == "回放" && isHide) {
|
|
|
|
+ targetDataKeys.splice(
|
|
|
|
+ targetDataKeys.findIndex((item) => item === id),
|
|
|
|
+ 1
|
|
|
|
+ );
|
|
|
|
+ flagCount++;
|
|
|
|
+ if (flagCount == newData.length) {
|
|
|
|
+ this.delHideAir(targetDataKeys);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
if (targetUav) {
|
|
if (targetUav) {
|
|
targetUav.x = newData[i].coordinateX;
|
|
targetUav.x = newData[i].coordinateX;
|
|
targetUav.y = newData[i].coordinateY;
|
|
targetUav.y = newData[i].coordinateY;
|
|
@@ -1781,8 +1802,6 @@ export default {
|
|
const targetTexture = new PIXI.Texture.from(uavTarPNG);
|
|
const targetTexture = new PIXI.Texture.from(uavTarPNG);
|
|
const group = new PIXI.Container();
|
|
const group = new PIXI.Container();
|
|
group.id = data.aircraftNumber;
|
|
group.id = data.aircraftNumber;
|
|
- group.buttonMode = true; // 鼠标悬停时显示手型
|
|
|
|
- group.interactive = true;
|
|
|
|
|
|
|
|
// 创建无人机
|
|
// 创建无人机
|
|
const dude = new PIXI.Sprite(targetTexture);
|
|
const dude = new PIXI.Sprite(targetTexture);
|
|
@@ -1828,6 +1847,8 @@ export default {
|
|
group.addChild(text);
|
|
group.addChild(text);
|
|
if (isZhen) {
|
|
if (isZhen) {
|
|
group.typeName = "zhenshi";
|
|
group.typeName = "zhenshi";
|
|
|
|
+ group.buttonMode = true; // 鼠标悬停时显示手型
|
|
|
|
+ group.interactive = true;
|
|
this.targetDataR[`${id}`] = dude;
|
|
this.targetDataR[`${id}`] = dude;
|
|
this.targetUavCircleR[`${id}`] = circle;
|
|
this.targetUavCircleR[`${id}`] = circle;
|
|
this.targetUavCircleNumR[`${id}`] = text;
|
|
this.targetUavCircleNumR[`${id}`] = text;
|
|
@@ -1853,6 +1874,40 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ // 删除回放时隐藏的飞机
|
|
|
|
+ delHideAir(targetDataKeys) {
|
|
|
|
+ const hideId = targetDataKeys[0];
|
|
|
|
+ let group = [];
|
|
|
|
+ this.pixiApp.stage.children.forEach((child) => {
|
|
|
|
+ // 检查 child 是否是 Container 类型
|
|
|
|
+ if (child instanceof PIXI.Container) {
|
|
|
|
+ if (child.id == hideId) {
|
|
|
|
+ group.push(child);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ group.forEach((child) => {
|
|
|
|
+ if (!(child instanceof PIXI.Graphics)) {
|
|
|
|
+ if (child.parent) {
|
|
|
|
+ child.parent.removeChild(child);
|
|
|
|
+ }
|
|
|
|
+ child.destroy();
|
|
|
|
+ if (this.targetDataR[hideId]) {
|
|
|
|
+ delete this.targetDataR[hideId];
|
|
|
|
+ }
|
|
|
|
+ if (this.targetLblAry[hideId]) {
|
|
|
|
+ delete this.targetLblAry[hideId];
|
|
|
|
+ }
|
|
|
|
+ const idx = this.allSpriteInfo.findIndex((info) => {
|
|
|
|
+ return info.id == hideId;
|
|
|
|
+ });
|
|
|
|
+ if (idx > -1) {
|
|
|
|
+ this.allSpriteInfo.splice(idx, 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
// 无人机集群 噪音数据
|
|
// 无人机集群 噪音数据
|
|
showTargetNAircraft(data) {
|
|
showTargetNAircraft(data) {
|
|
const targetData = data.targetAircraft[0];
|
|
const targetData = data.targetAircraft[0];
|
|
@@ -1867,9 +1922,31 @@ export default {
|
|
} else {
|
|
} else {
|
|
// 每次更新
|
|
// 每次更新
|
|
const newData = data.targetAircraft[0].aircrafts;
|
|
const newData = data.targetAircraft[0].aircrafts;
|
|
|
|
+ let isHide = false,
|
|
|
|
+ targetDataKeys,
|
|
|
|
+ flagCount = 0;
|
|
|
|
+ if (this.title == "回放") {
|
|
|
|
+ targetDataKeys = Object.keys(this.targetDataR);
|
|
|
|
+ const count = targetDataKeys.length;
|
|
|
|
+ // 当存的数据大于返回数据时,证明有数据隐藏
|
|
|
|
+ if (count > newData.length) {
|
|
|
|
+ isHide = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
for (let i = 0; i < newData.length; i++) {
|
|
for (let i = 0; i < newData.length; i++) {
|
|
const id = newData[i].aircraftNumber;
|
|
const id = newData[i].aircraftNumber;
|
|
const targetUav = this.targetDataN[`${id}`];
|
|
const targetUav = this.targetDataN[`${id}`];
|
|
|
|
+ // 有隐藏的话要删除飞机
|
|
|
|
+ if (this.title == "回放" && isHide) {
|
|
|
|
+ targetDataKeys.splice(
|
|
|
|
+ targetDataKeys.findIndex((item) => item === id),
|
|
|
|
+ 1
|
|
|
|
+ );
|
|
|
|
+ flagCount++;
|
|
|
|
+ if (flagCount == newData.length) {
|
|
|
|
+ this.delHideAir(targetDataKeys);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
if (targetUav) {
|
|
if (targetUav) {
|
|
targetUav.x = newData[i].coordinateX;
|
|
targetUav.x = newData[i].coordinateX;
|
|
targetUav.y = newData[i].coordinateY;
|
|
targetUav.y = newData[i].coordinateY;
|