diff --git a/public/baseConfig.js b/public/baseConfig.js index 6d2aacfed..141a38599 100644 --- a/public/baseConfig.js +++ b/public/baseConfig.js @@ -87,5 +87,6 @@ window['settings'] = { eventType: { label: '事件分类', color: 'info' }, subEvent: { label: '子事件', color: 'warning' }, + twoEvent: { label: '二级分类', color: 'warning' }, }, } diff --git a/src/api/Gantt/index.js b/src/api/Gantt/index.js index 3a1a1a16d..0a9f0bc2d 100644 --- a/src/api/Gantt/index.js +++ b/src/api/Gantt/index.js @@ -7,15 +7,45 @@ const sub = [ type: 'eventType', children: [ { - id: 1, - name: '发射事件', + id: 122, + name: '弹道DD', start: '2024-11-15', end: '2024-11-17', - type: 'subEvent', - trajData: {}, - avatar: '/images/影像.jpg', + type: "twoEvent", + children: [ + { + id: 1, + name: '发射事件', + start: '2024-11-15', + end: '2024-11-17', + type: 'subEvent', + trajData: {}, + avatar: '/images/影像.jpg', + + }, + ], + }, + { + id: 188, + name: '巡航DD', + start: '2024-11-15', + end: '2024-11-17', + type: "twoEvent", + children: [ + { + id: 1, + name: '发射事件', + start: '2024-11-15', + end: '2024-11-17', + type: 'subEvent', + trajData: {}, + avatar: '/images/影像.jpg', + + }, + ], }, ], + }, { id: 300, diff --git a/src/views/BaseMB/index.vue b/src/views/BaseMB/index.vue index afd5f1744..67a724834 100644 --- a/src/views/BaseMB/index.vue +++ b/src/views/BaseMB/index.vue @@ -26,17 +26,18 @@ watch(checkedKeys, val => { const { flyTo } = useEarth() const nodeProps = ({ option }: { option: TreeOption }) => { + // console.log(option, 'option') return { onclick: () => { if (option.children) { return } + const { dataId, data: { geom }, } = option const [lon, lat] = parseWKT(geom).coordinates - if (checkedKeys.value.includes(dataId as string)) { flyTo({ lon, lat }) } @@ -44,9 +45,7 @@ const nodeProps = ({ option }: { option: TreeOption }) => { } } -const renderSuffix = ({ option }: { option: TreeOption }) => { - -} +const renderSuffix = ({ option }: { option: TreeOption }) => {} diff --git a/src/views/Mubiao/index.vue b/src/views/Mubiao/index.vue index 2c564f9b9..9b2a5dbdd 100644 --- a/src/views/Mubiao/index.vue +++ b/src/views/Mubiao/index.vue @@ -11,6 +11,11 @@ import { useMuBiaoDisappearWS } from './hooks/mubiaoDisappear' import { useMubiaoDetail } from './hooks/mubiaoDetail' import { useMBTrajectory } from './components/HisTrajectory/hooks/mbTraj' import { useDaodan } from '../Daodan/ddHooks' +import { useEarth } from '../Earth/hooks/earth' +import { parseWKT } from '@/utils/parseWKT' +import { difference } from 'lodash' +import { useEntity } from '@/hooks/entity' +import { cartesian32LonLat } from '@/utils/pos' const { getMubiaoData, data, addMubiao, checkedKeys } = useMubiao() const useMbPosWS = useMuBiaoPositionWS() @@ -30,7 +35,35 @@ watch(checkedKeys, val => { const { showDetailsMubiao } = useMubiaoDetail() const { showOrHideHisTraj } = useMBTrajectory() +const { mubiaoMap } = useEntity() + // const { showOrHideDdConfig } = useDaodan() +const { flyTo } = useEarth() +const latValue = {} +const nodeProps = ({ option }: { option: TreeOption }) => { + return { + onclick: () => { + if (option.children) { + return + } + setTimeout(() => { + if (mubiaoMap.size > 0) { + mubiaoMap.forEach((entity, key) => { + const positions = entity.position._value + const [lon, lat, height] = cartesian32LonLat(positions) + const { + dataId, + // data: { geom }, + } = option + if (checkedKeys.value.includes(dataId as string)) { + flyTo({ lon, lat }) + } + }) + } + }, 500) + }, + } +} const renderSuffix = ({ option }: { option: TreeOption }) => { // console.log(option.data) if (!option.data) { @@ -103,6 +136,7 @@ const renderSuffix = ({ option }: { option: TreeOption }) => { v-model:checked="checkedKeys" showSearch :renderSuffix="renderSuffix" + :nodeProps="nodeProps" /> diff --git a/src/views/Satellite/hooks/satellite.ts b/src/views/Satellite/hooks/satellite.ts index f57448e19..539ac4146 100644 --- a/src/views/Satellite/hooks/satellite.ts +++ b/src/views/Satellite/hooks/satellite.ts @@ -52,6 +52,7 @@ export function useSatellite() { nodes.forEach(node => { const entity = addSatellite(node) satelliteMap.set(node.id, entity) + //console.log(satelliteMap, '卫星') if (showPoint.value) { showPointUnderSat(node.id) } diff --git a/src/views/Satellite/index.vue b/src/views/Satellite/index.vue index d9b99c90e..491270454 100644 --- a/src/views/Satellite/index.vue +++ b/src/views/Satellite/index.vue @@ -4,9 +4,15 @@ import { NButton } from 'naive-ui' import Tree from '@/components/Tree/index.vue' import { useSatellite } from './hooks/satellite' import { showDetailsSatellite } from './components/SatDetail' +import { useEarth } from '../Earth/hooks/earth' +import { useEntity } from '@/hooks/entity' -const { satelliteList, checkedKeys, getSatelliteList, addSatellites } = - useSatellite() +const { + satelliteList, + checkedKeys, + getSatelliteList, + addSatellites, +} = useSatellite() onMounted(async () => { getSatelliteList() @@ -15,7 +21,33 @@ onMounted(async () => { watch(checkedKeys, val => { addSatellites(val) }) +const { flyTo } = useEarth() +const { satelliteMap } = useEntity() +const nodeProps = ({ option }: { option: TreeOption }) => { + // console.log(option, '卫星option') + return { + onclick: () => { + // console.log(satelliteMap, 'satelliteMap') + }, + } + // return { + // onclick: () => { + // if (option.children) { + // return + // } + + // const { + // dataId, + // data: { geom }, + // } = option + // const [lon, lat] = parseWKT(geom).coordinates + // if (checkedKeys.value.includes(dataId as string)) { + // flyTo({ lon, lat }) + // } + // }, + // }, +} const renderSuffix = ({ option }: { option: TreeOption }) => { // console.log(option) return h('div', { class: 'flex items-center gap-2 pr-2' }, [ @@ -56,6 +88,7 @@ const renderSuffix = ({ option }: { option: TreeOption }) => { v-model:checked="checkedKeys" showSearch :renderSuffix="renderSuffix" + :nodeProps="nodeProps" />