添加优化

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

View File

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

View File

@ -217,6 +217,24 @@ export const constantRoutes = [
component: Test, component: Test,
hidden: true 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', path: '/demo',
component: 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系统 { // iscs系统
path: '/iscs', path: '/iscs',
component: Layout, component: Layout,