新增功能 点击快速处置标题的时候 关闭图像对比 并且灾害点定位在屏幕正中心

This commit is contained in:
huangchenhao 2025-12-01 15:09:10 +08:00
parent 24e0a7f278
commit 9588c5490b
3 changed files with 55 additions and 5 deletions

View File

@ -1,7 +1,11 @@
<template> <template>
<div class="right-panel"> <div class="right-panel">
<div class="right-panel__content"> <div class="right-panel__content">
<CollapsiblePanel title="快速处置" subtitle="「调度指挥」"> <CollapsiblePanel
title="快速处置"
subtitle="「调度指挥」"
@title-click="handleQuickDisposalClick"
>
<DispatchCommand /> <DispatchCommand />
</CollapsiblePanel> </CollapsiblePanel>
@ -29,6 +33,13 @@ import DispatchCommand from "./DispatchCommand.vue";
import VideoMonitorGrid from "./VideoMonitorGrid.vue"; import VideoMonitorGrid from "./VideoMonitorGrid.vue";
// import DispatchSuggestion from './DispatchSuggestion.vue' // import DispatchSuggestion from './DispatchSuggestion.vue'
import CollaborationInfo from "./CollaborationInfo.vue"; import CollaborationInfo from "./CollaborationInfo.vue";
const emit = defineEmits(["quick-disposal-click"]);
const handleQuickDisposalClick = () => {
console.log('@@@@@点击了标题');
emit("quick-disposal-click");
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -31,6 +31,11 @@ export const DEFAULT_CAMERA_POSITION = {
lat: 30.175697, lat: 30.175697,
} }
export const DEFAULT_CAMERA_POSITION_CENTER = {
lon: 108.011400,
lat: 30.175600,
}
/** /**
* 默认相机配置 * 默认相机配置
* 包含高度朝向等参数 * 包含高度朝向等参数

View File

@ -41,7 +41,9 @@
v-if="isCompareMode" v-if="isCompareMode"
class="situational-awareness__sync-btn" class="situational-awareness__sync-btn"
@click="toggleCameraSync" @click="toggleCameraSync"
:text="isCameraSyncEnabled ? '同步灾前灾后实景' : '未同步灾前灾后实景'" :text="
isCameraSyncEnabled ? '同步灾前灾后实景' : '未同步灾前灾后实景'
"
> >
</ActionButton> </ActionButton>
<!-- 灾前现场实景标签 - 在中间分割线左侧 --> <!-- 灾前现场实景标签 - 在中间分割线左侧 -->
@ -76,7 +78,7 @@
v-show="!isRightPanelCollapsed" v-show="!isRightPanelCollapsed"
class="situational-awareness__panel-column situational-awareness__panel-column--right" class="situational-awareness__panel-column situational-awareness__panel-column--right"
> >
<RightPanel /> <RightPanel @quick-disposal-click="handleQuickDisposalClick" />
</div> </div>
</Transition> </Transition>
</div> </div>
@ -284,6 +286,7 @@ import {
DISASTER_CENTER, DISASTER_CENTER,
DEFAULT_CAMERA_CARTESIAN, DEFAULT_CAMERA_CARTESIAN,
DEFAULT_CAMERA_POSITION, DEFAULT_CAMERA_POSITION,
DEFAULT_CAMERA_POSITION_CENTER,
DEFAULT_CAMERA_VIEW, DEFAULT_CAMERA_VIEW,
DEFAULT_SEARCH_RADIUS, DEFAULT_SEARCH_RADIUS,
MARKER_ICON_SIZE, MARKER_ICON_SIZE,
@ -337,11 +340,42 @@ const { isCompareMode, toggleCompareMode, isCameraSyncEnabled } =
useDualMapCompare(); useDualMapCompare();
const toggleCameraSync = () => { const toggleCameraSync = () => {
ElMessage.success(isCameraSyncEnabled.value ? "画面同步已关闭" : "画面同步已启用"); ElMessage.success(
isCameraSyncEnabled.value ? "画面同步已关闭" : "画面同步已启用"
);
console.log("[index.vue] 切换相机同步状态"); console.log("[index.vue] 切换相机同步状态");
isCameraSyncEnabled.value = !isCameraSyncEnabled.value; isCameraSyncEnabled.value = !isCameraSyncEnabled.value;
}; };
//
const handleQuickDisposalClick = async () => {
console.log("[index.vue] 快速处置点击事件");
const success = await setCompareToolState(false, "quick-disposal");
if (!success) {
// ,
console.error("[index.vue] 关闭地图对比模式失败,中止快速处置操作");
return;
}
const viewer = mapStore.viewer;
console.log("[index.vue] 设置相机到目标位置...");
viewer.camera.setView({
destination: Cesium.Cartesian3.fromDegrees(
DEFAULT_CAMERA_POSITION_CENTER.lon,
DEFAULT_CAMERA_POSITION_CENTER.lat,
DEFAULT_CAMERA_VIEW.height
),
orientation: {
heading: Cesium.Math.toRadians(DEFAULT_CAMERA_VIEW.heading),
pitch: Cesium.Math.toRadians(DEFAULT_CAMERA_VIEW.pitch),
roll: DEFAULT_CAMERA_VIEW.roll,
},
});
console.log("[index.vue] 已关闭地图对比模式");
};
// //
const { const {
initializeMarkers, initializeMarkers,