diff --git a/src/api/simulation.js b/src/api/simulation.js index a16d4132b..16e57f8ab 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -277,7 +277,7 @@ export function modifyScriptAction(group, actionId, data) { /** 分页查询存在的仿真 */ export function getExistingSimulation(params) { return request({ - url: `/api/simulation/manage/page`, + url: `/manage/simulation/exists`, method: 'get', params }); @@ -286,7 +286,7 @@ export function getExistingSimulation(params) { /** 删除存在的仿真 */ export function deleteExistingSimulation(group) { return request({ - url: `/api/simulation/manage/${group}`, + url: `/manage/simulation/${group}`, method: 'delete' }); } diff --git a/src/i18n/langs/en/tip.js b/src/i18n/langs/en/tip.js index d24ff3622..2a9a6daac 100644 --- a/src/i18n/langs/en/tip.js +++ b/src/i18n/langs/en/tip.js @@ -232,5 +232,6 @@ export default { deviceCodeRepeatTip: 'The device code already exists, please modify the device code and created!', stopPointOffsetTip: 'Set block stop offset in bulk successfully!', mapSortSuccessfully: 'Map sort successfully!', - mapSortFailed: 'Map sort failed' + mapSortFailed: 'Map sort failed', + enterTrainingRoomFailed: 'Failed to enter the comprehensive drill, please consult the administrator is still in the room!' }; diff --git a/src/i18n/langs/zh/tip.js b/src/i18n/langs/zh/tip.js index feb92e0b1..d33ed76a3 100644 --- a/src/i18n/langs/zh/tip.js +++ b/src/i18n/langs/zh/tip.js @@ -232,5 +232,6 @@ export default { deviceCodeRepeatTip: '已存在该设备编号,请修改设备编号后创建!', stopPointOffsetTip: '批量设置区段停车点偏移量成功!', mapSortSuccessfully: '地图排序成功!', - mapSortFailed: '地图排序失败!' + mapSortFailed: '地图排序失败!', + enterTrainingRoomFailed: '进入综合演练失败,请咨询管理员是否还在房间内!' }; diff --git a/src/jmap/theme/beijing_01/menus/dialog/standDetainTrainAll.vue b/src/jmap/theme/beijing_01/menus/dialog/standDetainTrainAll.vue index 6aac5f482..cec1b47fd 100644 --- a/src/jmap/theme/beijing_01/menus/dialog/standDetainTrainAll.vue +++ b/src/jmap/theme/beijing_01/menus/dialog/standDetainTrainAll.vue @@ -1,180 +1,187 @@ \ No newline at end of file +}; + diff --git a/src/jmapNew/config/deviceStyle.js b/src/jmapNew/config/deviceStyle.js index cc7c99d5a..dc5f1e563 100644 --- a/src/jmapNew/config/deviceStyle.js +++ b/src/jmapNew/config/deviceStyle.js @@ -4,7 +4,8 @@ const mapDeviceStyle = { '03': 'bejing_01', '04': 'chengdu_03', '06': 'ningbo_01', - '07': 'haerbin_01' + '07': 'haerbin_01', + '08': 'foshan_01' }; export function selectLineCode(code) { diff --git a/src/jmapNew/config/skinCode/bejing_01.js b/src/jmapNew/config/skinCode/bejing_01.js index f0f3bf99b..ce1d59ed4 100644 --- a/src/jmapNew/config/skinCode/bejing_01.js +++ b/src/jmapNew/config/skinCode/bejing_01.js @@ -30,17 +30,6 @@ class SkinCode extends defaultStyle { textPosition: 'inside', // 文字位置 textVerticalAlign: 'middle' // 文字垂直对齐方式 }, - switchText: { - show: false, // 道岔区段名称显示 - position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 - distance: 18, // 文字离区段距离 - fontSize: 11, // 字体大小 - fontWeight: 'normal', // 字体粗细 - fontColor: '#FFFFFF', // 字体颜色 - textAlign: 'center', // 水平对齐方式 - textPosition: 'inside', // 文字位置 - textVerticalAlign: 'middle' // 文字垂直对齐方式 - }, standText: { // 站台轨名称 show: true, // 站台轨名称显示 opposite: true, // 对称相反 diff --git a/src/jmapNew/config/skinCode/chengdu_01.js b/src/jmapNew/config/skinCode/chengdu_01.js index 6f478cac0..2d46e5a1c 100644 --- a/src/jmapNew/config/skinCode/chengdu_01.js +++ b/src/jmapNew/config/skinCode/chengdu_01.js @@ -30,17 +30,6 @@ class SkinCode extends defaultStyle { textPosition: 'inside', // 文字位置 textVerticalAlign: 'middle' // 文字垂直对齐方式 }, - switchText: { - show: false, // 道岔区段名称显示 - position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 - distance: 18, // 文字离区段距离 - fontSize: 11, // 字体大小 - fontWeight: 'normal', // 字体粗细 - fontColor: '#FFFFFF', // 字体颜色 - textAlign: 'center', // 水平对齐方式 - textPosition: 'inside', // 文字位置 - textVerticalAlign: 'middle' // 文字垂直对齐方式 - }, standText: { // 站台 show: true, // 站台轨名称显示 position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 diff --git a/src/jmapNew/config/skinCode/chengdu_03.js b/src/jmapNew/config/skinCode/chengdu_03.js index 73f17e5ba..d8bb8c54c 100644 --- a/src/jmapNew/config/skinCode/chengdu_03.js +++ b/src/jmapNew/config/skinCode/chengdu_03.js @@ -30,17 +30,6 @@ class SkinCode extends defaultStyle { textPosition: 'inside', // 文字位置 textVerticalAlign: 'middle' // 文字垂直对齐方式 }, - switchText: { - show: false, // 道岔区段名称显示 - position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 - distance: 18, // 文字离区段距离 - fontSize: 11, // 字体大小 - fontWeight: 'normal', // 字体粗细 - fontColor: '#FFFFFF', // 字体颜色 - textAlign: 'center', // 水平对齐方式 - textPosition: 'inside', // 文字位置 - textVerticalAlign: 'middle' // 文字垂直对齐方式 - }, standText: { show: true, // 站台轨名称显示 position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 diff --git a/src/jmapNew/config/skinCode/foshan_01.js b/src/jmapNew/config/skinCode/foshan_01.js new file mode 100644 index 000000000..20f86c8b3 --- /dev/null +++ b/src/jmapNew/config/skinCode/foshan_01.js @@ -0,0 +1,630 @@ +import defaultStyle from '../defaultStyle'; +import deviceType from '../../constant/deviceType'; + +class SkinCode extends defaultStyle { + constructor() { + super(); + this[deviceType.Section] = { + active: { + routeColor: false // 进路触发颜色 + }, + text: { + show: true, // 物理区段名称显示 + position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 + distance: 18, // 文字离区段距离 + fontSize: 11, // 字体大小 + fontWeight: 'normal', // 字体粗细 + fontColor: '#FFFFFF', // 字体颜色 + textAlign: 'center', // 水平对齐方式 + textPosition: 'inside', // 文字位置 + textVerticalAlign: 'middle' // 文字垂直对齐方式 + }, + logicText: { + show: true, // 逻辑区段名称显示 + position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 + distance: 6, // 文字离区段距离 + fontSize: 8, // 字体大小 + fontWeight: 'normal', // 字体粗细 + fontColor: '#FFFFFF', // 字体颜色 + textAlign: 'center', // 水平对齐方式 + textPosition: 'inside', // 文字位置 + textVerticalAlign: 'middle' // 文字垂直对齐方式 + }, + standText: { + show: true, // 站台轨名称显示 + position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 + distance: 30, // 文字离区段距离 + fontSize: 11, // 字体大小 + fontWeight: 'normal', // 字体粗细 + fontColor: '#FFFFFF', // 字体颜色 + textAlign: 'center', // 水平对齐方式 + textPosition: 'inside', // 文字位置 + textVerticalAlign: 'middle' // 文字垂直对齐方式 + }, + reentryText: { + show: true, // 折返轨名称显示 + position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 + distance: 30, // 文字离区段距离 + fontSize: 11, // 字体大小 + fontWeight: 'normal', // 字体粗细 + fontColor: '#FFFFFF', // 字体颜色 + textAlign: 'center', // 水平对齐方式 + textPosition: 'inside', // 文字位置 + textVerticalAlign: 'middle' // 文字垂直对齐方式 + }, + transferText: { + show: true, // 转换轨名称显示 + position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 + distance: 28, // 文字离区段距离 + fontSize: 11, // 字体大小 + fontWeight: 'normal', // 字体粗细 + fontColor: '#FFFFFF', // 字体颜色 + textAlign: 'center', // 水平对齐方式 + textPosition: 'inside', // 文字位置 + textVerticalAlign: 'middle' // 文字垂直对齐方式 + }, + destinationText: { + show: true, // 目的码名称显示 + opposite: true, // 对称相反 + position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 + distance: 10, // 文字离区段距离 + fontSize: 10, // 字体大小 + fontWeight: 'bold', // 字体粗细 + fontColor: 'yellow', // 字体颜色 + textAlign: 'center', // 水平对齐方式 + textPosition: 'inside', // 文字位置 + textVerticalAlign: 'middle' // 文字垂直对齐方式 + }, + line: { + width: 5, // 区段宽度 + beyondWidth: 1, // 区段宽超出宽度 + invadeColor: '#EF0C08', // 区段侵入颜色 + spareColor: '#3F3F3F', // 区段空闲颜色 + communicationOccupiedColor: '#FF329A', // 区段通信车占用颜色 + unCommunicationOccupiedColor: '#FE0000', // 区段非通讯车占用颜色 + routeLockColor: '#FFFFFF', // 区段路由锁定颜色 + faultLockColor: '#00FF00', // 区段故障锁闭颜色 + undefinedColor: '#0071C1', // 区段未定义颜色 + protectionLockedColor: '#FEFF00', // 保护区段锁闭(未用) + blockColor: '#800080', // 区段封锁颜色 + atcExcisionColor: '#A0522D', // 区段atc切除颜色 + atsExcisionColor: '#A0522D', // 区段ats切除颜色 + timeReleaseColor: '#3F3F3F', // 区段延时释放颜色 + protectiveLockColor: '#FFFF00', // 区段保护锁闭 + protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁 + logicalColor: '#FFFF00', // 逻辑区段颜色 (未用) + logicalTextColor: '#FFFFFF' // 逻辑区段名称颜色 (未用) + }, + axle: { + radius: 3, // 计轴 半径 + distance: 5, // 计轴和区段之间的距离 (未用) + color: '#FFFFFF', // 区段计轴颜色 + resetColor: '#00FFFF', // 区段计轴预复位颜色 + Failure: '#E6A23C' // #FFFF00 计轴失效 + }, + speedLimit: { // 限速元素 + width: 1, // 限速线的宽短 + distance: 5, // 限速线距离区段距离 + lineColor: '#FFFF00', // 限速线颜色 + nameShow: false // 名称显示 + }, + separator: { + z: 6, // 分割符层级 + width: 1.2, // 分隔符宽度 + endWidth: 3.5, // 尽头分隔符宽度 + endColor: '#3F3F3F', // 尽头分隔符颜色 + color: '#3149C3' // 区段边界符颜色 + }, + block: { + special: false // 区段特殊显示 + }, + trainPosition:{ + display: false // 列车实时位置显示 + } + }; + + this[deviceType.Signal] = { + distance: 10, // 设备距离区段的距离 + post: { + standardLength: 6, // 高柱长度 + standardHeight: 6, // 灯柱高度 + standardColor: '#3149C3', // 灯珠颜色 + standardWidth: 2 // 灯珠宽度 + }, + text: { + show: true, // 信号机名称显示 + distance: 0, // 文字和灯杆的距离 + isAlignCenter: true, // 信号字体对其方式 + fontSize: 11, // 信号机名称字体大小 + fontWeight: 'bold', // 信号机名称字体粗细 + defaultColor: '#FFFFFF', // 信号灯字体默认色 + blockColor: '#EF0C08', // 信号灯字体锁定颜色 + checkColor: '#00FF00', // 信号字体 + nameBorderShow: true // 信号机名字边框显示 + }, + lamp: { + bgShow: false, // 是否被选中 + guidName: 'defult', // 默认引导类型 + stopWidth: 2, // 禁止线宽度 + borderWidth: 1, // 信号灯边框线宽度 + borderColor: '#3149C3', // 信号灯边框线颜色 + radiusR: 6, // 信号灯半径 + blockColor: '#EF0C08', // 信号灯锁闭 + grayColor: '#7F7F7F', // 信号灯灰色 + redColor: '#FF0000', // 信号灯红色 + greenColor: '#00FF00', // 信号灯绿色 + yellowColor: '#FFFF00', // 信号灯黄色 + whiteColor: '#FFFFFF', // 信号灯白色 + blueColor: '#0070C0' // 信号灯蓝色 + }, + route: { + direction: false, // 自动进路方向 + offset: { x: -4, y: 0 }, // 自动进路偏移量 + routeColor: '#00FF00' // 自动进路 + }, + auto: { + signalFrontTriangle: false, // 信号灯前三角展示 + direction: false, // 自动通过方向 + offset: { x: -4, y: 0}, // 自动通过偏移量 + width: 5, // 自动宽度 + autoRoute: '#00FF00', // 自动进路 + autoTrigger: '#FFFF00', // 自动触发 + manualControl: '#FFFF00', // 人工控制 + outConflict: '#C00808' // 出车冲突 + }, + delay: { + direction: true, // 延时解锁方向 + offset: { x: 15, y: -10}, // 延时解锁偏移量 + fontSize: 11, // 延迟解锁字体大小 + fontColor: '#FF0000', // 延迟解锁颜色 + fontWeight: 'bold' // 字体粗细 + }, + button: { + distance: 5, // 信号灯按钮距离区段的距离 + borderDashColor: '#FFFFFF', // 信号灯按钮边线 + buttonColor: 'darkgreen', // 信号灯按钮颜色 + buttonLightenColor: '#E4EF50' // 信号灯按钮闪烁颜色 + }, + lowButton:{ + display: false // 现地 信号机按钮 + } + }; + + this[deviceType.StationStand] = { + common: { // 通用属性 + textFontSize: 11, // 站台默认字体大小 + functionButtonShow: '03' // 功能灯按钮显示条件(01所有模式下显示 02 行调显示 03现地显示) + }, + safetyDoor: { // 屏蔽门 + height: 3, // 站台屏蔽门高度 + width: 60, + distance: 8, // 站台和屏蔽门之间的距离 + defaultColor: '#00FF00', // 屏蔽门默认颜色 + splitDoorColor: '#F61107' // 屏蔽门切除颜色 + }, + stand: { // 站台 + headFontSize: 11, // 站台首端字体大小 + spareColor: '#606060', // 站台空闲颜色 + stopColor: '#FEFE00', // 站台列车停站颜色 + jumpStopColor: '#9A99FF', // 站台跳停颜色 + designatedJumpStopColor: 'lightSkyBlue' // 站台指定列车跳停颜色 + }, + standEmergent: { // 紧急关闭 + mergentR: 4, // 站台紧急关闭半径 + offset: {x: 0, y: 40}, // 站台紧急关闭偏移量 + closeColor: '#F61107' // 站台紧急关闭颜色 + }, + reentry: { // 站台折返策略 + position: 0, // 折返方向 + offset: {x: -16, y: 20}, // 折返偏移量 + noHumanColor: '#0F16DA', // 站台无人折返 + autoChangeEndsColor: '#0BF400' // 站台自动换端 + }, + detainCar: { // 扣车 + text: 'H', // 扣车显示内容 + position: -1, // 扣车方向 + offset: {x: -8, y: -6}, // 扣车偏移量 + trainColor: '#E4EF50', // 车站扣车颜色 + centerTrainColor: '#FFFFFF', // 中心扣车颜色 + andCenterTrainColor: '#F61107', // 车站+中心扣车颜色 + detainTrainTextColor: '#E4EF50' // 车站扣除文字颜色 + }, + stopTime: { // 停站时间 + position: 1, // 运行时间方向 + offset: {x: -8, y: 26}, // 运行时间偏移量 + textColor: '#FFFFFF' // 停站时间字体颜色 + }, + level: { // 运行等级 + position: 1, // 运行等级方向 + offset: {x: -8, y: 6}, // 运行等级偏移量 + textColor: '#FFFFFF' // 停站等级字体颜色 + }, + text: { + fontSize: 11, // 字体大小 + fontWeight: 'normal', // 字体粗细 + distance: 5 // 灯跟文字距离 + }, + lamp: { + radiusR: 6, // 控制灯大小 + lampColor: '#5A5D5A' // 功能按钮颜色 + } + }; + + this[deviceType.StationCounter] = { + text: { + distance: 2, // 计数器名称和文字的距离 + fontColor: '#FFFFFF', // 计数器字体颜色 + borderColor: '#E4EF50' // 计数器边框颜色 + } + }; + + this[deviceType.StationDelayUnlock] = { + text: { + distance: 3, // 延迟解锁和设备之间的距离 + fontColor: '#FFFFFF', // 延时解锁字体颜色 + borderColor: '#FFFFFF' // 延迟解锁边框颜色 + } + }; + this[deviceType.AutoTurnBack] = { + // 是否显示 + visibleConditions: '03', + text: { + fontSize: 11, // 字体大小 + fontWeight: 'normal', // 字体粗细 + distance: 5 // 灯跟文字距离 + }, + subtitleText: { + fontSize: 11, // 字体大小 + fontWeight: 'normal', // 字体粗细 + distance: 17 // 等于副标题距离 + }, + lamp: { + lineDash: null, // 灯的包围框 + borderShow: false, // 是否显示边框 + stroke: '#FFFFFF', // 框的颜色 + fill: 'rgba(0,0,0,0)', // 填充色 + radiusR: 6, // 控制灯大小 + controlColor: '#b5b3b3', // 控制灯颜色 (灰色) + lightUpColor: '#ffff00' // 点亮灯颜色 + }, + OutFrame: { + + } + }; + /** 引导总锁 */ + this[deviceType.GuideLock] = { + // 是否显示 + displayCondition: '03', // 显示条件 prdType + text: { + fontSize: 11, // 字体大小 + fontWeight: 'normal', // 字体粗细 + distance: 5 // 灯跟文字距离 + }, + lamp: { + fill: 'rgba(0,0,0,0)', // 填充色 + radiusR: 6, // 控制灯大小 + controlColor: '#b5b3b3', // 控制灯颜色 (灰色) + lightUpColor: '#FF0000' // 点亮灯颜色 + } + }; + this[deviceType.Station] = { + // text: { + // show: true // 公里标名称显示 + // }, + kmPostShow: true, // 公里标显示 + kilometerPosition: 'up', // 公里标朝向 + text: { + fontSize: 11, // 字体大小 + fontWeight: 'normal', // 字体粗细 + distance: 5 // 灯跟文字距离 + }, + lamp: { + radiusR: 6, // 控制灯大小 + controlColor: '#FFFF00' // 控制灯颜色 + }, + turnBack: { // 按图折返 + lamp: 1, // 灯数量 + lampSpace: 60 // 灯间距 + }, + StationControl:{ + text: { + distance: 2, // 灯和文字之间的距离 + fontSize: 11, // 字体大小 + fontFormat: 'consolas', // 字体格式 + fontColor: '#ffffff', // 字体颜色 + fontWeight: 'normal', // 字体粗细 + textAlign: 'middle', // 字体水平对齐 + textVerticalAlign: 'top', // 字体垂直对齐 + centerControlText: '中控', // 中控文字内容 + substationControlText: '站控', // 站控文字内容 + emergencyControlText:'紧急站控', // 紧急站控文字内容 + interconnectedControlText:'连锁控' // 连锁控文字内容 + // stationCenterControlText: '站中控', // 站中控文字内容 + // generalAlarmControlText: '总报警' // 总报警文字内容 + }, + lamp: { + count: 2, // 控制模式灯个数 + offset: {x: 0, y: 0}, // 控制模式灯偏移量 + radiusR: 4, // 控制模式灯的半径 + distance: 36, // 控制模式之间灯之间的距离 + grayColor: '#7F7F7F', // 控制模式灰色 + greenColor: '#00FF00', // 控制模式绿色 + redColor: '#FF0000', // 控制模式红色 + yellowColor: '#FFFF00', // 控制模式黄色 + emergencyControlShow: false, // 紧急站控显示 + centerControlShow: true, // 中控显示 + substationControlShow: true, // 站控按钮显示 + interconnectedControlShow: false, // 联锁控显示 + centerControlButtonShow: false // 中控显示 + }, + arrow: { + show: true // 控制模式箭头显隐 + }, + mouseOverStyle: { // 鼠标悬浮样式 + fontSize: null, + fontFormat: 'consolas', + fontColor: '#000', + fontWeight: 'normal', + textAlign: 'middle', + textVerticalAlign: 'top' + } + } + }; + + this[deviceType.Switch] = { + text: { + show: true, // 道岔名称显示 + position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 + offset: {x: 0, y: 8}, // 道岔名称与区段距离 + fontSize: 11, // 字体大小 + fontColor: '#C0C0C0', // 道岔名称颜色 + fontWeight: 'bold', // 字体粗细 + borderColor: '#FE0000', // 道岔边框颜色 + lossColor: '#FFFFFF', // 道岔失去颜色 + locateColor: '#00FF00', // 道岔定位颜色 + inversionColor: '#9C9D09', // 道岔反位颜色 + monolockColor: '#870E10' // 道岔单锁颜色 + }, + sectionAction: { + flag: false, // 道岔 关联区段显示 + spareColor: '#5b5b5b' // 区段显示颜色 + }, + core: { + length: 6 // 道岔单边长度 + }, + block: { // 道岔封锁配置 + blockName: 'default', // 默认道岔封锁类型 + nameBorderShow: true, // 道岔名称是否有包围框 显示 + contentRectShow: false // 道岔封锁显示 + }, + monolock: { // 道岔单锁配置 + locationColor: '#ea282c', // 道岔单锁定位颜色 (红色) + inversionColor: '#ea282c', // 道岔单锁反位颜色 (红色) + rectShow: false // 道岔单锁 矩形框是否显示 + } + }; + + this[deviceType.Line] = { + lineColor: '#FFFFFF' // 线条颜色 + }; + + this[deviceType.LcControl] = { + text: { + fontSize: 10, // 灯字体大小 + fontWeight: 'normal', // 字体粗细 + distance: 5 // 灯跟文字距离 + }, + lamp: { + radiusR: 6, // 灯大小 + controlColor: '#FFFF00' // 灯颜色 + }, + mouseOverStyle: { + fontSize: 10, + fontFormat: 'consolas', + fontColor: '#FFF000', + fontWeight: 'normal', + textAlign: 'middle', + textVerticalAlign: 'top', + arcColor: '#00FFFF', + textColor: '#000000' + } + }; + + this[deviceType.ZcControl] = { + text: { + fontSize: 10, // 字体大小 + fontWeight: 'normal', // 字体粗细 + distance: 5 // 灯跟文字距离 + }, + lamp: { + radiusR: 6, // 灯大小 + controlColor: '#00FF00' // 灯颜色 + }, + mouseOverStyle: { + fontSize: 10, + fontFormat: 'consolas', + fontColor: '#FFF000', + fontWeight: 'normal', + textAlign: 'middle', + textVerticalAlign: 'top', + arcColor: '#00FFFF', + textColor: '#000000' + } + }; + + this[deviceType.LimitControl] = { + text: { + fontSize: 10, // 字体大小 + fontWeight: 'normal', // 字体粗细 + distance: 5 // 灯跟文字距离 + }, + lamp: { + radiusR: 6, // 灯大小 + controlColor: '#ECE9D8' // 灯颜色 + }, + mouseOverStyle: { + fontSize: 10, + fontFormat: 'consolas', + fontColor: '#FFF000', + fontWeight: 'normal', + textAlign: 'middle', + textVerticalAlign: 'top', + textColor: '#000000', + arcColor: '#00FFFF' + } + }; + this[deviceType.AutomaticRoute] = { + // 是否显示 + displayCondition: '03', // 显示条件 prdType + text: { + fontSize: 11, // 字体大小 + fontWeight: 'normal', // 字体粗细 + distance: 5 // 灯跟文字距离 + }, + lamp: { + fill: 'rgba(0,0,0,0)', // 填充色 + radiusR: 6, // 控制灯大小 + controlColor: '#b5b3b3' // 控制灯颜色 (灰色) + } + }; + this[deviceType.TrainWindow] = { + lineColor: '#4DD43F', // 车次窗颜色 + lineDash: null, // 车次窗虚线间隔 + lineWidth: 1, // 车次窗线宽 + trainWindowSmooth: 0 // 车次窗矩形圆滑程度 + }; + + this[deviceType.Train] = { + trainBody: { + trainBodyLineWidth: 0, // 车身line宽 + changeTrainWidth: true, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度 + specialTrainType: [ + { + type: '03', + serviceNumber: 'MM', + nameFormat: 'serviceNumber:groupNumber' + }, + { + type: '02', + nameFormat: 'targetCode:groupNumber' + } + ], // 特殊列车类型需设置显示格式 + lrPadding: 1, // 两边间隔 + upPadding: 1, // 上边距离 + trainBodyFillColor: '#000000', // 列车车身填充颜色 + trainNameFormat: 'targetCode:serviceNumber:tripNumber'// 列车显示格式 + }, + hsda: { + trainHSDATextFontSize: 8// 列车HDSA字号 + }, + trainNumber: { + targetCodePrefix: '000', // 目的地码前缀 + defaultTargetCode: 'AAA', // 默认目的地码 + trainTargetTextAlign: 'left', // 车次号文字显示位置 + trainNumberOffset: { x: 1, y: 1}// 目的地码偏移量 + }, + trainServer: { + serviceNumberPrefix: '00', // 服务号(表号)前缀 + defaultServiceNumber: 'BB', // 默认服务号(表号) + trainServerOffset: { x: 26, y: 1}// 列车服务号偏移 + }, + trainTarget: { + tripNumberPrefix: '0000', // 车次号前缀 + defaultDirectionCode: 'D', // 默认车次号1 + defaultTripNumber: 'CCC', // 默认车次号2 + trainTargetOffset: { x: 42, y: 1}// 列车车次号偏移 + }, + trainTargetNumber: { + groupNumberPrefix: '000', // 车组号前缀 + defaultGroupNumber: 'EEE', // 默认车组号 + trainTargetNumberOffset: {x: -1, y: 1}// 车组号偏移量 + }, + trainHead: { + trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框 + trainHeadTriangleFirst: { x: 0, y: 0}, // 列车车头三角坐标1偏移量 + trainHeadTriangleSecond: { x: 4, y: 7.5}, // 列车车头三角坐标2偏移量 + trainHeadTriangleThird: { x: 0, y: 15}, // 列车车头三角坐标3偏移量 + trainHeadRectHeight: 15, // 列车车头矩形高度 + trainConntWidth: 4, // 列车竖杠的宽度 + trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色 + }, + common: { + trainHeight: 17, // 列车高度 + trainHeadDistance: 2, // 列车和车头之间的间距 + trainWidth: 76, // 列车长度 + trainTextFontSize: 15, // 列车字号 + fontFamily: 'consolas', // 默认字体 族类 + nameFontSize: 15, // 字体大小 + haveTextHSDA: false, // 是否需创建textHSDA对象 + haveArrowText: true, // 是否需创建arrowText对象 + haveTrainBorder: false, // 是否需创建trainBorder对象 + aspectRatio: 8 / 15, // 字体宽高比例(用以拼接text是计算位置) + textOffset: 1, // 字体偏移(用以控制字体据车头的距离) + trainWidthMoreText: 2, // 计算列车长度时--列车长比text多出尺寸 + displayPosition: 'margin' // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗 + }, + trainStatusStyle: { + destinationStatus: [ + {status: '01', showColor: '#FFFFFF'}, + {status: '02', showColor: '#00FF00'}, + {status: '03', showColor: '#3265FF'}, + {status: '04', showColor: '#9B4A09'}, + {status: '05', showColor: '#EF0C08'}, + {status: '06', showColor: '#FFFFFF'}, + {status: '07', showColor: '#FFFF00'} + ], // 目的地状态 01准点 02早点 03严重早点 04晚点 05严重晚点 06头码车 07ATP切除 + destinationStatusSetText: 'trainServer', // 目的地状态设置的对应哪个text的颜色 + directionType: [ + { + type: 1, + lineLShow: false, + lineRShow: false, + arrowLShow: false, + arrowRShow: true + }, + { + type: 0, + lineLShow: false, + lineRShow: false, + arrowLShow: true, + arrowRShow: false + } + ], // 运行方向状态类型对应车头显示状态 1从左往右 0从右往左 + directionStopType: [ + {type: '01', lineLShow: false, lineRShow: false}, + {type: '02', lineLShow: false, lineRShow: true}, + {type: '03', lineLShow: true, lineRShow: false} + ], // 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行 + driveModeStatus: [ + { + status: 'AM', + trainLColor: '#00FF00', + trainRColor: '#00FF00' + }, + { + status: 'CM', + trainLColor: '#FFFF00', + trainRColor: '#FFFF00' + }, + { + status: 'RM', + trainLColor: '#EA700D', + trainRColor: '#EA700D' + }, + { + status: 'NRM', + trainLColor: '#A0522D', + trainRColor: '#A0522D' + } + ], // 列车运行模式对应车头颜色 ATO自动驾驶模式AM ATP监控下的人工驾驶模式CM 限制人工驾驶模式RM 非限制人工驾驶模式NRM + runControlStatus: [], // 设置运行控制状态类型 eg:{status: '01', hShow: false, sShow: false} + doorStatus: [], // 设置车门状态类型 + communicationStatus: [], // 设置通信状态 eg:{status: '01', trainColor:'#725A64'} + alarmStatus: [], // 设置报警状态 eg:{status: '01', aShow: false} + serverNoType: []// 服务号状态类型 eg:{type: '01', showColor: '#FFFFFF'} + } + }; + } +} + +export default new SkinCode(); diff --git a/src/jmapNew/config/skinCode/fuzhou_01.js b/src/jmapNew/config/skinCode/fuzhou_01.js index f88f5568c..395070900 100644 --- a/src/jmapNew/config/skinCode/fuzhou_01.js +++ b/src/jmapNew/config/skinCode/fuzhou_01.js @@ -30,17 +30,6 @@ class SkinCode extends defaultStyle { textPosition: 'inside', // 文字位置 textVerticalAlign: 'middle' // 文字垂直对齐方式 }, - switchText: { - show: false, // 道岔区段名称显示 - position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 - distance: 18, // 文字离区段距离 - fontSize: 11, // 字体大小 - fontWeight: 'normal', // 字体粗细 - fontColor: '#FFFFFF', // 字体颜色 - textAlign: 'center', // 水平对齐方式 - textPosition: 'inside', // 文字位置 - textVerticalAlign: 'middle' // 文字垂直对齐方式 - }, standText: { show: true, // 站台轨名称显示 position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 diff --git a/src/jmapNew/config/skinCode/haerbin_01.js b/src/jmapNew/config/skinCode/haerbin_01.js index 43e55624d..6436563ab 100644 --- a/src/jmapNew/config/skinCode/haerbin_01.js +++ b/src/jmapNew/config/skinCode/haerbin_01.js @@ -30,17 +30,6 @@ class SkinCode extends defaultStyle { textPosition: 'inside', // 文字位置 textVerticalAlign: 'middle' // 文字垂直对齐方式 }, - switchText: { - show: false, // 道岔区段名称显示 - position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 - distance: 18, // 文字离区段距离 - fontSize: 11, // 字体大小 - fontWeight: 'normal', // 字体粗细 - fontColor: '#FFFFFF', // 字体颜色 - textAlign: 'center', // 水平对齐方式 - textPosition: 'inside', // 文字位置 - textVerticalAlign: 'middle' // 文字垂直对齐方式 - }, standText: { show: true, // 站台轨名称显示 position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 diff --git a/src/jmapNew/config/skinCode/ningbo_01.js b/src/jmapNew/config/skinCode/ningbo_01.js index 39c6eb19d..da0f50a84 100644 --- a/src/jmapNew/config/skinCode/ningbo_01.js +++ b/src/jmapNew/config/skinCode/ningbo_01.js @@ -30,17 +30,6 @@ class SkinCode extends defaultStyle { textPosition: 'inside', // 文字位置 textVerticalAlign: 'middle' // 文字垂直对齐方式 }, - switchText: { - show: false, // 道岔区段名称显示 - position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 - distance: 18, // 文字离区段距离 - fontSize: 11, // 字体大小 - fontWeight: 'normal', // 字体粗细 - fontColor: '#FFFFFF', // 字体颜色 - textAlign: 'center', // 水平对齐方式 - textPosition: 'inside', // 文字位置 - textVerticalAlign: 'middle' // 文字垂直对齐方式 - }, standText: { // 站台 show: true, // 站台轨名称显示 position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 diff --git a/src/jmapNew/constant/deviceState.js b/src/jmapNew/constant/deviceState.js index 2a7a98518..4313ca24c 100644 --- a/src/jmapNew/constant/deviceState.js +++ b/src/jmapNew/constant/deviceState.js @@ -12,7 +12,6 @@ deviceState[deviceType.Section] = { cutOff: 0, // 是否切除 invalid: 0, // 是否失效 speedUpLimit: 0, // 最高限速 - /** 是否故障*/ fault: 0 /** 非故障*/ }; // 进路后端状态 diff --git a/src/jmapNew/shape/Automactic/index.js b/src/jmapNew/shape/Automactic/index.js index 06a400eb8..1f53bbaf9 100644 --- a/src/jmapNew/shape/Automactic/index.js +++ b/src/jmapNew/shape/Automactic/index.js @@ -167,28 +167,28 @@ export default class Automactic extends Group { const showMode = this.model.showMode; const showConditions = this.style.AutoTurnBack.visibleConditions; if (!showConditions || showConditions === '01' || showMode === showConditions) { - this.show(); + this.showMode(); } else { - this.hide(); + this.hideMode(); } } setShowStation(stationCode) { if (!stationCode || this.model.stationCode === stationCode) { this.isShowShape = true; - this.show(); + this.showMode(); } else { this.isShowShape = false; - this.hide(); + this.hideMode(); } } - show() { + showMode() { this.control && this.control.show(); this.text && this.text.show(); this.subtitleText && this.subtitleText.show(); this.arcBorder && this.arcBorder.show(); this.setState(this.model); } - hide() { + hideMode() { this.control && this.control.hide(); this.text && this.text.hide(); this.subtitleText && this.subtitleText.hide(); diff --git a/src/jmapNew/shape/AutomacticRoute/index.js b/src/jmapNew/shape/AutomacticRoute/index.js index 17979cb80..6463e7ae4 100644 --- a/src/jmapNew/shape/AutomacticRoute/index.js +++ b/src/jmapNew/shape/AutomacticRoute/index.js @@ -136,27 +136,27 @@ export default class AutomacticRoute extends Group { const showMode = this.model.showMode; const showConditions = this.style.AutomaticRoute.displayCondition; if (!showConditions || showConditions === '01' || showMode === showConditions) { - this.show(); + this.showMode(); } else { - this.hide(); + this.hideMode(); } } setShowStation(stationCode) { if (!stationCode || this.model.stationCode === stationCode) { this.isShowShape = true; - this.show(); + this.showMode(); } else { this.isShowShape = false; - this.hide(); + this.hideMode(); } } - show() { + showMode() { this.control && this.control.show(); this.text && this.text.show(); this.subtitleText && this.subtitleText.show(); this.setState(this.model); } - hide() { + hideMode() { this.control && this.control.hide(); this.text && this.text.hide(); this.subtitleText && this.subtitleText.hide(); diff --git a/src/jmapNew/shape/GuideLock/index.js b/src/jmapNew/shape/GuideLock/index.js index 57e9bed0d..b95937551 100644 --- a/src/jmapNew/shape/GuideLock/index.js +++ b/src/jmapNew/shape/GuideLock/index.js @@ -136,27 +136,27 @@ export default class GuideLock extends Group { const showMode = this.model.showMode; const showConditions = this.style.GuideLock.displayCondition; if (!showConditions || showConditions === '01' || showMode === showConditions) { - this.show(); + this.showMode(); } else { - this.hide(); + this.hideMode(); } } setShowStation(stationCode) { if (!stationCode || this.model.stationCode === stationCode) { this.isShowShape = true; - this.show(); + this.showMode(); } else { this.isShowShape = false; - this.hide(); + this.hideMode(); } } - show() { + showMode() { this.control && this.control.show(); this.text && this.text.show(); this.subtitleText && this.subtitleText.show(); this.setState(this.model); } - hide() { + hideMode() { this.control && this.control.hide(); this.text && this.text.hide(); this.subtitleText && this.subtitleText.hide(); diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index b6939449b..ad40ea2fb 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -6,7 +6,7 @@ import ELines from './ELines'; // 创建多线条 曲线 (私有) import EblockLines from './EblockLines'; // 区段封锁特有 import ESeparator from './ESeparator'; // 分隔符 (私有) import EMouse from './EMouse'; -import { EAxle } from './EAxle'; // 创建计轴 (私有) +// import { EAxle } from './EAxle'; // 创建计轴 (暂时不使用) import { EBackArrow, EBackArrowTriangle } from './EBackArrow'; // 折返进路箭头 import ELimitName from './ELimitName'; // 成都三号线 限速名称 import JTriangle from '../../utils/JTriangle'; @@ -33,211 +33,12 @@ export default class Section extends Group { } create() { - const model = this.model; - // 01:计轴区段;02逻辑区段;03道岔区段 04道岔计轴区段 + // 区段type 01计轴区段;02逻辑区段;03道岔区段 04道岔计轴区段 this.createSectionText(); // 创建区段文字 - // if ((model.type === '01' || model.type === '03') && ( - // model.logicSectionNum.length <= 0 || - // model.logicSectionNum.length == 1 && model.logicSectionNum[0] == 0) || - // model.type === '02') { - // if (model.type === '01' || model.type === '03') { this.createSection(); // 创建区段 this.creatRelease(); // 创建延时释放 this.createSeparator(); // 创建分隔符 this.createTurnBack(); // 创建成都三号线 折返箭头 - if (model.type === '01' && model.type === '03') { - this.createAxles(); // 创建计轴 - } - // } - } - - /** 创建区段*/ - createSection() { - const model = this.model; - const style = this.style; - // 创建区段 - this.section = new ELines({ - zlevel: this.zlevel, - // z: model.type == '02' ? this.z + 1 : this.z, // 逻辑区段层级降低一层 - z: this.z, // 逻辑区段层级降低一层 - isSwitchSection: model.switchSection, - isCurve: model.curve, - points: model.type == '04' ? [model.namePosition, model.namePosition] : model.points, - style: style - }); - // 创建哈尔滨特殊区段(用作封锁显示) - this.sectionBlock = new EblockLines({ - zlevel: this.zlevel, - z: this.z, - isSwitchSection: model.switchSection, - isCurve: model.curve, - points: model.points, - style: style - }); - - this.add(this.section); - this.add(this.sectionBlock); - - if (this.style.Section.line.isActiveShow) { // 哈尔滨线路点击背景色 - this.lineBorder = new ELines({ - zlevel: this.zlevel, - z: this.z - 1, // 逻辑区段层级降低一层 - isSwitchSection: model.switchSection, - isCurve: model.curve, - points: model.type == '04' ? [model.namePosition, model.namePosition] : model.points, - style: style - }); - this.add(this.lineBorder); - this.lineBorder.setStyle({ lineWidth: 0 }); - } - } - - // 折返箭头 - createTurnBack() { - const model = this.model; - const style = this.style; - if (model.reentryTrack && style.Section.shuttleBack) { - const radius = 3; - model.drict = 1; // 箭头朝向 (是折返轨加一个方向选择) 目前在区段右边 - const width = style.Section.line.width * 2; - const height = style.Section.line.width * 1; - const turnBackDistance = style.Section.shuttleBack.distance + radius * 4; - - const points = model.points; - let x = -model.drict * width * 1.2; - let y = -turnBackDistance; - - if (model.drict < 0) { - x += points[0].x; - y += points[0].y; - } else { - x += points[points.length - 1].x; - y += points[points.length - 1].y; - } - - this.turnBack = new EBackArrow({ - zlevel: this.zlevel, - z: this.z + 10, - shape: { - drict: model.drict, - width: width, - height: height, - points: { - x: x, - y: y - } - }, - style: { - lineWidth: style.Section.separator.width, - stroke: style.Section.separator.color, - fill: 'rgba(0, 0, 0, 0)' - } - }); - this.turnBackriangle = new EBackArrowTriangle({ - zlevel: this.zlevel, - z: this.z + 10, - shape: { - drict: model.drict, - width: width, - height: height, - points: { - x: x, - y: y - } - }, - style: { - lineWidth: style.Section.separator.width, - stroke: style.Section.separator.color, - fill: style.Section.separator.color - } - }); - this.add(this.turnBack); - this.add(this.turnBackriangle); - this.turnBack.hide(); - this.turnBackriangle.hide(); - } - } - - // 创建延时释放 (需要在创建) - creatRelease() { - const model = this.model; - const style = this.style; - const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]); - this.release = new ERelease({ - zlevel: this.zlevel, - z: this.z, - shape: { - x1: model.points[0].x + traingle.getCos(traingle.absz / 3), - y1: model.points[0].y + traingle.getSin(traingle.absz / 3), - x2: model.points[0].x + traingle.getCos(traingle.absz / 3 * 2), - y2: model.points[0].y + traingle.getSin(traingle.absz / 3 * 2) - }, - lineWidth: style.Section.line.width, - stroke: style.Section.line.spareColor - }); - - this.add(this.release); - } - - // 创建限速线 (需要在创建) - creatSpeedLimit() { - const model = this.model; - const style = this.style; - const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]); - let x = traingle.drictx * (style.Section.speedLimit.distance) * traingle.getSinRate(); - let y = traingle.dricty * (style.Section.speedLimit.distance) * traingle.getCosRate(); - if (x == Infinity) { x = 0; } - if (y == Infinity) { y = 0; } - if (!this.speedLimitLeft && !this.speedLimitRight) { - this.speedLimitLeft = new ELimitLines({ - zlevel: this.zlevel, - z: this.z, - position: [x, -y], - style: style, - switch: model.switch, - code: model.code, - isSwitchSection: model.switchSection, - relSwitchCode: model.relSwitchCode, - isCurve: model.curve, // 是否曲线 - points: model.points - }); - this.speedLimitRight = new ELimitLines({ - zlevel: this.zlevel, - z: this.z, - position: [-x, y], - style: style, - switch: model.switch, - code: model.code, - isSwitchSection: model.switchSection, - relSwitchCode: model.relSwitchCode, - isCurve: model.curve, // 是否曲线 - points: model.points - }); - if (style.Section.speedLimit.nameShow) { - // 开头 起点位置 - this.speedLimitNameLeft = new ELimitName({ - zlevel: this.zlevel, - z: this.z + 10, - drict: -1, - x: model.points[0].x, - y: model.points[0].y - 15, - style: style - }); - // 终点位置 - this.speedLimitNameRight = new ELimitName({ - zlevel: this.zlevel, - z: this.z + 10, - drict: 1, - x: model.points[model.points.length - 1].x, - y: model.points[model.points.length - 1].y - 15, - style: style - }); - this.add(this.speedLimitNameLeft); - this.add(this.speedLimitNameRight); - } - } - this.add(this.speedLimitLeft); - this.add(this.speedLimitRight); } // 创建区段名称 @@ -251,14 +52,11 @@ 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; - /** 区段名称 (逻辑区段名称 或 物理区段名称 是否显示)*/ - let tempx = x; - let tempy = y; if (model.type == '01') { // 物理区段名称 if (style.Section.text.show) { 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); + 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, @@ -280,8 +78,8 @@ export default class Section extends Group { } else if (model.type == '02') { // 逻辑区段 if (style.Section.logicText.show) { 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); + 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, @@ -300,34 +98,14 @@ export default class Section extends Group { }); this.add(this.name); } - } else if (model.type == '03') { // 道岔区段 - if (style.Section.switchText.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); - } - } else if (model.type == '04') { // 道岔计轴区段名称 + } else if (model.type == '04') { // 道岔计轴区段 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, + 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, @@ -434,98 +212,196 @@ export default class Section extends Group { } } - // 创建计轴 (需要在创建) - createAxles() { + /** 创建区段*/ + createSection() { const model = this.model; const style = this.style; + // 创建区段 + this.section = new ELines({ + zlevel: this.zlevel, + z: this.z, // 逻辑区段会覆盖物理区段 + isSwitchSection: model.switchSection, + isCurve: model.curve, + points: model.type == '04' ? [model.namePosition, model.namePosition] : model.points, + style: style + }); + this.add(this.section); - /** 创建四个计轴*/ - let traingle = null; - if (model && style && model.axleShow && model.points && model.points.length > 1) { - traingle = new JTriangle(model.points[0], model.points[1]); - this.lUpAxle = new EAxle({ + if (this.style.Section.block.special) { // 创建哈尔滨特殊区段(用作封锁显示) + this.sectionBlock = new EblockLines({ zlevel: this.zlevel, - z: this.z + 5, // 层级大于道岔z 否则会压住显示完整 - shape: { - point: { - x: model.points[0].x, - y: model.points[0].y - }, - drictx: 1, - dricty: -1, - traingle: traingle, - style: style - }, - style: { - GBaseLineWidth: 1, - stroke: style.Section.axle.color - } - }); - this.lBottomAxle = new EAxle({ - zlevel: this.zlevel, - z: this.z + 5, // 层级大于道岔z 否则会压住显示完整 - shape: { - point: { - x: model.points[0].x, - y: model.points[0].y - }, - drictx: 1, - dricty: 1, - traingle: traingle, - style: style - }, - style: { - GBaseLineWidth: 1, - stroke: style.Section.axle.color - } + z: this.z, + isSwitchSection: model.switchSection, + isCurve: model.curve, + points: model.points, + style: style }); + this.add(this.sectionBlock); + } - traingle = new JTriangle(model.points[model.points.length - 2], model.points[model.points.length - 1]); - this.rUpAxle = new EAxle({ + if (this.style.Section.line.isActiveShow) { // 哈尔滨线路点击背景色 + this.lineBorder = new ELines({ zlevel: this.zlevel, - z: this.z + 5, // 层级大于道岔z 否则会压住显示完整 - shape: { - point: { - x: model.points[model.points.length - 1].x, - y: model.points[model.points.length - 1].y - }, - drictx: -1, - dricty: -1, - traingle: traingle, - style: style - }, - style: { - GBaseLineWidth: 1, - stroke: style.Section.axle.color - } + z: this.z - 1, + isSwitchSection: model.switchSection, + isCurve: model.curve, + points: model.type == '04' ? [model.namePosition, model.namePosition] : model.points, + style: style }); - this.rBottomAxle = new EAxle({ - zlevel: this.zlevel, - z: this.z + 5, // 层级大于道岔z 否则会压住显示完整 - shape: { - point: { - x: model.points[model.points.length - 1].x, - y: model.points[model.points.length - 1].y - }, - drictx: -1, - dricty: 1, - traingle: traingle, - style: style - }, - style: { - GBaseLineWidth: 1, - stroke: style.Section.axle.color - } - }); - - this.add(this.lUpAxle); - this.add(this.rUpAxle); - this.add(this.lBottomAxle); - this.add(this.rBottomAxle); + this.add(this.lineBorder); + this.lineBorder.setStyle({ lineWidth: 0 }); } } - // 创建分隔符 (内层需要在创建) + // 折返箭头 + createTurnBack() { + const model = this.model; + const style = this.style; + if (model.reentryTrack && style.Section.shuttleBack) { + const radius = 3; + model.drict = 1; // 箭头朝向 (是折返轨加一个方向选择) 目前在区段右边 + const width = style.Section.line.width * 2; + const height = style.Section.line.width * 1; + const turnBackDistance = style.Section.shuttleBack.distance + radius * 4; + + const points = model.points; + let x = -model.drict * width * 1.2; + let y = -turnBackDistance; + + if (model.drict < 0) { + x += points[0].x; + y += points[0].y; + } else { + x += points[points.length - 1].x; + y += points[points.length - 1].y; + } + + this.turnBack = new EBackArrow({ + zlevel: this.zlevel, + z: this.z + 10, + shape: { + drict: model.drict, + width: width, + height: height, + points: { + x: x, + y: y + } + }, + style: { + lineWidth: style.Section.separator.width, + stroke: style.Section.separator.color, + fill: 'rgba(0, 0, 0, 0)' + } + }); + this.turnBackriangle = new EBackArrowTriangle({ + zlevel: this.zlevel, + z: this.z + 10, + shape: { + drict: model.drict, + width: width, + height: height, + points: { + x: x, + y: y + } + }, + style: { + lineWidth: style.Section.separator.width, + stroke: style.Section.separator.color, + fill: style.Section.separator.color + } + }); + this.add(this.turnBack); + this.add(this.turnBackriangle); + this.turnBack.hide(); + this.turnBackriangle.hide(); + } + } + + // 创建延时释放 + creatRelease() { + const model = this.model; + const style = this.style; + const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]); + this.release = new ERelease({ + zlevel: this.zlevel, + z: this.z, + shape: { + x1: model.points[0].x + traingle.getCos(traingle.absz / 3), + y1: model.points[0].y + traingle.getSin(traingle.absz / 3), + x2: model.points[0].x + traingle.getCos(traingle.absz / 3 * 2), + y2: model.points[0].y + traingle.getSin(traingle.absz / 3 * 2) + }, + lineWidth: style.Section.line.width, + stroke: style.Section.line.spareColor + }); + + this.add(this.release); + } + + // 创建限速线 + creatSpeedLimit() { + const model = this.model; + const style = this.style; + const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]); + let x = traingle.drictx * (style.Section.speedLimit.distance) * traingle.getSinRate(); + let y = traingle.dricty * (style.Section.speedLimit.distance) * traingle.getCosRate(); + if (x == Infinity) { x = 0; } + if (y == Infinity) { y = 0; } + if (!this.speedLimitLeft && !this.speedLimitRight) { + this.speedLimitLeft = new ELimitLines({ + zlevel: this.zlevel, + z: this.z, + position: [x, -y], + style: style, + switch: model.switch, + code: model.code, + isSwitchSection: model.switchSection, + relSwitchCode: model.relSwitchCode, + isCurve: model.curve, // 是否曲线 + points: model.points + }); + this.speedLimitRight = new ELimitLines({ + zlevel: this.zlevel, + z: this.z, + position: [-x, y], + style: style, + switch: model.switch, + code: model.code, + isSwitchSection: model.switchSection, + relSwitchCode: model.relSwitchCode, + isCurve: model.curve, // 是否曲线 + points: model.points + }); + if (style.Section.speedLimit.nameShow) { + // 开头 起点位置 + this.speedLimitNameLeft = new ELimitName({ + zlevel: this.zlevel, + z: this.z + 10, + drict: -1, + x: model.points[0].x, + y: model.points[0].y - 15, + style: style + }); + // 终点位置 + this.speedLimitNameRight = new ELimitName({ + zlevel: this.zlevel, + z: this.z + 10, + drict: 1, + x: model.points[model.points.length - 1].x, + y: model.points[model.points.length - 1].y - 15, + style: style + }); + this.add(this.speedLimitNameLeft); + this.add(this.speedLimitNameRight); + } + } + this.add(this.speedLimitLeft); + this.add(this.speedLimitRight); + } + + // 创建分隔符 createSeparator() { const model = this.model; const style = this.style; @@ -566,14 +442,6 @@ export default class Section extends Group { } } - /** 设置区段集合显隐*/ - setInvisible() { - const invisible = this.model.type === '02' && this.model.logicSectionShow; - this.eachChild((child) => { - child.attr('invisible', invisible); - }); - } - /** 设置区段恢复默认状态*/ recover() { if (this.section) { @@ -584,10 +452,7 @@ export default class Section extends Group { stroke: this.style.Section.line.spareColor, lineWidth: this.style.Section.line.width }); - - if (this.release) { - this.release.hide(); - } + this.release && this.release.hide(); if (this.speedLimitLeft && this.speedLimitRight) { this.remove(this.speedLimitLeft); this.remove(this.speedLimitRight); @@ -664,7 +529,7 @@ export default class Section extends Group { } } - /** 故障锁定状态 05*/ + /** 故障锁闭 05*/ faultLock() { if (this.section) { this.section.setStyle({ @@ -705,7 +570,7 @@ export default class Section extends Group { } } - /** 延时释放 10*/ + /** 延时释放*/ async timeRelease() { this.section.setStyle({ stroke: this.style.Section.line.routeLockColor, @@ -725,7 +590,7 @@ export default class Section extends Group { } } - /** 保护区段延时解锁 11*/ + /** 保护区段延时解锁*/ protectiveTimeRelease() { this.section.setStyle({ stroke: this.style.Section.line.protectiveLockColor, @@ -786,7 +651,7 @@ export default class Section extends Group { setState(model, flag = false) { if (!this.isShowShape) return; this.recover(); - // 实际上就是 状态重置 必须在设置其他状态之前 设置颜色之类的 + // 哈尔滨线路 道岔相关区段设置 默认颜色 if (this.style.Switch.sectionAction.flag && model.relSwitchCode && !flag) { const switchModel = Vue.prototype.$jlmap.mapDevice[model.relSwitchCode]; if (switchModel.normalPosition != 0) { // 定位情况 @@ -808,14 +673,17 @@ export default class Section extends Group { model.routeLock && this.routeLock(); /** 轨道封锁 */ model.blockade && this.block(); - /** 非CBTC车占用 */ + /** 非通信车占用状态 */ model.nctOccupied && this.unCommunicationOccupied(); - /** CBTC车占用 */ + /** 通信车占用状态 */ model.ctOccupied && this.communicationOccupied(); /** 区段切除*/ model.cutOff && this.sectionCutOff(); /** 是否限速*/ model.speedUpLimit && this.setSpeedUpperLimit(); + // 区段计轴预复位状态 (未处理) + // 区段故障锁闭 + model.fault && this.faultLock(); /** 道岔区段更新岔心颜色 */ if (model.type === '03' && model.switch) { const sectionSwitch = store.getters['map/getDeviceByCode'](model.switch.code); diff --git a/src/jmapNew/shape/Signal/index.js b/src/jmapNew/shape/Signal/index.js index 72cf51406..9eede85fd 100644 --- a/src/jmapNew/shape/Signal/index.js +++ b/src/jmapNew/shape/Signal/index.js @@ -223,14 +223,10 @@ class Signal extends Group { } } - /* count 1单灯 2双灯 正向开放*/ + /* 正向开放*/ openPositive() { - // if (this.count == 2) { this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor); this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); // 设置黑色 - // } else if (this.count == 1) { - // this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor); - // } this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.greenColor); if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色 this.sigPost.setColor('#00FF00'); @@ -239,14 +235,10 @@ class Signal extends Group { } } } - /* count 1单灯 2双灯 侧向开放 */ + /* 侧向开放 */ openLateral() { - // if (this.count == 2) { this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor); this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); - // } else if (this.count == 1) { - // this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor); - // } if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色 this.sigPost.setColor('#00FF00'); if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色 @@ -256,19 +248,12 @@ class Signal extends Group { } // 列车进路 trainRoute() { - if (this.count == 1) { - /** 单灯 列兼调信号*/ - this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor); - } + this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor); } // 调车进路 shuntRoute() { - if (this.count == 1) { - /** 单灯 列兼调信号*/ - /** 单灯 阻挡兼调车信号*/ - this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.whiteColor); - } + this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.whiteColor); } // 引导 @@ -289,9 +274,7 @@ class Signal extends Group { // 封锁 block() { - if (this.count == 1) { - this.lamps[0].setColor(this.style.Signal.lamp.redColor); - } + this.lamps[0].setColor(this.style.Signal.lamp.redColor); if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色 this.sigPost.setColor('#000080'); } @@ -304,30 +287,24 @@ class Signal extends Group { // 功能封锁 functionBlock() { - if (this.count == 1) { - this.lamps[0].setColor(this.style.Signal.lamp.redColor); - } + this.lamps[0].setColor(this.style.Signal.lamp.redColor); } // 信号保护区段监视状态显示 signalCheck() { - if (this.count == 1) { - this.lamps[0].setColor(this.style.Signal.lamp.redColor); - this.sigName.setColor(this.style.Signal.text.checkColor); - } + this.lamps[0].setColor(this.style.Signal.lamp.redColor); + this.sigName.setColor(this.style.Signal.text.checkColor); } // 故障 fault() { - if (this.count == 2) { - this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor); - this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.blueColor); - } + this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor); + this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.blueColor); } // 逻辑点灯 logicalLight() { - if (this.style.Signal.lamp.guidName != 'haerbin_01') { // 哈尔滨不显示 X + if (this.style.Signal.lamp.guidName != 'haerbin_01') { // 哈尔滨不显示 X状态的逻辑点灯 this.lamps.forEach(lamp => { lamp.setStop(true); }); } } diff --git a/src/jmapNew/shape/Station/index.js b/src/jmapNew/shape/Station/index.js index 74d97f014..6f4251eea 100644 --- a/src/jmapNew/shape/Station/index.js +++ b/src/jmapNew/shape/Station/index.js @@ -161,7 +161,6 @@ export default class Station extends Group { y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y }, context: this.style.Station.StationControl.text.emergencyControlText, - // model.jjzkContent, pop: false }); this.add(this.emergencyControl); @@ -178,7 +177,6 @@ export default class Station extends Group { y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y }, context: this.style.Station.StationControl.text.centerControlText, - // model.zokContent, pop: false }); this.add(this.centerControl); @@ -195,7 +193,6 @@ export default class Station extends Group { y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y }, context: this.style.Station.StationControl.text.substationControlText, - // model.zakContent pop: false }); this.add(this.substationControl); @@ -268,32 +265,35 @@ export default class Station extends Group { this.setState(model); } + handleCenter() { // 中控 + this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor); + this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor); + this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.greenColor); + } + + handleLocal() { // 站控 + this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor); + this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.yellowColor); + this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor); + } + + handleEmergency() { // 紧急站控 + this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.redColor); + this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor); + this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor); + } + + recover() { + this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor); + this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor); + this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor); + } + // 设置状态 setState(model) { if (!this.isShowShape) return; - switch (model.controlMode) { - case '': // 无状态 - this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor); - this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor); - this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor); - break; - case 'Center': // 中控 - this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor); - this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor); - this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.greenColor); - break; - case 'Local': // 站控 - this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor); - this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.yellowColor); - this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor); - break; - case 'Emergency': // 紧急站控 - this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.redColor); - this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor); - this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor); - break; - } - + this.recover(); + model.controlMode && this['handle' + model.controlMode](); } getShapeTipPoint() { diff --git a/src/jmapNew/shape/StationControl/EMouse.js b/src/jmapNew/shape/StationControl/EMouse.js deleted file mode 100644 index a26e61025..000000000 --- a/src/jmapNew/shape/StationControl/EMouse.js +++ /dev/null @@ -1,62 +0,0 @@ -import Group from 'zrender/src/container/Group'; -import Text from 'zrender/src/graphic/Text'; - -export default class EMouse extends Group { - constructor(device) { - super(); - this.device = device; - this.create(); - } - create() { - this.text = new Text({ - _subType: 'Text', - zlevel: this.device.zlevel, - z: this.device.z + 1, - position: [0, 0], - style: { - x: this.device.model.position.x - this.device.style.StationControl.lamp.distance / 2 + this.device.style.StationControl.lamp.offset.x, - y: this.device.model.position.y + this.device.style.StationControl.lamp.offset.y + this.device.style.StationControl.lamp.radiusR + this.device.style.StationControl.text.distance - 40, - fontWeight: this.device.style.StationControl.mouseOverStyle.fontWeight, - fontSize: this.device.style.StationControl.mouseOverStyle.fontSize, - fontFamily: this.device.style.StationControl.mouseOverStyle.fontFormat, - text: '', - textFill: this.device.style.StationControl.mouseOverStyle.fontColor, - textAlign: this.device.style.StationControl.mouseOverStyle.textAlign, - textVerticalAlign: this.device.style.StationControl.mouseOverStyle.textVerticalAlign - } - }); - - this.add(this.text); - this.text.hide(); - } - setTextContext(text) { - if (text) { - this.text.setStyle('text', text); - } - } - mouseover(e) { - if (e.target) { - let name = ''; - switch (e.target.parent._subType) { - case 'emergency': - name = '紧急站控'; - break; - case 'center': - name = '中控'; - break; - case 'substation': - name = '站控'; - break; - } - // debugger; - this.setTextContext(name); - this.text.show(); - } - } - - mouseout(e) { - if (!this.device.model.down) { - this.text.hide(); - } - } -} diff --git a/src/jmapNew/shape/StationControl/index.js b/src/jmapNew/shape/StationControl/index.js deleted file mode 100644 index 137911f19..000000000 --- a/src/jmapNew/shape/StationControl/index.js +++ /dev/null @@ -1,198 +0,0 @@ -/* -* 控制模式 -*/ -import Group from 'zrender/src/container/Group'; -import ESingleControl from '../Station/ESingleControl'; // 单个信号灯 (私有) -import EArrow from '../Station/EArrow'; -import { arrow } from '../utils/ShapePoints'; -import EMouse from './EMouse'; - -/** 控制模式*/ -export default class StationControl extends Group { - constructor(model, style) { - super(); - this.selected = false; - this._code = model.code; - this._type = model._type; - this.zlevel = model.zlevel; - this.z = 1; - this.model = model; - this.style = style; - this.isShowShape = true; - this.create(); - this.createMouseEvent(); - this.setState(model); - } - - create() { - const model = this.model; - // 紧急站控 - if (this.style.Station.StationControl.lamp.emergencyControlShow) { - this.emergencyControl = new ESingleControl({ - _subType: 'emergency', - style: this.style, - zlevel: this.zlevel, - z: this.z, - point: { - x: model.position.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.lamp.offset.x, - y: model.position.y + this.style.Station.StationControl.lamp.offset.y - }, - context: this.style.Station.StationControl.text.emergencyControlText, - // model.jjzkContent, - pop: false - }); - this.add(this.emergencyControl); - } - // 中控按钮 - if (this.style.Station.StationControl.lamp.centerControlShow) { - this.centerControl = new ESingleControl({ - _subType: 'center', - style: this.style, - zlevel: this.zlevel, - z: this.z, - point: { - x: model.position.x - this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.lamp.offset.x, - y: model.position.y + this.style.Station.StationControl.lamp.offset.y - }, - context: this.style.Station.StationControl.text.centerControlText, - // model.zokContent, - pop: false - }); - this.add(this.centerControl); - } - // 站控按钮 - if (this.style.Station.StationControl.lamp.substationControlShow) { - this.substationControl = new ESingleControl({ - _subType: 'substation', - style: this.style, - zlevel: this.zlevel, - z: this.z, - point: { - x: model.position.x + this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.lamp.offset.x, - y: model.position.y + this.style.Station.StationControl.lamp.offset.y - }, - context: this.style.Station.StationControl.text.substationControlText, - // model.zakContent - pop: false - }); - this.add(this.substationControl); - } - // 联锁控 - if (this.style.Station.StationControl.lamp.interconnectedControlShow) { - this.interconnectedControl = new ESingleControl({ - _subType: 'interconnected', - style: this.style, - zlevel: this.zlevel, - z: this.z, - point: { - x: model.position.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.lamp.offset.x, - y: model.position.y + this.style.Station.StationControl.lamp.offset.y - }, - context: this.style.Station.StationControl.text.interconnectedControlText || '联锁控', - pop: false - }); - this.add(this.interconnectedControl); - } - // 箭头 - if (this.style.Station.StationControl.arrow.show) { - const point = arrow(this.model.position.x, this.model.position.y + this.style.Station.StationControl.lamp.radiusR / 2, this.style.Station.StationControl.lamp.distance / 6, this.style.Station.StationControl.lamp.radiusR * 0.8); - this.arrowsControl = new EArrow({ - zlevel: this.zlevel, - z: this.z, - style: this.style, - count: this.count, - drict: 1, - point: point, - x: model.position.x + this.style.Station.StationControl.lamp.offset.x, - y: model.position.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y, - fill: this.style.Station.StationControl.lamp.grayColor, - lineWidth: 1, - stroke: this.style.sidelineColor - }); - this.add(this.arrowsControl); - } - } - - // 设置状态 - setState(model) { - if (!this.isShowShape) return; - // switch (model.status) { - // case '00': // 无状态 - // this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor); - // this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor); - // this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor); - // break; - // case '01': // 中控 - // this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor); - // this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor); - // this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.greenColor); - // break; - // case '02': // 站控 - // this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor); - // this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.yellowColor); - // this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor); - // break; - // case '03': // 紧急站控 - // this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.redColor); - // this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor); - // this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor); - // break; - // } - } - - getArcBoundingRect(view) { - const rect = view.getBoundingRect().clone(); - const scale = view.scale[0]; - const offsetX = view.position[0]; - const offsetY = view.position[1]; - rect.x = rect.x * scale + offsetX - 2; - rect.y = rect.y * scale + offsetY - 2; - rect.width = rect.width * scale + 4; - rect.height = rect.height * scale + 4; - return rect; - } - - /** 按钮是否按下*/ - isPop(e) { - for (var i = 0; i < this.childCount(); i++) { - var rect = this.childAt(i).getBoundingRect(); - if (rect.contain(e.offsetX, e.offsetY) && this.childAt(i).pop) { - return true; - } - } - } - createMouseEvent() { - if (this.style.ZcControl.mouseOverStyle) { - this.mouseEvent = new EMouse(this); - this.add(this.mouseEvent); - this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); }); - this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); }); - } - } - getShapeTipPoint() { - if (this.stationControl) { - var distance = 2; - var rect = this.stationControl.getBoundingRect(); - return { - x: rect.x + rect.width / 2, - y: rect.y - distance - }; - } - return null; - } - setShowMode() {} - setShowStation(stationCode) { - if (!stationCode || this.model.stationCode === stationCode) { - this.eachChild(item => { - item.show(); - }); - this.isShowShape = true; - this.setState(this.model); - } else { - this.eachChild(item => { - item.hide(); - }); - this.isShowShape = false; - } - } -} diff --git a/src/jmapNew/shape/StationStand/index.js b/src/jmapNew/shape/StationStand/index.js index a1b17a219..2442c2b3a 100644 --- a/src/jmapNew/shape/StationStand/index.js +++ b/src/jmapNew/shape/StationStand/index.js @@ -79,6 +79,7 @@ class StationStand extends Group { r: style.StationStand.standEmergent.mergentR, n: 4 }); + this.add(this.emergent); // 列车停站 const stopX = model.position.x; @@ -95,6 +96,7 @@ class StationStand extends Group { r: style.StationStand.standEmergent.mergentR, n: 4 }); + this.add(this.trainStop); // 列车出发 const departX = model.position.x; @@ -109,6 +111,7 @@ class StationStand extends Group { x: departX, y: departY }); + this.add(this.trainDepart); /** 站台折返策略*/ const reentryH = style.StationStand.standEmergent.mergentR; @@ -124,8 +127,7 @@ class StationStand extends Group { lineWidth: 0, fill: style.StationStand.reentry.noHumanColor }); - - // const distance = style.StationStand.safetyDoor.height * 2 - style.StationStand.stand.headFontSize / 2 - 2; + this.add(this.reentry); /** 站台扣车*/ const detainD = model.right ? 1 : -1; @@ -147,6 +149,7 @@ class StationStand extends Group { textAlign: 'middle', textVerticalAlign: 'top' }); + this.add(this.detain); /** 停站时间*/ const timeDrict = model.right ? 1 : -1; @@ -160,6 +163,7 @@ class StationStand extends Group { y: timeY, name: model.parkingTime || '30' }); + this.add(this.time); /** 运行等级*/ const levelDrict = model.right ? 1 : -1; @@ -173,6 +177,7 @@ class StationStand extends Group { y: levelY, name: model.runLevelTime || '5' }); + this.add(this.level); /** 列车停跳 */ if (style.StationStand.common.haveJumpShow) { @@ -203,14 +208,6 @@ class StationStand extends Group { }); this.add(this.jump); } - - this.add(this.emergent); - this.add(this.detain); - this.add(this.reentry); - this.add(this.time); - this.add(this.level); - this.add(this.trainStop); - this.add(this.trainDepart); } createMouseEvent() { @@ -357,9 +354,7 @@ class StationStand extends Group { recover() { this.time && this.time.hide(); this.level && this.level.hide(); - // if (!this.style.StationStand.common.special) { this.detain && this.detain.hide(); - // } this.emergent && this.emergent.hide(); this.trainStop && this.trainStop.hide(); // 列车停站 this.trainDepart && this.trainDepart.hide(); @@ -509,12 +504,10 @@ class StationStand extends Group { } /** 设置跳停*/ - // model.allSkip = 1; model.assignSkip && this.designatedJumpStop(); // 指定列车跳停 model.allSkip && this.jumpStop(); // 站台全部跳停 /** 设置扣车*/ - // model.centerHoldTrain = 1; if (model.stationHoldTrain && model.centerHoldTrain) { this.standAndCenterDetainTrain(); // 中心+车站扣车 } else if (model.stationHoldTrain) { diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index 2d6f7493b..0954df983 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -269,8 +269,6 @@ export default class Switch extends Group { this.setSwitchCoreColor(this.style.backgroundColor); this.name.getNameText().stopAnimation(false); this.swCore.stopAnimation(false); - // this.relocShelter.hide(); - // this.rhomboid.hide(); this.sheltertriangle.hide(); this.rhomboid.stopAnimation(false); this.releaseBackground.hide(); @@ -333,10 +331,6 @@ export default class Switch extends Group { }); } - /** 空闲*/ - spare() { - } - /** 单锁*/ setMonolock() { if (this.style.Switch.monolock.rectShow) { // 判断单锁矩形是否显示 @@ -425,7 +419,6 @@ export default class Switch extends Group { this.sectionCutOff(section); } } - } setState(model) { @@ -443,7 +436,7 @@ export default class Switch extends Group { model.blockade && this.block(); /** 区段切除*/ model.cutOff && this.setSwitchCutOff(); - if (this.style.Switch.sectionAction.flag) { + if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色 const switchModel = Vue.prototype.$jlmap.mapDevice[model.code]; if (switchModel.normalPosition != 0) { // 定位情况 const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode]; diff --git a/src/jmapNew/theme/beijing_01/menus/menuDialog/childDialog/twoConfirmation.vue b/src/jmapNew/theme/beijing_01/menus/menuDialog/childDialog/twoConfirmation.vue index d1560b910..4a70d12b3 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuDialog/childDialog/twoConfirmation.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuDialog/childDialog/twoConfirmation.vue @@ -32,6 +32,7 @@ + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/childDialog/childDialog/noticeInfo.vue b/src/jmapNew/theme/foshan_01/menus/dialog/childDialog/childDialog/noticeInfo.vue new file mode 100644 index 000000000..444a28d5f --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/childDialog/childDialog/noticeInfo.vue @@ -0,0 +1,77 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/childDialog/confirmControl.vue b/src/jmapNew/theme/foshan_01/menus/dialog/childDialog/confirmControl.vue new file mode 100644 index 000000000..0569c806c --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/childDialog/confirmControl.vue @@ -0,0 +1,280 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/childDialog/confirmControlSpeed.vue b/src/jmapNew/theme/foshan_01/menus/dialog/childDialog/confirmControlSpeed.vue new file mode 100644 index 000000000..a73f00076 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/childDialog/confirmControlSpeed.vue @@ -0,0 +1,153 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/childDialog/confirmSignalUnlock.vue b/src/jmapNew/theme/foshan_01/menus/dialog/childDialog/confirmSignalUnlock.vue new file mode 100644 index 000000000..d192cb895 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/childDialog/confirmSignalUnlock.vue @@ -0,0 +1,118 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/childDialog/confirmTip.vue b/src/jmapNew/theme/foshan_01/menus/dialog/childDialog/confirmTip.vue new file mode 100644 index 000000000..6f4ea89d7 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/childDialog/confirmTip.vue @@ -0,0 +1,68 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/routeControl.vue b/src/jmapNew/theme/foshan_01/menus/dialog/routeControl.vue new file mode 100644 index 000000000..3a8026e76 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/routeControl.vue @@ -0,0 +1,241 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/routeDetail.vue b/src/jmapNew/theme/foshan_01/menus/dialog/routeDetail.vue new file mode 100644 index 000000000..fa74d117a --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/routeDetail.vue @@ -0,0 +1,168 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/routeHandControl.vue b/src/jmapNew/theme/foshan_01/menus/dialog/routeHandControl.vue new file mode 100644 index 000000000..aae0336b8 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/routeHandControl.vue @@ -0,0 +1,341 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/routeLock.vue b/src/jmapNew/theme/foshan_01/menus/dialog/routeLock.vue new file mode 100644 index 000000000..3521fb45a --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/routeLock.vue @@ -0,0 +1,171 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/routeSelection.vue b/src/jmapNew/theme/foshan_01/menus/dialog/routeSelection.vue new file mode 100644 index 000000000..282ff6974 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/routeSelection.vue @@ -0,0 +1,219 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/routeUnLock.vue b/src/jmapNew/theme/foshan_01/menus/dialog/routeUnLock.vue new file mode 100644 index 000000000..fea19772d --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/routeUnLock.vue @@ -0,0 +1,287 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/routerCommand.vue b/src/jmapNew/theme/foshan_01/menus/dialog/routerCommand.vue new file mode 100644 index 000000000..1bdf8dbcd --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/routerCommand.vue @@ -0,0 +1,148 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/sectionAlxeReset.vue b/src/jmapNew/theme/foshan_01/menus/dialog/sectionAlxeReset.vue new file mode 100644 index 000000000..33a16f85a --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/sectionAlxeReset.vue @@ -0,0 +1,157 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/sectionControl.vue b/src/jmapNew/theme/foshan_01/menus/dialog/sectionControl.vue new file mode 100644 index 000000000..751dc54b7 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/sectionControl.vue @@ -0,0 +1,188 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/sectionUnLock.vue b/src/jmapNew/theme/foshan_01/menus/dialog/sectionUnLock.vue new file mode 100644 index 000000000..f2771ff5b --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/sectionUnLock.vue @@ -0,0 +1,316 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/speedLimitControl.vue b/src/jmapNew/theme/foshan_01/menus/dialog/speedLimitControl.vue new file mode 100644 index 000000000..8c81c5fe0 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/speedLimitControl.vue @@ -0,0 +1,551 @@ + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/standBackStrategy.vue b/src/jmapNew/theme/foshan_01/menus/dialog/standBackStrategy.vue new file mode 100644 index 000000000..4b097fd5d --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/standBackStrategy.vue @@ -0,0 +1,229 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/standControl.vue b/src/jmapNew/theme/foshan_01/menus/dialog/standControl.vue new file mode 100644 index 000000000..a2414dc5e --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/standControl.vue @@ -0,0 +1,366 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/standDetail.vue b/src/jmapNew/theme/foshan_01/menus/dialog/standDetail.vue new file mode 100644 index 000000000..b1d6c726b --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/standDetail.vue @@ -0,0 +1,278 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/standDetainTrainAll.vue b/src/jmapNew/theme/foshan_01/menus/dialog/standDetainTrainAll.vue new file mode 100644 index 000000000..1d4d07108 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/standDetainTrainAll.vue @@ -0,0 +1,187 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/standJumpStopControl.vue b/src/jmapNew/theme/foshan_01/menus/dialog/standJumpStopControl.vue new file mode 100644 index 000000000..e4926cc57 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/standJumpStopControl.vue @@ -0,0 +1,355 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/standRunLevel.vue b/src/jmapNew/theme/foshan_01/menus/dialog/standRunLevel.vue new file mode 100644 index 000000000..1ba1899b3 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/standRunLevel.vue @@ -0,0 +1,333 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/standStopTime.vue b/src/jmapNew/theme/foshan_01/menus/dialog/standStopTime.vue new file mode 100644 index 000000000..d0ec86339 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/standStopTime.vue @@ -0,0 +1,242 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/stationCmdControl.vue b/src/jmapNew/theme/foshan_01/menus/dialog/stationCmdControl.vue new file mode 100644 index 000000000..42f8e9a05 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/stationCmdControl.vue @@ -0,0 +1,388 @@ + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/stationControl.vue b/src/jmapNew/theme/foshan_01/menus/dialog/stationControl.vue new file mode 100644 index 000000000..47473fd91 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/stationControl.vue @@ -0,0 +1,253 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/stationHumanControlAll.vue b/src/jmapNew/theme/foshan_01/menus/dialog/stationHumanControlAll.vue new file mode 100644 index 000000000..ab2d6b445 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/stationHumanControlAll.vue @@ -0,0 +1,127 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/stationSetRouteControlAll.vue b/src/jmapNew/theme/foshan_01/menus/dialog/stationSetRouteControlAll.vue new file mode 100644 index 000000000..61ae8dab8 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/stationSetRouteControlAll.vue @@ -0,0 +1,146 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/switchControl.vue b/src/jmapNew/theme/foshan_01/menus/dialog/switchControl.vue new file mode 100644 index 000000000..58e3f3af1 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/switchControl.vue @@ -0,0 +1,237 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/switchUnLock.vue b/src/jmapNew/theme/foshan_01/menus/dialog/switchUnLock.vue new file mode 100644 index 000000000..382f23406 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/switchUnLock.vue @@ -0,0 +1,322 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/trainAddPlan.vue b/src/jmapNew/theme/foshan_01/menus/dialog/trainAddPlan.vue new file mode 100644 index 000000000..340fbf9a9 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/trainAddPlan.vue @@ -0,0 +1,228 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/trainDefine.vue b/src/jmapNew/theme/foshan_01/menus/dialog/trainDefine.vue new file mode 100644 index 000000000..821001381 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/trainDefine.vue @@ -0,0 +1,180 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/trainDelete.vue b/src/jmapNew/theme/foshan_01/menus/dialog/trainDelete.vue new file mode 100644 index 000000000..9d969581d --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/trainDelete.vue @@ -0,0 +1,168 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/trainDeletePlan.vue b/src/jmapNew/theme/foshan_01/menus/dialog/trainDeletePlan.vue new file mode 100644 index 000000000..bcd707893 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/trainDeletePlan.vue @@ -0,0 +1,165 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/trainEdit.vue b/src/jmapNew/theme/foshan_01/menus/dialog/trainEdit.vue new file mode 100644 index 000000000..3f663a94a --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/trainEdit.vue @@ -0,0 +1,180 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/trainFlag.vue b/src/jmapNew/theme/foshan_01/menus/dialog/trainFlag.vue new file mode 100644 index 000000000..a0fe79a5e --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/trainFlag.vue @@ -0,0 +1,159 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/trainMove.vue b/src/jmapNew/theme/foshan_01/menus/dialog/trainMove.vue new file mode 100644 index 000000000..fca33d07b --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/trainMove.vue @@ -0,0 +1,180 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/trainMoveEvently.vue b/src/jmapNew/theme/foshan_01/menus/dialog/trainMoveEvently.vue new file mode 100644 index 000000000..11083a3d9 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/trainMoveEvently.vue @@ -0,0 +1,185 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/trainSetHead.vue b/src/jmapNew/theme/foshan_01/menus/dialog/trainSetHead.vue new file mode 100644 index 000000000..35cfbb7b8 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/trainSetHead.vue @@ -0,0 +1,180 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/trainSetPlan.vue b/src/jmapNew/theme/foshan_01/menus/dialog/trainSetPlan.vue new file mode 100644 index 000000000..8cdce8cf5 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/trainSetPlan.vue @@ -0,0 +1,173 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/trainSetWork.vue b/src/jmapNew/theme/foshan_01/menus/dialog/trainSetWork.vue new file mode 100644 index 000000000..baafc7f25 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/trainSetWork.vue @@ -0,0 +1,164 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/trainSetWorkATP.vue b/src/jmapNew/theme/foshan_01/menus/dialog/trainSetWorkATP.vue new file mode 100644 index 000000000..756dc9bc2 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/trainSetWorkATP.vue @@ -0,0 +1,175 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/dialog/turnBackControl.vue b/src/jmapNew/theme/foshan_01/menus/dialog/turnBackControl.vue new file mode 100644 index 000000000..22e1e6c62 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/dialog/turnBackControl.vue @@ -0,0 +1,179 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/index.vue b/src/jmapNew/theme/foshan_01/menus/index.vue new file mode 100644 index 000000000..e80fc73b5 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/index.vue @@ -0,0 +1,391 @@ + + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/menuAutoTrunRoute.vue b/src/jmapNew/theme/foshan_01/menus/menuAutoTrunRoute.vue new file mode 100644 index 000000000..f117a8d22 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuAutoTrunRoute.vue @@ -0,0 +1,144 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/menuAxleReset.vue b/src/jmapNew/theme/foshan_01/menus/menuAxleReset.vue new file mode 100644 index 000000000..1237a53ae --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuAxleReset.vue @@ -0,0 +1,108 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/menuBar.vue b/src/jmapNew/theme/foshan_01/menus/menuBar.vue new file mode 100644 index 000000000..981eb25f5 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuBar.vue @@ -0,0 +1,1132 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/menuButton.vue b/src/jmapNew/theme/foshan_01/menus/menuButton.vue new file mode 100644 index 000000000..9c58482f7 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuButton.vue @@ -0,0 +1,389 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/menuCancel.vue b/src/jmapNew/theme/foshan_01/menus/menuCancel.vue new file mode 100644 index 000000000..69031a452 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuCancel.vue @@ -0,0 +1,119 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/menuDialog/childDialog/twoConfirmation.vue b/src/jmapNew/theme/foshan_01/menus/menuDialog/childDialog/twoConfirmation.vue new file mode 100644 index 000000000..cb364d3a1 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuDialog/childDialog/twoConfirmation.vue @@ -0,0 +1,120 @@ + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/menuDialog/childDialog/userAdd.vue b/src/jmapNew/theme/foshan_01/menus/menuDialog/childDialog/userAdd.vue new file mode 100644 index 000000000..eac2e8cea --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuDialog/childDialog/userAdd.vue @@ -0,0 +1,162 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/menuDialog/childDialog/userDelete.vue b/src/jmapNew/theme/foshan_01/menus/menuDialog/childDialog/userDelete.vue new file mode 100644 index 000000000..243fe7ec2 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuDialog/childDialog/userDelete.vue @@ -0,0 +1,134 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/menuDialog/childDialog/userEdit.vue b/src/jmapNew/theme/foshan_01/menus/menuDialog/childDialog/userEdit.vue new file mode 100644 index 000000000..33d38059f --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuDialog/childDialog/userEdit.vue @@ -0,0 +1,178 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/menuDialog/detainTrainContorl.vue b/src/jmapNew/theme/foshan_01/menus/menuDialog/detainTrainContorl.vue new file mode 100644 index 000000000..d1866d269 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuDialog/detainTrainContorl.vue @@ -0,0 +1,192 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/menuDialog/detainTrainContorlUpDown.vue b/src/jmapNew/theme/foshan_01/menus/menuDialog/detainTrainContorlUpDown.vue new file mode 100644 index 000000000..ab5a392ab --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuDialog/detainTrainContorlUpDown.vue @@ -0,0 +1,183 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/menuDialog/helpAbout.vue b/src/jmapNew/theme/foshan_01/menus/menuDialog/helpAbout.vue new file mode 100644 index 000000000..0348a0cd8 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuDialog/helpAbout.vue @@ -0,0 +1,131 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/menuDialog/manageUser.vue b/src/jmapNew/theme/foshan_01/menus/menuDialog/manageUser.vue new file mode 100644 index 000000000..6c22ac606 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuDialog/manageUser.vue @@ -0,0 +1,290 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/menuDialog/stationControl.vue b/src/jmapNew/theme/foshan_01/menus/menuDialog/stationControl.vue new file mode 100644 index 000000000..a326e4233 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuDialog/stationControl.vue @@ -0,0 +1,237 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/menuDialog/trainAdd.vue b/src/jmapNew/theme/foshan_01/menus/menuDialog/trainAdd.vue new file mode 100644 index 000000000..d6e7647f4 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuDialog/trainAdd.vue @@ -0,0 +1,162 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/menuDialog/trainDelete.vue b/src/jmapNew/theme/foshan_01/menus/menuDialog/trainDelete.vue new file mode 100644 index 000000000..529f2df33 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuDialog/trainDelete.vue @@ -0,0 +1,149 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/menuDialog/trainTranstalet.vue b/src/jmapNew/theme/foshan_01/menus/menuDialog/trainTranstalet.vue new file mode 100644 index 000000000..0dc10a6f7 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuDialog/trainTranstalet.vue @@ -0,0 +1,152 @@ + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/menuLimit.vue b/src/jmapNew/theme/foshan_01/menus/menuLimit.vue new file mode 100644 index 000000000..c1e1b60d1 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuLimit.vue @@ -0,0 +1,119 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/menuSection.vue b/src/jmapNew/theme/foshan_01/menus/menuSection.vue new file mode 100644 index 000000000..3fd27578f --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuSection.vue @@ -0,0 +1,226 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/menuSignal.vue b/src/jmapNew/theme/foshan_01/menus/menuSignal.vue new file mode 100644 index 000000000..54782c105 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuSignal.vue @@ -0,0 +1,524 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/menuStation.vue b/src/jmapNew/theme/foshan_01/menus/menuStation.vue new file mode 100644 index 000000000..81b2a52f3 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuStation.vue @@ -0,0 +1,306 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/menuStationControl.vue b/src/jmapNew/theme/foshan_01/menus/menuStationControl.vue new file mode 100644 index 000000000..72b195cce --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuStationControl.vue @@ -0,0 +1,142 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/menuStationStand.vue b/src/jmapNew/theme/foshan_01/menus/menuStationStand.vue new file mode 100644 index 000000000..1f8f107ce --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuStationStand.vue @@ -0,0 +1,409 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue b/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue new file mode 100644 index 000000000..e9c1801f0 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue @@ -0,0 +1,318 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/menuTool.vue b/src/jmapNew/theme/foshan_01/menus/menuTool.vue new file mode 100644 index 000000000..266a43165 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuTool.vue @@ -0,0 +1,202 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menus/menuTrain.vue b/src/jmapNew/theme/foshan_01/menus/menuTrain.vue new file mode 100644 index 000000000..7d7fff421 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/menuTrain.vue @@ -0,0 +1,511 @@ + + + diff --git a/src/jmapNew/theme/foshan_01/menus/passiveDialog/alarm.vue b/src/jmapNew/theme/foshan_01/menus/passiveDialog/alarm.vue new file mode 100644 index 000000000..3fb293056 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/passiveDialog/alarm.vue @@ -0,0 +1,213 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/passiveDialog/control.vue b/src/jmapNew/theme/foshan_01/menus/passiveDialog/control.vue new file mode 100644 index 000000000..8beb7267a --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/passiveDialog/control.vue @@ -0,0 +1,285 @@ + + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/passiveDialog/timeout.vue b/src/jmapNew/theme/foshan_01/menus/passiveDialog/timeout.vue new file mode 100644 index 000000000..448e6b232 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/passiveDialog/timeout.vue @@ -0,0 +1,106 @@ + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/menus/utils/menuItemStatus.js b/src/jmapNew/theme/foshan_01/menus/utils/menuItemStatus.js new file mode 100644 index 000000000..dada7aa32 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menus/utils/menuItemStatus.js @@ -0,0 +1,570 @@ +import Vue from 'vue'; +import store from '@/store'; +import deviceState from '@/jmap/constant/deviceState'; +import { OperateMode } from '@/scripts/ConstDic'; + +export function getCurrentStateObject() { + return store.getters['menuOperation/selected']; +} + +/** 系统类型 */ +export const SystemType = { + '01': 'local', // 现地工作站 + '02': 'central' // 中心调度工作站 +}; + +export const StationControlType = { + '01': 'center', // 中控 + '02': 'station' // 站控 +}; + +// 控制禁用 +export const MenuDisabledState = { + Section: { + // 故障解锁 + fault() { + }, + // 切除 + split() { + const device = getCurrentStateObject(); + if (device && device.cutOff != deviceState.Section.cutOff.Default) { + return true; + } + }, + // 激活 + active() { + const device = getCurrentStateObject(); + if (device && device.cutOff == deviceState.Section.cutOff.Default) { + return true; + } + }, + // 区段封锁 + lock() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.Section.status.State06) { + return true; + } + }, + // 区段解禁 + unlock() { + const device = getCurrentStateObject(); + if (device && device.status != deviceState.Section.status.State06) { + return true; + } + }, + // 区段设置限速 + setSpeed() { + }, + // 区段取消限速 + cancelSpeed() { + const device = getCurrentStateObject(); + if (device && device.speedUpperLimit == deviceState.Section.speedUpperLimit.Default) { + return true; + } + }, + // 新建列车 + newTrain() { + }, + // 计轴预复位 + axlePreReset() { + }, + // 设置计轴有效 + alxeEffective() { + }, + // 设置计轴失效 + alxeFailure() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.Section.status.State13) { + return true; + } + } + }, + Signal: { + // 进路选排 + arrangementRoute() { + + }, + // 进路取消 + cancelTrainRoute() { + }, + // 信号封闭 + lock() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.Signal.status.State05) { + return true; + } + }, + // 信号解封 + unlock() { + const device = getCurrentStateObject(); + if (device && device.status != deviceState.Signal.status.State05) { + return true; + } + }, + // 信号重开 + reopenSignal() { + }, + // 进路引导 + guide() { + }, + // 设置联锁自动进路 + setAutoInterlock() { + }, + // 取消联锁自动进路 + cancelAutoInterlock() { + }, + // 设置联锁自动触发 + setAutoTrigger() { + }, + // 取消联锁自动触发 + cancelAutoTrigger() { + }, + // 关灯 + signalClose() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.Signal.status.State01) { + return true; + } + }, + // 人工控 + humanControl() { + }, + // ats自动控 + atsAutoControl() { + }, + // 查询进路状态 + detail() { + }, + // 设置故障 + setStoppage() { + const device = getCurrentStateObject(); + if (device && device.fault) { + return true; + } + }, + // 取消故障 + cancelStoppage() { + const device = getCurrentStateObject(); + if (device && !device.fault) { + return true; + } + } + }, + Station: { + // 全站设置联锁自动触发 + setAutoTrigger() { + }, + // 全站取消联锁自动触发 + cancelAutoTrigger() { + }, + // 上电解锁 + powerUnLock() { + }, + // 执行关键操作测试 + execKeyOperationTest() { + }, + // 所有进路自排开 + atsAutoControlALL() { + }, + // 所有进路自排关 + humanControlALL() { + }, + // 设置ZC故障 + setStoppage() { + const device = getCurrentStateObject(); + if (device && device.fault) { + return true; + } + }, + // 取消ZC故障 + cancelStoppage() { + const device = getCurrentStateObject(); + if (device && !device.fault) { + return true; + } + } + }, + StationControl: { + // 紧急站控 + emergencyStationControl() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.StationControl.status.State03) { + return true; + } + }, + // 请求站控 + requestStationControl() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.StationControl.status.State02) { + return true; + } + }, + // 强行站控 + forcedStationControl() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.StationControl.status.State02) { + return true; + } + }, + // 请求中控 + requestCentralControl() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.StationControl.status.State01) { + return true; + } + }, + // 设置故障 + setStoppage() { + const device = getCurrentStateObject(); + if (device && device.fault) { + return true; + } + }, + // 取消故障 + cancelStoppage() { + const device = getCurrentStateObject(); + if (device && !device.fault) { + return true; + } + } + }, + StationStand: { + // 设置扣车 + setDetainTrain() { + const device = getCurrentStateObject(); + if (device && device.holdStatus != deviceState.StationStand.holdStatus.State01) { + return true; + } + }, + // 取消扣车 + cancelDetainTrain() { + const device = getCurrentStateObject(); + if (device && device.holdStatus == deviceState.StationStand.holdStatus.State01) { + return true; + } + }, + // 强制取消扣车 + cancelDetainTrainForce() { + const device = getCurrentStateObject(); + if (device && device.holdStatus == deviceState.StationStand.holdStatus.State01) { + return true; + } + }, + // 设置全站扣车 + cancelDetainTrainAll() { + }, + // 设置运行等级 + setRunLevel() { + }, + // 设置停站时间 + setStopTime() { + }, + // 设置跳停 + setJumpStop() { + const device = getCurrentStateObject(); + if (device && device.jumpStopStatus != deviceState.StationStand.jumpStopStatus.State01) { + return true; + } + }, + // 取消跳停 + cancelJumpStop() { + const device = getCurrentStateObject(); + if (device && device.jumpStopStatus == deviceState.StationStand.jumpStopStatus.State01) { + return true; + } + }, + // 提前发车 + earlyDeparture() { + }, + // 站台详细信息 + detail() { + }, + // 设置折返策略 + setBackStrategy() { + }, + // 设置故障 + setStoppage() { + const device = getCurrentStateObject(); + if (device && device.fault) { + return true; + } + }, + // 取消故障 + cancelStoppage() { + const device = getCurrentStateObject(); + if (device && !device.fault) { + return true; + } + } + }, + Switch: { + // 单锁 + lock() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.Switch.status.State10) { + return true; + } + }, + // 解锁 + unlock() { + const device = getCurrentStateObject(); + if (device && device.status != deviceState.Switch.status.State10) { + return true; + } + }, + // 封锁 + block() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.Switch.status.State14) { + return true; + } + }, + // 解封 + unblock() { + const device = getCurrentStateObject(); + if (device && device.status != deviceState.Switch.status.State14) { + return true; + } + }, + // 强扳 + switchTurnoutForce() { + }, + // 转动 + switchTurnout() { + }, + // 道岔故障解锁 + fault() { + }, + // 计轴预复位 + axlePreReset() { + }, + // 道岔切除 + split() { + }, + // 道岔激活 + active() { + }, + // 道岔设置速度 + setSpeed() { + // const device = getCurrentStateObject(); + }, + // 设置计轴有效 + alxeEffective() { + }, + // 道岔取消速度 + cancelSpeed() { + }, + // 设置故障 + setStoppage() { + const device = getCurrentStateObject(); + if (device && device.fault) { + return true; + } + }, + // 取消故障 + cancelStoppage() { + const device = getCurrentStateObject(); + if (device && !device.fault) { + return true; + } + } + }, + Train: { + // 添加列车识别号 + addTrainId() { + }, + // 删除列车识别号 + delTrainId() { + }, + // 修改列车识别号 + editTrainId() { + }, + // 修改车组号 + editTrainNo() { + }, + // 移动列车识别号 + moveTrainId() { + }, + // 交换列车识别号 + switchTrainId() { + }, + // 设置限速 + limitSpeed() { + }, + // 设置通信故障 + setStoppage() { + const device = getCurrentStateObject(); + if (device && device.fault) { + return true; + } + }, + // 取消通信故障 + cancelStoppage() { + const device = getCurrentStateObject(); + if (device && !device.fault) { + return true; + } + }, + // 添加计划车 + addPlanTrain() { + }, + // 设置计划车 + setPlanTrain() { + }, + // 设置头码车 + setHeadTrain() { + }, + // 设置人工车 + setWorkTrain() { + }, + // 标记重点车 + trainToFlag() { + }, + // 取消标记重点车 + trainUnFlag() { + } + } +}; + +/** + * 将menu的disabled属性使用disabledCallback计算并返回 + * @param {Array} menu + */ +export function menuConvert(menu) { + if (menu.constructor === Array) { + menu.forEach(elem => { + if (elem.type === 'separator') { + elem.show = true; + return; + } + if (elem.disabledCallback.constructor === Function) { + if (!elem.defaultDisabled) { + elem.disabled = elem.disabledCallback(); + } + } + }); + } + return menu; +} + +/** + * 根据产品类型,返回对应的menuBar + * @param {*} menuObj + */ +export function menuBarConvert(menu, mode) { + if (menu) { + if (mode === OperateMode.NORMAL) { + menu.forEach(item => { + if (item.type === 'separator') { + item.show = true; + return; + } + + item.show = false; + if (!item.click) { + item.click = () => { }; + } + + if (!item.froce) { + item.show = true; + if (item.children && item.children.length > 0) { + menuBarConvert(item.children, mode); + } + } + }); + } else if (mode === OperateMode.ADMIN) { + menu.forEach(item => { + item.show = true; + if (!item.click) { + item.click = () => { }; + } + if (item.children && item.children.length > 0) { + menuBarConvert(item.children, mode); + } + }); + } + } + return menu || []; +} + +/** + * 将menu的show属性过滤返回 + * @param {Array} menu + */ +export function menuFiltration(menuObj) { + var selected = getCurrentStateObject(); + var control; + var menu = []; + + if (selected._type == 'StationStand') { + control = store.getters['map/getStationControlByStationCode'](selected.deviceStationCode); + } else if (selected._type == 'Station') { + control = store.getters['map/getStationControlByStationCode'](selected.code); + } else { + control = store.getters['map/getStationControlByStationCode'](selected.stationCode); + } + + if (control) { + if (store.state.training.prdType != '') { + const type = SystemType[store.state.training.prdType]; + const status = StationControlType[control.status]; + menu = [...menuObj[type]]; + if (menu.constructor === Array) { + menu.forEach(elem => { + if (elem.type === 'separator') { + elem.show = true; + return; + } + + if (elem.auth.constructor === Object) { + elem.show = true; + if (!elem.auth['station'] && !elem.auth['center']) { // 控制不显示 + elem.show = false; + } + elem.defaultDisabled = !elem.auth[status]; + } + }); + } + } + } + return menu; +} + +/** + * 将train menu的show属性过滤返回 + */ +export function trainMenuFiltration(menuObj) { + var menu = []; + if (store.state.training.prdType != '') { + const type = SystemType[store.state.training.prdType]; + menu = [...menuObj[type]]; + if (menu.constructor === Array) { + menu.forEach(elem => { + if (elem.type === 'separator') { + elem.show = true; + return; + } + + if (elem.auth.constructor === Object) { + elem.show = true; + if (!elem.auth['station'] && !elem.auth['center']) { // 控制不显示 + elem.show = false; + } + } + }); + } + } + return menu; +} + +/** + * 离开菜单以及执行完菜单取消选中状态 + */ +export function mouseCancelState(selected) { + const device = Vue.prototype.$jlmap.getDeviceByCode(selected.code); + const instance = (device || {}).instance; + if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) { + device['down'] = false; + instance.mouseEvent.mouseout(Vue.prototype.$jlmap.$zr.curEvent); + } +} diff --git a/src/jmapNew/theme/foshan_01/menusPlan/addTask.vue b/src/jmapNew/theme/foshan_01/menusPlan/addTask.vue new file mode 100644 index 000000000..cf092b0ca --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menusPlan/addTask.vue @@ -0,0 +1,175 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menusPlan/chooseTemplatePlan.vue b/src/jmapNew/theme/foshan_01/menusPlan/chooseTemplatePlan.vue new file mode 100644 index 000000000..f9ea0760d --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menusPlan/chooseTemplatePlan.vue @@ -0,0 +1,115 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menusPlan/components/dataTable.vue b/src/jmapNew/theme/foshan_01/menusPlan/components/dataTable.vue new file mode 100644 index 000000000..fa98a48e7 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menusPlan/components/dataTable.vue @@ -0,0 +1,206 @@ + + + + + diff --git a/src/jmapNew/theme/foshan_01/menusPlan/createTodayPlan.vue b/src/jmapNew/theme/foshan_01/menusPlan/createTodayPlan.vue new file mode 100644 index 000000000..27e3513d2 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menusPlan/createTodayPlan.vue @@ -0,0 +1,134 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menusPlan/createWeekPlan.vue b/src/jmapNew/theme/foshan_01/menusPlan/createWeekPlan.vue new file mode 100644 index 000000000..48f65d60f --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menusPlan/createWeekPlan.vue @@ -0,0 +1,137 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menusPlan/deleteTask.vue b/src/jmapNew/theme/foshan_01/menusPlan/deleteTask.vue new file mode 100644 index 000000000..035f23fca --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menusPlan/deleteTask.vue @@ -0,0 +1,73 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menusPlan/deleteTodayPlan.vue b/src/jmapNew/theme/foshan_01/menusPlan/deleteTodayPlan.vue new file mode 100644 index 000000000..3110e2858 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menusPlan/deleteTodayPlan.vue @@ -0,0 +1,62 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menusPlan/managePlanList.vue b/src/jmapNew/theme/foshan_01/menusPlan/managePlanList.vue new file mode 100644 index 000000000..034b461b6 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menusPlan/managePlanList.vue @@ -0,0 +1,143 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menusPlan/modifyingPlan.vue b/src/jmapNew/theme/foshan_01/menusPlan/modifyingPlan.vue new file mode 100644 index 000000000..a9d25ea80 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menusPlan/modifyingPlan.vue @@ -0,0 +1,177 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/menusPlan/modifyingTask.vue b/src/jmapNew/theme/foshan_01/menusPlan/modifyingTask.vue new file mode 100644 index 000000000..194534120 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/menusPlan/modifyingTask.vue @@ -0,0 +1,327 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/model.js b/src/jmapNew/theme/foshan_01/model.js new file mode 100644 index 000000000..62440bda8 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/model.js @@ -0,0 +1,63 @@ +import deviceType from '../../constant/deviceType'; + +class Model { + 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 + }; + } + + initPublicProps(model) { + if (model) { + var modelInitial = this.public[model._type]; + if (modelInitial) { + for (var prop in modelInitial) { + model[prop] = modelInitial[prop]; + } + } + } + + return model; + } + + initPrivateProps(model) { + if (model) { + var modelInitial = this.private[model._type]; + if (modelInitial) { + for (var prop in modelInitial) { + model[prop] = modelInitial[prop]; + } + } + } + + return model; + } +} + +export default new Model(); diff --git a/src/jmapNew/theme/foshan_01/planConvert.js b/src/jmapNew/theme/foshan_01/planConvert.js new file mode 100644 index 000000000..8f2fc6dc3 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/planConvert.js @@ -0,0 +1,334 @@ +import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan'; + +export default { + /** 边缘高度*/ + EdgeHeight: 600, + + /** 间隔高度*/ + CoordMultiple: 1, + + /** 偏移时间*/ + TranslationTime: 60 * 60 * 2, + + /** excel解析配置*/ + ExcelConfig: { + beginRow: 1, + beginCol: 0, + fieldNum: 10, + sepField: '行车间隔', + trainId: 'TrainID', + columns: ['折返线', 'TrainID', '行车间隔'] + }, + + /** 解析exal数据转换为Json后台数据*/ + importData(Sheet, JsonData) { + var dataList = convertSheetToList(Sheet, true); + if (dataList && dataList.length) { + if (dataList && dataList.length && dataList[1] && dataList[0]) { + // const tIndex = dataList.findIndex(it => { return it[0]; }); // 设置不用过滤行数 + const tIndex = 9; // 设置不用过滤行数 + + /** 解析二维数组为json对象*/ + const reg3 = /^(\d+:\d+:\d+|)/; // 06:12:00 + dataList.forEach((elem, i) => { + var begin = -1; + /** 跳过名称所在的行*/ + if (i != tIndex && elem && elem.length > 0) { + let flag = false; + let count = 0; + let param = { begTime: '', endTime: '' }; + if (i > tIndex) { elem.reverse(); } + elem.forEach((item, j) => { + /** 过滤空值*/ + if (item) { + let title = ''; + var value = `${item}`.trim(); + if (i > tIndex) { // 上行线 + title = `${dataList[tIndex][dataList[tIndex].length - j - 1]}`.replace(/\s*/g, ''); + if (title == 'undefined') { + title = `${dataList[tIndex][dataList[tIndex].length - j - 2]}`.replace(/\s*/g, ''); + } + } else { // 下行线 + title = `${dataList[tIndex][j]}`.replace(/\s*/g, ''); + if (title == 'undefined') { + title = `${dataList[tIndex][j - 1]}`.replace(/\s*/g, ''); + } + } + + /** 匹配到开始位置或者结束位置*/ + if (title == this.ExcelConfig.trainId) { + if (begin == -1) { + flag = true; + begin = value; // 设置初始索引 + JsonData.push({ + code: value, + destinationCode: '', + arrivalList: [] + }); + } else if (flag) { + begin = -1; // 清空初始索引 + JsonData[JsonData.length - 1].destinationCode = value; + flag = false; + } + } else if (begin !== -1) { + /** 匹配到中间位置*/ + var stationName = title.replace(/\s/, ''); + if (this.ExcelConfig.columns.indexOf(stationName) == -1 && reg3.test(value)) { + let need = false; + if (value.split(':')[0] == '24') { // 24:XX:XX 类似这种数据 变24为00 + const arr = value.split(':'); + arr[0] = '00'; + value = arr.join(':'); + } + if (count == 1) { + count = 0; + param.endTime = value; + } + if (count == 0) { + count = 1; + param.begTime = param.begTime || value; + } + + if (param.begTime && param.endTime) { + need = true; + } + + /** 添加json数据*/ + if (need) { // 储存非空 数据 + var stationObj = { + stationName: stationName + }; + stationObj['arriveTime'] = prefixTime(param.begTime); + stationObj['departureTime'] = prefixTime(param.endTime); + JsonData[JsonData.length - 1].arrivalList.push(stationObj); + param = { begTime: '', endTime: '' }; + count = 0; + } + } + } + } + }); + } + }); + } + } + return JsonData; + }, + + /** 将后台数据解析成图表*/ + convertDataToModels(data, stations, kmRangeCoordMap, lineStyle) { + var models = []; + if (data && data.serviceNumberDataList && data.serviceNumberDataList.length) { + /** 按服务遍历数据*/ + data.serviceNumberDataList.forEach((service) => { + /** 按车次遍历数据*/ + var opt = { name: '', markPointData: [], data: [] }; + if (service.tripNumberDataList && service.tripNumberDataList.length) { + service.tripNumberDataList.forEach((train, j) => { + var pointdata = {}; + var idx = 0; + var num = 0; + var lastPoint = null; + var nextPoint = null; + + /** 如果车次号为空,不显示名称*/ + if (train.tripNumber) { + /** 创建标记点名称和坐标*/ + pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`; + pointdata.color = '#000' || lineStyle.color; + pointdata.directionCode = train.directionCode; + pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)]; + + /** 给服务对象添加服务名称和标记点*/ + opt.markPointData.push(createMartPoint(pointdata)); + /** 创建服务号名称*/ + opt.name = `${service.serviceNumber}`; + } + + /** 计算非折返点车次点坐标集合*/ + train.stationTimeList.forEach((elem, index) => { + idx = index; + if (index == 0 && train.stationTimeList[index].stationCode != train.stationTimeList[index + 1].stationCode || + index == train.stationTimeList.length - 2 && train.stationTimeList[index].secondTime != train.stationTimeList[index + 1].secondTime || + index > 0 && index < train.stationTimeList.length - 1) { + const aa = `${train.directionCode}${train.tripNumber}`; + opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]); + } + }); + + /** 计算折返点车次坐标点集合*/ + if (!train.backup && train.reentry && service.tripNumberDataList[j + 1] && service.tripNumberDataList[j + 1].stationTimeList) { + lastPoint = train.stationTimeList[idx - 1]; + nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1]; + num = this.computedReentryNumber(train.tripNumber); + opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode]); + opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode]); + } + + /** 如果是备用车,按车次添加线*/ + if (train.backup) { + /** 创建一条完成的服务数据*/ + opt.name += j; + var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle)); + if (model) { + models.push(model); + opt = { name: '', markPointData: [], data: [] }; + } + } + }); + + // 不是备用车,按服务添加线 + if (!service.backup) { + /** 创建一条完成的服务数据*/ + var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle)); + if (model) { + models.push(model); + } + } + } + }); + return models; + } else { + return []; + } + }, + + /** 更新数据并解析成图表*/ + updateDataToModels(data, stations, kmRangeCoordMap, runPlanData, series, lineStyle) { + if (data && data.length) { + data.forEach(elem => { + /** 判断此条记录的服务号是否存在*/ + if (!runPlanData[elem.serviceNumber]) { + /** 创建一个新服务号标记*/ + runPlanData[elem.serviceNumber] = {}; + /** 不存在此服务号,则需要创建一条新的line*/ + series.push(createSeriesModel({ + zlevel: 1, + name: `run${elem.serviceNumber}`, + data: [], + markPointData: [] + }, Object.assign({ color: hexColor.toCreate() }, lineStyle))); + } + + /** 添加数据*/ + series.forEach(serie => { + /** 找到服务号所在图数据的位置*/ + if (serie.name == `run${elem.serviceNumber}`) { + /** 添加车组号记录标记*/ + if (!runPlanData[elem.serviceNumber][elem.tripNumber]) { + runPlanData[elem.serviceNumber][elem.tripNumber] = []; + } + + runPlanData[elem.serviceNumber][elem.tripNumber].push(elem); + runPlanData[elem.serviceNumber][elem.tripNumber].sort((a, b) => { + return parseInt(a.secondTime) - parseInt(b.secondTime); + }); + + /** 如果此记录车组号的数据为第一条时,则打上标签*/ + if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) { + serie.markPoint.data.push(createMartPoint({ + directionCode: elem.directionCode, + coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)], + name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`, + color: lineStyle.color || '#000' + })); + } + + /** 计算折返点*/ + var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.directionCode]; + if (serie.data.length > 0) { + var lastPoint = serie.data[serie.data.length - 1]; + if (lastPoint[2] !== nextPoint[2]) { + var num = this.computedReentryNumber(elem.tripNumber); + serie.data.push([lastPoint[0], this.getYvalueByDirectionCode(lastPoint[1], lastPoint[2], num), lastPoint[2]]); + serie.data.push([nextPoint[0], this.getYvalueByDirectionCode(nextPoint[1], lastPoint[2], num), lastPoint[2]]); + } + } + + /** 添加车组号数据到对应的服务图数据中*/ + serie.data.push(nextPoint); + + /** 保证原始数据排序*/ + serie.data.sort((a, b) => { + return parseInt(a[0]) - parseInt(b[0]); + }); + } + }); + }); + } + + return series; + }, + + /** 初始化Y轴*/ + initializeYaxis(stations) { + return createMarkLineModels(stations, (elem) => { + return this.EdgeHeight + elem.kmRange * this.CoordMultiple; + }); + }, + + /** 将后台数据转换为试图序列模型*/ + convertStationsToMap(stations) { + var map = {}; + if (stations && stations.length) { + stations.forEach((elem) => { + map[`${elem.kmRange}`] = this.EdgeHeight + elem.kmRange * this.CoordMultiple; + }); + } + + return map; + }, + + /** 计算y轴最小值*/ + computedYaxisMinValue(stations) { + return stations[0].kmRange * this.CoordMultiple; + }, + + /** 计算y轴最大值*/ + computedYaxisMaxValue(stations) { + return stations[stations.length - 1].kmRange * this.CoordMultiple + this.EdgeHeight * 2; + }, + + /** 格式化y轴数据*/ + computedFormatYAxis(stations, params) { + var yText = '0m'; + + stations.forEach(elem => { + if (elem.kmRange < parseInt(params.value) / this.CoordMultiple - this.EdgeHeight) { + yText = Math.floor(elem.kmRange) + 'm'; + } + }); + + return yText; + }, + + /** 根据是否和上一个车次是否相交,计算下一个车次的折返的高度*/ + computedReentryNumber(code) { + return parseInt(code || 1) % 2 ? 1 : 2; + }, + + /** 根据方向计算y折返偏移量*/ + getYvalueByDirectionCode(defaultVlue, directionCode, num) { + if (directionCode === '1') { + defaultVlue -= this.EdgeHeight / 2 * num; + } else if (directionCode === '2') { + defaultVlue += this.EdgeHeight / 2 * num; + } + + return defaultVlue; + }, + + /** 根据elem计算y值*/ + getCoordYByElem(stations, kmRangeCoordMap, elem, directionCode, isSpecial, num) { + var defaultVlue = 0; + var station = stations.find(it => { return it.code == elem.stationCode; }); + if (station) { + defaultVlue = kmRangeCoordMap[`${station.kmRange}`]; + if (isSpecial) { + defaultVlue = this.getYvalueByDirectionCode(defaultVlue, directionCode, num); + } + } + + return defaultVlue; + } +}; diff --git a/src/jmapNew/theme/foshan_01/planSchedule/index.vue b/src/jmapNew/theme/foshan_01/planSchedule/index.vue new file mode 100644 index 000000000..332007bb7 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/planSchedule/index.vue @@ -0,0 +1,403 @@ + + + + + diff --git a/src/jmapNew/theme/foshan_01/planSchedule/menuBar.vue b/src/jmapNew/theme/foshan_01/planSchedule/menuBar.vue new file mode 100644 index 000000000..e64ae3063 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/planSchedule/menuBar.vue @@ -0,0 +1,514 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/planSchedule/menuTool.vue b/src/jmapNew/theme/foshan_01/planSchedule/menuTool.vue new file mode 100644 index 000000000..d3ecde016 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/planSchedule/menuTool.vue @@ -0,0 +1,172 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/foshan_01/planSchedule/schedule.vue b/src/jmapNew/theme/foshan_01/planSchedule/schedule.vue new file mode 100644 index 000000000..82a3c9ed3 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/planSchedule/schedule.vue @@ -0,0 +1,468 @@ + + + + diff --git a/src/jmapNew/theme/foshan_01/planSchedule/statusBar.vue b/src/jmapNew/theme/foshan_01/planSchedule/statusBar.vue new file mode 100644 index 000000000..4c1418fb3 --- /dev/null +++ b/src/jmapNew/theme/foshan_01/planSchedule/statusBar.vue @@ -0,0 +1,107 @@ + + + + + diff --git a/src/jmapNew/theme/foshan_01/planSchedule/titleBar.vue b/src/jmapNew/theme/foshan_01/planSchedule/titleBar.vue new file mode 100644 index 000000000..689c3486a --- /dev/null +++ b/src/jmapNew/theme/foshan_01/planSchedule/titleBar.vue @@ -0,0 +1,75 @@ + + + + \ No newline at end of file diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue index 8a2e150b6..da8eaf525 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue @@ -18,9 +18,9 @@ import AlxeEffective from './dialog/alxeEffective'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import { mapGetters } from 'vuex'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; -import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import {menuOperate, commitOperate} from './utils/menuOperate'; export default { name: 'SectionMenu', @@ -150,144 +150,52 @@ export default { }, // 设置计轴失效 alxeFailure() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Section.alxeFailure.menu.operation, - param: { - sectionCode: this.selected.code - } - }; - this.mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + commitOperate(menuOperate.Section.alxeFailure, {sectionCode:this.selected.code}, 3).then((data)=>{ + }).catch((error)=>{ + this.$refs.noticeInfo.doShow({}, error.message); }); }, // 故障解锁 fault() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Section.fault.menu.operation, - param: { - sectionCode: this.selected.code - } - }; - - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.sectionUnLock.doShow(operate, this.selected); - } + commitOperate(menuOperate.Section.fault, {sectionCode:this.selected.code}, 0).then((data)=>{ + this.$refs.sectionUnLock.doShow(data.operate, this.selected); }); }, // 切除 split() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Section.split.menu.operation, - param: { - sectionCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.sectionControl.doShow(operate, this.selected); - } + commitOperate(menuOperate.Section.split, {sectionCode:this.selected.code}, 0).then((data)=>{ + this.$refs.sectionControl.doShow(data.operate, this.selected); }); }, // 确认计轴有效 alxeEffective() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Section.alxeEffective.menu.operation, - param: { - sectionCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.alxeEffective.doShow(operate, this.selected); - } + commitOperate(menuOperate.Section.alxeEffective, {sectionCode:this.selected.code}, 0).then((data)=>{ + this.$refs.alxeEffective.doShow(data.operate, this.selected); }); }, // 区段激活 active() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Section.active.menu.operation, - param: { - sectionCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.sectionControl.doShow(operate, this.selected); - } + commitOperate(menuOperate.Section.active, {sectionCode:this.selected.code}, 0).then((data)=>{ + this.$refs.sectionControl.doShow(data.operate, this.selected); }); }, // 区段封锁 lock() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Section.lock.menu.operation, - param: { - sectionCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.sectionControl.doShow(operate, this.selected); - } + commitOperate(menuOperate.Section.lock, {sectionCode:this.selected.code}, 0).then((data)=>{ + this.$refs.sectionControl.doShow(data.operate, this.selected); }); }, // 区段解锁 unlock() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Section.unlock.menu.operation, - param: { - sectionCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.sectionUnLock.doShow(operate, this.selected); - } + commitOperate(menuOperate.Section.unlock, {sectionCode:this.selected.code}, 0).then((data)=>{ + this.$refs.sectionUnLock.doShow(data.operate, this.selected); }); }, // 设置速度 setSpeed() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Section.setSpeed.menu.operation, - param: { - sectionCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.speedLimitControl.doShow(operate, this.selected); - } + commitOperate(menuOperate.Section.setSpeed, {sectionCode:this.selected.code}, 0).then((data)=>{ + this.$refs.speedLimitControl.doShow(data.operate, this.selected); }); } } diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue index 23a018b2d..8d0d83edd 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue @@ -22,7 +22,7 @@ import RouteHandControl from './dialog/routeHandControl'; import RouterCommand from './dialog/routerCommand'; import RouteDetail from './dialog/routeDetail'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; - +import {menuOperate, commitOperate} from './utils/menuOperate'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import { mapGetters } from 'vuex'; @@ -274,256 +274,92 @@ export default { this.$refs.noticeInfo.doShow(step); }); }, + // 获取进路列表 + getRouteList(selectType) { + const routes = []; + this.routeList.forEach(elem => { + if (elem.startSignalCode === selectType.code) { + routes.push(elem); + } + }); + return routes; + }, // 排列进路 arrangementRoute() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Signal.arrangementRoute.menu.operation, - param: { - signalCode: this.selected.code - } - }; - - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - if (valid) { - const routes = []; - this.routeList.forEach(elem => { - if (elem.startSignalCode === this.selected.code) { - routes.push(elem); - } - }); - this.$refs.routeSelection.doShow(step.operation, this.selected, routes); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); + commitOperate(menuOperate.Signal.arrangementRoute, {signalCode:this.selected.code}, 0).then((data)=>{ + this.$refs.routeSelection.doShow(data.operate, this.selected, this.getRouteList(this.selected)); }); }, // 取消进路 cancelTrainRoute() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Signal.cancelTrainRoute.menu.operation, - param: { - signalCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - if (valid) { - this.$refs.routeControl.doShow(operate, this.selected); - } + commitOperate(menuOperate.Signal.cancelTrainRoute, {signalCode:this.selected.code}, 0).then((data)=>{ + this.$refs.routeControl.doShow(data.operate, this.selected); }); }, // 信号封锁 lock() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Signal.lock.menu.operation, - param: { - signalCode: this.selected.code - } - }; - - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeLock.doShow(operate.operation, this.selected); - } - }).catch((error) => { - console.log(error); - this.$refs.noticeInfo.doShow(operate); + commitOperate(menuOperate.Signal.lock, {signalCode:this.selected.code}, 0).then((data)=>{ + this.$refs.routeLock.doShow(data.operate, this.selected); }); }, - // 信号解封 + // unlock() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Signal.unlock.menu.operation, - param: { - signalCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeUnLock.doShow(operate, this.selected); - } + commitOperate(menuOperate.Signal.unlock, {signalCode:this.selected.code}, 0).then((data)=>{ + this.$refs.routeUnLock.doShow(data.operate, this.selected); }); }, // 信号重开 reopenSignal() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Signal.reopenSignal.menu.operation, - param: { - signalCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeControl.doShow(operate, this.selected); - } + commitOperate(menuOperate.Signal.reopenSignal, {signalCode:this.selected.code}, 0).then((data)=>{ + this.$refs.routeControl.doShow(data.operate, this.selected); }); }, // 信号关灯 signalClose() { - const operate = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Signal.signalClose.menu.operation, - param: { - signalCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeControl.doShow(operate, this.selected); - } + commitOperate(menuOperate.Signal.signalClose, {signalCode:this.selected.code}, 0).then((data)=>{ + this.$refs.routeControl.doShow(data.operate, this.selected); }); }, // 进路交人工控 humanControl() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Signal.humanControl.menu.operation, - param: { - signalCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - const routes = []; - this.routeList.forEach(elem => { - if (elem.startSignalCode === this.selected.code) { - routes.push(elem); - } - }); - this.$refs.routeHandControl.doShow(operate, this.selected, routes); - } + commitOperate(menuOperate.Signal.humanControl, {signalCode:this.selected.code}, 0).then((data)=>{ + this.$refs.routeHandControl.doShow(data.operate, this.selected, this.getRouteList(this.selected)); }); }, // 进路交自动控 atsAutoControl() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Signal.atsAutoControl.menu.operation, - param: { - signalCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - const routes = []; - this.routeList.forEach(elem => { - if (elem.startSignalCode === this.selected.code) { - routes.push(elem); - } - }); - this.$refs.routeHandControl.doShow(operate, this.selected, routes); - } + commitOperate(menuOperate.Signal.atsAutoControl, {signalCode:this.selected.code}, 0).then((data)=>{ + this.$refs.routeHandControl.doShow(data.operate, this.selected, this.getRouteList(this.selected)); }); }, // 设置通过模式 singalPassModel() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Signal.setAutoInterlock.menu.operation, - param: { - signalCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeControl.doShow(operate, this.selected); - } + commitOperate(menuOperate.Signal.setAutoInterlock, {signalCode:this.selected.code}, 0).then((data)=>{ + this.$refs.routeControl.doShow(data.operate, this.selected); }); }, // 取消通过模式 singalCancelPassModel() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation, - param: { - signalCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeControl.doShow(operate, this.selected); - } + commitOperate(menuOperate.Signal.cancelAutoInterlock, {signalCode:this.selected.code}, 0).then((data)=>{ + this.$refs.routeControl.doShow(data.operate, this.selected); }); }, // 查询进路状态 detail() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Signal.detail.menu.operation, - param: { - signalCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - const routes = []; - this.routeList.forEach(elem => { - if (elem.startSignalCode === this.selected.code) { - routes.push(elem); - } - }); - this.$refs.routeDetail.doShow(step, this.selected, routes); - } + commitOperate(menuOperate.Signal.detail, {signalCode:this.selected.code}, 0).then((data)=>{ + this.$refs.routeDetail.doShow(data.operate, this.selected, this.getRouteList(this.selected)); }); }, // 人工解锁进路(信号机取消引导) humanTrainRoute() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Signal.cancelGuide.menu.operation, - param: { - signalCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routerCommand.doShow(step, this.selected, '是否执行人解列车进路命令?'); - } + commitOperate(menuOperate.Signal.cancelGuide, {signalCode:this.selected.code}, 0).then((data)=>{ + this.$refs.routerCommand.doShow(data.operate, this.selected, '是否执行人解列车进路命令?'); }); }, // 进路引导 guide() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Signal.guide.menu.operation, - param: { - signalCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routerCommand.doShow(step, this.selected, '是否执行引导命令'); - } + commitOperate(menuOperate.Signal.guide, {signalCode:this.selected.code}, 0).then((data)=>{ + this.$refs.routerCommand.doShow(data.operate, this.selected, '是否执行引导命令?'); }); } } diff --git a/src/jmapNew/theme/ningbo_01/menus/menuStationStand.vue b/src/jmapNew/theme/ningbo_01/menus/menuStationStand.vue index a104fb3b6..a1be973ac 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuStationStand.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuStationStand.vue @@ -22,7 +22,7 @@ import StandRunLevel from './dialog/standRunLevel'; import StandStopTime from './dialog/standStopTime'; import StandBulkBuckleTrain from './dialog/standBulkBuckleTrain'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; - +import {menuOperate, commitOperate} from './utils/menuOperate'; // import Handler from '@/scripts/cmdPlugin/Handler'; import { mapGetters } from 'vuex'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; @@ -244,218 +244,74 @@ export default { }, // 设置扣车 setDetainTrain() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.StationStand.setDetainTrain.menu.operation, - param: { - standCode: `${this.selected.code}` - } - }; - - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(step, this.selected); - } + commitOperate(menuOperate.StationStand.setDetainTrain, {standCode:this.selected.code}, 0).then((data)=>{ + this.$refs.standControl.doShow(data.operate, this.selected); }); }, // 取消扣车 cancelDetainTrain() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation, - param: { - standCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(step, this.selected); - } + commitOperate(menuOperate.StationStand.cancelDetainTrain, {standCode:this.selected.code}, 0).then((data)=>{ + this.$refs.standControl.doShow(data.operate, this.selected); }); }, // 区间列车数量限制 setDetainTrainAll() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.StationStand.setDetainTrainAuto.menu.operation, - param: { - standCode: `${this.selected.code}` - } - }; - - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(step, this.selected); - } + commitOperate(menuOperate.StationStand.setDetainTrainAuto, {standCode:this.selected.code}, 0).then((data)=>{ + this.$refs.standControl.doShow(data.operate, this.selected); }); }, // 取消区间列车数量限制 cancelDetainTrainAll() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.StationStand.cancelDetainTrainAuto.menu.operation, - param: { - standCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(step, this.selected); - } + commitOperate(menuOperate.StationStand.cancelDetainTrainAuto, {standCode:this.selected.code}, 0).then((data)=>{ + this.$refs.standControl.doShow(data.operate, this.selected); }); }, // 批量扣车 setBulkBuckleTrain() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.StationStand.setBulkBuckleTrain.menu.operation - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standBulkBuckleTrain.doShow(step, this.selected); - } + commitOperate(menuOperate.StationStand.setBulkBuckleTrain, {}, 0).then((data)=>{ + this.$refs.standBulkBuckleTrain.doShow(data.operate, this.selected); }); }, // 批量取消扣车 cancelBulkBuckleTrain() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.StationStand.cancelBulkBuckleTrain.menu.operation - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standBulkBuckleTrain.doShow(step, this.selected); - } + commitOperate(menuOperate.StationStand.cancelBulkBuckleTrain, {}, 0).then((data)=>{ + this.$refs.standBulkBuckleTrain.doShow(data.operate, this.selected); }); }, // 设置跳停 setJumpStop() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.StationStand.setJumpStop.menu.operation, - param: { - standCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standJumpStopControl.doShow(step, this.selected); - } + commitOperate(menuOperate.StationStand.setJumpStop, {standCode:this.selected.code}, 0).then((data)=>{ + this.$refs.standJumpStopControl.doShow(data.operate, this.selected); }); }, // 取消跳停 cancelJumpStop() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.StationStand.cancelJumpStop.menu.operation, - param: { - standCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standJumpStopControl.doShow(step, this.selected); - } + commitOperate(menuOperate.StationStand.cancelJumpStop, {standCode:this.selected.code}, 0).then((data)=>{ + this.$refs.standJumpStopControl.doShow(data.operate, this.selected); }); }, // 设置停站时间 setStopTime() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.StationStand.setStopTime.menu.operation, - param: { - standCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - // Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {standCode: `${this.selected.code}`}).then(resp => { - // const tempData = resp.data; - const tempData = []; - this.$refs.standStopTime.doShow(step, this.selected, tempData); - // }); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); + commitOperate(menuOperate.StationStand.setStopTime, {standCode:this.selected.code}, 0).then((data)=>{ + this.$refs.standStopTime.doShow(data.operate, this.selected, []); }); }, // 设置运行等级 setRunLevel() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.StationStand.setRunLevel.menu.operation, - param: { - standCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - // Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {standCode: `${this.selected.code}`}).then(resp => { - // const tempData = resp.data; - const tempData = []; - this.$refs.standRunLevel.doShow(step, this.selected, tempData); - // }); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); + commitOperate(menuOperate.StationStand.setRunLevel, {standCode:this.selected.code}, 0).then((data)=>{ + this.$refs.standRunLevel.doShow(data.operate, this.selected, []); }); }, // 设置提前发车 earlyDeparture() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.StationStand.earlyDeparture.menu.operation, - param: { - standCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(step, this.selected); - } + commitOperate(menuOperate.StationStand.earlyDeparture, {standCode:this.selected.code}, 0).then((data)=>{ + this.$refs.standControl.doShow(data.operate, this.selected, []); }); }, // 查询站台状态 detail() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.StationStand.detail.menu.operation, - param: {} - }; - this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - // Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {standCode: `${this.selected.code}`}).then(resp => { - // const tempData = resp.data; - const tempData = []; - this.$refs.standDetail.doShow(step, this.selected, tempData); - // }); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); + commitOperate(menuOperate.StationStand.detail, {standCode:this.selected.code}, 0).then((data)=>{ + this.$refs.standDetail.doShow(data.operate, this.selected, []); }); } } diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue index 6a2b247a9..61a60cf34 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue @@ -22,6 +22,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import {menuOperate, commitOperate} from './utils/menuOperate'; export default { name: 'SwitchMenu', @@ -89,7 +90,7 @@ export default { cmdType: CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN }, { - type: 'separator' + type: 'separator' }, { label: '区段激活', @@ -102,8 +103,8 @@ export default { cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF }, { - type: 'separator' - }, + type: 'separator' + }, { label: '确认计轴有效', handler: this.alxeEffective, @@ -115,7 +116,7 @@ export default { cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED }, { - type: 'separator' + type: 'separator' }, { label: '查看公里标', @@ -229,172 +230,62 @@ export default { }, // 单操到定位 locate() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Switch.locate.menu.operation, - param: { - switchCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); - } + commitOperate(menuOperate.Switch.locate, {switchCode:this.selected.code}, 0).then((data)=>{ + this.$refs.switchControl.doShow(data.operate, this.selected); }); }, // 单操到反位 reverse() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Switch.reverse.menu.operation, - param: { - switchCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); - } + commitOperate(menuOperate.Switch.reverse, {switchCode:this.selected.code}, 0).then((data)=>{ + this.$refs.switchControl.doShow(data.operate, this.selected); }); }, // 道岔单锁 lock() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Switch.lock.menu.operation, - param: { - switchCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); - } + commitOperate(menuOperate.Switch.lock, {switchCode:this.selected.code}, 0).then((data)=>{ + this.$refs.switchControl.doShow(data.operate, this.selected); }); }, // 道岔解锁 unlock() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Switch.unlock.menu.operation, - param: { - switchCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchUnLock.doShow(operate, this.selected); - } + commitOperate(menuOperate.Switch.unlock, {switchCode:this.selected.code}, 0).then((data)=>{ + this.$refs.switchUnLock.doShow(data.operate, this.selected); }); }, // 道岔封锁 block() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Switch.block.menu.operation, - param: { - switchCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); - } + commitOperate(menuOperate.Switch.block, {switchCode:this.selected.code}, 0).then((data)=>{ + this.$refs.switchControl.doShow(data.operate, this.selected); }); }, // 道岔解封 unblock() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Switch.unblock.menu.operation, - param: { - switchCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchUnLock.doShow(operate, this.selected); - } + commitOperate(menuOperate.Switch.unblock, {switchCode:this.selected.code}, 0).then((data)=>{ + this.$refs.switchUnLock.doShow(data.operate, this.selected); }); }, // 区段切除 split() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Switch.split.menu.operation, - param: { - switchCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); - } + commitOperate(menuOperate.Switch.split, {switchCode:this.selected.code}, 0).then((data)=>{ + this.$refs.switchControl.doShow(data.operate, this.selected); }); }, // 区段激活 active() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Switch.active.menu.operation, - param: { - switchCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); - } + commitOperate(menuOperate.Switch.active, {switchCode:this.selected.code}, 0).then((data)=>{ + this.$refs.switchControl.doShow(data.operate, this.selected); }); }, // 设置临时限速 setSpeed() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Switch.setSpeed.menu.operation, - param: { - switchCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.speedLimitControl.doShow(operate, this.selected); - } + commitOperate(menuOperate.Switch.setSpeed, {switchCode:this.selected.code}, 0).then((data)=>{ + this.$refs.speedLimitControl.doShow(data.operate, this.selected); }); }, // 确认计轴有效 alxeEffective() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Switch.alxeEffective.menu.operation, - param: { - switchCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.alxeEffective.doShow(operate, this.selected); - } + commitOperate(menuOperate.Switch.alxeEffective, {switchCode:this.selected.code}, 0).then((data)=>{ + this.$refs.alxeEffective.doShow(data.operate, this.selected); }); }, undeveloped() { diff --git a/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js b/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js new file mode 100644 index 000000000..b7c73bb05 --- /dev/null +++ b/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js @@ -0,0 +1,279 @@ +import store from '@/store'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; + +// 操作 +export const menuOperate = { + Section:{ + alxeFailure:{ + // 设置计轴失效 + operation: OperationEvent.Section.alxeFailure.menu.operation, + // cmdType 值有问题 + cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + }, + active:{ + // 区段激活 + operation: OperationEvent.Section.active.menu.operation, + cmdType: CMD.Section.CMD_SECTION_ACTIVE + }, + alxeEffective:{ + // 确认计轴有效 + operation: OperationEvent.Section.alxeEffective.menu.operation, + cmdType: CMD.Section.CMD_SECTION_COMFIRMATION_AXLE + }, + split:{ + // 区段切除 + operation: OperationEvent.Section.split.menu.operation, + cmdType: CMD.Section.CMD_SECTION_CUT_OFF + }, + lock:{ + // 区段封锁 + operation: OperationEvent.Section.lock.menu.operation, + cmdType: CMD.Section.CMD_SECTION_BLOCK + }, + unlock:{ + // 区段解锁 + operation: OperationEvent.Section.unlock.menu.operation, + cmdType: CMD.Section.CMD_SECTION_UNBLOCK + }, + setSpeed:{ + // 设置速度 + operation: OperationEvent.Section.setSpeed.menu.operation, + cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED + }, + fault:{ + // 区段故障解锁 + operation: OperationEvent.Section.fault.menu.operation, + cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK + } + }, + Signal:{ + arrangementRoute:{ + // 排列进路 + operation: OperationEvent.Signal.arrangementRoute.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE + }, + cancelTrainRoute:{ + // 取消进路 + operation: OperationEvent.Signal.cancelTrainRoute.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE + }, + lock:{ + // 信号封锁 + operation:OperationEvent.Signal.lock.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_BLOCK + }, + unlock:{ + // 信号解封 + operation: OperationEvent.Signal.unlock.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK + }, + guide:{ + // 进路引导 + operation: OperationEvent.Signal.guide.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE + }, + reopenSignal:{ + // 信号重开 + operation: OperationEvent.Signal.reopenSignal.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL + }, + signalClose:{ + // 信号关灯 + operation: OperationEvent.Signal.signalClose.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL + }, + humanControl:{ + // 进路交人工控 + operation: OperationEvent.Signal.humanControl.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING + }, + atsAutoControl:{ + // 进路交自动控 + operation: OperationEvent.Signal.atsAutoControl.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING + }, + setAutoInterlock:{ + // 设置通过模式 + operation: OperationEvent.Signal.setAutoInterlock.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO + }, + cancelAutoInterlock:{ + // 取消通过模式 + operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO + }, + detail:{ + // 查询进路状态 + operation: OperationEvent.Signal.detail.menu.operation + }, + cancelGuide:{ + // 人工解锁进路(信号机取消引导) + operation: OperationEvent.Signal.cancelGuide.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE + } + }, + Switch:{ + lock:{ + // 道岔单锁 + operation: OperationEvent.Switch.lock.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK + }, + unlock:{ + // 道岔解锁 + operation: OperationEvent.Switch.unlock.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK + }, + block:{ + // 道岔封锁 + operation: OperationEvent.Switch.block.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_BLOCK + }, + unblock:{ + // 道岔解封 + operation: OperationEvent.Switch.unblock.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK + }, + locate:{ + // 单操到定位 + operation: OperationEvent.Switch.locate.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION + }, + reverse:{ + // 单操到反位 + operation: OperationEvent.Switch.reverse.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION + }, + split:{ + // 区段切除 + operation: OperationEvent.Switch.split.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF + }, + active:{ + // 区段激活 + operation: OperationEvent.Switch.active.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_ACTIVE + }, + setSpeed:{ + // 设置临时限速 + operation: OperationEvent.Switch.setSpeed.menu.operation, + cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED + }, + alxeEffective:{ + // 确认计轴有效 + operation: OperationEvent.Switch.alxeEffective.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE + } + }, + StationStand:{ + setDetainTrain:{ + // 设置扣车 + operation: OperationEvent.StationStand.setDetainTrain.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN + }, + cancelDetainTrain:{ + // 取消扣车 + operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation, + cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN + }, + setDetainTrainAuto:{ + // 区间列车数量限制 + operation: OperationEvent.StationStand.setDetainTrainAuto.menu.operation, + cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_AUTO + }, + cancelDetainTrainAuto:{ + // 取消区间列车数量限制 + operation: OperationEvent.StationStand.cancelDetainTrainAuto.menu.operation, + cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_AUTO + }, + setBulkBuckleTrain:{ + // 批量扣车 + operation: OperationEvent.StationStand.setBulkBuckleTrain.menu.operation, + cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_ALL + }, + cancelBulkBuckleTrain:{ + // 批量取消扣车 + operation: OperationEvent.StationStand.cancelBulkBuckleTrain.menu.operation, + cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_ALL + }, + setJumpStop:{ + // 设置跳停 + operation: OperationEvent.StationStand.setJumpStop.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP + }, + cancelJumpStop:{ + // 取消跳停 + operation: OperationEvent.StationStand.cancelJumpStop.menu.operation, + cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP + }, + setStopTime:{ + // 停站时间控制 + operation: OperationEvent.StationStand.setStopTime.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME + }, + setRunLevel:{ + // 运行时间控制 + operation: OperationEvent.StationStand.setRunLevel.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME + }, + earlyDeparture:{ + // 设置提前发车 + operation: OperationEvent.StationStand.earlyDeparture.menu.operation, + cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART + }, + setBackStrategy:{ + // 设置折返策略 + operation: OperationEvent.StationStand.setBackStrategy.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY + }, + detail:{ + // 查询站台状态 + operation: OperationEvent.StationStand.detail.menu.operation + } + } + // StationControl:{ + // requestCentralControl:{ + // // 请求中控(遥控) + // operation: OperationEvent.StationControl.requestCentralControl.menu.operation, + // cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL + // }, + // requestStationControl:{ + // // 请求站控 + // operation: OperationEvent.StationControl.requestStationControl.menu.operation, + // cmdType:CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL + // }, + // emergencyStationControl:{ + // // 紧急站控 + // operation: OperationEvent.StationControl.emergencyStationControl.menu.operation, + // cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL + // } + + // } +}; + +export function commitOperate(operate, paramList, over) { + const step = { + start: true, + operation: operate.operation, + param:{} + }; + step.param = paramList; + // over 0为首次操作,1为中间操作,2为最后操作,3为直接一次性操作 + if (over != 0 && over != 3) { + delete step.start; + } + if (over == 2 || over == 3) { + step.over = true; + step.cmdType = operate.cmdType; + } + return new Promise(function(resolve, reject) { + store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + store.dispatch('menuOperation/handleBreakFlag', { break: true }); + resolve({operate:step}); + } + }).catch(error=>{ + reject(error); + }); + }); +} diff --git a/src/scripts/ConstConfig.js b/src/scripts/ConstConfig.js index 427ecf9c7..d65f84bd0 100644 --- a/src/scripts/ConstConfig.js +++ b/src/scripts/ConstConfig.js @@ -148,6 +148,5 @@ export default { { enlabel: 'Dispatch workstation', label: '派班工作站', value: '05'}, { enlabel: 'ISCS workstation', label: 'ISCS工作站', value: '06'} ] - } }; diff --git a/src/scripts/translate.js b/src/scripts/translate.js index 8019f2ce7..f9f46434c 100644 --- a/src/scripts/translate.js +++ b/src/scripts/translate.js @@ -231,7 +231,7 @@ export const translate = { { key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } }, { key: 'namePosition', tHeader: '名称坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } }, // { key: 'nameShow', tHeader: '名称是否显示', formatter: (val) => { return val || false; } }, - { key: 'axleShow', tHeader: '是否显示计轴器', formatter: (val) => { return val || false; } }, + // { key: 'axleShow', tHeader: '是否显示计轴器', formatter: (val) => { return val || false; } }, { key: 'type', tHeader: '类型', formatter: (val) => { return val || ''; } }, { key: 'linkCode', tHeader: 'link编号', formatter: (val) => { return val || ''; } }, // { key: 'logicSectionNameShow', tHeader: '是否显示逻辑区段名称', formatter: (val) => { return val || false; } }, diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index 7fbc857b4..2b1950fd6 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -2,7 +2,7 @@ import store from '@/store'; import { Notification } from 'element-ui'; function handle(state, data) { - // console.log(data, 'socket订阅'); + console.log(data, 'socket订阅'); const msg = data.body; const path = window.location.href; switch (data.type) { @@ -24,11 +24,14 @@ function handle(state, data) { state.equipmentStatus = msg; break; case 'Simulation_RunFact': // 仿真-列车实际到发车站消息 - let runFactMsg = msg; - if (runFactMsg.constructor !== Array ) { - runFactMsg = [msg]; + // let runFactMsg = msg; + // if (runFactMsg.constructor !== Array ) { + // runFactMsg = [msg]; + // } + if (!Array.isArray(msg)) { + console.log([msg], '列车实际到发车站消息'); + state.trainStationList = [msg]; } - state.trainStationList = runFactMsg; break; case 'Simulation_Error': // 仿真-异常消息 state.simulationError = msg; @@ -37,7 +40,7 @@ function handle(state, data) { state.simulationStart = msg; break; case 'Simulation_Reset': // 仿真-仿真重置消息 退出计划行车 - state.simulationReset = msg; + state.simulationReset = 'reset'; break; case 'Simulation_Conversation': // 仿真-用户交互消息(聊天/命令) handleSimulationInfo(state, msg); diff --git a/src/views/demonstration/deomonTopic/index.vue b/src/views/demonstration/deomonTopic/index.vue index 3dd0888f7..66cec85b2 100644 --- a/src/views/demonstration/deomonTopic/index.vue +++ b/src/views/demonstration/deomonTopic/index.vue @@ -62,29 +62,32 @@ export default { this.loading = true; const rest = await getPublishMapInfo(this.mapId); const drawWay = rest.data.drawWay; + if (drawWay) { + await getjointTrainingNew(this.group); + } else { + await getjointTraining(this.group); + } if (this.state == '02') { launchFullscreen(); + const query = { lineCode: rest.data.lineCode, mapId: this.mapId, group: this.group, drawWay: drawWay }; if (drawWay) { await putJointTrainingSimulationEntranceNew(this.group); + this.$router.push({ path: `/jointTrainingNew`, query: query }); } else { await putJointTrainingSimulationEntrance(this.group); + this.$router.push({ path: `/jointTraining`, query: query }); } - const query = { lineCode: rest.data.lineCode, mapId: this.mapId, group: this.group, drawWay: drawWay }; - this.$router.push({ path: `/jointTraining`, query: query }); } else if (this.state == '01') { const query = { group: this.group, drawWay: drawWay }; this.$router.push({ path: `/trainroom`, query: query }); } this.dialogShow = false; - if (rest.drawWay) { - await getjointTrainingNew(this.group); - } else { - await getjointTraining(this.group); - } } catch (e) { + this.$messageBox(this.$t('tip.enterTrainingRoomFailed')); console.error(e); } finally { this.loading = false; + this.dialogShow = false; } } } diff --git a/src/views/demonstration/detail/index.vue b/src/views/demonstration/detail/index.vue index 93a10192d..64fe758e5 100644 --- a/src/views/demonstration/detail/index.vue +++ b/src/views/demonstration/detail/index.vue @@ -190,7 +190,7 @@ export default { }; let res = ''; if (this.drawWay) { - res = postCreateRoomNew(param); + res = await postCreateRoomNew(param); } else { res = await postCreateRoom(param); } diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 05621887e..4e90ba429 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -26,7 +26,7 @@
{{ $t('login.scanCodeLogin') }}
-
+
{{ $t('login.recommendedConfiguration') }} {{ $t('login.browser') }} @@ -203,6 +203,9 @@ export default { setTimeout(() => { this.tipsMsg = ''; }, 5000); }); } + if (this.project === 'hyd') { + this.bgImg = ''; + } }, mounted() { document.title = loginInfo[this.project].title; @@ -342,6 +345,7 @@ export default { $light_gray:#eee; .login-container { + background: #E4EAEA; .el-form-item{ background: #fff !important; border: 1px solid rgba(0, 0, 0, 0.1) !important; diff --git a/src/views/mapdraft/mapoperate/section.vue b/src/views/mapdraft/mapoperate/section.vue index 54cbd3ed0..b1f2ad1bb 100644 --- a/src/views/mapdraft/mapoperate/section.vue +++ b/src/views/mapdraft/mapoperate/section.vue @@ -225,7 +225,6 @@ export default { rightStopPointOffset: 0, // 右向停车点偏移量 destinationCode: '', // 目的地码 destinationCodePoint: { x: 0, y: 0 }, // 目的地码坐标 - axleShow: false, namePosition: { x: 0, y: 0 }, kmRangeRight: 0, kmRangeLeft: 0, @@ -664,7 +663,6 @@ export default { code: getUID('Section'), name: String.fromCharCode(index + 'A'.charCodeAt()), parentCode: model.code, - axleShow: false, type: '02', namePosition: { x: 0, y: 0 }, isStandTrack: false, @@ -809,7 +807,6 @@ export default { code: uid, name: uname, type: '01', - axleShow: false, isStandTrack: false, standTrackName: '', standTrackNamePosition: { x: 0, y: 0 }, @@ -979,7 +976,6 @@ export default { name: `${selected.name}_${index}`, type: '01', parentCode: '', - axleShow: selected.axleShow, isStandTrack: false, kmRangeRight: '', kmRangeLeft: '', @@ -1084,7 +1080,6 @@ export default { models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](rsection.code), { _dispose: true })); if (lsection.points[lsection.points.length - 1].x == rsection.points[0].x && lsection.points[lsection.points.length - 1].y == rsection.points[0].y) { - model.axleShow = lsection.axleShow; model.logicSectionNum = lsection.logicSectionNum; model.logicSectionShow = lsection.logicSectionShow; model.trainPosType = lsection.trainPosType; @@ -1104,7 +1099,6 @@ export default { this.$emit('updateMapModel', models); } if (lsection.points[0].x == rsection.points[rsection.points.length - 1].x && lsection.points[0].y == rsection.points[rsection.points.length - 1].y) { - model.axleShow = rsection.axleShow; model.logicSectionNum = rsection.logicSectionNum; model.logicSectionShow = rsection.logicSectionShow; model.trainPosType = rsection.trainPosType; diff --git a/src/views/mapdraft/mapoperate/switch.vue b/src/views/mapdraft/mapoperate/switch.vue index 0d2623e3a..c42a5f735 100644 --- a/src/views/mapdraft/mapoperate/switch.vue +++ b/src/views/mapdraft/mapoperate/switch.vue @@ -432,7 +432,6 @@ export default { code: uid, name: sectiona.name || sectionb.name || sectionc.name, type: '03', - axleShow: false, namePosition: point, isStandTrack: false, kmRangeRight: '', diff --git a/src/views/newMap/jlmapNew/index.vue b/src/views/newMap/jlmapNew/index.vue index 470ae0433..799737373 100644 --- a/src/views/newMap/jlmapNew/index.vue +++ b/src/views/newMap/jlmapNew/index.vue @@ -133,7 +133,7 @@ export default { $route() { this.mapViewLoaded(true); }, - '$store.training.state.prdType': function (val) { + '$store.state.training.prdType': function (val) { this.changePrdType(val); } }, @@ -349,7 +349,7 @@ export default { }, // 综合演练切换现地行调模式 changePrdType(val) { - const nameList = Object.keys(this.$store.state.map.map); + const nameList = Object.keys(this.$store.state.map.map || {}); let list = []; nameList.forEach(item => { if (item !== 'skinVO') { diff --git a/src/views/newMap/jointTrainingNew/menuDemon.vue b/src/views/newMap/jointTrainingNew/menuDemon.vue index 097c81ccb..edaeecd7c 100644 --- a/src/views/newMap/jointTrainingNew/menuDemon.vue +++ b/src/views/newMap/jointTrainingNew/menuDemon.vue @@ -20,7 +20,7 @@