Browse Source

威力区和探测区

mh
cuitw 1 month ago
parent
commit
76337b13be
  1. 72
      ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/PlatformStyleDTO.java
  2. 74
      ruoyi-ui/src/views/cesiumMap/ContextMenu.vue
  3. 950
      ruoyi-ui/src/views/cesiumMap/index.vue
  4. 6
      ruoyi-ui/src/views/childRoom/index.vue

72
ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/PlatformStyleDTO.java

@ -27,11 +27,25 @@ public class PlatformStyleDTO implements Serializable {
/** 平台颜色 */ /** 平台颜色 */
private String platformColor; private String platformColor;
/** 探测区半径(千米),整圆 */
private Double detectionZoneRadius;
/** 探测区填充颜色 */
private String detectionZoneColor;
/** 探测区透明度 0-1 */
private Double detectionZoneOpacity;
/** 探测区是否在地图上显示 */
private Boolean detectionZoneVisible;
/** 威力区半径(千米) */ /** 威力区半径(千米) */
private Double powerZoneRadius; private Double powerZoneRadius;
/** 威力区扇形夹角(度),如 60 表示 60 度扇形 */
private Double powerZoneAngle;
/** 威力区填充颜色 */ /** 威力区填充颜色 */
private String powerZoneColor; private String powerZoneColor;
/** 威力区透明度 0-1 */
private Double powerZoneOpacity;
/** 威力区是否在地图上显示 */
private Boolean powerZoneVisible;
public String getRoomId() { public String getRoomId() {
return roomId; return roomId;
@ -112,4 +126,60 @@ public class PlatformStyleDTO implements Serializable {
public void setPowerZoneColor(String powerZoneColor) { public void setPowerZoneColor(String powerZoneColor) {
this.powerZoneColor = powerZoneColor; this.powerZoneColor = powerZoneColor;
} }
public Double getDetectionZoneRadius() {
return detectionZoneRadius;
}
public void setDetectionZoneRadius(Double detectionZoneRadius) {
this.detectionZoneRadius = detectionZoneRadius;
}
public String getDetectionZoneColor() {
return detectionZoneColor;
}
public void setDetectionZoneColor(String detectionZoneColor) {
this.detectionZoneColor = detectionZoneColor;
}
public Double getDetectionZoneOpacity() {
return detectionZoneOpacity;
}
public void setDetectionZoneOpacity(Double detectionZoneOpacity) {
this.detectionZoneOpacity = detectionZoneOpacity;
}
public Boolean getDetectionZoneVisible() {
return detectionZoneVisible;
}
public void setDetectionZoneVisible(Boolean detectionZoneVisible) {
this.detectionZoneVisible = detectionZoneVisible;
}
public Double getPowerZoneAngle() {
return powerZoneAngle;
}
public void setPowerZoneAngle(Double powerZoneAngle) {
this.powerZoneAngle = powerZoneAngle;
}
public Double getPowerZoneOpacity() {
return powerZoneOpacity;
}
public void setPowerZoneOpacity(Double powerZoneOpacity) {
this.powerZoneOpacity = powerZoneOpacity;
}
public Boolean getPowerZoneVisible() {
return powerZoneVisible;
}
public void setPowerZoneVisible(Boolean powerZoneVisible) {
this.powerZoneVisible = powerZoneVisible;
}
} }

74
ruoyi-ui/src/views/cesiumMap/ContextMenu.vue

@ -52,10 +52,22 @@
<span class="menu-icon">📝</span> <span class="menu-icon">📝</span>
<span>编辑</span> <span>编辑</span>
</div> </div>
<div class="menu-item" @click="handleDetectionZone">
<span class="menu-icon">🔍</span>
<span>探测区</span>
</div>
<div class="menu-item" @click="handlePowerZone"> <div class="menu-item" @click="handlePowerZone">
<span class="menu-icon"></span> <span class="menu-icon"></span>
<span>威力区</span> <span>威力区</span>
</div> </div>
<div class="menu-item menu-item-sub" @click="handleToggleDetectionZone">
<span class="menu-icon">{{ detectionZoneVisible ? '👁' : '👁‍🗨' }}</span>
<span>{{ detectionZoneVisible ? '隐藏探测区' : '显示探测区' }}</span>
</div>
<div class="menu-item menu-item-sub" @click="handleTogglePowerZone">
<span class="menu-icon">{{ powerZoneVisible ? '👁' : '👁‍🗨' }}</span>
<span>{{ powerZoneVisible ? '隐藏威力区' : '显示威力区' }}</span>
</div>
</div> </div>
<!-- 线段特有选项 --> <!-- 线段特有选项 -->
@ -332,18 +344,21 @@
<!-- 平台图标拖拽到地图的图标特有选项 --> <!-- 平台图标拖拽到地图的图标特有选项 -->
<div class="menu-section" v-if="entityData.type === 'platformIcon'"> <div class="menu-section" v-if="entityData.type === 'platformIcon'">
<div class="menu-title">平台图标</div> <div class="menu-title">平台图标</div>
<div class="menu-item" @click.stop="handleShowTransformBox"> <div class="menu-item" @click="handleDetectionZonePlatform">
<span class="menu-icon">📐</span> <span class="menu-icon">🔍</span>
<span>显示伸缩框</span> <span>探测区</span>
</div> </div>
<div class="menu-item" @click="handleEditPlatformPosition"> <div class="menu-item" @click="handlePowerZonePlatform">
<span class="menu-icon">📍</span> <span class="menu-icon"></span>
<span>修改位置</span> <span>威力区</span>
</div> </div>
<div class="menu-item" @click="handleEditPlatformHeading"> <div class="menu-item menu-item-sub" @click="handleToggleDetectionZone">
<span class="menu-icon">🧭</span> <span class="menu-icon">{{ detectionZoneVisible ? '👁' : '👁‍🗨' }}</span>
<span>修改朝向</span> <span>{{ detectionZoneVisible ? '隐藏探测区' : '显示探测区' }}</span>
<span class="menu-value">{{ entityData.heading != null ? entityData.heading + '°' : '0°' }}</span> </div>
<div class="menu-item menu-item-sub" @click="handleTogglePowerZone">
<span class="menu-icon">{{ powerZoneVisible ? '👁' : '👁‍🗨' }}</span>
<span>{{ powerZoneVisible ? '隐藏威力区' : '显示威力区' }}</span>
</div> </div>
<div class="menu-title" style="margin-top:8px;">航线</div> <div class="menu-title" style="margin-top:8px;">航线</div>
<div class="menu-item" @click="handleStartRouteBeforePlatform"> <div class="menu-item" @click="handleStartRouteBeforePlatform">
@ -377,6 +392,14 @@ export default {
routeLocked: { routeLocked: {
type: Object, type: Object,
default: () => ({}) default: () => ({})
},
detectionZoneVisible: {
type: Boolean,
default: true
},
powerZoneVisible: {
type: Boolean,
default: true
} }
}, },
data() { data() {
@ -415,16 +438,20 @@ export default {
this.$emit('delete') this.$emit('delete')
}, },
handleShowTransformBox() { handleDetectionZonePlatform() {
this.$emit('show-transform-box') this.$emit('detection-zone')
}, },
handleEditPlatformPosition() { handlePowerZonePlatform() {
this.$emit('edit-platform-position') this.$emit('power-zone')
},
handleToggleDetectionZone() {
this.$emit('toggle-detection-zone')
}, },
handleEditPlatformHeading() { handleTogglePowerZone() {
this.$emit('edit-platform-heading') this.$emit('toggle-power-zone')
}, },
handleStartRouteBeforePlatform() { handleStartRouteBeforePlatform() {
@ -474,6 +501,10 @@ export default {
this.$emit('edit-platform') this.$emit('edit-platform')
}, },
handleDetectionZone() {
this.$emit('detection-zone')
},
handlePowerZone() { handlePowerZone() {
this.$emit('power-zone') this.$emit('power-zone')
}, },
@ -677,6 +708,17 @@ export default {
flex: 1; flex: 1;
} }
.menu-item-sub {
padding: 6px 16px 6px 24px;
font-size: 12px;
color: #666;
}
.menu-item-sub:hover {
background-color: #f0f7ff;
color: #333;
}
/* 颜色选择器样式 */ /* 颜色选择器样式 */
.color-picker-container { .color-picker-container {
padding: 8px 16px; padding: 8px 16px;

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

File diff suppressed because it is too large

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

@ -1393,7 +1393,8 @@ export default {
// 线 // 线
if (this.$refs.cesiumMap) { if (this.$refs.cesiumMap) {
this.$refs.cesiumMap.removeRouteById(route.id); this.$refs.cesiumMap.removeRouteById(route.id);
// 线 // 线removeRouteById
this.$refs.cesiumMap.removeDetectionZoneByRouteId(route.id);
this.$refs.cesiumMap.removePowerZoneByRouteId(route.id); this.$refs.cesiumMap.removePowerZoneByRouteId(route.id);
} }
// ID // ID
@ -3091,7 +3092,8 @@ export default {
this.activeRouteIds.splice(index, 1); this.activeRouteIds.splice(index, 1);
if (this.$refs.cesiumMap) { if (this.$refs.cesiumMap) {
this.$refs.cesiumMap.removeRouteById(route.id); this.$refs.cesiumMap.removeRouteById(route.id);
// 线 // 线
this.$refs.cesiumMap.removeDetectionZoneByRouteId(route.id);
this.$refs.cesiumMap.removePowerZoneByRouteId(route.id); this.$refs.cesiumMap.removePowerZoneByRouteId(route.id);
} }
if (this.selectedRouteDetails && this.selectedRouteDetails.id === route.id) { if (this.selectedRouteDetails && this.selectedRouteDetails.id === route.id) {

Loading…
Cancel
Save