Browse Source

去掉冗余代码

master
menghao 3 months ago
parent
commit
9b1daba6fe
  1. 220
      ruoyi-ui/src/views/childRoom/index.vue

220
ruoyi-ui/src/views/childRoom/index.vue

@ -10,10 +10,10 @@
<p>二维GIS地图区域</p>
<p class="text-sm mt-1">支持标绘/航线/空域/实时态势</p>
</div>
<!-- 地图中间的浮动红点触发左侧菜单 -->
<div
class="floating-red-dot left-red-dot"
<div
class="floating-red-dot left-red-dot"
:class="{ hidden: !isMenuHidden }"
@click="showMenu"
title="显示左侧菜单"
@ -108,42 +108,42 @@
<bottom-left-panel />
<!-- 底部时间轴最初版本的样式- 蓝色主题 -->
<div
class="floating-timeline blue-theme"
<div
class="floating-timeline blue-theme"
:class="{ 'show': showKTimePopup }"
>
<!-- 隐藏按钮向下箭头 -->
<div class="popup-hide-btn" @click="hideKTimePopup" title="隐藏K时">
<i class="el-icon-arrow-down"></i>
</div>
<div class="timeline-controls">
<div class="current-time blue-time">
<i class="el-icon-time"></i>
<span class="time-text">{{ currentTime }}</span>
</div>
<div class="timeline-slider">
<el-slider
v-model="timeProgress"
:max="100"
<el-slider
v-model="timeProgress"
:max="100"
:format-tooltip="formatTimeTooltip"
class="compact-slider blue-slider"
/>
</div>
<div class="playback-controls">
<button
class="control-btn blue-control-btn"
<button
class="control-btn blue-control-btn"
@click="togglePlay"
:title="isPlaying ? '暂停' : '播放'"
>
<i :class="isPlaying ? 'el-icon-video-pause' : 'el-icon-video-play'"></i>
</button>
<div class="speed-control">
<button
class="control-btn blue-control-btn"
<button
class="control-btn blue-control-btn"
@click="decreaseSpeed"
:disabled="playbackSpeed <= 1"
title="减速"
@ -151,8 +151,8 @@
<i class="el-icon-arrow-down"></i>
</button>
<span class="speed-text">{{ playbackSpeed }}x</span>
<button
class="control-btn blue-control-btn"
<button
class="control-btn blue-control-btn"
@click="increaseSpeed"
:disabled="playbackSpeed >= 25"
title="加速"
@ -162,29 +162,29 @@
</div>
</div>
</div>
</div>
<!-- 在线成员弹窗 -->
<online-members-dialog
v-model="showOnlineMembers"
/>
<!-- 平台编辑弹窗 -->
<platform-edit-dialog
v-model="showPlatformDialog"
:platform="selectedPlatform"
@save="updatePlatform"
/>
<!-- 航线编辑弹窗 -->
<route-edit-dialog
v-model="showRouteDialog"
:route="selectedRoute"
@save="updateRoute"
/>
<!-- 航点编辑弹窗 -->
<waypoint-edit-dialog
v-model="showWaypointDialog"
@ -229,28 +229,28 @@ export default {
selectedRoute: null,
showWaypointDialog: false,
selectedWaypoint: null,
//
roomCode: 'JTF-7-ALPHA',
onlineCount: 30,
combatTime: 'K+01:30:45',
astroTime: '',
//
isMenuHidden: true, //
activeMenu: 'file',
//
isRightPanelHidden: true, //
// K
showKTimePopup: false,
// /
showAirport: true,
showLandmark: true,
showRoute: true,
menuItems: [
{ id: 'file', name: '方案', icon: 'el-icon-s-operation' },
{ id: 'start', name: '冲突', icon: 'el-icon-warning-outline' },
@ -263,12 +263,12 @@ export default {
{ id: 'import', name: '导入', icon: 'el-icon-upload2' },
{ id: 'export', name: '导出', icon: 'el-icon-download' }
],
//
activeRightTab: 'plan',
selectedRouteId: 101,
selectedRouteDetails: null,
//
conflictCount: 2,
conflicts: [
@ -289,7 +289,7 @@ export default {
severity: 'medium'
}
],
//
activePlatformTab: 'air',
airPlatforms: [
@ -308,21 +308,21 @@ export default {
{ id: 9, name: 'PLZ-05自行火炮', type: '自行火炮', icon: 'el-icon-aim', color: '#fa8c16', status: 'ready' },
{ id: 10, name: '指挥控制车', type: '指挥车', icon: 'el-icon-monitor', color: '#1890ff', status: 'operating' },
],
// 线
routes: [
{ id: 101, name: 'Alpha进场航线', points: 8, conflict: true },
{ id: 102, name: 'Beta巡逻航线', points: 6, conflict: false },
{ id: 103, name: '侦察覆盖区', points: 4, conflict: false },
],
//
timeProgress: 45,
currentTime: 'K+01:15:30',
isPlaying: false,
playbackSpeed: 1,
playbackInterval: null,
//
userAvatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
};
@ -332,7 +332,7 @@ export default {
this.isMenuHidden = true;
//
this.isRightPanelHidden = true;
//
this.updateTime();
setInterval(this.updateTime, 1000);
@ -388,7 +388,7 @@ export default {
const seconds = now.getSeconds().toString().padStart(2, '0');
this.astroTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
updateCombatTime() {
// K
//
@ -396,202 +396,198 @@ export default {
const baseSeconds = 5400; // 130 = 5400
const currentSeconds = now.getSeconds() + now.getMinutes() * 60 + now.getHours() * 3600;
const combatSeconds = baseSeconds + (currentSeconds % 86400);
const hours = Math.floor(combatSeconds / 3600);
const minutes = Math.floor((combatSeconds % 3600) / 60);
const seconds = combatSeconds % 60;
this.combatTime = `K+${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
},
//
showMenu() {
this.isMenuHidden = false;
this.$message.info('显示左侧菜单');
},
hideMenu() {
this.isMenuHidden = true;
this.$message.info('隐藏左侧菜单');
},
//
showRightPanel() {
this.isRightPanelHidden = false;
this.$message.info('显示右侧面板');
},
//
savePlan() {
this.$message.success('保存计划');
},
importPlanFile() {
this.$message.success('导入计划');
},
importACD() {
this.$message.success('导入ACD');
},
importATO() {
this.$message.success('导入ATO');
},
importLayer() {
this.$message.success('导入图层');
},
importRoute() {
this.$message.success('导入航线');
},
exportPlan() {
this.$message.success('导出计划');
},
//
routeEdit() {
this.$message.success('航线编辑');
},
militaryMarking() {
this.$message.success('军事标绘');
},
iconEdit() {
this.$message.success('图标编辑');
},
attributeEdit() {
this.$message.success('属性修改');
},
timeSettings() {
this.$message.success('时间设置');
},
aircraftSettings() {
this.$message.success('机型设置');
},
keyEventEdit() {
this.$message.success('关键事件编辑');
},
missileLaunch() {
this.$message.success('导弹发射');
},
//
toggle2D3D() {
this.$message.success('2D/3D切换');
},
toggleRuler() {
this.$message.success('显示/隐藏标尺');
},
toggleGrid() {
this.$message.success('显示/隐藏网格');
},
toggleScale() {
this.$message.success('显示/隐藏比例尺');
},
//
loadTerrain() {
this.$message.success('加载/切换地形');
},
changeProjection() {
this.$message.success('投影');
},
loadAeroChart() {
this.$message.success('航空图');
},
//
powerZone() {
this.$message.success('威力区');
},
threatZone() {
this.$message.success('威胁区');
},
//
routeCalculation() {
this.$message.success('航线计算');
},
conflictDisplay() {
this.$message.success('冲突显示');
},
dataMaterials() {
this.$message.success('数据资料');
},
coordinateConversion() {
this.$message.success('坐标换算');
},
//
pageLayout() {
this.$message.success('页面布局');
},
dataStoragePath() {
this.$message.success('数据存储路径');
},
externalParams() {
this.$message.success('外部参数');
},
toggleAirport() {
this.showAirport = !this.showAirport;
this.$message.success(this.showAirport ? '显示机场' : '隐藏机场');
},
toggleLandmark() {
this.showLandmark = !this.showLandmark;
this.$message.success(this.showLandmark ? '显示地标' : '隐藏地标');
},
toggleRoute() {
this.showRoute = !this.showRoute;
this.$message.success(this.showRoute ? '显示航线' : '隐藏航线');
},
systemDescription() {
this.$message.success('系统说明');
},
//
layerFavorites() {
this.$message.success('图层收藏');
},
routeFavorites() {
this.$message.success('航线收藏');
},
showOnlineMembersDialog() {
this.showOnlineMembers = true;
},
hideRightPanel() {
this.isRightPanelHidden = true;
this.$message.info('隐藏右侧面板');
},
selectMenu(item) {
this.activeMenu = item.id;
//
if (item.id === 'file') {
//
@ -632,16 +628,16 @@ export default {
} else {
//
this.$message.info(`选择菜单: ${item.name}`);
}
},
// K
hideKTimePopup() {
this.showKTimePopup = false;
this.$message.info('隐藏推演时钟控制');
},
//
togglePlay() {
this.isPlaying = !this.isPlaying;
@ -653,7 +649,7 @@ export default {
this.$message.info('暂停播放');
}
},
startPlayback() {
if (this.playbackInterval) {
clearInterval(this.playbackInterval);
@ -666,14 +662,14 @@ export default {
this.updateTimeFromProgress();
}, 100);
},
stopPlayback() {
if (this.playbackInterval) {
clearInterval(this.playbackInterval);
this.playbackInterval = null;
}
},
increaseSpeed() {
if (this.playbackSpeed < 25) {
this.playbackSpeed++;
@ -682,7 +678,7 @@ export default {
}
}
},
decreaseSpeed() {
if (this.playbackSpeed > 1) {
this.playbackSpeed--;
@ -691,40 +687,40 @@ export default {
}
}
},
updateTimeFromProgress() {
const totalSeconds = Math.floor(this.timeProgress * 72);
const hours = Math.floor(totalSeconds / 3600) - 2;
const minutes = Math.floor((totalSeconds % 3600) / 60);
const seconds = totalSeconds % 60;
const sign = hours >= 0 ? '+' : '-';
const absHours = Math.abs(hours);
this.currentTime = `K${sign}${String(absHours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
},
//
play() {
this.$message.success('推演开始');
},
pause() {
this.$message.info('推演暂停');
},
reset() {
this.timeProgress = 0;
this.currentTime = 'K+00:00:00';
this.$message.info('推演已重置');
},
formatTimeTooltip(val) {
const hours = Math.floor(val / 4);
const minutes = (val % 4) * 15;
return `K+${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:00`;
},
// 线
selectRoute(route) {
this.selectedRouteId = route.id;
@ -741,7 +737,7 @@ export default {
// 线
this.openRouteDialog(route);
},
addWaypoint() {
if (this.selectedRouteDetails) {
const count = this.selectedRouteDetails.waypoints.length + 1;
@ -754,35 +750,35 @@ export default {
this.$message.success('添加航点成功');
}
},
cancelRoute() {
this.selectedRouteId = null;
this.selectedRouteDetails = null;
this.$message.info('已取消选中');
},
//
runConflictCheck() {
this.conflictCount = 2;
this.$message.warning('检测到2处航线冲突');
},
viewConflict(conflict) {
this.$message.info(`查看冲突:${conflict.title}`);
},
resolveConflict(conflict) {
this.$message.success(`解决冲突:${conflict.title}`);
//
this.conflicts = this.conflicts.filter(c => c.id !== conflict.id);
this.conflictCount = this.conflicts.length;
},
//
exportReport() {
this.$message.success('作战报表导出成功');
},
//
importData() {
this.$message.success('导入数据成功');
@ -945,9 +941,9 @@ background: url('~@/assets/map-background.png');
color: #008aff;
}
.status-dot.operating {
background: #008aff;
animation: pulse 2s infinite;
.status-dot.operating {
background: #008aff;
animation: pulse 2s infinite;
box-shadow: 0 0 10px rgba(0, 138, 255, 0.8);
}
@ -1170,4 +1166,4 @@ background: url('~@/assets/map-background.png');
.ml-3 {
margin-left: 10px;
}
</style>
</style>

Loading…
Cancel
Save