2019-07-03 14:29:09 +08:00
|
|
|
import deviceType from '../config/deviceType';
|
|
|
|
import Link from './Link';
|
2019-07-15 10:07:04 +08:00
|
|
|
import Section from './section';
|
2019-07-03 14:29:09 +08:00
|
|
|
|
2019-07-03 18:41:00 +08:00
|
|
|
/** 图库*/
|
2019-07-03 14:29:09 +08:00
|
|
|
const mapShape = {};
|
|
|
|
mapShape[deviceType.Link] = Link;
|
2019-07-15 10:07:04 +08:00
|
|
|
mapShape[deviceType.Section] = Section;
|
2019-07-03 14:29:09 +08:00
|
|
|
|
2019-07-03 18:41:00 +08:00
|
|
|
function shapefactory(type, device, style) {
|
2019-07-04 10:59:40 +08:00
|
|
|
const shape = mapShape[type];
|
|
|
|
if (shape instanceof Function) {
|
2019-07-04 18:39:30 +08:00
|
|
|
return new shape(device, style[type], style.Global);
|
2019-07-04 10:59:40 +08:00
|
|
|
}
|
2019-07-03 14:29:09 +08:00
|
|
|
}
|
|
|
|
|
2019-07-11 17:58:58 +08:00
|
|
|
export default shapefactory;
|