吉安感知网项目-前端
shuishen
2026-01-31 0ce4185ff8033881b14681a4b3c403473965bb82
feat:场景管理,指挥点位置选择增加提示
2 files modified
50 ■■■■ changed files
applications/drone-command/src/views/areaManage/areaStatistics/index.vue 10 ●●●● patch | view | raw | blame | history
applications/drone-command/src/views/areaManage/sceneManage/FormDiaLog.vue 40 ●●●●● patch | view | raw | blame | history
applications/drone-command/src/views/areaManage/areaStatistics/index.vue
@@ -6,9 +6,9 @@
                    clearable @clear="handleSearch" />
            </el-form-item>
            <el-form-item label="区域类型" prop="areaType">
            <el-form-item label="区域类型" prop="areaTypeKeys">
                <el-select class="command-select" popper-class="command-select-popper"
                    v-model="searchParams.areaType" placeholder="请选择" clearable @change="handleSearch">
                    v-model="searchParams.areaTypeKeys" placeholder="请选择" clearable @change="handleSearch">
                    <el-option v-for="item in dictObj.areaType" :key="item.dictKey" :label="item.dictValue"
                        :value="item.dictKey" />
                </el-select>
@@ -33,9 +33,9 @@
                <el-table class="command-table" :data="list">
                    <el-table-column type="index" show-overflow-tooltip width="64" label="序号" />
                    <el-table-column prop="areaName" show-overflow-tooltip label="区域名称" />
                    <el-table-column prop="areaType" show-overflow-tooltip label="区域类型">
                    <el-table-column prop="areaTypeKeys" show-overflow-tooltip label="区域类型">
                        <template v-slot="{ row }">
                            {{ getDictLabel(row.areaType, dictObj.areaType) }}
                            {{ getDictLabel(row.areaTypeKeys, dictObj.areaType) }}
                        </template>
                    </el-table-column>
                    <el-table-column prop="sceneName" show-overflow-tooltip label="关联场景" />
@@ -79,7 +79,7 @@
// 初始化查询参数
const initSearchParams = () => ({
    areaName: '', // 区域名称
    areaType: '', // 区域类型
    areaTypeKeys: '', // 区域类型
    sceneType: '', // 场景类型
    current: 1, // 当前页
    size: 10, // 每页大小
applications/drone-command/src/views/areaManage/sceneManage/FormDiaLog.vue
@@ -160,6 +160,7 @@
import { buildEllipsePositions } from '@/utils/cesium/shapeTools'
import { cartesian3Convert } from '@/utils/cesium/mapUtil'
import { AREA_TYPE_STYLE_MAP, BUFFER_LEVEL_STYLES, DEFAULT_AREA_STYLE } from '@ztzf/constants'
import { MapTooltip } from '@/utils/cesium/shapeTools/Tooltip'
// 初始化表单数据
const initForm = () => ({
@@ -198,6 +199,10 @@
let redPointEntity
let areaDisplaySource
let leftClickBound = false
let mouseMoveBound = false
let mapTooltip
let publicCesium
const tooltipEventKey = 'scene-manage-point-tip'
// 表单验证规则
const rules = {
@@ -555,13 +560,36 @@
// 初始化地图实例
function initMap() {
    if (viewer) return
    const map = mapRef.value?.getMap()
    if (!map?.viewer) return
    viewer = map.viewer
    viewer ||= map.viewer
    publicCesium ||= map.publicCesium
    if (!readonly.value && !leftClickBound) {
        map.publicCesium?.addLeftClickEvent?.(null, LeftClickEvent)
        leftClickBound = true
    }
    if (!readonly.value) ensurePointTooltip()
}
function ensurePointTooltip() {
    if (!viewer || !publicCesium || mouseMoveBound) return
    mapTooltip ||= new MapTooltip(viewer, { offset: { x: 28, y: 24 } })
    publicCesium.addMouseHandler?.(
        null,
        movement => {
            if (!visible.value || readonly.value) return
            mapTooltip?.show('点击地图选择指挥点位置', movement.endPosition)
        },
        tooltipEventKey
    )
    mouseMoveBound = true
}
function clearPointTooltip() {
    mapTooltip?.hide()
    if (publicCesium && mouseMoveBound) {
        publicCesium.removeMouseHandler?.(tooltipEventKey)
        mouseMoveBound = false
    }
}
@@ -626,6 +654,9 @@
    redPointEntity = null
    await nextTick()
    initMap()
    if (dialogMode.value === 'view') {
        clearPointTooltip()
    }
    await getSceneConfigList()
    if (dialogMode.value === 'add') {
        mapRef.value?.zoomToAdminBoundary?.()
@@ -652,7 +683,10 @@
watch(
    () => visible.value,
    val => {
        if (!val) clearAreaDisplay()
        if (!val) {
            clearAreaDisplay()
            clearPointTooltip()
        }
    }
)