添加优化

This commit is contained in:
ival 2021-04-15 14:29:54 +08:00
parent 4921b43e1b
commit 624b06fe85
3 changed files with 41 additions and 39 deletions

View File

@ -19,43 +19,20 @@ import elementConst from '@/iscs_new/core/form/elementConst';
import formBuilder from '@/iscs_new/core/form/formBuilder';
import { EventBus } from '@/scripts/event-bus';
const exec = (fm, name, ...args) => fm && fm[name] && fm[name](...args);
export default {
data () {
return {
visible: true,
shapeType: 'compose',
enum: 'Compose',
graphicType: [],
builderMap: {
strategyMap: {
'Compose': {
init() {
init: () => {
this.graphicType = Object.fromEntries(Object.keys(graphic).filter(type => !['Group'].includes(type)).map(type => [type, type]))
},
doBuilder(type) {
}
},
'Map': {
init() {
},
doBuilder(type) {
}
}
}
};
},
mounted() {
},
methods: {
init() {
if (shapeType) {
this.graphicType = Object.fromEntries(Object.keys(graphic).filter(type => !['Group'].includes(type)).map(type => [type, type]));
}
},
doBuilder(type) {
doBuilder: (type) => {
const form = formBuilder.buildForm(elementConst[type]);
const model = utils.deepClone(form.model);
model.code = utils.getUID(type);
@ -66,6 +43,29 @@ export default {
this.$iscs && this.$iscs.render([{model, action: {shapeType: shapeType.Element, order: orders.Add}}]);
EventBus.$emit('getComposeElemList');
}
},
'Map': {
init: () =>{
},
doBuilder: (type) => {
}
}
}
};
},
mounted() {
this.init();
},
methods: {
init() {
exec(this.strategyMap[this.enum], 'init')
},
doBuilder(type) {
exec(this.strategyMap[this.enum], 'doBuilder', type)
}
}
};
</script>

View File

@ -4,6 +4,7 @@ import ELimitLines from './ELimitLines'; // 区段限速 (私有)
import ELines from './ELines'; // 创建多线条 曲线 (私有)
import EblockLines from './EblockLines'; // 区段封锁特有
import ESeparator from './ESeparator'; // 分隔符 (私有)
import EDerailer from './EDerailer'; // 脱轨器
import EMouse from './EMouse';
import EAxle from './EAxle'; // 创建计轴
// import { EBackArrow, EBackArrowTriangle } from './EBackArrow'; // 折返进路箭头
@ -61,7 +62,8 @@ export default class Section extends Group {
'separator': ESeparator, // 分隔符
'speedLimit': ELimitLines, // 限速线
'speedLimitName': ELimitName, // 限速线名称
'shuttleBack': EBackArrowGroup // 折返箭头 (成都三号线显示)
'shuttleBack': EBackArrowGroup, // 折返箭头 (成都三号线显示)
'derailer': EDerailer, //脱轨器
};
// 遍历当前线路下的绘图元素
const model = this.model;

View File

@ -217,6 +217,24 @@ export const constantRoutes = [
component: Test,
hidden: true
},
{
path:'/iscs_new/design/compose/edit',
hidden: true,
component: IscsNewDraw,
meta: {
i18n: 'router.iscsDraw',
roles: [admin]
}
},
{
path:'/iscs_new/design/map/edit',
hidden: true,
component: IscsNewDesign,
meta: {
i18n: 'router.iscsDraw',
roles: [admin]
}
},
{
path: '/demo',
component: Demo,
@ -1153,24 +1171,6 @@ export const asyncRouter = [
}
]
},
{
path:'/iscs_new/design/compose/edit',
hidden: true,
component: IscsNewDraw,
meta: {
i18n: 'router.iscsDraw',
roles: [admin]
}
},
{
path:'/iscs_new/design/map/edit',
hidden: true,
component: IscsNewDesign,
meta: {
i18n: 'router.iscsDraw',
roles: [admin]
}
},
{ // iscs系统
path: '/iscs',
component: Layout,