diff --git a/src/jmap/shape/Section/index.js b/src/jmap/shape/Section/index.js index 9c1d46060..25de6ef79 100644 --- a/src/jmap/shape/Section/index.js +++ b/src/jmap/shape/Section/index.js @@ -230,78 +230,66 @@ export default class Section extends Group { const y = Math.min(model.points[0].y, model.points[model.points.length - 1].y) + Math.abs(model.points[model.points.length - 1].y - model.points[0].y) / 2; const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]); const drict = model.trainPosType != '01' ? 1 : -1; - /** 区段名称 (逻辑区段名称 或 物理区段名称 是否显示)*/ - if (style.Section.logicText.show || style.Section.text.show) { - let tempx = x; - let tempy = y; - // 创建区段名称 - if (model.type !== '03') { - if (model.type == '02') { - const opposite = style.Section.logicText.opposite ? -1 : 1; - tempx += traingle.getSin(style.Section.logicText.distance); - tempy += traingle.getCos(style.Section.logicText.distance) * (style.Section.logicText.position || opposite * drict); - if (style.Section.logicText.show) { - this.name = new ETextName({ - zlevel: this.zlevel, - z: this.z + 2, - style: this.style, - silent: false, - x: tempx + model.namePosition.x, - y: tempy + model.namePosition.y, - fontWeight: style.Section.logicText.fontWeight, - fontSize: style.Section.logicText.fontSize, - fontFamily: style.fontFamily, - text: model.name, - textFill: style.Section.logicText.fontColor, - textAlign: style.Section.logicText.textAlign, - textPosition: style.Section.logicText.textPosition, - textVerticalAlign: style.Section.logicText.textVerticalAlign - }); - this.add(this.name); - } - } else if (style.Section.text.show && !model.isSwitchSection) { - const opposite = style.Section.text.opposite ? -1 : 1; - tempx += traingle.getSin(style.Section.text.distance); - tempy += traingle.getCos(style.Section.text.distance) * (style.Section.text.position || opposite * drict); - this.name = new ETextName({ - zlevel: this.zlevel, - z: this.z + 2, - style: this.style, - silent: false, - x: tempx + model.namePosition.x, - y: tempy + model.namePosition.y, - fontWeight: style.Section.text.fontWeight, - fontSize: style.Section.text.fontSize, - fontFamily: style.fontFamily, - text: model.name, - textFill: style.Section.text.fontColor, - textAlign: style.Section.text.textAlign, - textPosition: style.Section.text.textPosition, - textVerticalAlign: style.Section.text.textVerticalAlign - }); - this.add(this.name); - } - } else { - if (style.Section.text.show) { - this.name = new ETextName({ - zlevel: this.zlevel, - z: this.z + 2, - style: this.style, - silent: false, - x: tempx + model.namePosition.x, - y: tempy + model.namePosition.y + style.Section.text.distance * drict, - fontWeight: style.Section.text.fontWeight, - fontSize: style.Section.text.fontSize, - fontFamily: style.fontFamily, - text: model.name, - textFill: style.Section.text.fontColor, - textAlign: style.Section.text.textAlign, - textPosition: style.Section.text.textPosition, - textVerticalAlign: style.Section.text.textVerticalAlign - }); - this.add(this.name); - } - } + if (model.type == '01' && style.Section.text.show && model.nameShow) { // 物理区段名称 + const opposite = style.Section.text.opposite ? -1 : 1; + const tempx = x + traingle.getSin(style.Section.text.distance); + const tempy = y + traingle.getCos(style.Section.text.distance) * (style.Section.text.position || opposite * drict); + this.name = new ETextName({ + zlevel: this.zlevel, + z: this.z + 2, + style: this.style, + silent: false, + x: tempx + model.namePosition.x, + y: tempy + model.namePosition.y, + fontWeight: style.Section.text.fontWeight, + fontSize: style.Section.text.fontSize, + fontFamily: style.fontFamily, + text: model.name, + textFill: style.Section.text.fontColor, + textAlign: style.Section.text.textAlign, + textPosition: style.Section.text.textPosition, + textVerticalAlign: style.Section.text.textVerticalAlign + }); + this.add(this.name); + } else if (model.type == '02' && style.Section.logicText.show && model.nameShow) { // 逻辑区段 + const opposite = style.Section.logicText.opposite ? -1 : 1; + const tempx = x + traingle.getSin(style.Section.logicText.distance); + const tempy = y + traingle.getCos(style.Section.logicText.distance) * (style.Section.logicText.position || opposite * drict); + this.name = new ETextName({ + zlevel: this.zlevel, + z: this.z + 2, + style: this.style, + silent: false, + x: tempx + model.namePosition.x, + y: tempy + model.namePosition.y, + fontWeight: style.Section.logicText.fontWeight, + fontSize: style.Section.logicText.fontSize, + fontFamily: style.fontFamily, + text: model.name, + textFill: style.Section.logicText.fontColor, + textAlign: style.Section.logicText.textAlign, + textPosition: style.Section.logicText.textPosition, + textVerticalAlign: style.Section.logicText.textVerticalAlign + }); + this.add(this.name); + } else if (model.type == '03' && model.nameShow) { // 道岔计轴区段 + this.name = new ETextName({ + zlevel: this.zlevel, + z: this.z + 2, + style: this.style, + silent: false, + x: x + model.namePosition.x, + y: y + model.namePosition.y + style.Section.text.distance * drict, + fontWeight: style.Section.text.fontWeight, + fontSize: style.Section.text.fontSize, + fontFamily: style.fontFamily, + text: model.name, + textFill: style.Section.text.fontColor, + textAlign: style.Section.text.textAlign, + textPosition: style.Section.text.textPosition, + textVerticalAlign: style.Section.text.textVerticalAlign + }); + this.add(this.name); } /** 站台轨名称*/ @@ -374,7 +362,7 @@ export default class Section extends Group { } /** 目的码名称*/ - if (model.destinationCode && style.Section.destinationText.show) { + if (model.destinationCode && model.destinationNameShow && style.Section.destinationText.show) { const opposite = style.Section.destinationText.opposite ? -1 : 1; const tempx = x + traingle.getSin(style.Section.destinationText.distance); const tempy = y + traingle.getCos(style.Section.destinationText.distance) * (style.Section.destinationText.position || opposite * drict); diff --git a/src/jmap/shape/Station/index.js b/src/jmap/shape/Station/index.js index 152d34e4d..68afa99e9 100644 --- a/src/jmap/shape/Station/index.js +++ b/src/jmap/shape/Station/index.js @@ -5,70 +5,71 @@ import Group from 'zrender/src/container/Group'; import ETextName from '../element/ETextName'; // 名称文字 (共有) export default class Station extends Group { - constructor(model, style) { - super(); - this._code = model.code; - this._type = model._type; - this.zlevel = model.zlevel; - this.z = 40; - this.model = model; - this.style = style; - this.create(); - this.setState(model); - } + constructor(model, style) { + super(); + this._code = model.code; + this._type = model._type; + this.zlevel = model.zlevel; + this.z = 40; + this.model = model; + this.style = style; + this.create(); + this.setState(model); + } - create() { - const model = this.model; - const style = this.style; + create() { + const model = this.model; + const style = this.style; - if (model.visible) { - // 公里标名称是否显示 - this.stationText = new ETextName({ - zlevel: this.zlevel, - z: this.z, - position: [0, 0], - x: model.position.x, - y: model.position.y, - fontWeight: model.fontWeight, - fontSize: model.nameFont || 18, - fontFamily: style.fontFamily, - text: model.name, - textAlign: 'middle', - textVerticalAlign: 'top', - textFill: model.nameFontColor - }); - this.add(this.stationText); - const path = window.location.href; - if (style.Station.kmPostShow || path.includes('/map/draw')) { - // 公里标是否显示 - let direction = 1; - if (this.style.Station.kilometerPosition == 'up') { - direction = -1; - } - this.mileageText = new ETextName({ - zlevel: this.zlevel, - z: this.z, - position: [0, 0], - x: model.position.x, - y: model.position.y + ((parseInt(model.nameFont) + 2) * direction), - fontWeight: model.fontWeight, - fontSize: model.kmPostFont || 18, - fontFamily: style.fontFamily, - text: model.kmPost, - textAlign: 'middle', - textVerticalAlign: 'top', - textFill: model.kmPostFontColor - }); - this.add(this.mileageText); - } - } - } + if (model.visible) { + // 公里标名称是否显示 + this.stationText = new ETextName({ + zlevel: this.zlevel, + z: this.z, + position: [0, 0], + x: model.position.x, + y: model.position.y, + fontWeight: model.fontWeight, + fontSize: model.nameFont || 18, + fontFamily: style.fontFamily, + text: model.name, + textAlign: 'middle', + textVerticalAlign: 'top', + textFill: model.nameFontColor + }); + this.add(this.stationText); + const path = window.location.href; + if (style.Station.kmPostShow || path.includes('/map/draw')) { + // 公里标是否显示 + let direction = 1; + if (this.style.Station.kilometerPosition == 'up') { + direction = -1; + } + this.mileageText = new ETextName({ + zlevel: this.zlevel, + z: this.z, + position: [0, 0], + x: model.position.x, + y: model.position.y + ((parseInt(model.nameFont) + 2) * direction), + fontWeight: model.fontWeight, + fontSize: model.kmPostFont || 18, + fontFamily: style.fontFamily, + text: model.kmPost, + textAlign: 'middle', + textVerticalAlign: 'top', + textFill: model.kmPostFontColor + }); + this.add(this.mileageText); + model.kmPostShow ? this.mileageText.show() : this.mileageText.hide(); + } + } + } - // eslint-disable-next-line no-unused-vars - setState(model) { - } + // eslint-disable-next-line no-unused-vars + setState(model) { + } - getShapeTipPoint() { - return null; - } + getShapeTipPoint() { + return null; + } } diff --git a/src/jmap/shape/Switch/index.js b/src/jmap/shape/Switch/index.js index c51012deb..d3d4a4035 100644 --- a/src/jmap/shape/Switch/index.js +++ b/src/jmap/shape/Switch/index.js @@ -144,6 +144,7 @@ export default class Switch extends Group { this.add(this.relocShelter); this.add(this.releaseBackground); this.add(this.name); + style.Switch.text.show && model.nameShow ? this.name.show() : this.name.hide(); } createLockRect() { diff --git a/src/jmap/theme/beijing_01/model.js b/src/jmap/theme/beijing_01/model.js index cf408a81f..91a04242b 100644 --- a/src/jmap/theme/beijing_01/model.js +++ b/src/jmap/theme/beijing_01/model.js @@ -1,63 +1,67 @@ import deviceType from '../../constant/deviceType'; class Model { - constructor() { - // 公共字段部分默认初始值 - this['public'] = {}; - this['public'][deviceType.Signal] = { - lampPositionType: '02', - lampPostType: '02' - }; + constructor() { + // 公共字段部分默认初始值 + this['public'] = {}; + this['public'][deviceType.Signal] = { + lampPositionType: '02', + lampPostType: '02' + }; - // 私有字段部分默认初始值 - this['private'] = {}; - this['private'][deviceType.StationControl] = { - indicatorShow: true // 标识灯名称显示 - }; - this['private'][deviceType.Section] = { - borderBorderShow: true, // 区段边界显示 - standTrackNameShow: true, // 站台轨名称显示 - reentryTrackNameShow: true, // 折返轨名称显示 - transferTrackNameShow: true // 转换轨名称显示 - }; - this['private'][deviceType.Signal] = { - linkageAutoRouteShow: true, // 联锁自动进路表示灯显示 - atsAutoTriggerShow: true // ATS自动触发表示灯显示 - }; - this['private'][deviceType.Train] = { - nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式 - nameFontSize: 10 // 字体大小 - }; - this['private'][deviceType.TrainWindow] = { - trainWindowShow: true - }; - } + // 私有字段部分默认初始值 + this['private'] = {}; + this['private'][deviceType.StationControl] = { + indicatorShow: true // 标识灯名称显示 + }; + this['private'][deviceType.Switch] = { + nameShow: true + }; + this['private'][deviceType.Section] = { + borderBorderShow: true, // 区段边界显示 + destinationNameShow: true, // 目的地码名称显示 + standTrackNameShow: true, // 站台轨名称显示 + reentryTrackNameShow: true, // 折返轨名称显示 + transferTrackNameShow: true // 转换轨名称显示 + }; + this['private'][deviceType.Signal] = { + linkageAutoRouteShow: true, // 联锁自动进路表示灯显示 + atsAutoTriggerShow: true // ATS自动触发表示灯显示 + }; + this['private'][deviceType.Train] = { + nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式 + nameFontSize: 10 // 字体大小 + }; + this['private'][deviceType.TrainWindow] = { + trainWindowShow: true + }; + } - initPublicProps(model) { - if (model) { - var modelInitial = this.public[model._type]; - if (modelInitial) { - for (var prop in modelInitial) { - model[prop] = modelInitial[prop]; - } - } - } + initPublicProps(model) { + if (model) { + var modelInitial = this.public[model._type]; + if (modelInitial) { + for (var prop in modelInitial) { + model[prop] = modelInitial[prop]; + } + } + } - return model; - } + return model; + } - initPrivateProps(model) { - if (model) { - var modelInitial = this.private[model._type]; - if (modelInitial) { - for (var prop in modelInitial) { - model[prop] = modelInitial[prop]; - } - } - } + initPrivateProps(model) { + if (model) { + var modelInitial = this.private[model._type]; + if (modelInitial) { + for (var prop in modelInitial) { + model[prop] = modelInitial[prop]; + } + } + } - return model; - } + return model; + } } export default new Model(); diff --git a/src/jmap/theme/chengdu_03/menus/index.vue b/src/jmap/theme/chengdu_03/menus/index.vue index 67d082909..6c8937b5d 100644 --- a/src/jmap/theme/chengdu_03/menus/index.vue +++ b/src/jmap/theme/chengdu_03/menus/index.vue @@ -37,53 +37,53 @@ import PassiveContorl from './passiveDialog/control'; import PassiveTimeout from './passiveDialog/timeout'; export default { - name: 'Menus', - components: { - MenuBar, - MenuButton, - MenuCancel, - MenuSignal, - MenuSwitch, - MenuSection, - MenuStationControl, - MenuStationStand, - MenuStation, - MenuTrain, - PassiveAlarm, - PassiveContorl, - PassiveTimeout - }, - props: { - selected: { - type: Object, - default() { - return null; - } - } - }, - computed: { - ...mapGetters('config', [ - 'width' - ]), - isShowAll() { - return this.$route.params.mode !== 'dp' && + name: 'Menus', + components: { + MenuBar, + MenuButton, + MenuCancel, + MenuSignal, + MenuSwitch, + MenuSection, + MenuStationControl, + MenuStationStand, + MenuStation, + MenuTrain, + PassiveAlarm, + PassiveContorl, + PassiveTimeout + }, + props: { + selected: { + type: Object, + default() { + return null; + } + } + }, + computed: { + ...mapGetters('config', [ + 'width' + ]), + isShowAll() { + return this.$route.params.mode !== 'dp' && this.$route.params.mode !== 'plan' && this.$store.state.training.roles != 'BigScreen'; - }, - isShowBar() { - return this.$store.state.training.prdType; - } - }, - watch: { - isShowBar(val) { - val && this.$store.dispatch('config/updateMenuBar'); - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('config/updateMenuBar'); - }); - } + }, + isShowBar() { + return this.$store.state.training.prdType; + } + }, + watch: { + isShowBar(val) { + val && this.$store.dispatch('config/updateMenuBar'); + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('config/updateMenuBar'); + }); + } }; diff --git a/src/jmap/theme/chengdu_03/menus/menuBar.vue b/src/jmap/theme/chengdu_03/menus/menuBar.vue index 6eda8c025..1b7125fe5 100644 --- a/src/jmap/theme/chengdu_03/menus/menuBar.vue +++ b/src/jmap/theme/chengdu_03/menus/menuBar.vue @@ -95,805 +95,805 @@ import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import { EventBus } from '@/scripts/event-bus'; export default { - name: 'MenuBar', - components: { - NoticeInfo, - StationControlConvert, - PasswordBox, - ViewTrainId, - ViewName, - ViewDevice, - TrainAdd, - TrainTranstalet, - TrainDelete, - ManageUser, - HelpAbout, - SetLimitSpeed - }, - props: { - selected: { - type: Object, - default() { - return null; - } - } - }, - data() { - return { - classA: -1, - classB: -1, - tempClassA: -1, - tempClassB: -1, - valid: true, - menu: [], - menuNormal: { - local: [ - { - title: '系统', - operate: OperationEvent.Command.mBar.system, - children: [ - { - title: '登录', - click: this.undeveloped - }, - { - title: '注销', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '连接主用中心', - click: this.undeveloped - }, - { - title: '连接备用中心', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '退出', - click: this.undeveloped - } - ] - }, - { - title: '临时限速', - operate: OperationEvent.Command.mBar.limitSpeed, - children: [ - { - title: '设置临时限速', - operate: OperationEvent.Section.setLimitSpeed, - click: this.setLimitSpeed - }, - { - title: '取消临时限速', - operate: OperationEvent.Section.cancelSpeed, - click: this.cancleLimitSpeed - } - ] - }, - { - title: '查看', - operate: OperationEvent.Command.mBar.check, - children: [ - { - title: '运行图', - click: this.undeveloped - }, - { - title: '报告分析', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '视图', - click: this.undeveloped, - operate: '', - children: [{ - title: '报警', - click: this.undeveloped - }, - { - title: '列车运行信息', - click: this.undeveloped - }, - { - title: '设备状态', - click: this.undeveloped - }, - { - title: '列车详细信息', - click: this.undeveloped - }, - { - title: '站台详细信息', - click: this.undeveloped - }] - }, - { - title: '终端站发车列表', - click: this.undeveloped - }, - { - title: '详细设备状态', - click: this.undeveloped - }, - { - title: '查找列车', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '显示目的地号', - click: this.undeveloped - }, - { - title: '显示轨道名', - click: this.undeveloped - }, - { - title: '显示道岔名', - click: this.undeveloped - }, - { - title: '显示信号机名', - click: this.undeveloped - }, - { - title: '显示车次窗位置', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '显示车次号', - click: this.undeveloped - }, - { - title: '显示车组号', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '全屏', - click: this.undeveloped - }, - { - title: '放大', - click: this.undeveloped - }, - { - title: '缩小', - click: this.undeveloped - }, - { - title: '恢复', - click: this.undeveloped - } - ] - }, - { - title: '车站定位', - operate: '', - children: [ - ] - }, - { - title: '显示', - operate: OperationEvent.Command.mBar.view, - hide: true, - children: [ - { - title: '设置列车识别号显示', - click: this.setTrainIdDisplay, - operate: OperationEvent.Command.view.setTrainIdDisplay - }, - { - title: '设置名称显示', - click: this.setNameDisplay, - operate: OperationEvent.Command.view.setNameDisplay - }, - { - title: '设置设备显示', - click: this.setDeviceDisplay, - operate: OperationEvent.Command.view.setDeviceDisplay - } - ] - }, - { - title: 'ATS终端操作', - operate: '', - children: [ - { - title: '当天运行车计划', - click: this.undeveloped - }, - { - title: '出入库预告', - click: this.undeveloped - } - ] - }, - { - title: '计划车操作', - operate: '', - children: [ - { - title: '添加计划车', - click: this.undeveloped - }, - { - title: '平移计划车', - click: this.undeveloped - }, - { - title: '删除计划车', - click: this.undeveloped - } - ] - }, - { - title: '批处理命令', - operate: '', - children: [ - { - title: '全线扣车', - click: this.undeveloped - }, - { - title: '取消全线扣车', - click: this.undeveloped - }, - { - title: '取消上行全线扣车', - click: this.undeveloped - }, - { - title: '取消下行全线扣车', - click: this.undeveloped - } - ] - }, - { - title: '信息管理', - operate: '', - children: [ - { - title: '调度日志', - click: this.undeveloped - }, - { - title: '调度留言提醒', - click: this.undeveloped - }, - { - title: '报警设置', - click: this.undeveloped - } - ] - }, - { - title: '帮助', - children: [ - { - title: '关于ITS GPC 工作站', - click: this.about, - operate: OperationEvent.Command.help.about - } - ] - } - ], - central: [ - { - title: '系统', - operate: OperationEvent.Command.mBar.system, - children: [ - { - title: '登录', - click: this.undeveloped - }, - { - title: '注销', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '连接主用中心', - click: this.undeveloped - }, - { - title: '连接备用中心', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '退出', - click: this.undeveloped - } - ] - }, - { - title: '临时限速', - operate: OperationEvent.Command.mBar.limitSpeed, - children: [ - { - title: '设置临时限速', - operate: OperationEvent.Section.setLimitSpeed, - click: this.setLimitSpeed - }, - { - title: '取消临时限速', - operate: OperationEvent.Section.cancelSpeed, - click: this.cancleLimitSpeed - } - ] - }, - { - title: '查看', - operate: OperationEvent.Command.mBar.check, - children: [ - { - title: '运行图', - click: this.undeveloped - }, - { - title: '报告分析', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '视图', - click: this.undeveloped, - operate: '', - children: [{ - title: '报警', - click: this.undeveloped - }, - { - title: '列车运行信息', - click: this.undeveloped - }, - { - title: '设备状态', - click: this.undeveloped - }, - { - title: '列车详细信息', - click: this.undeveloped - }, - { - title: '站台详细信息', - click: this.undeveloped - }] - }, - { - title: '终端站发车列表', - click: this.undeveloped - }, - { - title: '详细设备状态', - click: this.undeveloped - }, - { - title: '查找列车', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '显示目的地号', - click: this.undeveloped - }, - { - title: '显示轨道名', - click: this.undeveloped - }, - { - title: '显示道岔名', - click: this.undeveloped - }, - { - title: '显示信号机名', - click: this.undeveloped - }, - { - title: '显示车次窗位置', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '显示车次号', - click: this.undeveloped - }, - { - title: '显示车组号', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '全屏', - click: this.undeveloped - }, - { - title: '放大', - click: this.undeveloped - }, - { - title: '缩小', - click: this.undeveloped - }, - { - title: '恢复', - click: this.undeveloped - } - ] - }, - { - title: '车站定位', - operate: '', - children: [ - ] - }, - { - title: '显示', - operate: OperationEvent.Command.mBar.view, - hide: true, - children: [ - { - title: '设置列车识别号显示', - click: this.setTrainIdDisplay, - operate: OperationEvent.Command.view.setTrainIdDisplay - }, - { - title: '设置名称显示', - click: this.setNameDisplay, - operate: OperationEvent.Command.view.setNameDisplay - }, - { - title: '设置设备显示', - click: this.setDeviceDisplay, - operate: OperationEvent.Command.view.setDeviceDisplay - } - ] - }, - { - title: 'ATS终端操作', - operate: '', - children: [ - { - title: '当天运行车计划', - click: this.undeveloped - }, - { - title: '出入库预告', - click: this.undeveloped - } - ] - }, - { - title: '计划车操作', - operate: '', - children: [ - { - title: '添加计划车', - click: this.undeveloped - }, - { - title: '平移计划车', - click: this.undeveloped - }, - { - title: '删除计划车', - click: this.undeveloped - } - ] - }, - { - title: '批处理命令', - operate: '', - children: [ - { - title: '全线扣车', - click: this.undeveloped - }, - { - title: '取消全线扣车', - click: this.undeveloped - }, - { - title: '取消上行全线扣车', - click: this.undeveloped - }, - { - title: '取消下行全线扣车', - click: this.undeveloped - } - ] - }, - { - title: '信息管理', - operate: '', - children: [ - { - title: '调度日志', - click: this.undeveloped - }, - { - title: '调度留言提醒', - click: this.undeveloped - }, - { - title: '报警设置', - click: this.undeveloped - } - ] - }, - { - title: '帮助', - children: [ - { - title: '关于ITS GPC 工作站', - click: this.about, - operate: OperationEvent.Command.help.about - } - ] - } - ] - } - }; - }, - computed: { - ...mapGetters('training', [ - 'mode', - 'started', - 'steps', - 'order', - 'mode' - ]), - ...mapGetters('map', [ - 'stationList' - ]) - }, - watch: { - tempClassA() { - this.classA = this.$store.state.menuOperation.break ? -1 : this.tempClassA; - }, - tempClassB() { - this.classB = this.$store.state.menuOperation.break ? -1 : this.tempClassB; - }, - '$store.state.menuOperation.break': function (val) { - if (val) { - this.classA = this.classB = -1; - } else { - this.classA = this.tempClassA; - this.classB = this.tempClassB; - } - }, - '$store.state.training.operatemode': function (mode) { - this.initMenu(); - }, - '$store.state.training.started': function (val) { - this.closeMenu(true); - }, - '$store.state.training.prdType': function () { - this.initMenu(); - } - }, - mounted() { - this.initMenu(); - }, - methods: { - handleShow(item) { - if (item.hide) { - return false; - } - return true; - }, - initStationList() { - const list = []; - this.stationList.forEach(station => { - if (station.visible) { - const node = { - title: station.name, - operate: station.code, - show: true, - click: this.mapLocation, - code: station.code - }; + name: 'MenuBar', + components: { + NoticeInfo, + StationControlConvert, + PasswordBox, + ViewTrainId, + ViewName, + ViewDevice, + TrainAdd, + TrainTranstalet, + TrainDelete, + ManageUser, + HelpAbout, + SetLimitSpeed + }, + props: { + selected: { + type: Object, + default() { + return null; + } + } + }, + data() { + return { + classA: -1, + classB: -1, + tempClassA: -1, + tempClassB: -1, + valid: true, + menu: [], + menuNormal: { + local: [ + { + title: '系统', + operate: OperationEvent.Command.mBar.system, + children: [ + { + title: '登录', + click: this.undeveloped + }, + { + title: '注销', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '连接主用中心', + click: this.undeveloped + }, + { + title: '连接备用中心', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '退出', + click: this.undeveloped + } + ] + }, + { + title: '临时限速', + operate: OperationEvent.Command.mBar.limitSpeed, + children: [ + { + title: '设置临时限速', + operate: OperationEvent.Section.setLimitSpeed, + click: this.setLimitSpeed + }, + { + title: '取消临时限速', + operate: OperationEvent.Section.cancelSpeed, + click: this.cancleLimitSpeed + } + ] + }, + { + title: '查看', + operate: OperationEvent.Command.mBar.check, + children: [ + { + title: '运行图', + click: this.undeveloped + }, + { + title: '报告分析', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '视图', + click: this.undeveloped, + operate: '', + children: [{ + title: '报警', + click: this.undeveloped + }, + { + title: '列车运行信息', + click: this.undeveloped + }, + { + title: '设备状态', + click: this.undeveloped + }, + { + title: '列车详细信息', + click: this.undeveloped + }, + { + title: '站台详细信息', + click: this.undeveloped + }] + }, + { + title: '终端站发车列表', + click: this.undeveloped + }, + { + title: '详细设备状态', + click: this.undeveloped + }, + { + title: '查找列车', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '显示目的地号', + click: this.undeveloped + }, + { + title: '显示轨道名', + click: this.undeveloped + }, + { + title: '显示道岔名', + click: this.undeveloped + }, + { + title: '显示信号机名', + click: this.undeveloped + }, + { + title: '显示车次窗位置', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '显示车次号', + click: this.undeveloped + }, + { + title: '显示车组号', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '全屏', + click: this.undeveloped + }, + { + title: '放大', + click: this.undeveloped + }, + { + title: '缩小', + click: this.undeveloped + }, + { + title: '恢复', + click: this.undeveloped + } + ] + }, + { + title: '车站定位', + operate: '', + children: [ + ] + }, + { + title: '显示', + operate: OperationEvent.Command.mBar.view, + hide: true, + children: [ + { + title: '设置列车识别号显示', + click: this.setTrainIdDisplay, + operate: OperationEvent.Command.view.setTrainIdDisplay + }, + { + title: '设置名称显示', + click: this.setNameDisplay, + operate: OperationEvent.Command.view.setNameDisplay + }, + { + title: '设置设备显示', + click: this.setDeviceDisplay, + operate: OperationEvent.Command.view.setDeviceDisplay + } + ] + }, + { + title: 'ATS终端操作', + operate: '', + children: [ + { + title: '当天运行车计划', + click: this.undeveloped + }, + { + title: '出入库预告', + click: this.undeveloped + } + ] + }, + { + title: '计划车操作', + operate: '', + children: [ + { + title: '添加计划车', + click: this.undeveloped + }, + { + title: '平移计划车', + click: this.undeveloped + }, + { + title: '删除计划车', + click: this.undeveloped + } + ] + }, + { + title: '批处理命令', + operate: '', + children: [ + { + title: '全线扣车', + click: this.undeveloped + }, + { + title: '取消全线扣车', + click: this.undeveloped + }, + { + title: '取消上行全线扣车', + click: this.undeveloped + }, + { + title: '取消下行全线扣车', + click: this.undeveloped + } + ] + }, + { + title: '信息管理', + operate: '', + children: [ + { + title: '调度日志', + click: this.undeveloped + }, + { + title: '调度留言提醒', + click: this.undeveloped + }, + { + title: '报警设置', + click: this.undeveloped + } + ] + }, + { + title: '帮助', + children: [ + { + title: '关于ITS GPC 工作站', + click: this.about, + operate: OperationEvent.Command.help.about + } + ] + } + ], + central: [ + { + title: '系统', + operate: OperationEvent.Command.mBar.system, + children: [ + { + title: '登录', + click: this.undeveloped + }, + { + title: '注销', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '连接主用中心', + click: this.undeveloped + }, + { + title: '连接备用中心', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '退出', + click: this.undeveloped + } + ] + }, + { + title: '临时限速', + operate: OperationEvent.Command.mBar.limitSpeed, + children: [ + { + title: '设置临时限速', + operate: OperationEvent.Section.setLimitSpeed, + click: this.setLimitSpeed + }, + { + title: '取消临时限速', + operate: OperationEvent.Section.cancelSpeed, + click: this.cancleLimitSpeed + } + ] + }, + { + title: '查看', + operate: OperationEvent.Command.mBar.check, + children: [ + { + title: '运行图', + click: this.undeveloped + }, + { + title: '报告分析', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '视图', + click: this.undeveloped, + operate: '', + children: [{ + title: '报警', + click: this.undeveloped + }, + { + title: '列车运行信息', + click: this.undeveloped + }, + { + title: '设备状态', + click: this.undeveloped + }, + { + title: '列车详细信息', + click: this.undeveloped + }, + { + title: '站台详细信息', + click: this.undeveloped + }] + }, + { + title: '终端站发车列表', + click: this.undeveloped + }, + { + title: '详细设备状态', + click: this.undeveloped + }, + { + title: '查找列车', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '显示目的地号', + click: this.undeveloped + }, + { + title: '显示轨道名', + click: this.undeveloped + }, + { + title: '显示道岔名', + click: this.undeveloped + }, + { + title: '显示信号机名', + click: this.undeveloped + }, + { + title: '显示车次窗位置', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '显示车次号', + click: this.undeveloped + }, + { + title: '显示车组号', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '全屏', + click: this.undeveloped + }, + { + title: '放大', + click: this.undeveloped + }, + { + title: '缩小', + click: this.undeveloped + }, + { + title: '恢复', + click: this.undeveloped + } + ] + }, + { + title: '车站定位', + operate: '', + children: [ + ] + }, + { + title: '显示', + operate: OperationEvent.Command.mBar.view, + hide: true, + children: [ + { + title: '设置列车识别号显示', + click: this.setTrainIdDisplay, + operate: OperationEvent.Command.view.setTrainIdDisplay + }, + { + title: '设置名称显示', + click: this.setNameDisplay, + operate: OperationEvent.Command.view.setNameDisplay + }, + { + title: '设置设备显示', + click: this.setDeviceDisplay, + operate: OperationEvent.Command.view.setDeviceDisplay + } + ] + }, + { + title: 'ATS终端操作', + operate: '', + children: [ + { + title: '当天运行车计划', + click: this.undeveloped + }, + { + title: '出入库预告', + click: this.undeveloped + } + ] + }, + { + title: '计划车操作', + operate: '', + children: [ + { + title: '添加计划车', + click: this.undeveloped + }, + { + title: '平移计划车', + click: this.undeveloped + }, + { + title: '删除计划车', + click: this.undeveloped + } + ] + }, + { + title: '批处理命令', + operate: '', + children: [ + { + title: '全线扣车', + click: this.undeveloped + }, + { + title: '取消全线扣车', + click: this.undeveloped + }, + { + title: '取消上行全线扣车', + click: this.undeveloped + }, + { + title: '取消下行全线扣车', + click: this.undeveloped + } + ] + }, + { + title: '信息管理', + operate: '', + children: [ + { + title: '调度日志', + click: this.undeveloped + }, + { + title: '调度留言提醒', + click: this.undeveloped + }, + { + title: '报警设置', + click: this.undeveloped + } + ] + }, + { + title: '帮助', + children: [ + { + title: '关于ITS GPC 工作站', + click: this.about, + operate: OperationEvent.Command.help.about + } + ] + } + ] + } + }; + }, + computed: { + ...mapGetters('training', [ + 'mode', + 'started', + 'steps', + 'order', + 'mode' + ]), + ...mapGetters('map', [ + 'stationList' + ]) + }, + watch: { + tempClassA() { + this.classA = this.$store.state.menuOperation.break ? -1 : this.tempClassA; + }, + tempClassB() { + this.classB = this.$store.state.menuOperation.break ? -1 : this.tempClassB; + }, + '$store.state.menuOperation.break': function (val) { + if (val) { + this.classA = this.classB = -1; + } else { + this.classA = this.tempClassA; + this.classB = this.tempClassB; + } + }, + '$store.state.training.operatemode': function (mode) { + this.initMenu(); + }, + '$store.state.training.started': function (val) { + this.closeMenu(true); + }, + '$store.state.training.prdType': function () { + this.initMenu(); + } + }, + mounted() { + this.initMenu(); + }, + methods: { + handleShow(item) { + if (item.hide) { + return false; + } + return true; + }, + initStationList() { + const list = []; + this.stationList.forEach(station => { + if (station.visible) { + const node = { + title: station.name, + operate: station.code, + show: true, + click: this.mapLocation, + code: station.code + }; - list.push(node); - } - }); - return list; - }, - initMenu(menu) { - this.menu = menuBarConvert(this.menuNormal[SystemType[this.$store.state.training.prdType]], this.$store.state.training.operatemode); - if (this.menu.length) { - this.menu[2].children = this.initStationList(); - this.clickEvent(); - this.closeMenu(true); - } - }, - clickEvent() { - const self = this; - window.onclick = function (e) { - if (document.getElementById('menuBar')) { - self.closeMenu(false); - } - }; - }, - getDomId(item) { - if (item && item.operate) { - return item.operate.domId; - } - return ''; - }, - noShowingChildren(children) { - if (!children || children.length <= 0) { - return true; - } - return false; - }, - hasShowingChildren(children) { - if (children && children.length > 0) { - return true; - } - return false; - }, - closeMenu(flag) { - if (flag || (this.mode !== TrainingMode.EDIT && this.mode !== TrainingMode.TEACH)) { - this.classA = this.tempClassA = -1; - this.classB = this.tempClassB = -1; - } - }, - hookClick(item, event) { - this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null }); - if (item && typeof item.click == 'function') { - item.click(item.operate); - } - }, - selectedClassA(item, index) { - const order = this.order || 0; - if (this.mode !== TrainingMode.TEACH) { // 编辑模式下可显示 - this.popupMenuA(item, index); - } else if (this.steps[order] && this.steps[order].type == 'bar') { // 操作步骤没有顶部操作顶部菜单都不可显示 - this.popupMenuA(item, index); - } - }, - // 弹出顶部菜单操作 - popupMenuA(item, index) { - this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null }); - this.clickEvent(); - const operate = { - type: 'bar', - operation: item.operate - }; - this.tempClassA = index; - this.tempClassB = -1; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } - }); - }, - selectedClassB(item, index) { - const order = this.order || 0; - if (this.mode !== TrainingMode.TEACH) { // 编辑模式下可显示 - this.popupMenuB(item, index); - } else if (this.steps[order] && this.steps[order].type == 'bar') { // 操作步骤没有顶部操作顶部菜单都不可显示 - this.popupMenuB(item, index); - } - }, - popupMenuB(item, index) { - this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null }); - const operate = { - type: 'bar', - operation: item.operate - }; - this.tempClassB = index; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } - }); - }, - // 设置地图定位 - mapLocation(code) { - if (code) { - this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: code }); - this.closeMenu(true); - } - }, - // 关于 - about(order) { - const operate = { - type: 'bar', - operation: order.operate - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.closeMenu(true); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.helpAbout.doShow(operate); - } - }); - }, - // 刷新 - refresh() { - this.closeMenu(true); - EventBus.$emit('refresh'); - }, - getLoginResult(operate) { - /** 密码校验*/ - if (operate.operation == OperationEvent.StationControl.forcedStationControl.passwordConfirm.operation) { - if (operate.success) { - /** 校验成功*/ - this.$refs.stationControlConvert.doShow({ operation: OperationEvent.StationControl.forcedStationControl.mbar.operation }); - } - } - }, - setLimitSpeed(order) { - const operate = { - type: 'bar', - operation: order.operate - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.closeMenu(true); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.setLimitSpeed.doShow(operate, true); - } - }); - }, - cancleLimitSpeed(order) { - const operate = { - type: 'bar', - operation: order.operate - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.closeMenu(true); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.setLimitSpeed.doShow(operate, false); - } - }); - }, - undeveloped() { - this.doClose(); - this.$alert('实现中......', '提示', { - confirmButtonText: '确定', - callback: action => { - } - }); - }, - doClose() { - this.$nextTick(() => { - EventBus.$emit('closeMenu'); - }); - } - } + list.push(node); + } + }); + return list; + }, + initMenu(menu) { + this.menu = menuBarConvert(this.menuNormal[SystemType[this.$store.state.training.prdType]], this.$store.state.training.operatemode); + if (this.menu.length) { + this.menu[2].children = this.initStationList(); + this.clickEvent(); + this.closeMenu(true); + } + }, + clickEvent() { + const self = this; + window.onclick = function (e) { + if (document.getElementById('menuBar')) { + self.closeMenu(false); + } + }; + }, + getDomId(item) { + if (item && item.operate) { + return item.operate.domId; + } + return ''; + }, + noShowingChildren(children) { + if (!children || children.length <= 0) { + return true; + } + return false; + }, + hasShowingChildren(children) { + if (children && children.length > 0) { + return true; + } + return false; + }, + closeMenu(flag) { + if (flag || (this.mode !== TrainingMode.EDIT && this.mode !== TrainingMode.TEACH)) { + this.classA = this.tempClassA = -1; + this.classB = this.tempClassB = -1; + } + }, + hookClick(item, event) { + this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null }); + if (item && typeof item.click == 'function') { + item.click(item.operate); + } + }, + selectedClassA(item, index) { + const order = this.order || 0; + if (this.mode !== TrainingMode.TEACH) { // 编辑模式下可显示 + this.popupMenuA(item, index); + } else if (this.steps[order] && this.steps[order].type == 'bar') { // 操作步骤没有顶部操作顶部菜单都不可显示 + this.popupMenuA(item, index); + } + }, + // 弹出顶部菜单操作 + popupMenuA(item, index) { + this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null }); + this.clickEvent(); + const operate = { + type: 'bar', + operation: item.operate + }; + this.tempClassA = index; + this.tempClassB = -1; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } + }); + }, + selectedClassB(item, index) { + const order = this.order || 0; + if (this.mode !== TrainingMode.TEACH) { // 编辑模式下可显示 + this.popupMenuB(item, index); + } else if (this.steps[order] && this.steps[order].type == 'bar') { // 操作步骤没有顶部操作顶部菜单都不可显示 + this.popupMenuB(item, index); + } + }, + popupMenuB(item, index) { + this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null }); + const operate = { + type: 'bar', + operation: item.operate + }; + this.tempClassB = index; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } + }); + }, + // 设置地图定位 + mapLocation(code) { + if (code) { + this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: code }); + this.closeMenu(true); + } + }, + // 关于 + about(order) { + const operate = { + type: 'bar', + operation: order.operate + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.closeMenu(true); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.helpAbout.doShow(operate); + } + }); + }, + // 刷新 + refresh() { + this.closeMenu(true); + EventBus.$emit('refresh'); + }, + getLoginResult(operate) { + /** 密码校验*/ + if (operate.operation == OperationEvent.StationControl.forcedStationControl.passwordConfirm.operation) { + if (operate.success) { + /** 校验成功*/ + this.$refs.stationControlConvert.doShow({ operation: OperationEvent.StationControl.forcedStationControl.mbar.operation }); + } + } + }, + setLimitSpeed(order) { + const operate = { + type: 'bar', + operation: order.operate + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.closeMenu(true); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.setLimitSpeed.doShow(operate, true); + } + }); + }, + cancleLimitSpeed(order) { + const operate = { + type: 'bar', + operation: order.operate + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.closeMenu(true); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.setLimitSpeed.doShow(operate, false); + } + }); + }, + undeveloped() { + this.doClose(); + this.$alert('实现中......', '提示', { + confirmButtonText: '确定', + callback: action => { + } + }); + }, + doClose() { + this.$nextTick(() => { + EventBus.$emit('closeMenu'); + }); + } + } }; diff --git a/src/jmap/theme/chengdu_03/model.js b/src/jmap/theme/chengdu_03/model.js index cf408a81f..91a04242b 100644 --- a/src/jmap/theme/chengdu_03/model.js +++ b/src/jmap/theme/chengdu_03/model.js @@ -1,63 +1,67 @@ import deviceType from '../../constant/deviceType'; class Model { - constructor() { - // 公共字段部分默认初始值 - this['public'] = {}; - this['public'][deviceType.Signal] = { - lampPositionType: '02', - lampPostType: '02' - }; + constructor() { + // 公共字段部分默认初始值 + this['public'] = {}; + this['public'][deviceType.Signal] = { + lampPositionType: '02', + lampPostType: '02' + }; - // 私有字段部分默认初始值 - this['private'] = {}; - this['private'][deviceType.StationControl] = { - indicatorShow: true // 标识灯名称显示 - }; - this['private'][deviceType.Section] = { - borderBorderShow: true, // 区段边界显示 - standTrackNameShow: true, // 站台轨名称显示 - reentryTrackNameShow: true, // 折返轨名称显示 - transferTrackNameShow: true // 转换轨名称显示 - }; - this['private'][deviceType.Signal] = { - linkageAutoRouteShow: true, // 联锁自动进路表示灯显示 - atsAutoTriggerShow: true // ATS自动触发表示灯显示 - }; - this['private'][deviceType.Train] = { - nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式 - nameFontSize: 10 // 字体大小 - }; - this['private'][deviceType.TrainWindow] = { - trainWindowShow: true - }; - } + // 私有字段部分默认初始值 + this['private'] = {}; + this['private'][deviceType.StationControl] = { + indicatorShow: true // 标识灯名称显示 + }; + this['private'][deviceType.Switch] = { + nameShow: true + }; + this['private'][deviceType.Section] = { + borderBorderShow: true, // 区段边界显示 + destinationNameShow: true, // 目的地码名称显示 + standTrackNameShow: true, // 站台轨名称显示 + reentryTrackNameShow: true, // 折返轨名称显示 + transferTrackNameShow: true // 转换轨名称显示 + }; + this['private'][deviceType.Signal] = { + linkageAutoRouteShow: true, // 联锁自动进路表示灯显示 + atsAutoTriggerShow: true // ATS自动触发表示灯显示 + }; + this['private'][deviceType.Train] = { + nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式 + nameFontSize: 10 // 字体大小 + }; + this['private'][deviceType.TrainWindow] = { + trainWindowShow: true + }; + } - initPublicProps(model) { - if (model) { - var modelInitial = this.public[model._type]; - if (modelInitial) { - for (var prop in modelInitial) { - model[prop] = modelInitial[prop]; - } - } - } + initPublicProps(model) { + if (model) { + var modelInitial = this.public[model._type]; + if (modelInitial) { + for (var prop in modelInitial) { + model[prop] = modelInitial[prop]; + } + } + } - return model; - } + return model; + } - initPrivateProps(model) { - if (model) { - var modelInitial = this.private[model._type]; - if (modelInitial) { - for (var prop in modelInitial) { - model[prop] = modelInitial[prop]; - } - } - } + initPrivateProps(model) { + if (model) { + var modelInitial = this.private[model._type]; + if (modelInitial) { + for (var prop in modelInitial) { + model[prop] = modelInitial[prop]; + } + } + } - return model; - } + return model; + } } export default new Model(); diff --git a/src/jmap/theme/chengdu_04/model.js b/src/jmap/theme/chengdu_04/model.js index cf408a81f..91a04242b 100644 --- a/src/jmap/theme/chengdu_04/model.js +++ b/src/jmap/theme/chengdu_04/model.js @@ -1,63 +1,67 @@ import deviceType from '../../constant/deviceType'; class Model { - constructor() { - // 公共字段部分默认初始值 - this['public'] = {}; - this['public'][deviceType.Signal] = { - lampPositionType: '02', - lampPostType: '02' - }; + constructor() { + // 公共字段部分默认初始值 + this['public'] = {}; + this['public'][deviceType.Signal] = { + lampPositionType: '02', + lampPostType: '02' + }; - // 私有字段部分默认初始值 - this['private'] = {}; - this['private'][deviceType.StationControl] = { - indicatorShow: true // 标识灯名称显示 - }; - this['private'][deviceType.Section] = { - borderBorderShow: true, // 区段边界显示 - standTrackNameShow: true, // 站台轨名称显示 - reentryTrackNameShow: true, // 折返轨名称显示 - transferTrackNameShow: true // 转换轨名称显示 - }; - this['private'][deviceType.Signal] = { - linkageAutoRouteShow: true, // 联锁自动进路表示灯显示 - atsAutoTriggerShow: true // ATS自动触发表示灯显示 - }; - this['private'][deviceType.Train] = { - nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式 - nameFontSize: 10 // 字体大小 - }; - this['private'][deviceType.TrainWindow] = { - trainWindowShow: true - }; - } + // 私有字段部分默认初始值 + this['private'] = {}; + this['private'][deviceType.StationControl] = { + indicatorShow: true // 标识灯名称显示 + }; + this['private'][deviceType.Switch] = { + nameShow: true + }; + this['private'][deviceType.Section] = { + borderBorderShow: true, // 区段边界显示 + destinationNameShow: true, // 目的地码名称显示 + standTrackNameShow: true, // 站台轨名称显示 + reentryTrackNameShow: true, // 折返轨名称显示 + transferTrackNameShow: true // 转换轨名称显示 + }; + this['private'][deviceType.Signal] = { + linkageAutoRouteShow: true, // 联锁自动进路表示灯显示 + atsAutoTriggerShow: true // ATS自动触发表示灯显示 + }; + this['private'][deviceType.Train] = { + nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式 + nameFontSize: 10 // 字体大小 + }; + this['private'][deviceType.TrainWindow] = { + trainWindowShow: true + }; + } - initPublicProps(model) { - if (model) { - var modelInitial = this.public[model._type]; - if (modelInitial) { - for (var prop in modelInitial) { - model[prop] = modelInitial[prop]; - } - } - } + initPublicProps(model) { + if (model) { + var modelInitial = this.public[model._type]; + if (modelInitial) { + for (var prop in modelInitial) { + model[prop] = modelInitial[prop]; + } + } + } - return model; - } + return model; + } - initPrivateProps(model) { - if (model) { - var modelInitial = this.private[model._type]; - if (modelInitial) { - for (var prop in modelInitial) { - model[prop] = modelInitial[prop]; - } - } - } + initPrivateProps(model) { + if (model) { + var modelInitial = this.private[model._type]; + if (modelInitial) { + for (var prop in modelInitial) { + model[prop] = modelInitial[prop]; + } + } + } - return model; - } + return model; + } } export default new Model(); diff --git a/src/jmap/theme/fuzhou_01/menus/menuDialog/viewName.vue b/src/jmap/theme/fuzhou_01/menus/menuDialog/viewName.vue index 361d91c12..83006fcf3 100644 --- a/src/jmap/theme/fuzhou_01/menus/menuDialog/viewName.vue +++ b/src/jmap/theme/fuzhou_01/menus/menuDialog/viewName.vue @@ -190,9 +190,10 @@ export default { // 区段 nameShow = false; - let standTrackNameShow = false; - let reentryTrackNameShow = false; - let transferTrackNameShow = false; + const standTrackNameShow = this.nameLevels.indexOf(2) !== -1; // 站台轨名称 + const reentryTrackNameShow = this.nameLevels.indexOf(4) !== -1; // 折返轨名称 + const transferTrackNameShow = this.nameLevels.indexOf(6) !== -1; // 转换轨名称 + const destinationNameShow = this.nameLevels.indexOf(10) !== -1; const sectionList = this.$store.getters['map/sectionList']; if (sectionList && sectionList.length > 0) { sectionList.forEach(elem => { @@ -213,22 +214,7 @@ export default { } } - // 站台轨名称 - if (elem.isStandTrack) { - standTrackNameShow = this.nameLevels.indexOf(2) !== -1; - } - - // 折返轨名称 - if (elem.isReentryTrack) { - reentryTrackNameShow = this.nameLevels.indexOf(4) !== -1; - } - - // 转换轨名称 - if (elem.isTransferTrack) { - transferTrackNameShow = this.nameLevels.indexOf(6) !== -1; - } - - deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow })); + deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow, destinationNameShow })); }); } diff --git a/src/jmap/theme/fuzhou_01/model.js b/src/jmap/theme/fuzhou_01/model.js index 62440bda8..91a04242b 100644 --- a/src/jmap/theme/fuzhou_01/model.js +++ b/src/jmap/theme/fuzhou_01/model.js @@ -14,8 +14,12 @@ class Model { this['private'][deviceType.StationControl] = { indicatorShow: true // 标识灯名称显示 }; + this['private'][deviceType.Switch] = { + nameShow: true + }; this['private'][deviceType.Section] = { borderBorderShow: true, // 区段边界显示 + destinationNameShow: true, // 目的地码名称显示 standTrackNameShow: true, // 站台轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示 transferTrackNameShow: true // 转换轨名称显示 diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index cdca73580..b55d1709a 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -98,53 +98,49 @@ export default class Section extends Group { const y = Math.min(model.points[0].y, model.points[model.points.length - 1].y) + Math.abs(model.points[model.points.length - 1].y - model.points[0].y) / 2; const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]); const drict = model.trainPosType != '01' ? 1 : -1; - if (model.type == '01') { // 物理区段名称 - if (style.Section.text.show) { - const opposite = style.Section.text.opposite ? -1 : 1; - const tempx = x + traingle.getSin(style.Section.text.distance); - const tempy = y + traingle.getCos(style.Section.text.distance) * (style.Section.text.position || opposite * drict); - this.name = new ETextName({ - zlevel: this.zlevel, - z: this.z + 2, - style: this.style, - silent: false, - x: tempx + model.namePosition.x, - y: tempy + model.namePosition.y, - fontWeight: style.Section.text.fontWeight, - fontSize: style.Section.text.fontSize, - fontFamily: style.fontFamily, - text: model.name, - textFill: style.Section.text.fontColor, - textAlign: style.Section.text.textAlign, - textPosition: style.Section.text.textPosition, - textVerticalAlign: style.Section.text.textVerticalAlign - }); - this.add(this.name); - } - } else if (model.type == '02') { // 逻辑区段 - if (style.Section.logicText.show) { - const opposite = style.Section.logicText.opposite ? -1 : 1; - const tempx = x + traingle.getSin(style.Section.logicText.distance); - const tempy = y + traingle.getCos(style.Section.logicText.distance) * (style.Section.logicText.position || opposite * drict); - this.name = new ETextName({ - zlevel: this.zlevel, - z: this.z + 2, - style: this.style, - silent: false, - x: tempx + model.namePosition.x, - y: tempy + model.namePosition.y, - fontWeight: style.Section.logicText.fontWeight, - fontSize: style.Section.logicText.fontSize, - fontFamily: style.fontFamily, - text: model.name, - textFill: style.Section.logicText.fontColor, - textAlign: style.Section.logicText.textAlign, - textPosition: style.Section.logicText.textPosition, - textVerticalAlign: style.Section.logicText.textVerticalAlign - }); - this.add(this.name); - } - } else if (model.type == '04') { // 道岔计轴区段 + if (model.type == '01' && model.nameShow && style.Section.text.show) { // 物理区段名称 + const opposite = style.Section.text.opposite ? -1 : 1; + const tempx = x + traingle.getSin(style.Section.text.distance); + const tempy = y + traingle.getCos(style.Section.text.distance) * (style.Section.text.position || opposite * drict); + this.name = new ETextName({ + zlevel: this.zlevel, + z: this.z + 2, + style: this.style, + silent: false, + x: tempx + model.namePosition.x, + y: tempy + model.namePosition.y, + fontWeight: style.Section.text.fontWeight, + fontSize: style.Section.text.fontSize, + fontFamily: style.fontFamily, + text: model.name, + textFill: style.Section.text.fontColor, + textAlign: style.Section.text.textAlign, + textPosition: style.Section.text.textPosition, + textVerticalAlign: style.Section.text.textVerticalAlign + }); + this.add(this.name); + } else if (model.type == '02' && model.nameShow && style.Section.logicText.show) { // 逻辑区段 + const opposite = style.Section.logicText.opposite ? -1 : 1; + const tempx = x + traingle.getSin(style.Section.logicText.distance); + const tempy = y + traingle.getCos(style.Section.logicText.distance) * (style.Section.logicText.position || opposite * drict); + this.name = new ETextName({ + zlevel: this.zlevel, + z: this.z + 2, + style: this.style, + silent: false, + x: tempx + model.namePosition.x, + y: tempy + model.namePosition.y, + fontWeight: style.Section.logicText.fontWeight, + fontSize: style.Section.logicText.fontSize, + fontFamily: style.fontFamily, + text: model.name, + textFill: style.Section.logicText.fontColor, + textAlign: style.Section.logicText.textAlign, + textPosition: style.Section.logicText.textPosition, + textVerticalAlign: style.Section.logicText.textVerticalAlign + }); + this.add(this.name); + } else if (model.type == '04' && model.nameShow) { // 道岔计轴区段 this.name = new ETextName({ zlevel: this.zlevel, z: this.z + 2, @@ -234,7 +230,7 @@ export default class Section extends Group { } /** 目的码名称*/ - if (model.destinationCode && style.Section.destinationText.show) { + if (model.destinationCode && model.destinationNameShow && style.Section.destinationText.show) { const opposite = style.Section.destinationText.opposite ? -1 : 1; const tempx = x + traingle.getSin(style.Section.destinationText.distance); const tempy = y + traingle.getCos(style.Section.destinationText.distance) * (style.Section.destinationText.position || opposite * drict); diff --git a/src/jmapNew/shape/Station/index.js b/src/jmapNew/shape/Station/index.js index 259bcbdb9..f7999da88 100644 --- a/src/jmapNew/shape/Station/index.js +++ b/src/jmapNew/shape/Station/index.js @@ -82,6 +82,7 @@ export default class Station extends Group { textFill: model.kmPostFontColor }); this.add(this.mileageText); + model.kmPostShow ? this.mileageText.show() : this.mileageText.hide(); } if (model.subheadDisplay) { // 副标题 this.subheadText = new ETextName({ diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index be2ab0c62..5ed02fdbf 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -161,6 +161,7 @@ export default class Switch extends Group { this.add(this.sheltertriangle); this.add(this.releaseBackground); this.add(this.name); + style.Switch.text.show && model.nameShow ? this.name.show() : this.name.hide(); } createLockRect() { diff --git a/src/jmapNew/theme/beijing_01/model.js b/src/jmapNew/theme/beijing_01/model.js index 9ea48872d..6d68a5630 100644 --- a/src/jmapNew/theme/beijing_01/model.js +++ b/src/jmapNew/theme/beijing_01/model.js @@ -14,8 +14,12 @@ class Model { this['private'][deviceType.StationControl] = { indicatorShow: true // 标识灯名称显示 }; + this['private'][deviceType.Switch] = { + nameShow: true + }; this['private'][deviceType.Section] = { borderBorderShow: true, // 区段边界显示 + destinationNameShow: true, // 目的地码名称显示 standTrackNameShow: true, // 站台轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示 transferTrackNameShow: true // 转换轨名称显示 diff --git a/src/jmapNew/theme/chengdu_01/model.js b/src/jmapNew/theme/chengdu_01/model.js index 9ea48872d..6d68a5630 100644 --- a/src/jmapNew/theme/chengdu_01/model.js +++ b/src/jmapNew/theme/chengdu_01/model.js @@ -14,8 +14,12 @@ class Model { this['private'][deviceType.StationControl] = { indicatorShow: true // 标识灯名称显示 }; + this['private'][deviceType.Switch] = { + nameShow: true + }; this['private'][deviceType.Section] = { borderBorderShow: true, // 区段边界显示 + destinationNameShow: true, // 目的地码名称显示 standTrackNameShow: true, // 站台轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示 transferTrackNameShow: true // 转换轨名称显示 diff --git a/src/jmapNew/theme/chengdu_03/model.js b/src/jmapNew/theme/chengdu_03/model.js index 9ea48872d..6d68a5630 100644 --- a/src/jmapNew/theme/chengdu_03/model.js +++ b/src/jmapNew/theme/chengdu_03/model.js @@ -14,8 +14,12 @@ class Model { this['private'][deviceType.StationControl] = { indicatorShow: true // 标识灯名称显示 }; + this['private'][deviceType.Switch] = { + nameShow: true + }; this['private'][deviceType.Section] = { borderBorderShow: true, // 区段边界显示 + destinationNameShow: true, // 目的地码名称显示 standTrackNameShow: true, // 站台轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示 transferTrackNameShow: true // 转换轨名称显示 diff --git a/src/jmapNew/theme/foshan_01/model.js b/src/jmapNew/theme/foshan_01/model.js index 9ea48872d..6d68a5630 100644 --- a/src/jmapNew/theme/foshan_01/model.js +++ b/src/jmapNew/theme/foshan_01/model.js @@ -14,8 +14,12 @@ class Model { this['private'][deviceType.StationControl] = { indicatorShow: true // 标识灯名称显示 }; + this['private'][deviceType.Switch] = { + nameShow: true + }; this['private'][deviceType.Section] = { borderBorderShow: true, // 区段边界显示 + destinationNameShow: true, // 目的地码名称显示 standTrackNameShow: true, // 站台轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示 transferTrackNameShow: true // 转换轨名称显示 diff --git a/src/jmapNew/theme/fuzhou_01/model.js b/src/jmapNew/theme/fuzhou_01/model.js index 9ea48872d..6d68a5630 100644 --- a/src/jmapNew/theme/fuzhou_01/model.js +++ b/src/jmapNew/theme/fuzhou_01/model.js @@ -14,8 +14,12 @@ class Model { this['private'][deviceType.StationControl] = { indicatorShow: true // 标识灯名称显示 }; + this['private'][deviceType.Switch] = { + nameShow: true + }; this['private'][deviceType.Section] = { borderBorderShow: true, // 区段边界显示 + destinationNameShow: true, // 目的地码名称显示 standTrackNameShow: true, // 站台轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示 transferTrackNameShow: true // 转换轨名称显示 diff --git a/src/jmapNew/theme/haerbin_01/model.js b/src/jmapNew/theme/haerbin_01/model.js index 9ea48872d..6d68a5630 100644 --- a/src/jmapNew/theme/haerbin_01/model.js +++ b/src/jmapNew/theme/haerbin_01/model.js @@ -14,8 +14,12 @@ class Model { this['private'][deviceType.StationControl] = { indicatorShow: true // 标识灯名称显示 }; + this['private'][deviceType.Switch] = { + nameShow: true + }; this['private'][deviceType.Section] = { borderBorderShow: true, // 区段边界显示 + destinationNameShow: true, // 目的地码名称显示 standTrackNameShow: true, // 站台轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示 transferTrackNameShow: true // 转换轨名称显示 diff --git a/src/jmapNew/theme/ningbo_01/model.js b/src/jmapNew/theme/ningbo_01/model.js index 9ea48872d..6d68a5630 100644 --- a/src/jmapNew/theme/ningbo_01/model.js +++ b/src/jmapNew/theme/ningbo_01/model.js @@ -14,8 +14,12 @@ class Model { this['private'][deviceType.StationControl] = { indicatorShow: true // 标识灯名称显示 }; + this['private'][deviceType.Switch] = { + nameShow: true + }; this['private'][deviceType.Section] = { borderBorderShow: true, // 区段边界显示 + destinationNameShow: true, // 目的地码名称显示 standTrackNameShow: true, // 站台轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示 transferTrackNameShow: true // 转换轨名称显示 diff --git a/src/jmapNew/theme/xian_02/model.js b/src/jmapNew/theme/xian_02/model.js index 9ea48872d..6d68a5630 100644 --- a/src/jmapNew/theme/xian_02/model.js +++ b/src/jmapNew/theme/xian_02/model.js @@ -14,8 +14,12 @@ class Model { this['private'][deviceType.StationControl] = { indicatorShow: true // 标识灯名称显示 }; + this['private'][deviceType.Switch] = { + nameShow: true + }; this['private'][deviceType.Section] = { borderBorderShow: true, // 区段边界显示 + destinationNameShow: true, // 目的地码名称显示 standTrackNameShow: true, // 站台轨名称显示 reentryTrackNameShow: true, // 折返轨名称显示 transferTrackNameShow: true // 转换轨名称显示