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

Loading…
Cancel
Save