|
@@ -56,6 +56,7 @@
|
|
<el-table-column label="消息" align="center" prop="context"></el-table-column>
|
|
<el-table-column label="消息" align="center" prop="context"></el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="exportReport()">导出报告</el-button>
|
|
<el-button @click="dialogVisible = false">关闭</el-button>
|
|
<el-button @click="dialogVisible = false">关闭</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -73,7 +74,7 @@ import missileModel from 'public/static/model/basic_missle.glb';
|
|
import centerModel from 'public/static/model/the_white_house.glb';
|
|
import centerModel from 'public/static/model/the_white_house.glb';
|
|
import radarModel from 'public/static/model/radar.glb'
|
|
import radarModel from 'public/static/model/radar.glb'
|
|
import { mapGetters } from "vuex";
|
|
import { mapGetters } from "vuex";
|
|
-import CesiumNavigation from 'cesium-navigation-es6/viewerCesiumNavigationMixin'
|
|
|
|
|
|
+import CesiumNavigation from 'cesium-navigation-es6/viewerCesiumNavigationMixin';
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
TimeLine
|
|
TimeLine
|
|
@@ -92,6 +93,7 @@ export default {
|
|
satelliteRange: [],
|
|
satelliteRange: [],
|
|
missileList: {},
|
|
missileList: {},
|
|
thaadList: {},
|
|
thaadList: {},
|
|
|
|
+ finish: false,
|
|
websocket: null,
|
|
websocket: null,
|
|
centerPosition: null,
|
|
centerPosition: null,
|
|
leftwidth: 12,
|
|
leftwidth: 12,
|
|
@@ -567,9 +569,11 @@ export default {
|
|
console.log('position :>> ', position);
|
|
console.log('position :>> ', position);
|
|
let color = ''
|
|
let color = ''
|
|
let modelUrl = ''
|
|
let modelUrl = ''
|
|
|
|
+ let size = 64
|
|
if (type == 'red') {
|
|
if (type == 'red') {
|
|
color = 'Red'
|
|
color = 'Red'
|
|
modelUrl = missileModel
|
|
modelUrl = missileModel
|
|
|
|
+ size = 100
|
|
this.missileList[name] = {
|
|
this.missileList[name] = {
|
|
disturb: 20,
|
|
disturb: 20,
|
|
id: this.id
|
|
id: this.id
|
|
@@ -612,7 +616,7 @@ export default {
|
|
model: {
|
|
model: {
|
|
uri: modelUrl, // 替换为你的3D模型文件路径
|
|
uri: modelUrl, // 替换为你的3D模型文件路径
|
|
scale: 1.0, // 调整3D模型的缩放大小
|
|
scale: 1.0, // 调整3D模型的缩放大小
|
|
- minimumPixelSize: 64 // 设置3D模型的最小像素大小,确保在视图中可见
|
|
|
|
|
|
+ minimumPixelSize: size // 设置3D模型的最小像素大小,确保在视图中可见
|
|
},
|
|
},
|
|
label: {
|
|
label: {
|
|
text: type + ' ' + name,
|
|
text: type + ' ' + name,
|
|
@@ -637,7 +641,7 @@ export default {
|
|
model: {
|
|
model: {
|
|
uri: modelUrl, // 替换为你的3D模型文件路径
|
|
uri: modelUrl, // 替换为你的3D模型文件路径
|
|
scale: 1.0, // 调整3D模型的缩放大小
|
|
scale: 1.0, // 调整3D模型的缩放大小
|
|
- minimumPixelSize: 64 // 设置3D模型的最小像素大小,确保在视图中可见
|
|
|
|
|
|
+ minimumPixelSize: size // 设置3D模型的最小像素大小,确保在视图中可见
|
|
},
|
|
},
|
|
label: {
|
|
label: {
|
|
text: type + ' ' + name,
|
|
text: type + ' ' + name,
|
|
@@ -664,7 +668,7 @@ export default {
|
|
model: {
|
|
model: {
|
|
uri: modelUrl, // 替换为你的3D模型文件路径
|
|
uri: modelUrl, // 替换为你的3D模型文件路径
|
|
scale: 1.0, // 调整3D模型的缩放大小
|
|
scale: 1.0, // 调整3D模型的缩放大小
|
|
- minimumPixelSize: 64 // 设置3D模型的最小像素大小,确保在视图中可见
|
|
|
|
|
|
+ minimumPixelSize: size // 设置3D模型的最小像素大小,确保在视图中可见
|
|
},
|
|
},
|
|
label: {
|
|
label: {
|
|
text: type + ' ' + name,
|
|
text: type + ' ' + name,
|
|
@@ -683,7 +687,7 @@ export default {
|
|
model: {
|
|
model: {
|
|
uri: modelUrl, // 替换为你的3D模型文件路径
|
|
uri: modelUrl, // 替换为你的3D模型文件路径
|
|
scale: 1.0, // 调整3D模型的缩放大小
|
|
scale: 1.0, // 调整3D模型的缩放大小
|
|
- minimumPixelSize: 64 // 设置3D模型的最小像素大小,确保在视图中可见
|
|
|
|
|
|
+ minimumPixelSize: size // 设置3D模型的最小像素大小,确保在视图中可见
|
|
},
|
|
},
|
|
label: {
|
|
label: {
|
|
text: type + ' ' + name,
|
|
text: type + ' ' + name,
|
|
@@ -779,8 +783,8 @@ export default {
|
|
this.$data._viewer2D.clock.stopTime = stop.clone();
|
|
this.$data._viewer2D.clock.stopTime = stop.clone();
|
|
this.$data._viewer3D.clock.stopTime = stop.clone();
|
|
this.$data._viewer3D.clock.stopTime = stop.clone();
|
|
// 时间速率,数字越大时间过的越快,设置1好像是和实际时间一样
|
|
// 时间速率,数字越大时间过的越快,设置1好像是和实际时间一样
|
|
- this.$data._viewer2D.clock.multiplier = stepTime;
|
|
|
|
- this.$data._viewer3D.clock.multiplier = stepTime;
|
|
|
|
|
|
+ this.$data._viewer2D.clock.multiplier = 10;
|
|
|
|
+ this.$data._viewer3D.clock.multiplier = 10;
|
|
// 时间轴绑定到viewer上去
|
|
// 时间轴绑定到viewer上去
|
|
this.$data._viewer2D.timeline.zoomTo(start, stop);
|
|
this.$data._viewer2D.timeline.zoomTo(start, stop);
|
|
this.$data._viewer3D.timeline.zoomTo(start, stop);
|
|
this.$data._viewer3D.timeline.zoomTo(start, stop);
|
|
@@ -792,24 +796,24 @@ export default {
|
|
time: startTime,
|
|
time: startTime,
|
|
context: "开始模拟!!!"
|
|
context: "开始模拟!!!"
|
|
})
|
|
})
|
|
- this.$data._viewer2D.clock.onTick.addEventListener(clock => {
|
|
|
|
- const currentTime = clock.currentTime; // 获取当前时间轴的时间
|
|
|
|
- const elapsedTime = this.Cesium.JulianDate.secondsDifference(
|
|
|
|
- currentTime,
|
|
|
|
- this.$data._viewer2D.clock.startTime
|
|
|
|
- ); // 获取从起始时间到当前时间的秒数
|
|
|
|
- if (parseInt(elapsedTime) % stepTime === 0 && elapsedTime != 0) {
|
|
|
|
- // 当从起始时间到当前时间的秒数是 stepTime 的倍数时,发送请求
|
|
|
|
- this.requestDataAndUpdateModel2D(startTime, elapsedTime);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ // this.$data._viewer2D.clock.onTick.addEventListener(clock => {
|
|
|
|
+ // const currentTime = clock.currentTime; // 获取当前时间轴的时间
|
|
|
|
+ // const elapsedTime = this.Cesium.JulianDate.secondsDifference(
|
|
|
|
+ // currentTime,
|
|
|
|
+ // this.$data._viewer2D.clock.startTime
|
|
|
|
+ // ); // 获取从起始时间到当前时间的秒数
|
|
|
|
+ // if (parseInt(elapsedTime) % stepTime === 0 && parseInt(elapsedTime) !== 0 && this.$data._viewer2D.clock.shouldAnimate) {
|
|
|
|
+ // // 当从起始时间到当前时间的秒数是 stepTime 的倍数时,发送请求
|
|
|
|
+ // this.requestDataAndUpdateModel2D(startTime, elapsedTime);
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
this.$data._viewer3D.clock.onTick.addEventListener(clock => {
|
|
this.$data._viewer3D.clock.onTick.addEventListener(clock => {
|
|
const currentTime = clock.currentTime; // 获取当前时间轴的时间
|
|
const currentTime = clock.currentTime; // 获取当前时间轴的时间
|
|
const elapsedTime = this.Cesium.JulianDate.secondsDifference(
|
|
const elapsedTime = this.Cesium.JulianDate.secondsDifference(
|
|
currentTime,
|
|
currentTime,
|
|
this.$data._viewer3D.clock.startTime
|
|
this.$data._viewer3D.clock.startTime
|
|
); // 获取从起始时间到当前时间的秒数
|
|
); // 获取从起始时间到当前时间的秒数
|
|
- if (parseInt(elapsedTime) % stepTime === 0 && elapsedTime != 0) {
|
|
|
|
|
|
+ if (parseInt(elapsedTime) % stepTime === 0 && parseInt(elapsedTime) !== 0) {
|
|
// 当从起始时间到当前时间的秒数是 stepTime 的倍数时,发送请求
|
|
// 当从起始时间到当前时间的秒数是 stepTime 的倍数时,发送请求
|
|
this.requestDataAndUpdateModel3D(startTime, elapsedTime);
|
|
this.requestDataAndUpdateModel3D(startTime, elapsedTime);
|
|
}
|
|
}
|
|
@@ -942,7 +946,8 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+ // this.$data._viewer2D.clock.shouldAnimate = true;
|
|
|
|
+ // this.$data._viewer3D.clock.shouldAnimate = true;
|
|
},
|
|
},
|
|
// 根据时间参数请求模型位置并更新 2D
|
|
// 根据时间参数请求模型位置并更新 2D
|
|
async requestDataAndUpdateModel2D(startTime, elapsedTime) {
|
|
async requestDataAndUpdateModel2D(startTime, elapsedTime) {
|
|
@@ -982,10 +987,11 @@ export default {
|
|
}
|
|
}
|
|
this.judgeMissile(this.$data._viewer2D, newTimeString);
|
|
this.judgeMissile(this.$data._viewer2D, newTimeString);
|
|
//判断攻防是否结束
|
|
//判断攻防是否结束
|
|
- if (this.ifFinish(this.$data._viewer3D, newTimeString)) {
|
|
|
|
|
|
+ if (this.ifFinish(this.$data._viewer3D, newTimeString) && !this.finish) {
|
|
// 停止时间轴动画
|
|
// 停止时间轴动画
|
|
this.$data._viewer2D.clock.shouldAnimate = false;
|
|
this.$data._viewer2D.clock.shouldAnimate = false;
|
|
this.dialogVisible = true
|
|
this.dialogVisible = true
|
|
|
|
+ this.finish = true
|
|
}
|
|
}
|
|
|
|
|
|
//更新模型位置
|
|
//更新模型位置
|
|
@@ -1035,10 +1041,11 @@ export default {
|
|
//判断是否有导弹被拦截
|
|
//判断是否有导弹被拦截
|
|
this.judgeMissile(this.$data._viewer3D, newTimeString);
|
|
this.judgeMissile(this.$data._viewer3D, newTimeString);
|
|
//判断攻防是否结束
|
|
//判断攻防是否结束
|
|
- if (this.ifFinish(this.$data._viewer3D, newTimeString)) {
|
|
|
|
|
|
+ if (this.ifFinish(this.$data._viewer3D, newTimeString) && !this.finish) {
|
|
// 停止时间轴动画
|
|
// 停止时间轴动画
|
|
this.$data._viewer3D.clock.shouldAnimate = false;
|
|
this.$data._viewer3D.clock.shouldAnimate = false;
|
|
this.dialogVisible = true
|
|
this.dialogVisible = true
|
|
|
|
+ this.finish = true
|
|
}
|
|
}
|
|
|
|
|
|
//更新模型位置
|
|
//更新模型位置
|
|
@@ -1131,13 +1138,13 @@ export default {
|
|
radar.ellipsoid.radii = new this.Cesium.Cartesian3(newRange, newRange, newRange);
|
|
radar.ellipsoid.radii = new this.Cesium.Cartesian3(newRange, newRange, newRange);
|
|
},
|
|
},
|
|
isObjectEmpty(obj) {
|
|
isObjectEmpty(obj) {
|
|
- for (let key in obj) {
|
|
|
|
- if (obj.hasOwnProperty(key)) {
|
|
|
|
- return false; // 如果对象有任何属性,返回 false
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return true; // 如果对象没有任何属性,返回 true
|
|
|
|
-},
|
|
|
|
|
|
+ for (let key in obj) {
|
|
|
|
+ if (obj.hasOwnProperty(key)) {
|
|
|
|
+ return false; // 如果对象有任何属性,返回 false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true; // 如果对象没有任何属性,返回 true
|
|
|
|
+ },
|
|
//判断攻防是否完成
|
|
//判断攻防是否完成
|
|
ifFinish(viewer, time) {
|
|
ifFinish(viewer, time) {
|
|
if (this.isObjectEmpty(this.missileList)) {
|
|
if (this.isObjectEmpty(this.missileList)) {
|
|
@@ -1150,7 +1157,7 @@ export default {
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
for (let key in this.missileList) {
|
|
for (let key in this.missileList) {
|
|
- let missilePos = viewer.entities.getById(this.messageList[key].id).position._value
|
|
|
|
|
|
+ let missilePos = viewer.entities.getById(this.missileList[key].id).position._value
|
|
if (this.Cesium.Cartesian3.distance(this.centerPosition, missilePos) <= 100) {
|
|
if (this.Cesium.Cartesian3.distance(this.centerPosition, missilePos) <= 100) {
|
|
this.messageList.push({
|
|
this.messageList.push({
|
|
order: this.order,
|
|
order: this.order,
|
|
@@ -1162,6 +1169,10 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return false
|
|
return false
|
|
|
|
+ },
|
|
|
|
+ exportReport() {
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|