13 files modified
1 files renamed
| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | import { buildEllipsePositions } from '../shapeUtils' |
| | | |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | import { buildEllipsePositions } from '../shapeUtils' |
| | | |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | |
| | | const POINT_ENTITY_NAME = 'draw-polygon-point' |
| | |
| | | |
| | | this.polygonEntity = this.dataSource.entities.add({ |
| | | polygon: { |
| | | hierarchy: new Cesium.CallbackProperty( |
| | | () => new Cesium.PolygonHierarchy(getPreviewPositions()), |
| | | false |
| | | ), |
| | | hierarchy: new Cesium.CallbackProperty(() => new Cesium.PolygonHierarchy(getPreviewPositions()), false), |
| | | material: this.style.fill, |
| | | outline: false, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | import { getBoundsFromCartesians, rectanglePositionsFromBounds } from '../shapeUtils' |
| | | |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | import { buildEllipsePositions, cartesianToLocal } from '../shapeUtils' |
| | | |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | import { |
| | | getBoundsFromLngLats, |
| | |
| | | const minorFromMeta = Number.isFinite(meta?.semiMinor) ? Number(meta.semiMinor) : 0 |
| | | const majorPoint = resolveCartographic(meta?.majorPoint) |
| | | const minorPoint = resolveCartographic(meta?.minorPoint) |
| | | const majorDistance = |
| | | majorFromMeta || (majorPoint ? getMetersBetween(centerCarto, majorPoint) : 0) |
| | | const minorDistance = |
| | | minorFromMeta || (minorPoint ? getMetersBetween(centerCarto, minorPoint) : 0) |
| | | const majorDistance = majorFromMeta || (majorPoint ? getMetersBetween(centerCarto, majorPoint) : 0) |
| | | const minorDistance = minorFromMeta || (minorPoint ? getMetersBetween(centerCarto, minorPoint) : 0) |
| | | if (majorDistance > 0) this.semiMajor = Math.max(1, majorDistance) |
| | | if (minorDistance > 0) this.semiMinor = Math.max(1, minorDistance) |
| | | if (this.semiMinor > this.semiMajor) this.semiMinor = this.semiMajor |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | |
| | | const POINT_ENTITY_NAME = 'edit-polygon-point' |
| | |
| | | createEntities() { |
| | | this.polygonEntity = this.dataSource.entities.add({ |
| | | polygon: { |
| | | hierarchy: new Cesium.CallbackProperty( |
| | | () => new Cesium.PolygonHierarchy(this.positions), |
| | | false |
| | | ), |
| | | hierarchy: new Cesium.CallbackProperty(() => new Cesium.PolygonHierarchy(this.positions), false), |
| | | material: this.style.fill, |
| | | outline: false, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | import { getBoundsFromLngLats, rectanglePositionsFromBounds } from '../shapeUtils' |
| | | |
| | |
| | | } |
| | | |
| | | getCornerCartographics() { |
| | | return rectanglePositionsFromBounds(this.bounds).map(position => |
| | | Cesium.Cartographic.fromCartesian(position) |
| | | ) |
| | | return rectanglePositionsFromBounds(this.bounds).map(position => Cesium.Cartographic.fromCartesian(position)) |
| | | } |
| | | |
| | | getPositionFromScreen(screenPosition) { |
| | |
| | | export { DrawManager } from './DrawManager' |
| | | export { EditManager } from './EditManager' |
| | | export { buildEllipsePositions, getBoundsFromCartesians, getBoundsFromLngLats, rectanglePositionsFromBounds, getCenterFromBounds, getMetersBetween, cartesianToLocal } from './shapeUtils' |
| | | export { |
| | | buildEllipsePositions, |
| | | getBoundsFromCartesians, |
| | | getBoundsFromLngLats, |
| | | rectanglePositionsFromBounds, |
| | | getCenterFromBounds, |
| | | getMetersBetween, |
| | | cartesianToLocal, |
| | | } from './shapeUtils' |
| | | export { DrawPolygonTool } from './draw/DrawPolygonTool' |
| | | export { DrawRectangleTool } from './draw/DrawRectangleTool' |
| | | export { DrawEllipseTool } from './draw/DrawEllipseTool' |
| | |
| | | export { EditEllipseTool } from './edit/EditEllipseTool' |
| | | export { EditBufferCircleTool } from './edit/EditBufferCircleTool' |
| | | export { ToolBase } from './ToolBase' |
| | | export { MapTooltip as Tooltip } from './Tooltip' |
| | | export { MapTooltip as Tooltip } from '@ztzf/utils' |
| | |
| | | import { saveOperationLog } from '@ztzf/apis' |
| | | import { useRoute } from 'vue-router' |
| | | import positionIcon from '@/assets/images/areaManage/positionIcon.png' |
| | | import { MapTooltip } from '@/utils/cesium/shapeTools/Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | |
| | | const initForm = () => ({ |
| | | address: '', // 位置 |
| | |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="指挥点位置" prop="longitude"> |
| | | <el-input |
| | | class="command-input" |
| | | :model-value="commandPointText" |
| | | disabled |
| | | placeholder="请选择指挥点位置" |
| | | > |
| | | <el-input class="command-input" :model-value="commandPointText" disabled placeholder="请选择指挥点位置"> |
| | | <template #suffix> |
| | | <span class="suffix-action">地图选点</span> |
| | | </template> |
| | |
| | | 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' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | |
| | | // 初始化表单数据 |
| | | const initForm = () => ({ |
| | |
| | | }) |
| | | |
| | | const commandPointText = computed(() => { |
| | | // 你也可以改成 `${lng}, ${lat}` |
| | | if (!formData.value.longitude) { |
| | | return '' |
| | | } |
| | | return `${formData.value.longitude}, ${formData.value.latitude}`; |
| | | }); |
| | | // 你也可以改成 `${lng}, ${lat}` |
| | | if (!formData.value.longitude) { |
| | | return '' |
| | | } |
| | | return `${formData.value.longitude}, ${formData.value.latitude}` |
| | | }) |
| | | |
| | | const emit = defineEmits(['success']) |
| | | const formRef = ref(null) // 表单实例 |
| | |
| | | const resolved = resolveLngLatPoint(point) |
| | | const normalized = normalizeShapePoint(resolved) |
| | | if (!normalized) return |
| | | positions.push( |
| | | Cesium.Cartesian3.fromDegrees(normalized.lng, normalized.lat, normalized.height) |
| | | ) |
| | | positions.push(Cesium.Cartesian3.fromDegrees(normalized.lng, normalized.lat, normalized.height)) |
| | | }) |
| | | } |
| | | if (shape?.drawType === 'buffer' && shape?.meta?.center && Array.isArray(shape?.meta?.bufferRadii)) { |
| | |
| | | sceneConfigList.value = res?.data?.data ?? [] |
| | | } |
| | | |
| | | |
| | | // 获取场景配置名称 |
| | | function getSceneConfigName(id) { |
| | | if (!id) return '' |
| | |
| | | fitViewToSceneAreas() |
| | | } |
| | | |
| | | onMounted(() => { |
| | | }) |
| | | onMounted(() => {}) |
| | | |
| | | watch( |
| | | () => formData.value.defenseSceneId, |
| | |
| | | } |
| | | } |
| | | ) |
| | | |
| | | |
| | | defineExpose({ |
| | | open, |
| | |
| | | <div class="right-container"> |
| | | <div class="header"> |
| | | <span>{{ formTitle }}</span> |
| | | |
| | | |
| | | <el-icon class="close-btn" @click.stop="visible = false"><Close /></el-icon> |
| | | </div> |
| | | |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="设备位置" prop="deployLocation"> |
| | | <el-input |
| | | class="command-input" |
| | | v-model="formData.deployLocation" |
| | | disabled |
| | | placeholder="请选择位置" |
| | | > |
| | | <el-input class="command-input" v-model="formData.deployLocation" disabled placeholder="请选择位置"> |
| | | <template #suffix> |
| | | <span class="suffix-action">地图选点</span> |
| | | </template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="设备编号" prop="deviceSn"> |
| | | <el-input |
| | | class="command-input" |
| | | v-model="formData.deviceSn" |
| | | disabled |
| | | placeholder="请输入" |
| | | clearable |
| | | /> |
| | | <el-input class="command-input" v-model="formData.deviceSn" disabled placeholder="请输入" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="设备型号" prop="deviceModel"> |
| | | <el-input |
| | | class="command-input" |
| | | v-model="formData.deviceModel" |
| | | disabled |
| | | placeholder="请输入" |
| | | clearable |
| | | /> |
| | | <el-input class="command-input" v-model="formData.deviceModel" disabled placeholder="请输入" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="覆盖范围(m)" prop="effectiveRangeKm"> |
| | | <el-input-number |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <div class="footer"> |
| | | <el-button v-if="dialogMode != 'view'" color="#2B2B4C" @click="handleCancel">{{ dialogReadonly ? '关闭' : '取消' }}</el-button> |
| | | <el-button v-if="dialogMode != 'view'" color="#2B2B4C" @click="handleCancel"> |
| | | {{ dialogReadonly ? '关闭' : '取消' }} |
| | | </el-button> |
| | | <el-button |
| | | color="#284FE3" |
| | | v-if="!dialogReadonly" |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { saveOperationLog } from '@ztzf/apis' |
| | | import { useRoute } from 'vue-router' |
| | | import { MapTooltip } from '@/utils/cesium/shapeTools/Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | |
| | | import equipment from '@/assets/images/dataCockpit/legend/equipment.png' |
| | | |
| | |
| | | if (!isValid) return |
| | | submitting.value = true |
| | | try { |
| | | const {longitude, latitude} = parseDeployLocation(formData.value.deployLocation) |
| | | const { longitude, latitude } = parseDeployLocation(formData.value.deployLocation) |
| | | const normalizedRange = normalizeRange(formData.value.effectiveRangeKm) |
| | | |
| | | const payload = { |
| | |
| | | effectiveRangeKmIsNotNull: normalizedRange != null ? 1 : 2, |
| | | effectiveRangeKm: normalizedRange, |
| | | longitude, |
| | | latitude |
| | | latitude, |
| | | } |
| | | formData.value.effectiveRangeKm = normalizedRange |
| | | delete payload.deviceId |
| | |
| | | saveOperationLog({ |
| | | requestUri: route.path, |
| | | title: `${route.name || '侦测范围管理'}-${actionText}`, |
| | | type: 1 |
| | | type: 1, |
| | | }) |
| | | |
| | | ElMessage.success(dialogMode.value === 'add' ? '新增成功' : '更新成功') |
| | |
| | | current: 1, |
| | | size: 200, |
| | | effectiveRangeKmIsNotNull: 2, |
| | | isTrack: 1 |
| | | isTrack: 1, |
| | | }) |
| | | const records = res?.data?.data?.records ?? [] |
| | | deviceOptions.value = records.map(item => ({ |
| File was renamed from applications/drone-command/src/utils/cesium/shapeTools/Tooltip.js |
| | |
| | | export class MapTooltip { |
| | | export class MapTooltip { |
| | | constructor(viewer, options = {}) { |
| | | this.viewer = viewer |
| | | this.options = options |
| | |
| | | if (!this.tooltipEl || !position) return |
| | | const width = this.container?.clientWidth ?? 0 |
| | | const height = this.container?.clientHeight ?? 0 |
| | | if ( |
| | | !width || |
| | | !height || |
| | | position.x < 0 || |
| | | position.y < 0 || |
| | | position.x > width || |
| | | position.y > height |
| | | ) { |
| | | if (!width || !height || position.x < 0 || position.y < 0 || position.x > width || position.y > height) { |
| | | this.hide() |
| | | return |
| | | } |
| | |
| | | import * as Cesium from 'cesium' |
| | | |
| | | // 获取正射影像4至点 |
| | | export function getOrthoImageBoundaryPoints (data) { |
| | | const arr = JSON.parse(data) |
| | | |
| | | if (arr.length !== 4) return undefined |
| | | |
| | | const west = Math.min(arr[0], arr[2]) |
| | | const east = Math.max(arr[0], arr[2]) |
| | | const south = Math.min(arr[1], arr[3]) |
| | | const north = Math.max(arr[1], arr[3]) |
| | | |
| | | return Cesium.Rectangle.fromDegrees( |
| | | west, |
| | | south, |
| | | east, |
| | | north |
| | | ) |
| | | } |
| | | |
| | | import { MapTooltip } from './MapTooltip' |
| | | /** |
| | | * 飞到中心点并且所有点在可视范围 |
| | | * @param positionsData 二维数组,每项为 [lon, lat] 或 三维数组 [lon, lat, height] |
| | |
| | | * @param multiple 缩放倍数-默认为4 |
| | | * @param pitch 俯仰角-默认为-90 |
| | | */ |
| | | export function flyVisual({ positionsData, viewer, multiple = 4, pitch = -90 }) { |
| | | function flyVisual({ positionsData, viewer, multiple = 4, pitch = -90 }) { |
| | | if (!Array.isArray(positionsData) || positionsData.length === 0) return |
| | | |
| | | // 如果是一个点,加两个点方便后续生成外包围盒 |
| | |
| | | }, |
| | | }) |
| | | } |
| | | |
| | | export { MapTooltip, flyVisual } |