import deviceType from '../config/deviceType'; import Link from './Link'; import Section from './Section'; import Signal from './Signal'; import Station from './Station'; import StationControl from './StationControl'; import ImageControl from './ImageControl'; import LcControl from './LcControl'; import LimitControl from './LimitControl'; import Switch from './Switch'; import ZcControl from './ZcControl'; import StationCounter from './StationCounter'; import StationDelayUnlock from './StationDelayUnlock'; /** 图库*/ const mapShape = {}; mapShape[deviceType.Link] = Link; mapShape[deviceType.Section] = Section; mapShape[deviceType.Signal] = Signal; mapShape[deviceType.Station] = Station; mapShape[deviceType.StationControl] = StationControl; mapShape[deviceType.ImageControl] = ImageControl; mapShape[deviceType.LcControl] = LcControl; mapShape[deviceType.LimitControl] = LimitControl; mapShape[deviceType.Switch] = Switch; mapShape[deviceType.ZcControl] = ZcControl; mapShape[deviceType.StationCounter] = StationCounter; mapShape[deviceType.StationDelayUnlock] = StationDelayUnlock; function shapefactory(type, device, jmap) { const style = jmap.getStyleDict(); const shape = mapShape[type]; if (shape instanceof Function) { return new shape(device, style[type], jmap); } } export default shapefactory;