refactor: 更新地面站和卫星状态接口,优化类型命名和属性结构
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { GroundStationState, SatelliteState } from './useHCesiumManager.types';
|
||||
import type { HCesiumManagerStationState, HCesiumManagerSatelliteState } from './useHCesiumManager.types';
|
||||
|
||||
import { useHCesiumManager } from './useHCesiumManager';
|
||||
import { useHCesiumManagerSatellite } from './useHCesiumManager.卫星';
|
||||
@ -8,8 +8,8 @@ import { useHCesiumManagerStation } from './useHCesiumManager.站点';
|
||||
import 'cesium/Build/Cesium/Widgets/widgets.css';
|
||||
|
||||
const props = defineProps<{
|
||||
groundStationState?: GroundStationState;
|
||||
satelliteState?: SatelliteState;
|
||||
groundStationState?: HCesiumManagerStationState;
|
||||
satelliteState?: HCesiumManagerSatelliteState;
|
||||
}>();
|
||||
|
||||
// 1. 管理 Cesium Viewer 实例生命周期
|
||||
@ -19,7 +19,7 @@ const { hCesiumViewerManager } = useHCesiumManager('cesium-container'); // 获
|
||||
// 将实例的 getter 和 props 的 getter 传递给组合函数
|
||||
useHCesiumManagerStation(
|
||||
() => hCesiumViewerManager, // 传递 Manager 实例的 getter
|
||||
() => props.groundStationState?.groundStations, // 从新的 prop 中获取列表
|
||||
() => props.groundStationState?.stations, // 从新的 prop 中获取列表
|
||||
() => props.groundStationState?.selectedIds, // 从新的 prop 中获取选中 ID
|
||||
);
|
||||
|
||||
|
@ -4,9 +4,9 @@ import type { I卫星, I站点 } from './managers/HCesiumManager.types'; // 从
|
||||
* 地面站状态接口
|
||||
* 包含地面站列表和当前选中的地面站 ID 列表
|
||||
*/
|
||||
export interface GroundStationState {
|
||||
export interface HCesiumManagerStationState {
|
||||
/** 地面站配置数组 */
|
||||
groundStations: I站点[];
|
||||
stations: I站点[];
|
||||
/** 选中的地面站 ID 集合 */
|
||||
selectedIds: Set<string>;
|
||||
}
|
||||
@ -15,7 +15,7 @@ export interface GroundStationState {
|
||||
* 卫星状态接口
|
||||
* 包含卫星列表和当前选中的卫星 ID 列表
|
||||
*/
|
||||
export interface SatelliteState {
|
||||
export interface HCesiumManagerSatelliteState {
|
||||
/** 卫星配置数组 */
|
||||
satellites: I卫星[];
|
||||
/** 选中的卫星 ID 集合 */
|
||||
|
Reference in New Issue
Block a user