diff --git a/ruoyi-ui/src/views/cesiumMap/DrawingToolbar.vue b/ruoyi-ui/src/views/cesiumMap/DrawingToolbar.vue index c23a904..de6a0f0 100644 --- a/ruoyi-ui/src/views/cesiumMap/DrawingToolbar.vue +++ b/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) } diff --git a/ruoyi-ui/src/views/cesiumMap/index.vue b/ruoyi-ui/src/views/cesiumMap/index.vue index b51244f..3ffe8d4 100644 --- a/ruoyi-ui/src/views/cesiumMap/index.vue +++ b/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 diff --git a/ruoyi-ui/src/views/childRoom/index.vue b/ruoyi-ui/src/views/childRoom/index.vue index c7f6792..d15f557 100644 --- a/ruoyi-ui/src/views/childRoom/index.vue +++ b/ruoyi-ui/src/views/childRoom/index.vue @@ -4,7 +4,9 @@
-
@@ -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; } },