Browse Source

空域,测距功能分离

wxp
ctw 2 months ago
parent
commit
05134aae2a
  1. 34
      ruoyi-ui/src/views/cesiumMap/DrawingToolbar.vue
  2. 11
      ruoyi-ui/src/views/cesiumMap/index.vue
  3. 25
      ruoyi-ui/src/views/childRoom/index.vue

34
ruoyi-ui/src/views/cesiumMap/DrawingToolbar.vue

@ -30,17 +30,21 @@ export default {
hasEntities: {
type: Boolean,
default: false
},
toolMode: {
type: String,
default: 'airspace' // 'airspace' or 'ranging'
}
},
data() {
return {
toolbarItems: [
{ id: 'point', name: '点', icon: 'el-icon-location' },
{ id: 'line', name: '线', icon: 'el-icon-edit-outline' },
{ id: 'polygon', name: '面', icon: 'el-icon-s-grid' },
{ id: 'rectangle', name: '矩形', icon: 'el-icon-s-data' },
// 线
allToolbarItems: [
{ id: 'mouse', name: '鼠标', icon: 'el-icon-position' },
{ id: 'polygon', name: '面', icon: 'el-icon-house' },
{ id: 'rectangle', name: '矩形', icon: 'el-icon-crop' },
{ id: 'circle', name: '圆形', icon: 'el-icon-circle-plus-outline' },
{ id: 'sector', name: '扇形', icon: 'el-icon-s-operation' },
{ id: 'sector', name: '扇形', icon: 'el-icon-pie-chart' },
{ id: 'arrow', name: '箭头', icon: 'el-icon-right' },
{ id: 'text', name: '文本', icon: 'el-icon-document' },
{ id: 'image', name: '图片', icon: 'el-icon-picture-outline' },
@ -48,9 +52,25 @@ export default {
{ id: 'clear', name: '清除', icon: 'el-icon-delete' },
{ id: 'import', name: '导入', icon: 'el-icon-upload' },
{ id: 'export', name: '导出', icon: 'el-icon-download' }
],
//
rangingToolbarItems: [
{ id: 'mouse', name: '鼠标', icon: 'el-icon-position' },
{ id: 'point', name: '点', icon: 'el-icon-location' },
{ id: 'line', name: '线', icon: 'el-icon-edit-outline' },
{ id: 'clear', name: '清除', icon: 'el-icon-delete' }
]
}
},
computed: {
toolbarItems() {
if (this.toolMode === 'ranging') {
return this.rangingToolbarItems;
} else {
return this.allToolbarItems;
}
}
},
methods: {
handleItemClick(item) {
if (item.id === 'clear') {
@ -61,6 +81,8 @@ export default {
this.$emit('import-data')
} else if (item.id === 'locate') {
this.$emit('locate')
} else if (item.id === 'mouse') {
this.$emit('toggle-drawing', null)
} else {
this.$emit('toggle-drawing', item.id)
}

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

@ -6,6 +6,7 @@
:draw-dom-click="drawDomClick"
:drawing-mode="drawingMode"
:has-entities="allEntities.length > 0"
:tool-mode="toolMode"
@toggle-drawing="toggleDrawing"
@clear-all="clearAll"
@export-data="exportData"
@ -65,6 +66,10 @@ export default {
return isBoolean
}
},
toolMode: {
type: String,
default: 'airspace' // 'airspace' or 'ranging'
},
},
watch: {
drawDomClick: {
@ -684,7 +689,11 @@ export default {
},
// ================== ==================
toggleDrawing(mode) {
if (this.drawingMode === mode) {
if (mode === null) {
// null
this.stopDrawing()
this.drawingMode = null
} else if (this.drawingMode === mode) {
//
this.stopDrawing()
this.drawingMode = null

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

@ -4,7 +4,9 @@
<!-- 地图背景 -->
<div id="gis-map-background" class="map-background">
<!-- cesiummap组件 -->
<cesiumMap ref="cesiumMap" :drawDomClick="drawDom" @draw-complete="handleMapDrawComplete"
<cesiumMap ref="cesiumMap" :drawDomClick="drawDom || airspaceDrawDom"
:tool-mode="drawDom ? 'ranging' : (airspaceDrawDom ? 'airspace' : 'airspace')"
@draw-complete="handleMapDrawComplete"
@open-waypoint-dialog="handleOpenWaypointEdit" />
<div class="map-overlay-text">
<i class="el-icon-location-outline text-3xl mb-2 block"></i>
@ -305,6 +307,7 @@ export default {
data() {
return {
drawDom:false,
airspaceDrawDom:false,
// 线
showOnlineMembers: false,
//
@ -398,9 +401,9 @@ export default {
{ id: 'file', name: '方案', icon: 'el-icon-folder-opened' },
{ id: 'start', name: '冲突', icon: 'el-icon-error' },
{ id: 'insert', name: '平台', icon: 'el-icon-s-platform' },
{ id: 'pattern', name: '图案', icon: 'el-icon-picture-outline-round' },
{ id: 'pattern', name: '空域', icon: 'el-icon-picture-outline-round' },
{ id: 'deduction', name: '推演', icon: 'el-icon-video-play' },
{ id: 'modify', name: '修改', icon: 'el-icon-edit-outline' },
{ id: 'modify', name: '测距', icon: 'el-icon-edit-outline' },
{ id: 'refresh', name: '刷新', icon: 'el-icon-refresh' },
{ id: 'basemap', name: '底图', icon: 'el-icon-picture' },
{ id: 'save', name: '保存', icon: 'el-icon-document-checked' },
@ -1141,6 +1144,7 @@ export default {
//
if (item.id === 'file' || item.id === 'start' || item.id === 'insert') {
this.drawDom = false;
this.airspaceDrawDom = false;
}
//
@ -1169,20 +1173,31 @@ export default {
this.isRightPanelHidden = false;
}
} else if (item.id === 'modify') {
//
this.drawDom = !this.drawDom
//
this.airspaceDrawDom = false
//
this.isRightPanelHidden = true;
console.log(this.drawDom, 999999)
console.log('测距绘制模式:', this.drawDom, 999999)
} else if (item.id === 'pattern') {
//
this.airspaceDrawDom = !this.airspaceDrawDom
this.drawDom = false
//
this.isRightPanelHidden = true;
console.log('空域绘制模式:', this.airspaceDrawDom, 999999)
} else if (item.id === 'deduction') {
// /K
this.showKTimePopup = !this.showKTimePopup;
//
this.drawDom = false;
this.airspaceDrawDom = false;
} else {
//
this.isRightPanelHidden = true;
//
this.drawDom = false;
this.airspaceDrawDom = false;
}
},

Loading…
Cancel
Save