diff --git a/src/api/chat.js b/src/api/chat.js index 1b9c88513..7b493411a 100644 --- a/src/api/chat.js +++ b/src/api/chat.js @@ -49,7 +49,7 @@ export function chatWithText(data, group) { }); } -// 文字聊天 发送文字 +// 文字聊天 发送语音 export function chatWithAudio(file, group) { return request({ url: `/api/jointTraining/chatWithAudio?group=${group}`, @@ -58,6 +58,15 @@ export function chatWithAudio(file, group) { }); } +// 文字聊天 发送语音(新版) +export function chatWithAudioNew(file, group) { + return request({ + url: `/api/v1/jointTraining/chatWithAudio?group=${group}`, + method: 'post', + data: file + }); +} + // 生成分发二维码 export function getJoinTrainCode(data, group) { return request({ diff --git a/src/api/designPlatform.js b/src/api/designPlatform.js index 3d7eb400a..861d4fe60 100644 --- a/src/api/designPlatform.js +++ b/src/api/designPlatform.js @@ -142,7 +142,7 @@ export function loadDraftScript(scriptId, memberId, group) { /** 剧本预览选择角色 */ export function loadDraftScriptNew(memberId, group) { return request({ - url: `/simulation/${group}/${memberId}`, + url: `/simulation/${group}/choosePlay?memberId=${memberId}`, method: 'put' }); } diff --git a/src/api/script.js b/src/api/script.js index 9524987be..19264af82 100644 --- a/src/api/script.js +++ b/src/api/script.js @@ -10,6 +10,15 @@ export function getScriptPageListOnline(params) { }); } +/** 分页查找上线的剧本(新版)*/ +export function getScriptPageListOnlineNew(params) { + return request({ + url: `/api/scirpt/v1/paging/online`, + method: 'get', + params: params + }); +} + /** 通过ID查询发布的剧本的详细信息 */ export function getScriptById(id) { return request({ @@ -17,6 +26,15 @@ export function getScriptById(id) { method: 'get' }); } + +/** 通过ID查询发布的剧本的详细信息(新版) */ +export function getScriptByIdNew(id) { + return request({ + url: `/api/scirpt/v1/${id}/detail`, + method: 'get' + }); +} + /** 通过group查询未发布剧本的详细信息 */ export function getDraftScriptByGroup(group) { return request({ diff --git a/src/api/simulation.js b/src/api/simulation.js index af6e69e51..43bfb7ad1 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -285,6 +285,14 @@ export function selectScriptMembers(group, data) { }); } +/** 剧本开始执行(新版) */ +export function scriptExecuteNew(group) { + return request({ + url: `/api/scriptExecute/${group}`, + method: 'put' + }); +} + /** 选择剧本演出成员角色 (新版地图)*/ export function selectScriptMembersNew(group, data) { return request({ diff --git a/src/jmapNew/config/skinCode/bejing_01.js b/src/jmapNew/config/skinCode/bejing_01.js index 7b58a90c4..b894c34d1 100644 --- a/src/jmapNew/config/skinCode/bejing_01.js +++ b/src/jmapNew/config/skinCode/bejing_01.js @@ -597,7 +597,8 @@ class SkinCode extends defaultStyle { trainHeadTriangleThird: { x: 7, y: 19 }, // 列车车头三角坐标3偏移量 trainHeadRectHeight: 20, // 列车车头矩形高度 trainConntWidth: 3, // 列车竖杠的宽度 - trainHeadFillColor: '#000000'// 列车车头矩形填充颜色 + trainHeadFillColor: '#000000', // 列车车头矩形填充颜色 + directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 }, common: { trainHeight: 20, // 列车高度 diff --git a/src/jmapNew/config/skinCode/chengdu_01.js b/src/jmapNew/config/skinCode/chengdu_01.js index 9505ece98..105148ae5 100644 --- a/src/jmapNew/config/skinCode/chengdu_01.js +++ b/src/jmapNew/config/skinCode/chengdu_01.js @@ -540,7 +540,8 @@ class SkinCode extends defaultStyle { trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量 trainConntWidth: 4, // 列车竖杠的宽度 trainHeadFillColor: '#000000', // 列车车头矩形填充颜色 - trainHeadRectHeight: 20 // 列车车头矩形高度 + trainHeadRectHeight: 20, // 列车车头矩形高度 + directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 }, common: { trainHeight: 20, // 列车高度 diff --git a/src/jmapNew/config/skinCode/chengdu_03.js b/src/jmapNew/config/skinCode/chengdu_03.js index 6c7e90c45..b74e40bd9 100644 --- a/src/jmapNew/config/skinCode/chengdu_03.js +++ b/src/jmapNew/config/skinCode/chengdu_03.js @@ -717,7 +717,8 @@ class SkinCode extends defaultStyle { trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量 trainConntWidth: 3, // 列车竖杠的宽度 trainHeadFillColor: '#000000', // 列车车头矩形填充颜色 - trainHeadRectHeight: 20 // 列车车头矩形高度 + trainHeadRectHeight: 20, // 列车车头矩形高度 + directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 }, common: { trainHeight: 20, // 列车高度 diff --git a/src/jmapNew/config/skinCode/foshan_01.js b/src/jmapNew/config/skinCode/foshan_01.js index aef8b7fbb..0465d732a 100644 --- a/src/jmapNew/config/skinCode/foshan_01.js +++ b/src/jmapNew/config/skinCode/foshan_01.js @@ -574,7 +574,8 @@ class SkinCode extends defaultStyle { trainHeadTriangleThird: { x: 0, y: 18}, // 列车车头三角坐标3偏移量 trainHeadRectHeight: 18, // 列车车头矩形高度 trainConntWidth: 5, // 列车竖杠的宽度 - trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色 + trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色 + directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 }, common: { useSelfFormat: true, diff --git a/src/jmapNew/config/skinCode/fuzhou_01.js b/src/jmapNew/config/skinCode/fuzhou_01.js index 367ee37be..02bc12167 100644 --- a/src/jmapNew/config/skinCode/fuzhou_01.js +++ b/src/jmapNew/config/skinCode/fuzhou_01.js @@ -413,7 +413,6 @@ class SkinCode extends defaultStyle { block: false // 封锁显示 } }; - this[deviceType.Line] = { lineColor: '#FFFFFF' // 线条颜色 }; @@ -567,7 +566,8 @@ class SkinCode extends defaultStyle { trainHeadTriangleThird: { x: 0, y: 15}, // 列车车头三角坐标3偏移量 trainHeadRectHeight: 15, // 列车车头矩形高度 trainConntWidth: 4, // 列车竖杠的宽度 - trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色 + trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色 + directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 }, common: { trainHeight: 17, // 列车高度 @@ -613,18 +613,18 @@ class SkinCode extends defaultStyle { } ], // 运行方向状态类型对应车头显示状态 1从左往右 0从右往左 directionStopType: [ - { - type: 1, - lineLShow: false, - lineRShow: true - }, - { - type: 0, - lineLShow: true, - lineRShow: false - } + { + type: 1, + lineLShow: false, + lineRShow: true + }, + { + type: 0, + lineLShow: true, + lineRShow: false + } - ], // 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行 + ], // 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行 driveModeStatus: [ { status: 'AM', diff --git a/src/jmapNew/config/skinCode/haerbin_01.js b/src/jmapNew/config/skinCode/haerbin_01.js index e70790ae5..25fce0178 100644 --- a/src/jmapNew/config/skinCode/haerbin_01.js +++ b/src/jmapNew/config/skinCode/haerbin_01.js @@ -618,7 +618,8 @@ class SkinCode extends defaultStyle { trainHeadTriangleThird: { x: 0, y: 15 }, // 列车车头三角坐标3偏移量 trainHeadRectHeight: 15, // 列车车头矩形高度 trainConntWidth: 0, // 列车竖杠的宽度 - trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色 + trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色 + directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 }, common: { hasTravelSigns: true, // 是否有行进标志 diff --git a/src/jmapNew/config/skinCode/ningbo_01.js b/src/jmapNew/config/skinCode/ningbo_01.js index 2926891b8..940c09892 100644 --- a/src/jmapNew/config/skinCode/ningbo_01.js +++ b/src/jmapNew/config/skinCode/ningbo_01.js @@ -577,7 +577,8 @@ class SkinCode extends defaultStyle { trainHeadTriangleThird: { x: 4, y: 20}, // 列车车头三角坐标3偏移量 trainConntWidth: 2, // 列车竖杠的宽度 trainHeadFillColor: '#000000', // 列车车头矩形填充颜色 - trainHeadRectHeight: 20 // 列车车头矩形高度 + trainHeadRectHeight: 20, // 列车车头矩形高度 + directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 }, common: { trainHeight: 20, // 列车高度 diff --git a/src/jmapNew/config/skinCode/xian_01.js b/src/jmapNew/config/skinCode/xian_01.js index 148e0a159..022134b49 100644 --- a/src/jmapNew/config/skinCode/xian_01.js +++ b/src/jmapNew/config/skinCode/xian_01.js @@ -81,7 +81,7 @@ class SkinCode extends defaultStyle { textShadowColor: '#22DFDF', nameShow: false, lineDash: '', - lineWidthMore: 0 + lineWidthMore: 5 }, line: { width: 5, // 区段宽度 @@ -594,7 +594,8 @@ class SkinCode extends defaultStyle { trainHeadTriangleThird: { x: 0, y: 15}, // 列车车头三角坐标3偏移量 trainHeadRectHeight: 15, // 列车车头矩形高度 trainConntWidth: 4, // 列车竖杠的宽度 - trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色 + trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色 + directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 }, common: { trainHeight: 17, // 列车高度 diff --git a/src/jmapNew/config/skinCode/xian_02.js b/src/jmapNew/config/skinCode/xian_02.js index 6eb06b18b..8d9a50e62 100644 --- a/src/jmapNew/config/skinCode/xian_02.js +++ b/src/jmapNew/config/skinCode/xian_02.js @@ -88,7 +88,7 @@ class SkinCode extends defaultStyle { beyondWidth: 0, // 区段宽超出宽度 invadeColor: '#FFFFFF', // 区段侵入颜色 spareColor: '#AAA9A9', // 区段空闲颜色 - communicationOccupiedColor: '#FF00FF', // 区段通信车占用颜色 + communicationOccupiedColor: '#DE310C', // 区段通信车占用颜色 unCommunicationOccupiedColor: '#DE310C', // 区段非通讯车占用颜色 routeLockColor: '#52BD5F', // 区段进路锁定颜色 faultLockColor: '#006400', // 区段故障锁定颜色 @@ -105,13 +105,13 @@ class SkinCode extends defaultStyle { }, axle: { show: true, // 计轴是否显示 - radius: 5, // 计轴 半径 - distance: 5, // 计轴和区段之间的距离 (未用) + radius: 3, // 计轴 半径 + distance: 4, // 计轴和区段之间的距离 (未用) color: '#9F9C9C', // 区段计轴颜色 occupyColor: '#FF0000', // 区段计轴占用颜色 resetColor: '#00FFFF', // 区段计轴预复位颜色 Failure: '#E6A23C', // #FFFF00 计轴失效 - lineWidth: 3 + lineWidth: 2 }, speedLimit: { // 限速元素 width: 1, // 限速线的宽度 @@ -165,6 +165,7 @@ class SkinCode extends defaultStyle { }, lamp: { bgShow: false, // 是否被选中 + logicColor: true, // cbtc通信是否影响灯颜色 guidName: 'singleRY', // 默认引导类型 borderVariable: true, // 信号灯边框可变 stopWidth: 2, // 禁止线宽度 @@ -599,7 +600,7 @@ class SkinCode extends defaultStyle { rectWidth: 20, // 折返模块宽度 lineWidth: 3, // 折返模块线宽 fillColor: 'rgba(0,0,0,0)', // 填充色 - strokeColor: '#FFFFFF' // 线颜色 + strokeColor: '#9F9C9C' // 线颜色 }; this[deviceType.ModeStatusGroup] = { // 车站状态模式 displayCondition: '01', // 显示条件 (01所有模式下显示 02 行调显示 03现地显示) @@ -679,16 +680,18 @@ class SkinCode extends defaultStyle { textAContent: '警' // textA文本 }, trainNumber: { - targetCodePrefix: '000', // 目的地码前缀 - defaultTargetCode: 'DDD', // 默认目的地码 + targetCodePrefix: '00', // 目的地码前缀 + defaultTargetCode: 'DD', // 默认目的地码 trainTargetTextAlign: 'left', // 目的地码文字显示位置 - trainNumberOffset: { x: 24, y: 4}// 目的地码偏移量 + trainNumberOffset: { x: 24, y: 4}, // 目的地码偏移量 + fontColor: '#000000' }, trainServer: { serviceNumberPrefix: '000', // 服务号(表号)前缀 defaultServiceNumber: 'TTT', // 默认服务号(表号) defaultServerNoColor: '#FFFFFF', // 默认服务号状态显示颜色 - trainServerOffset: { x: 4, y: 4} // 列车服务号偏移 + trainServerOffset: { x: 4, y: 4}, // 列车服务号偏移 + fontColor: '#000000' }, trainTarget: { tripNumberPrefix: '000', // 车次号前缀 @@ -708,7 +711,8 @@ class SkinCode extends defaultStyle { trainHeadTriangleThird: { x: -1, y: 21}, // 列车车头三角坐标3偏移量 trainConntWidth: 0, // 列车竖杠的宽度 trainHeadFillColor: '#2AA32A', // 列车车头矩形填充颜色 - trainHeadRectHeight: 20 // 列车车头矩形高度 + trainHeadRectHeight: 20, // 列车车头矩形高度 + directionStopType:'special' // special 西安二号线 停车 列车方向图标不消失 normal 正常 }, common: { trainHeight: 20, // 列车高度 diff --git a/src/jmapNew/constant/deviceState.js b/src/jmapNew/constant/deviceState.js index 685b10874..fc28859b7 100644 --- a/src/jmapNew/constant/deviceState.js +++ b/src/jmapNew/constant/deviceState.js @@ -124,7 +124,6 @@ deviceState[deviceType.StationStand] = { assignSkip: 0, // 是否指定跳停 runLevelTime: 0, // 区间运行时间 自动为 0 parkingTime: 0, // 站台停车时间 自动为0 - doorOpen:0, // 车门开启 自动为0 (西安二号线样式 暂时后端没加该字段) // /** 折返策略*/ // reentryStrategy: { diff --git a/src/jmapNew/constant/stateTransition.js b/src/jmapNew/constant/stateTransition.js index 98178fda3..1acf8f664 100644 --- a/src/jmapNew/constant/stateTransition.js +++ b/src/jmapNew/constant/stateTransition.js @@ -24,8 +24,7 @@ class Status { assignSkip: device.assignSkip, // 是否指定跳停 runLevelTime: device.runLevelTime, // 区间运行时间 自动为 0 parkingTime: device.parkingTime, // 站台停车时间 自动为0 - fault: device.fault, /** 非故障*/ - doorOpen:device.doorOpen /** 车门开启 自动为0 (西安二号线样式 暂时后端没加该字段)*/ + fault: device.fault /** 非故障*/ }; } handleSection(device) { diff --git a/src/jmapNew/shape/Section/EMouse.js b/src/jmapNew/shape/Section/EMouse.js index 6b51b4889..03316ae93 100644 --- a/src/jmapNew/shape/Section/EMouse.js +++ b/src/jmapNew/shape/Section/EMouse.js @@ -93,9 +93,8 @@ class EMouse extends Group { this.lineBorder.hide(); } else { const model = this.device.model; - const arr = JSON.parse(JSON.stringify(model.points)); - arr.reverse(); - const points = []; + let points = []; + const pointsReverse = []; model.points.forEach((ele, index) => { let flag = false; if (index == model.points.length - 1) { @@ -103,11 +102,9 @@ class EMouse extends Group { } else { this.triangle = new JTriangle(ele, model.points[index + 1]); } - const directx = this.triangle.drictx; const directy = this.triangle.dricty; - const switchWidth = 5; // 超出宽度多少 if (index > 0) { - if (model.points[index - 1].y == ele.y) { + if (model.points[index - 1].y == ele.y || index < model.points.length - 1 && model.points[index + 1].y == ele.y) { flag = true; } } else { @@ -116,40 +113,22 @@ class EMouse extends Group { } } if (flag) { + const switchWidth = this.device.style.Section.mouseOverStyle.lineWidthMore; // 超出宽度多少 const param = [ele.x, ele.y + switchWidth]; points.push(param); + const param1 = [ele.x, ele.y - switchWidth]; + pointsReverse.unshift(param1); } else { - const param = [ele.x - directx * this.triangle.getAbsSin(switchWidth), ele.y + directy * this.triangle.getAbsCos(switchWidth)]; + const switchWidth = this.device.style.Section.mouseOverStyle.lineWidthMore + 3; + const T = this.triangle.getAbsCos(switchWidth); + const param = [ele.x - directy * this.triangle.getAbsSin(T), ele.y + this.triangle.getAbsCos(T)]; points.push(param); + const param1 = [ele.x + directy * this.triangle.getAbsSin(T), ele.y - this.triangle.getAbsCos(T)]; + pointsReverse.unshift(param1); } + }); - model.points.forEach((ele, index) => { - let flag = false; - if (index == model.points.length - 1) { - this.triangle = new JTriangle(model.points[index - 1], ele); - } else { - this.triangle = new JTriangle(ele, model.points[index + 1]); - } - const directx = this.triangle.drictx; - const directy = this.triangle.dricty; - const switchWidth = 5; // 超出宽度多少 - if (index > 0) { - if (model.points[index - 1].y == ele.y) { - flag = true; - } - } else { - if (model.points[index + 1].y == ele.y) { - flag = true; - } - } - if (flag) { - const param = [ele.x, ele.y - switchWidth]; - points.unshift(param); - } else { - const param = [ele.x + directx * this.triangle.getAbsSin(switchWidth), ele.y - directy * this.triangle.getAbsCos(switchWidth)]; - points.unshift(param); - } - }); + points = points.concat(pointsReverse); this.lineBorder = new Polygon({ zlevel: this.device.zlevel, z: this.device.z + 10, diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index 0a3fb9872..737f8fa92 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -48,6 +48,11 @@ export default class Section extends Group { const traingleStart = new JTriangle(this.model.points[0], this.model.points[1]); const traingleEnd = new JTriangle(this.model.points[length - 2], this.model.points[length - 1]); if (this.model.leftAxlePosition) { + const leftPoint = {x:this.model.points[0].x, y: this.model.points[0].y}; + if (this.model.leftAxleOffset) { + leftPoint.x = leftPoint.x + this.model.leftAxleOffset.x || 0; + leftPoint.y = leftPoint.y + this.model.leftAxleOffset.y || 0; + } this.leftAxle = new EAxle({ _subType: 'leftAxle', zlevel: this.zlevel, @@ -58,7 +63,7 @@ export default class Section extends Group { drictx: 1, dricty: this.model.leftAxlePosition === 1 || this.model.leftAxlePosition === 2 ? 1 : -1, isSpecial: this.model.leftAxlePosition === -2 || this.model.leftAxlePosition === 2, - point: this.model.points[0], + point: leftPoint, difference: this.model.points[0].y - this.model.points[1].y, multiple: 1 }, @@ -71,6 +76,11 @@ export default class Section extends Group { this.add(this.leftAxle); } if (this.model.rightAxlePosition) { + const rightPoint = {x:this.model.points[length - 1].x, y: this.model.points[length - 1].y}; + if (this.model.rightAxleOffset) { + rightPoint.x = rightPoint.x + this.model.rightAxleOffset.x || 0; + rightPoint.y = rightPoint.y + this.model.rightAxleOffset.y || 0; + } this.rightAxle = new EAxle({ _subType: 'rightAxle', zlevel: this.zlevel, @@ -81,7 +91,7 @@ export default class Section extends Group { drictx: -1, dricty: this.model.rightAxlePosition === 1 || this.model.rightAxlePosition === 2 ? 1 : -1, isSpecial: this.model.rightAxlePosition === -2 || this.model.rightAxlePosition === 2, - point: this.model.points[length - 1], + point: rightPoint, difference: this.model.points[length - 2].y - this.model.points[length - 1].y, multiple1: -1 }, @@ -282,7 +292,6 @@ export default class Section extends Group { style: style }); this.add(this.section); - if (this.style.Section.block.special) { // 创建哈尔滨特殊区段(用作封锁显示) this.sectionBlock = new EblockLines({ zlevel: this.zlevel, @@ -381,20 +390,22 @@ export default class Section extends Group { 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 - }); + if ((model.type == '01' && (!model.logicSectionCodeList || !model.logicSectionCodeList.length)) || model.type == '02' || model.type == '03') { + 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); + this.add(this.release); + } } // 创建限速线 diff --git a/src/jmapNew/shape/Signal/index.js b/src/jmapNew/shape/Signal/index.js index 1b0f0875b..904575ab6 100644 --- a/src/jmapNew/shape/Signal/index.js +++ b/src/jmapNew/shape/Signal/index.js @@ -36,6 +36,7 @@ class Signal extends Group { y: 0 }; } + this.cbtcStatus = ''; this.create(); this.createMouseEvent(); this.transformRotation(this); @@ -314,39 +315,89 @@ class Signal extends Group { } // 关闭 - close() { - if (this.count == 2) { // 双灯 - this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor); - this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); - } else if (this.count == 1) { // 单灯 - if (this.model.useType == '05' && this.lamps[0]) { // 调车信号机 - this.lamps[0].setColor(this.style.Signal.lamp.blueColor); - } else { - this.lamps[0].setColor(this.style.Signal.lamp.redColor); + close(logicLight) { + if (this.style.Signal.lamp.logicColor && logicLight) { + // 逻辑点灯影响灯颜色仅西安二且暂无双灯 + if (this.count == 1) { + this.lamps[0].setColor(this.style.Signal.lamp.grayColor); + this.insideTriangle.show(); + this.insideTriangle.setStyle({fill: this.style.Signal.lamp.redColor}); + if (this.cbtcStatus !== 'close') { + setTimeout(()=> { + this.insideTriangle.setStyle({fill: '#000'}); + }, 1000); + setTimeout(()=> { + this.insideTriangle.setStyle({fill: this.style.Signal.lamp.redColor}); + }, 2000); + } + this.cbtcStatus = 'close'; + } + } else { + this.cbtcStatus = ''; + if (this.count == 2) { // 双灯 + this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor); + this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); + } else if (this.count == 1) { // 单灯 + if (this.model.useType == '05' && this.lamps[0]) { // 调车信号机 + this.lamps[0].setColor(this.style.Signal.lamp.blueColor); + } else { + this.lamps[0].setColor(this.style.Signal.lamp.redColor); + } } } + } /* 正向开放*/ - openPositive() { - this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor); - this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); // 设置黑色 - this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.greenColor); - if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色 - this.sigPost.setColor('#00FF00'); - if (this.model.logicLight) { - this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor); + openPositive(logicLight) { + if (this.style.Signal.lamp.logicColor && logicLight) { + // 逻辑点灯影响灯颜色仅西安二且暂无双灯 + if (this.count == 1) { + this.lamps[0].setColor(this.style.Signal.lamp.grayColor); + this.insideTriangle.show(); + this.insideTriangle.setStyle({fill: this.style.Signal.lamp.greenColor}); + if (this.cbtcStatus !== 'openPositive') { + setTimeout(()=> { + this.insideTriangle.setStyle({fill: '#000'}); + }, 500); + setTimeout(()=> { + this.insideTriangle.setStyle({fill: this.style.Signal.lamp.greenColor}); + }, 1000); + } + this.cbtcStatus = 'openPositive'; + } + } else { + this.cbtcStatus = ''; + this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor); + this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); // 设置黑色 + this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.greenColor); + if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色 + this.sigPost.setColor('#00FF00'); + if (this.model.logicLight) { + this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor); + } } } + } /* 侧向开放 */ - openLateral() { - this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor); - this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); - if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色 - this.sigPost.setColor('#00FF00'); - if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色 - this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor); + openLateral(logicLight) { + if (this.style.Signal.lamp.logicColor && logicLight) { + if (this.count == 1) { + this.lamps[0].setColor(this.style.Signal.lamp.grayColor); + this.insideTriangle.show(); + this.insideTriangle.setStyle({fill: this.style.Signal.lamp.yellowColor}); + this.cbtcStatus = 'openLateral'; + } + } else { + this.cbtcStatus = ''; + this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor); + this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); + if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色 + this.sigPost.setColor('#00FF00'); + if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色 + this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor); + } } } } @@ -362,6 +413,7 @@ class Signal extends Group { // 引导 guid() { + this.cbtcStatus = 'guid'; if (this.style.Signal.lamp.guidName === 'double') { this.lamps[1].show(); } @@ -502,6 +554,7 @@ class Signal extends Group { if (this.style.Signal.lamp.guidName === 'double' || this.style.Signal.lamp.guidName === 'doubleAndBase') { this.lamps[1].hide(); } + this.insideTriangle && this.insideTriangle.setStyle({fill: this.style.Signal.insideTriangle.startSignalColor, stroke: this.style.Signal.insideTriangle.strokeColor}); this.insideTriangle && this.insideTriangle.hide(); this.sigPost && this.sigPost.removeTerminalOptional(); this.ciConfirm && this.ciConfirm.stopAnimation(false); @@ -528,13 +581,10 @@ class Signal extends Group { /** 信号机封锁 */ // 缺一个功能封锁 model.blockade && this.block(); /** 设置灯的颜色 */ - // model.redOpen = 1; - // model.yellowOpen = 1; - // model.greenOpen = 0; model.redOpen && model.yellowOpen && !model.greenOpen && this.guid(); // 引导信号显示 - model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(); // 信号关闭 - model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(); // 信号正向开放 - model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(); // 信号侧向开放 + model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(model.logicLight); // 信号关闭 + model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(model.logicLight); // 信号正向开放 + model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(model.logicLight); // 信号侧向开放 /** 进路交人工控或自动控 */ !model.atsControl && this.setArtificialRouteClose(); // 联锁自动进路通过 diff --git a/src/jmapNew/shape/StationStand/index.js b/src/jmapNew/shape/StationStand/index.js index 2ce6b4d69..3de6cb70d 100644 --- a/src/jmapNew/shape/StationStand/index.js +++ b/src/jmapNew/shape/StationStand/index.js @@ -382,6 +382,7 @@ class StationStand extends Group { this.trainDepart && this.trainDepart.hideMode(); this.reentry && this.reentry.hideMode(); this.jump && this.jump.hideMode(); + this.detainCircle && this.detainCircle.setColor(this.style.StationStand.detainCar.defaultColor); } /** 空闲*/ @@ -492,7 +493,7 @@ class StationStand extends Group { model.trainParking && this.stop(); /** 列车停站*/ model.emergencyClosed && this.emergentClose(); /** 站台紧急关闭*/ - model.doorOpen && this.doorOpen(); /** 车门开启 (西安二号线样式)*/ + model.trainParking && this.doorOpen(); /** 车门开启 (西安二号线样式)*/ if (Number(model.parkingTime) > 0) { this.setManuallyArmisticeTime(model.parkingTime); // 设置站台停车时间 diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index 94dfff3ee..0b9312fcf 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -162,7 +162,7 @@ export default class Switch extends Group { _subType: 'enabled', // 标识 style: { x: arrowTextX, - y: arrowTextY, + y: arrowTextY + 10, fontSize: 12, text: 'E', textAlign: 'center', diff --git a/src/jmapNew/shape/Train/EMouse.js b/src/jmapNew/shape/Train/EMouse.js index bb8351a2a..17f024a44 100644 --- a/src/jmapNew/shape/Train/EMouse.js +++ b/src/jmapNew/shape/Train/EMouse.js @@ -3,6 +3,7 @@ import Text from 'zrender/src/graphic/Text'; import LangStorage from '@/utils/lang'; import Rect from 'zrender/src/graphic/shape/Rect'; import store from '@/store/index_APP_TARGET'; +import Vue from 'vue'; class EMouse extends Group { constructor(device) { @@ -33,9 +34,13 @@ class EMouse extends Group { direction = this.device.model.right != 1; } if (LangStorage.getLang() == 'en') { - text = ` The planned train: ${trainType} \n Table No.: ${this.device.model.serviceNumber} \n Train Trip No.: ${this.device.model.tripNumber}\n Destination: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n Train No.: ${this.device.model.groupNumber}\n Early or late: ${destinationText}\n Direction: ${direction ? 'up' : 'down'}\n Crew No.: \n Start Station: \n Terminal Station: \n Occupied Track: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n Current Station: \n Train-ground communication: normal \n Operation Speed level: 4 \n Detained: ${this.device.model.hold ? 'Detained' : 'Normal'}\n \n 跳停状态: ${this.device.model.jump ? 'Skip to continue moving' : 'Normal'}Stationary: ${!this.device.model.stop ? 'No' : 'Yes'}\n Blocked: No \n Speed: ${this.device.model.speed || 0} km/h \n Authorized Distance: ${this.device.model.maLen || 0} m`; + text = ` The planned train: ${trainType} \n Table No.: ${this.device.model.serviceNumber} \n Train Trip No.: ${this.device.model.tripNumber}\n Destination: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n Train No.: ${this.device.model.groupNumber}\n Early or late: ${destinationText}\n Direction: ${direction ? 'up' : 'down'}\n Crew No.: \n Start Station: \n Terminal Station: \n Occupied Track: ${this.device.model.sectionModel ? this.device.model.sectionModel.parentName : ''}\n Current Station: \n Train-ground communication: normal \n Operation Speed level: 4 \n Detained: ${this.device.model.hold ? 'Detained' : 'Normal'}\n \n 跳停状态: ${this.device.model.jump ? 'Skip to continue moving' : 'Normal'}Stationary: ${!this.device.model.stop ? 'No' : 'Yes'}\n Blocked: No \n Speed: ${this.device.model.speed || 0} km/h \n Authorized Distance: ${this.device.model.maLen || 0} m`; } else { - text = `列车类型: ${trainType} \n表\0\0\0\0号: ${this.device.model.serviceNumber}\n车\0次\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n车\0组\0号: ${this.device.model.groupNumber}\n早\0晚\0点: ${destinationText}\n运行方向: ${direction ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${ this.device.model.hold ? '扣车' : '正常'}\n跳停状态: ${this.device.model.jump ? '跳停' : '正常'} \n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`; + if (Vue.prototype.$jlmap.lineCode == '11' || Vue.prototype.$jlmap.lineCode == '10') { + text = `列车类型: ${trainType}\n来\0\0\0\0源:人工标记\n车\0组\0号: ${this.device.model.groupNumber}\n表\0\0\0\0号: ${this.device.model.serviceNumber}\n车\0次\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n早\0晚\0点: ${destinationText}\n运行方向: ${direction ? '上行' : '下行'}\nATP报告方向: ${direction ? '上行' : '下行'}\n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.parentName : ''}\n所在车站: \n车次通信: 通信车\n运行时间: \n停站时间: \n扣车状态: ${ this.device.model.hold ? '扣车' : '正常'}\n车戴扣车: 不执行\n跳停状态: 无跳停\n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车状态: CTC车\n最高信号系统控制: CTC\n驾驶模式: SM模式\n最高ATP模式: AM\nATP1状态: 激活\nATP2状态: 备用\n速度: ${this.device.model.speed || 0} km/h\n车门状态: ${this.device.model.speed ? '关闭' : direction ? '左开右关' : '左关右开'}\n制动状态: 无紧急制动\n停车保证: 可保证停车\n站台无法进入: 否\n前方站台停车点: 中间\n折法策略: \n折返状态: \n屏蔽门开门许可: 是\n运营里程: 无效\n总重量: 196T\n车长: 11860cm\n列车编组: 1`; + } else { + text = `列车类型: ${trainType} \n表\0\0\0\0号: ${this.device.model.serviceNumber}\n车\0次\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n车\0组\0号: ${this.device.model.groupNumber}\n早\0晚\0点: ${destinationText}\n运行方向: ${direction ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.parentName : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${ this.device.model.hold ? '扣车' : '正常'}\n跳停状态: ${this.device.model.jump ? '跳停' : '正常'} \n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`; + } } const trainTip = this.device.style.Train.common.trainTip; if (trainTip) { diff --git a/src/jmapNew/shape/Train/TrainBody.js b/src/jmapNew/shape/Train/TrainBody.js index 24c1ec280..a2ce5a85d 100644 --- a/src/jmapNew/shape/Train/TrainBody.js +++ b/src/jmapNew/shape/Train/TrainBody.js @@ -135,9 +135,8 @@ export default class TrainBody extends Group { x: parseInt(model.point.x + style.Train.trainNumber.trainNumberOffset.x), y: parseInt(model.point.y + style.Train.trainNumber.trainNumberOffset.y), text: targetCode.substring(targetCode.length - style.Train.trainNumber.targetCodePrefix.length), - textFill: style.trainTextColor, + textFill: model.style.Train.trainNumber.fontColor || style.trainTextColor, textStroke: style.trainTextColor, - fontWeight: 400, textStrokeWidth: 0, fontSize: model.fontSize, fontFamily: style.Train.common.fontFamily, @@ -301,20 +300,12 @@ export default class TrainBody extends Group { this.trainBodyBox && this.trainBodyBox.setColor(key, color); } getBoundingRect() { - let rect = null; - this.eachChild(elem => { - if (elem) { - const tempRect = elem.getBoundingRect(); - if ((tempRect.x || tempRect.y) && tempRect.width && tempRect.height) { - if (rect) { - rect.union(tempRect); - } else { - rect = tempRect; - } - } - } - }); - return rect || new BoundingRect(0, 0, 0, 0); + const rect = new BoundingRect(0, 0, 0, 0); + if (this.trainBodyBox) { + const tempRect = this.trainBodyBox.getBoundingRect().clone(); + rect.union(tempRect); + } + return rect; } formatChangePosition(model, style) { if (this.nameFormat) { diff --git a/src/jmapNew/shape/Train/TrainBodyBox.js b/src/jmapNew/shape/Train/TrainBodyBox.js index 74f706de8..bc398a283 100644 --- a/src/jmapNew/shape/Train/TrainBodyBox.js +++ b/src/jmapNew/shape/Train/TrainBodyBox.js @@ -2,32 +2,32 @@ import Group from 'zrender/src/container/Group'; import Rect from 'zrender/src/graphic/shape/Rect'; export default class TrainBodyBox extends Group { - constructor(model) { - super(); - this.model = model; - this.create(); - } - create() { - const model = this.model; + constructor(model) { + super(); + this.model = model; + this.create(); + } + create() { + const model = this.model; this.trainBodyBox = new Rect({ - zlevel: model.zlevel, - z: model.z, - shape: { - x: model.point.x, - y: model.point.y, - width: model.style.Train.common.trainWidth, - height: model.style.Train.common.trainHeight - }, - style: { - lineWidth: model.style.Train.trainBody.trainBodyLineWidth, - stroke: model.style.Train.trainBody.trainSidelineColor || model.style.trainSidelineColor, - fill: model.style.Train.trainBody.trainBodyFillColor - }, - cursor: 'pointer' - }); - this.add(this.trainBodyBox); - } - setColor(key, color) { - this.trainBodyBox.setStyle(key, color); - } + zlevel: model.zlevel, + z: model.z, + shape: { + x: model.point.x, + y: model.point.y, + width: model.style.Train.common.trainWidth, + height: model.style.Train.common.trainHeight + }, + style: { + lineWidth: model.style.Train.trainBody.trainBodyLineWidth, + stroke: model.style.Train.trainBody.trainSidelineColor || model.style.trainSidelineColor, + fill: model.style.Train.trainBody.trainBodyFillColor + }, + cursor: 'pointer' + }); + this.add(this.trainBodyBox); + } + setColor(key, color) { + this.trainBodyBox.setStyle(key, color); + } } diff --git a/src/jmapNew/shape/Train/index.js b/src/jmapNew/shape/Train/index.js index 5c66041ba..8c13301b1 100644 --- a/src/jmapNew/shape/Train/index.js +++ b/src/jmapNew/shape/Train/index.js @@ -229,34 +229,34 @@ export default class Train extends Group { const flag = this.style.Train.trainStatusStyle.destinationStatus.some((item) => { if (status === item.status) { switch (this.style.Train.trainStatusStyle.destinationStatusSetText) { - case 'trainTarget': - this.trainB && this.trainB.setTextTrainTargetColor(item.showColor); - break; - case 'trainServer': - this.trainB && this.trainB.setTextTrainServerColor(item.showColor); - break; - case 'trainWindowBorder': - this.trainB && this.trainB.setBodyBoxShape('stroke', item.showColor); - break; - default: - this.trainB && this.trainB.setTextTrainTargetColor(item.showColor); + case 'trainTarget': + this.trainB && this.trainB.setTextTrainTargetColor(item.showColor); + break; + case 'trainServer': + this.trainB && this.trainB.setTextTrainServerColor(item.showColor); + break; + case 'trainWindowBorder': + this.trainB && this.trainB.setBodyBoxShape('stroke', item.showColor); + break; + default: + this.trainB && this.trainB.setTextTrainTargetColor(item.showColor); } return true; } }); if (this.style.Train.trainStatusStyle.defaultDestinationColor && !flag) { switch (this.style.Train.trainStatusStyle.destinationStatusSetText) { - case 'trainTarget': - this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor); - break; - case 'trainServer': - this.trainB && this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultDestinationColor); - break; - case 'trainWindowBorder': - this.trainB && this.trainB.setBodyBoxShape('stroke', this.style.Train.trainStatusStyle.defaultDestinationColor); - break; - default: - this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor); + case 'trainTarget': + this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor); + break; + case 'trainServer': + this.trainB && this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultDestinationColor); + break; + case 'trainWindowBorder': + this.trainB && this.trainB.setBodyBoxShape('stroke', this.style.Train.trainStatusStyle.defaultDestinationColor); + break; + default: + this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor); } } } @@ -291,8 +291,13 @@ export default class Train extends Group { if (this.style.Train.trainStatusStyle.directionStopType.length > 0) { this.style.Train.trainStatusStyle.directionStopType.forEach((item) => { if (right === item.type) { - this.trainL && this.trainL.setLineShow(item.lineLShow); - this.trainR && this.trainR.setLineShow(item.lineRShow); + if (this.style.Train.trainHead.directionStopType == 'special') { + this.trainL && this.trainL.setArrowShow(item.lineLShow); + this.trainR && this.trainR.setArrowShow(item.lineRShow); + } else { + this.trainL && this.trainL.setLineShow(item.lineLShow); + this.trainR && this.trainR.setLineShow(item.lineRShow); + } return true; } }); @@ -425,22 +430,22 @@ export default class Train extends Group { const arr = this.nameFormat.split(':'); arr.forEach(ele => { switch (ele) { - case 'targetCode': { - this.size += (style.Train.trainNumber.targetCodePrefix || '').length; - break; - } - case 'serviceNumber': { - this.size += (style.Train.trainServer.serviceNumberPrefix || '').length; - break; - } - case 'tripNumber': { - this.size += (style.Train.trainTarget.tripNumberPrefix || '').length; - break; - } - case 'groupNumber': { - this.size += (style.Train.trainTargetNumber.groupNumberPrefix || '').length; - break; - } + case 'targetCode': { + this.size += (style.Train.trainNumber.targetCodePrefix || '').length; + break; + } + case 'serviceNumber': { + this.size += (style.Train.trainServer.serviceNumberPrefix || '').length; + break; + } + case 'tripNumber': { + this.size += (style.Train.trainTarget.tripNumberPrefix || '').length; + break; + } + case 'groupNumber': { + this.size += (style.Train.trainTargetNumber.groupNumberPrefix || '').length; + break; + } } }); } else { diff --git a/src/jmapNew/utils/parser.js b/src/jmapNew/utils/parser.js index b93fab06e..e75dc26ed 100644 --- a/src/jmapNew/utils/parser.js +++ b/src/jmapNew/utils/parser.js @@ -47,6 +47,12 @@ export function parser(data, skinCode, showConfig) { mapDevice[elem.code] = createDevice(deviceType.Section, elem, propConvert, showConfig); }, this); + zrUtil.each(data.sectionList || [], elem => { + if (elem.type == '02' || elem.type == '03') { + mapDevice[elem.code].parentName = mapDevice[elem.parentCode] ? mapDevice[elem.parentCode].name : ''; + } + }, this); + zrUtil.each(data.signalList || [], elem => { mapDevice[elem.code] = createDevice(deviceType.Signal, elem, propConvert, showConfig); }, this); diff --git a/src/layout/components/Entry.vue b/src/layout/components/Entry.vue index 16d9fc6ec..fb457a4e2 100644 --- a/src/layout/components/Entry.vue +++ b/src/layout/components/Entry.vue @@ -49,12 +49,12 @@ export default { { name: 'global.designPlatformEntrance', handle: this.goToDesign, - hidden: getSessionStorage('project').startsWith('design') + hidden: getSessionStorage('project').startsWith('design') || !goOtherPlatformMenu[getSessionStorage('project')] }, { name: 'global.trainingPlatformEntrance', handle: this.goToTraining, - hidden: !getSessionStorage('project').startsWith('design') + hidden: !getSessionStorage('project').startsWith('design') || !goOtherPlatformMenu[getSessionStorage('project')] }, { name: 'global.caseShow', diff --git a/src/layout/components/userInfo.vue b/src/layout/components/userInfo.vue index 22e2c02b5..a62d5cff9 100644 --- a/src/layout/components/userInfo.vue +++ b/src/layout/components/userInfo.vue @@ -236,9 +236,9 @@