help.ts
811 Bytes
import { Component } from 'vue';
import { FrontComponent } from '../../../const/const';
import BasicDataSourceForm from './BasicDataSourceForm.vue';
import ControlDataSourceForm from './ControlDataSourceForm.vue';
import MapDataSourceForm from './MapDataSourceForm.vue';
const dataSourceComponentMap = new Map<FrontComponent, Component>();
dataSourceComponentMap.set(FrontComponent.CONTROL_COMPONENT_TOGGLE_SWITCH, ControlDataSourceForm);
dataSourceComponentMap.set(FrontComponent.MAP_COMPONENT_TRACK_REAL, MapDataSourceForm);
dataSourceComponentMap.set(FrontComponent.MAP_COMPONENT_TRACK_HISTORY, MapDataSourceForm);
export const getDataSourceComponent = (frontId: FrontComponent) => {
if (dataSourceComponentMap.has(frontId)) return dataSourceComponentMap.get(frontId)!;
return BasicDataSourceForm;
};