Browse Source

飞机标牌优化,房间内返回选择房间路由,选择房间返回登录界面

master
ctw 2 months ago
parent
commit
f449ed201d
  1. 1
      ruoyi-ui/src/lang/en.js
  2. 1
      ruoyi-ui/src/lang/zh.js
  3. 1
      ruoyi-ui/src/views/cesiumMap/index.vue
  4. 25
      ruoyi-ui/src/views/childRoom/TopHeader.vue
  5. 22
      ruoyi-ui/src/views/childRoom/index.vue
  6. 5
      ruoyi-ui/src/views/dialogs/RouteEditDialog.vue
  7. 34
      ruoyi-ui/src/views/selectRoom/index.vue

1
ruoyi-ui/src/lang/en.js

@ -77,6 +77,7 @@ export default {
},
info: {
roomCode: 'Room Code',
roomName: 'Room Name',
onlineCount: 'Online Count',
combatTime: 'Combat Time',
astroTime: 'Astro Time',

1
ruoyi-ui/src/lang/zh.js

@ -77,6 +77,7 @@ export default {
},
info: {
roomCode: '房间编号',
roomName: '房间名称',
onlineCount: '在线人数',
combatTime: '作战时间',
astroTime: '天文时间',

1
ruoyi-ui/src/views/cesiumMap/index.vue

@ -4065,7 +4065,6 @@ export default {
}
this.contextMenu.visible = false
if (this.viewer.scene.requestRenderMode) this.viewer.scene.requestRender()
this.$message && this.$message.success(nextVisible ? '已显示标牌' : '已隐藏标牌')
},
//
deleteEntityFromContextMenu() {

25
ruoyi-ui/src/views/childRoom/TopHeader.vue

@ -217,11 +217,14 @@
<div class="header-right">
<!-- 作战信息区域 -->
<div class="combat-info-group">
<div class="info-box">
<div
class="info-box room-name-box clickable"
@click="handleBackToSelectRoom"
>
<i class="el-icon-office-building info-icon"></i>
<div class="info-content">
<div class="info-label">{{ $t('topHeader.info.roomCode') }}</div>
<div class="info-value">{{ roomCode }}</div>
<div class="info-label">{{ $t('topHeader.info.roomName') }}</div>
<div class="info-value">{{ roomDisplayName }}</div>
</div>
</div>
@ -363,6 +366,11 @@ export default {
}
},
computed: {
/** 显示数据库房间名,无则回退为房间编号 */
roomDisplayName() {
if (this.roomDetail && this.roomDetail.name) return this.roomDetail.name;
return this.roomCode;
},
topNavItems() {
return [
{ id: 'file', name: this.$t('topHeader.nav.file'), icon: 'el-icon-document' },
@ -387,6 +395,17 @@ export default {
}
},
methods: {
/** 点击房间名称:弹窗确认是否回到选择房间页面 */
handleBackToSelectRoom() {
this.$confirm('是否返回选择房间页面?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'info'
}).then(() => {
this.$router.push({ path: '/selectRoom' }).catch(() => {})
}).catch(() => {})
},
selectTopNav(item) {
this.$emit('select-nav', item)
},

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

@ -872,6 +872,14 @@ export default {
//
this.showPlatformDialog = false;
},
/** 新建航线时写入数据库的默认样式(与地图默认显示一致:紫色实线线宽3) */
getDefaultRouteAttributes() {
const defaultAttrs = {
waypointStyle: { pixelSize: 7, color: '#ffffff', outlineColor: '#0078FF', outlineWidth: 2 },
lineStyle: { style: 'solid', width: 3, color: '#800080', gapColor: '#000000', dashLength: 20 }
};
return JSON.stringify(defaultAttrs);
},
/** 从航线 attributes JSON 解析出地图渲染用的样式对象 */
parseRouteStyle(attributes) {
if (attributes == null || attributes === '') return null;
@ -1088,25 +1096,31 @@ export default {
}
// 2. pointTypeholdParams 14 #333333
const finalWaypoints = this.tempMapPoints.map((p, index) => ({
// 线 0 45°
const wpCount = this.tempMapPoints.length;
const finalWaypoints = this.tempMapPoints.map((p, index) => {
const isFirstOrLast = index === 0 || index === wpCount - 1;
const defaultTurnAngle = isFirstOrLast ? 0.0 : 45.0;
return {
name: p.name || `WP${index + 1}`,
lat: p.lat,
lng: p.lng,
alt: p.alt != null ? p.alt : 5000.0,
speed: p.speed != null ? p.speed : 800.0,
startTime: p.startTime || 'K+00:00:00',
turnAngle: p.turnAngle != null ? p.turnAngle : 0.0,
turnAngle: p.turnAngle != null ? p.turnAngle : defaultTurnAngle,
labelFontSize: p.labelFontSize != null ? p.labelFontSize : 14,
labelColor: p.labelColor || '#333333',
...(p.pointType && { pointType: p.pointType }),
...(p.holdParams != null && { holdParams: typeof p.holdParams === 'string' ? p.holdParams : JSON.stringify(p.holdParams) })
}));
};
});
const routeData = {
callSign: this.newRouteName,
scenarioId: currentScenarioId,
platformId: 1,
attributes: "{}",
attributes: this.getDefaultRouteAttributes(),
waypoints: finalWaypoints
};

5
ruoyi-ui/src/views/dialogs/RouteEditDialog.vue

@ -221,13 +221,14 @@ export default {
id: '',
name: ''
},
// 线线线3 attributes 退
defaultStyle: {
waypoint: { pixelSize: 7, color: '#ffffff', outlineColor: '#0078FF', outlineWidth: 2 },
line: { style: 'dash', width: 4, color: '#ffffff', gapColor: '#000000', dashLength: 20 }
line: { style: 'solid', width: 3, color: '#800080', gapColor: '#000000', dashLength: 20 }
},
styleForm: {
waypoint: { pixelSize: 7, color: '#ffffff', outlineColor: '#0078FF', outlineWidth: 2 },
line: { style: 'dash', width: 4, color: '#ffffff', gapColor: '#000000', dashLength: 20 }
line: { style: 'solid', width: 3, color: '#800080', gapColor: '#000000', dashLength: 20 }
},
presetColors: [
'#ffffff', '#000000', '#0078FF', '#409EFF', '#67C23A', '#E6A23C', '#F56C6C',

34
ruoyi-ui/src/views/selectRoom/index.vue

@ -5,6 +5,9 @@
<div class="main-content">
<div class="room-panel">
<div class="panel-header">
<a href="javascript:;" class="back-login" @click="backToLogin">
<i class="el-icon-back"></i> 返回登录
</a>
<h2>房间选择</h2>
<p>选择或创建您要加入的协作房间</p>
</div>
@ -169,6 +172,18 @@ export default {
}
},
methods: {
/** 返回登录页:登出并跳转到登录界面 */
backToLogin() {
this.$confirm('确定退出当前账号并返回登录页吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
this.$router.push({ path: '/login' }).catch(() => {})
}).catch(() => {})
}).catch(() => {})
},
getList() {
listRooms().then(response => {
this.rooms = response.rows || response;
@ -309,6 +324,25 @@ export default {
padding: 20px 24px 16px;
border-bottom: 1px solid #e2e8f0;
text-align: center;
position: relative;
}
.back-login {
position: absolute;
left: 24px;
top: 50%;
transform: translateY(-50%);
font-size: 14px;
color: #64748b;
text-decoration: none;
display: inline-flex;
align-items: center;
gap: 4px;
transition: color 0.2s;
}
.back-login:hover {
color: #165DFF;
}
.panel-header h2 {

Loading…
Cancel
Save