diff --git a/src/api/simulation.js b/src/api/simulation.js index 43ecc026c..be1d41e60 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -385,6 +385,15 @@ export function modifyScriptAction(group, actionId, data) { }); } +/** 修改剧本动作(新版) */ +export function modifyScriptActionNew(group, data) { + return request({ + url: `/api/scriptSimulation/${group}/action/update`, + method: 'put', + data + }); +} + /** 分页查询存在的仿真 */ export function getExistingSimulation(params) { return request({ @@ -709,3 +718,4 @@ export function getMemberInfo(group, memberId) { method: 'get' }); } + diff --git a/src/jmapNew/config/skinCode/bejing_01.js b/src/jmapNew/config/skinCode/bejing_01.js index b96e1c110..01d7a40a8 100644 --- a/src/jmapNew/config/skinCode/bejing_01.js +++ b/src/jmapNew/config/skinCode/bejing_01.js @@ -608,14 +608,13 @@ class SkinCode extends defaultStyle { trainTargetNumberOffset: { x: -4, y: 4 }// 车组号偏移量 }, trainHead: { - trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框 - trainHeadTriangleFirst: { x: 7, y: 1 }, // 列车车头三角坐标1偏移量 - trainHeadTriangleSecond: { x: 13, y: 10 }, // 列车车头三角坐标2偏移量 - trainHeadTriangleThird: { x: 7, y: 19 }, // 列车车头三角坐标3偏移量 trainHeadRectHeight: 20, // 列车车头矩形高度 trainConntWidth: 3, // 列车竖杠的宽度 trainHeadFillColor: '#000000', // 列车车头矩形填充颜色 - directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 + directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常 + trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度 + trainHeadArrowWidth: 6, // 列车车头三角宽度 + trainHeadArrowOffsetX: 2 // 列车车头三角偏移 }, common: { trainHeight: 20, // 列车高度 diff --git a/src/jmapNew/config/skinCode/chengdu_01.js b/src/jmapNew/config/skinCode/chengdu_01.js index 29b033f70..e0725afe2 100644 --- a/src/jmapNew/config/skinCode/chengdu_01.js +++ b/src/jmapNew/config/skinCode/chengdu_01.js @@ -544,14 +544,13 @@ class SkinCode extends defaultStyle { trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量 }, trainHead: { - trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框 - trainHeadTriangleFirst: { x: 7, y: 1}, // 列车车头三角坐标1偏移量 - trainHeadTriangleSecond: { x: 13, y: 10}, // 列车车头三角坐标2偏移量 - trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量 trainConntWidth: 4, // 列车竖杠的宽度 trainHeadFillColor: '#000000', // 列车车头矩形填充颜色 trainHeadRectHeight: 20, // 列车车头矩形高度 - directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 + directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常 + trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度 + trainHeadArrowWidth: 5, // 列车车头三角宽度 + trainHeadArrowOffsetX: 2 // 列车车头三角偏移 }, common: { trainHeight: 20, // 列车高度 diff --git a/src/jmapNew/config/skinCode/chengdu_03.js b/src/jmapNew/config/skinCode/chengdu_03.js index aeddad95c..00c1305e7 100644 --- a/src/jmapNew/config/skinCode/chengdu_03.js +++ b/src/jmapNew/config/skinCode/chengdu_03.js @@ -729,14 +729,13 @@ class SkinCode extends defaultStyle { trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量 }, trainHead: { - trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框 - trainHeadTriangleFirst: { x: 7, y: 1}, // 列车车头三角坐标1偏移量 - trainHeadTriangleSecond: { x: 13, y: 10}, // 列车车头三角坐标2偏移量 - trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量 trainConntWidth: 3, // 列车竖杠的宽度 trainHeadFillColor: '#000000', // 列车车头矩形填充颜色 trainHeadRectHeight: 20, // 列车车头矩形高度 - directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 + directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常 + trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度 + trainHeadArrowWidth: 6, // 列车车头三角宽度 + trainHeadArrowOffsetX: 5 // 列车车头三角偏移 }, common: { trainHeight: 20, // 列车高度 diff --git a/src/jmapNew/config/skinCode/foshan_01.js b/src/jmapNew/config/skinCode/foshan_01.js index da1bb83f4..640ce6e48 100644 --- a/src/jmapNew/config/skinCode/foshan_01.js +++ b/src/jmapNew/config/skinCode/foshan_01.js @@ -413,7 +413,7 @@ class SkinCode extends defaultStyle { }, core: { length: 6, // 道岔单边长度 - graphShow: true // 图形显示 + graphShow: true // 图形显示 }, jointImg: { // 道岔 A B C D四元素属性配置 trapezoidLength: 8, // 直角梯形元素默认长度 @@ -582,14 +582,13 @@ class SkinCode extends defaultStyle { trainTargetNumberOffset: {x: -1, y: 1}// 车组号偏移量 }, trainHead: { - trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框 - trainHeadTriangleFirst: { x: 0, y: 0}, // 列车车头三角坐标1偏移量 - trainHeadTriangleSecond: { x: 5, y: 9}, // 列车车头三角坐标2偏移量 - trainHeadTriangleThird: { x: 0, y: 18}, // 列车车头三角坐标3偏移量 trainHeadRectHeight: 18, // 列车车头矩形高度 trainConntWidth: 5, // 列车竖杠的宽度 trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色 - directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 + directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常 + trainHeadHeight: 'text', // 列车车头高度取决于trainBox高度 + trainHeadArrowWidth: 5, // 列车车头三角宽度 + trainHeadArrowOffsetX: 3 // 列车车头三角偏移 }, common: { useSelfFormat: true, diff --git a/src/jmapNew/config/skinCode/fuzhou_01.js b/src/jmapNew/config/skinCode/fuzhou_01.js index 985280ca9..f80bbde37 100644 --- a/src/jmapNew/config/skinCode/fuzhou_01.js +++ b/src/jmapNew/config/skinCode/fuzhou_01.js @@ -570,14 +570,13 @@ class SkinCode extends defaultStyle { 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', // 列车车头矩形填充颜色 - directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 + directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常 + trainHeadHeight: 'text', // 列车车头高度取决于trainBox高度 + trainHeadArrowWidth: 5, // 列车车头三角宽度 + trainHeadArrowOffsetX: 2 // 列车车头三角偏移 }, common: { trainHeight: 17, // 列车高度 diff --git a/src/jmapNew/config/skinCode/haerbin_01.js b/src/jmapNew/config/skinCode/haerbin_01.js index 080f9ae0b..d74a58b95 100644 --- a/src/jmapNew/config/skinCode/haerbin_01.js +++ b/src/jmapNew/config/skinCode/haerbin_01.js @@ -630,14 +630,13 @@ class SkinCode extends defaultStyle { trainTargetNumberOffset: { x: 5, y: 25 }// 车组号偏移量 }, 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: 0, // 列车竖杠的宽度 trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色 - directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 + directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常 + trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度 + trainHeadArrowWidth: 5, // 列车车头三角宽度 + trainHeadArrowOffsetX: 2 // 列车车头三角偏移 }, common: { hasTravelSigns: true, // 是否有行进标志 diff --git a/src/jmapNew/config/skinCode/ningbo_01.js b/src/jmapNew/config/skinCode/ningbo_01.js index 1c21ac13b..bda60421a 100644 --- a/src/jmapNew/config/skinCode/ningbo_01.js +++ b/src/jmapNew/config/skinCode/ningbo_01.js @@ -581,14 +581,13 @@ class SkinCode extends defaultStyle { trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量 }, trainHead: { - trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框 - trainHeadTriangleFirst: { x: 4, y: 0}, // 列车车头三角坐标1偏移量 - trainHeadTriangleSecond: { x: 9, y: 10}, // 列车车头三角坐标2偏移量 - trainHeadTriangleThird: { x: 4, y: 20}, // 列车车头三角坐标3偏移量 trainConntWidth: 2, // 列车竖杠的宽度 trainHeadFillColor: '#000000', // 列车车头矩形填充颜色 trainHeadRectHeight: 20, // 列车车头矩形高度 - directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 + directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常 + trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度 + trainHeadArrowWidth: 5, // 列车车头三角宽度 + trainHeadArrowOffsetX: 2 // 列车车头三角偏移 }, common: { trainHeight: 20, // 列车高度 diff --git a/src/jmapNew/config/skinCode/xian_01.js b/src/jmapNew/config/skinCode/xian_01.js index 77632feca..a48711500 100644 --- a/src/jmapNew/config/skinCode/xian_01.js +++ b/src/jmapNew/config/skinCode/xian_01.js @@ -503,22 +503,22 @@ class SkinCode extends defaultStyle { }; this[deviceType.StationTurnBack] = { // 站后折返 - lamp: { - fill: '#FFFF00', // 填充色 - radiusR: 6, // 控制灯大小 - }, - text: { - fontWeight: 'normal', - fontSize: 12, - distance: 10 - }, - rect: { - fill: 'rgba(0,0,0,0)', + lamp: { + fill: '#FFFF00', // 填充色 + radiusR: 6 // 控制灯大小 + }, + text: { + fontWeight: 'normal', + fontSize: 12, + distance: 10 + }, + rect: { + fill: 'rgba(0,0,0,0)', stroke: '#fff', lineWidth: 2, - padding: 6 - } - } + padding: 6 + } + }; this[deviceType.LimitControl] = { text: { fontSize: 10, // 字体大小 @@ -635,14 +635,13 @@ class SkinCode extends defaultStyle { headTypeColor: '#FF0' // 头码车 }, 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', // 列车车头矩形填充颜色 - directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 + directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常 + trainHeadHeight: 'text', // 列车车头高度取决于trainBox高度 + trainHeadArrowWidth: 4, // 列车车头三角宽度 + trainHeadArrowOffsetX: 2 // 列车车头三角偏移 }, common: { trainHeight: 17, // 列车高度 diff --git a/src/jmapNew/config/skinCode/xian_02.js b/src/jmapNew/config/skinCode/xian_02.js index cd98e29f7..e7fa9de51 100644 --- a/src/jmapNew/config/skinCode/xian_02.js +++ b/src/jmapNew/config/skinCode/xian_02.js @@ -716,14 +716,13 @@ class SkinCode extends defaultStyle { trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量 }, trainHead: { - trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框 - trainHeadTriangleFirst: { x: -1, y: -1}, // 列车车头三角坐标1偏移量 - trainHeadTriangleSecond: { x: 15, y: 10}, // 列车车头三角坐标2偏移量 - trainHeadTriangleThird: { x: -1, y: 21}, // 列车车头三角坐标3偏移量 trainConntWidth: 0, // 列车竖杠的宽度 trainHeadFillColor: '#2AA32A', // 列车车头矩形填充颜色 trainHeadRectHeight: 20, // 列车车头矩形高度 - directionStopType:'special' // special 西安二号线 停车 列车方向图标不消失 normal 正常 + directionStopType:'special', // special 西安二号线 停车 列车方向图标不消失 normal 正常 + trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度 + trainHeadArrowWidth: 16, // 列车车头三角宽度 + trainHeadArrowOffsetX: -0.5 // 列车车头三角偏移 }, common: { trainHeight: 20, // 列车高度 diff --git a/src/jmapNew/shape/Train/TrainHead.js b/src/jmapNew/shape/Train/TrainHead.js index c619d6d04..fd8afc86d 100644 --- a/src/jmapNew/shape/Train/TrainHead.js +++ b/src/jmapNew/shape/Train/TrainHead.js @@ -12,16 +12,16 @@ export default class TrainHead extends Group { create() { const model = this.model; const style = this.model.style; - const baseMargin = (model.drect === -1 ? 1 : 0); + const baseMargin = (model.drect === -1 ? -1 : 0); if (style.Train.trainHead.trainConntWidth) { this.line = new Rect({ zlevel: model.zlevel, z: model.z, shape: { - x: model.point.x - baseMargin * (style.Train.trainHead.trainConntWidth * model.scale), + x: model.point.x + baseMargin * ((style.Train.trainHead.trainConntWidth + style.Train.trainBody.trainBodyLineWidth) * model.scale), y: model.point.y, width: style.Train.trainHead.trainConntWidth * model.scale, - height: model.height || style.Train.trainHead.trainHeadRectHeight * model.scale + height: style.Train.trainHead.trainHeadHeight === 'trainBox' ? style.Train.common.trainHeight : model.height }, style: { lineWidth: 0.1, @@ -31,12 +31,12 @@ export default class TrainHead extends Group { }); this.add(this.line); } - const height = model.height / 2; - const startX = model.point.x + model.drect * (style.Train.trainHead.trainConntWidth * model.scale); + const height = style.Train.trainHead.trainHeadHeight === 'trainBox' ? style.Train.common.trainHeight / 2 : model.height / 2; + const startX = model.point.x + model.drect * (style.Train.trainHead.trainHeadArrowOffsetX * model.scale); const points = [ - [startX + model.drect * 2 * model.scale, (model.point.y + height)], - [startX + model.drect * -2 * model.scale, (model.point.y + height) + height], - [startX + model.drect * -2 * model.scale, (model.point.y + height) - height] + [startX + model.drect * style.Train.trainHead.trainHeadArrowWidth * model.scale, (model.point.y + height)], + [startX, (model.point.y + height) + height], + [startX, (model.point.y + height) - height] ]; this.arrow = new Polygon({ zlevel: model.zlevel, diff --git a/src/scripts/ConstConfig.js b/src/scripts/ConstConfig.js index a462dc7b9..73f6f7ee7 100644 --- a/src/scripts/ConstConfig.js +++ b/src/scripts/ConstConfig.js @@ -90,11 +90,13 @@ export default { roleTypeNew:[ {label: '管理员', value: 'ADMIN', enLabel: 'Admin '}, {label: '教员', value: 'Instructor', enLabel: 'Instructor '}, - {label: '行调', value: 'DISPATCHER', enLabel: 'Dispatcher '}, {label: '行值', value: 'STATION_SUPERVISOR', enLabel: 'Attendant '}, {label: '观众', value: 'AUDIENCE', enLabel: 'Audience '}, {label: '司机', value: 'DRIVER', enLabel: 'Driver '}, - {label: '通号', value: 'MAINTAINER', enLabel: 'Repairman '} + {label: '通号', value: 'MAINTAINER', enLabel: 'Repairman '}, + {label: '车辆段调度', value: 'DEPOT_DISPATCHER', enLabel: 'Depot dispatcher '}, + {label: '工电调度', value: 'ELECTRIC_DISPATCHER', enLabel: 'Electric dispatcher'}, + {label: '行调', value: 'DISPATCHER', enLabel: 'Dispatcher '} ], SimulationType: [ { label: '实训', value: 'Training'}, diff --git a/src/views/iscs/iscsSystem/config/canvas/iscsCanvas.vue b/src/views/iscs/iscsSystem/config/canvas/iscsCanvas.vue index 4e5ba823f..864f15923 100644 --- a/src/views/iscs/iscsSystem/config/canvas/iscsCanvas.vue +++ b/src/views/iscs/iscsSystem/config/canvas/iscsCanvas.vue @@ -98,12 +98,12 @@ export default { }; this.iscsDestroy(); this.loading = true; - const data = parser(iscsData[deviceCode], {width: this.canvasWidth, height: this.canvasHeight}); + const data = parser(iscsData[deviceCode], {width: this.widthCanvas, height: this.canvasHeight}); this.$iscs = new Iscs({ dom: document.getElementById(this.iscsId), config: { renderer: 'canvas', - width: this.canvasWidth, + width: this.widthCanvas, height: this.canvasHeight }, options: { diff --git a/src/views/iscs/iscsSystem/config/deviceControl.vue b/src/views/iscs/iscsSystem/config/deviceControl.vue index 9227ecc3c..f5fd5199d 100644 --- a/src/views/iscs/iscsSystem/config/deviceControl.vue +++ b/src/views/iscs/iscsSystem/config/deviceControl.vue @@ -14,8 +14,9 @@
设备名称
{{ modeName }}
-
{{ stationName }}
-
{{ deviceType }}
+
{{ stationName }}
+
{{ deviceType }}
+
{{ deviceCode|| ' ' }}
状态
@@ -92,11 +93,20 @@ export default { modeName: '', status: '', operation: 'home', + deviceCode: '', deviceMap: { ManualAlarmButton:'手动报警按钮', SmokeDetector: '消火栓按钮', FireHydranAlarmButton: '点型火灾探测器', - GasFireControl:'气体灭火控制器' + GasFireControl:'气体灭火控制器', + LightingGroup: '照明', + Electrically: '', + VolumeControlDamper: '电动风阀', + SmookExhaustFd: '排烟防火阀', + Ventilator: '普通风机', + AirConditioner: '组合式空调机组', + FireDamper: '防火阀', + SmookProofFd: '防烟防火阀' }, modeMap: { standFAS: '火灾报警', @@ -142,17 +152,21 @@ export default { }, methods: { doShow(device) { + this.deviceCode = ''; this.deviceType = this.deviceMap[device._type]; this.modeName = this.modeMap[this.$route.params.mode]; this.stationName = this.$route.query.stationName; this.dialogShow = true; + if (device._type === 'LightingGroup') { + this.deviceCode = device.topContext.split(/[(\r\n)\r\n]+/)[0]; + } }, doClose() { this.loading = false; this.dialogShow = false; }, clickEvent(type) { - this.operation = type; + this.operation = type; } } }; diff --git a/src/views/iscs/iscsSystem/config/fire-alarm/stand.vue b/src/views/iscs/iscsSystem/config/fire-alarm/stand.vue index be3757e4f..162c88c30 100644 --- a/src/views/iscs/iscsSystem/config/fire-alarm/stand.vue +++ b/src/views/iscs/iscsSystem/config/fire-alarm/stand.vue @@ -23,11 +23,15 @@ export default { const device = this.$store.state.iscs.selected; if (device && device._type === 'IscsButton' && device.function === 'PublicArea') { this.width = 1520; - this.$refs.iscsPlate.show('12'); + this.$nextTick(() => { + this.$refs.iscsPlate.show('12'); + }); console.log(this.width); } else if (device && device._type === 'IscsButton' && device.function === 'GoBack') { this.width = 1100; - this.$refs.iscsPlate.show('14'); + this.$nextTick(() => { + this.$refs.iscsPlate.show('14'); + }); } } }, diff --git a/src/views/iscs/iscsSystem/config/graphicEle.vue b/src/views/iscs/iscsSystem/config/graphicEle.vue index c4bf768f7..3c3a5ee23 100644 --- a/src/views/iscs/iscsSystem/config/graphicEle.vue +++ b/src/views/iscs/iscsSystem/config/graphicEle.vue @@ -45,6 +45,21 @@ export default { {graphicEle: 'smokeDetector', deviceType: '点型火灾探测器'}, {graphicEle: 'gasFireControl', deviceType: '气体灭火控制器'} ], + basData: [ + {graphicEle: 'AirConditioner', deviceType: '组合式空调机组、空调器'}, + {graphicEle: 'Ventilator', deviceType: '普通风机'}, + {graphicEle: '', deviceType: '隧道风机'}, + {graphicEle: '', deviceType: '排热风机'}, + {graphicEle: 'FireDamper', deviceType: '防火阀'}, + {graphicEle: 'SmookExhaustFd', deviceType: '排烟防火阀'}, + {graphicEle: 'VolumeControlDamper', deviceType: '电动风阀'}, + {graphicEle: 'SmookProofFd', deviceType: '防烟防火阀'}, + {graphicEle: '', deviceType: '冷却塔'}, + {graphicEle: '', deviceType: '冷水机组'}, + {graphicEle: '', deviceType: '电动蝶阀'}, + {graphicEle: '', deviceType: '动态平衡电动调节阀'}, + {graphicEle: '', deviceType: '冷冻泵、冷却泵'} + ], graphicEleMap: { manualAlarm: ManualAlarm, fireHydrant: FireHydrant, diff --git a/src/views/iscs/iscsSystem/config/index.vue b/src/views/iscs/iscsSystem/config/index.vue index bc3e8b4e2..2c24fa87a 100644 --- a/src/views/iscs/iscsSystem/config/index.vue +++ b/src/views/iscs/iscsSystem/config/index.vue @@ -1,8 +1,8 @@ @@ -107,7 +107,20 @@ export default { data() { return { mode: 'standFAS', - deviceList: ['ManualAlarmButton', 'SmokeDetector', 'FireHydranAlarmButton', 'GasFireControl'] + deviceList: [ + 'ManualAlarmButton', + 'SmokeDetector', + 'FireHydranAlarmButton', + 'GasFireControl', + 'LightingGroup', + 'Electrically', + 'VolumeControlDamper', + 'SmookExhaustFd', + 'Ventilator', + 'AirConditioner', + 'FireDamper', + 'SmookProofFd' + ] }; }, watch: { @@ -116,9 +129,10 @@ export default { }, '$store.state.iscs.selectedCount': function() { const device = this.$store.state.iscs.selected; - if (device._type === 'IscsButton' && device.function === 'GraphicEle') { + console.log(device, '11111111111111'); + if (device && device._type === 'IscsButton' && device.function === 'GraphicEle') { this.$refs.graphicEle.doShow(); - } else if (this.deviceList.includes(device._type)) { + } else if (device && this.deviceList.includes(device._type)) { this.$refs.deviceControl.doShow(device); } } diff --git a/src/views/jsxt/apply/index.vue b/src/views/jsxt/apply/index.vue index 8333e0aed..0a0bffba8 100644 --- a/src/views/jsxt/apply/index.vue +++ b/src/views/jsxt/apply/index.vue @@ -58,7 +58,7 @@
-
报名成功!:
您的赛事信息如下: +
报名成功!
您的赛事信息如下:
竞赛名称:{{ compition.name }}
竞赛时间:{{ compition.startDate }}
姓名:{{ formModel.name }} @@ -85,7 +85,7 @@
- + diff --git a/src/views/jsxt/refereeList/display.vue b/src/views/jsxt/refereeList/display.vue index f60c7f7f3..8195c8eb1 100644 --- a/src/views/jsxt/refereeList/display.vue +++ b/src/views/jsxt/refereeList/display.vue @@ -16,7 +16,9 @@ import { mapGetters } from 'vuex'; import { checkLoginLine } from '@/api/login'; import { EventBus } from '@/scripts/event-bus'; import MenuReplay from './menuReplay'; +import { getToken } from '@/utils/auth'; import { DeviceMenu, getDeviceMenuByDeviceType } from '@/scripts/ConstDic'; +import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp'; export default { name:'RefereeDisplay', components: { @@ -52,25 +54,49 @@ export default { }, height() { return this.$store.state.app.height; + }, + group() { + return this.$route.query.group; } }, watch: { '$store.state.map.mapViewLoadedCount': function (val) { // 地图视图加载完成标识 开始加载默认状态 + this.subscribe(); this.mapBoxP = document.getElementById(this.canvasId).children[0]; this.mapBoxP.style.cursor = ''; }, - // 'size.width': function(val) { - // this.setWindowSize(); + '$store.state.socket.equipmentStatus': function (val) { + if (val.length) { + this.statusMessage(val); + } + }, + '$store.state.socket.trainStationList': function (val) { + if (val.length) { + this.runFactMessage(val); + } + }, + // '$store.state.socket.simulationError': function (val) { + // if (val) { + // this.simulationError(val); + // } // }, + '$store.state.socket.simulationReset': function (val) { + if (val) { + this.simulationReset(val); + } + }, '$store.state.app.windowSizeCount': function() { this.setWindowSize(); } }, + async mounted() { + window.onbeforeunload = this.clearSubscribe; await this.setWindowSize(); await this.initLoadData(); }, async beforeDestroy() { + this.clearSubscribe(); await this.clearAllTimer(); await this.quit(); await this.$store.dispatch('training/reset'); @@ -81,6 +107,47 @@ export default { async back() { // await this.$refs.menuScript.back(); }, + clearSubscribe() { + clearSubscribe(`${displayTopic}\/${this.group}`); + }, + async subscribe() { + this.clearSubscribe(); + const header = { group: this.group || '', 'X-Token': getToken() }; + creatSubscribe(`${displayTopic}\/${this.group}`, header); + + await this.$store.dispatch('training/setHasSubscribed'); + }, + async statusMessage(list) { + await this.$store.dispatch('training/updateMapState', list); + await this.$store.dispatch('socket/setEquipmentStatus'); + }, + async runFactMessage(list) { + await this.$store.dispatch('runPlan/updateRunPlanData', list); + await this.$store.dispatch('socket/setTrainStationList'); + }, + async simulationReset() { + await this.$store.dispatch('map/clearJlmapTrainView'); + await this.$store.dispatch('map/setTrainWindowShow', false); + await this.$store.dispatch('training/over'); + await this.$store.dispatch('socket/setSimulationReset'); + await this.$store.dispatch('socket/setSimulationStart'); + await this.$store.dispatch('training/setMapDefaultState'); + }, + // async simulationError() { + // await this.$store.dispatch('map/clearJlmapTrainView'); + // await this.$store.dispatch('map/setTrainWindowShow', false); + // await this.$store.dispatch('socket/setSimulationError'); + // await this.$store.dispatch('training/setMapDefaultState'); + // this.clearSubscribe(); + // this.$confirm(this.$t('tip.getMapStateDataException'), this.$t('tip.hint'), { + // confirmButtonText: this.$t('global.confirm'), + // showCancelButton: false, + // type: 'warning' + // }).then(() => { + // this.$emit('back'); + // }).catch(() => { + // }); + // }, // 加载数据 async initLoadData() { this.$store.dispatch('training/reset'); diff --git a/src/views/jsxt/refereeList/index.vue b/src/views/jsxt/refereeList/index.vue index 8f7c52e78..94c1b04fe 100644 --- a/src/views/jsxt/refereeList/index.vue +++ b/src/views/jsxt/refereeList/index.vue @@ -82,7 +82,7 @@ export default { prop: 'theoryScore', width:100, type: 'tag', - columnValue: (row) => { return row.artificialTheoryScore ? `${row.theoryScore}(${row.artificialTheoryScore})` : row.theoryScore || '0'; }, + columnValue: (row) => { return row.artificialTheoryScore ? `${row.theoryScore}(${row.artificialTheoryScore})` : this.covert(row.theoryScore); }, tagType: (row) => { return 'success'; } }, { @@ -90,7 +90,7 @@ export default { prop: 'practiceScore', width:100, type: 'tag', - columnValue: (row) => { return row.artificialPracticeScore ? `${row.practiceScore}(${row.artificialPracticeScore})` : row.practiceScore || '0'; }, + columnValue: (row) => { return row.artificialPracticeScore ? `${row.practiceScore}(${row.artificialPracticeScore})` : this.covert(row.practiceScore); }, tagType: (row) => { return 'success'; } }, { @@ -119,13 +119,13 @@ export default { name: '理论结果', handleClick: this.handleTheoryResult, type: '', - showControl: (row) => { return row.status == '5' || row.status == '4'; } + showControl: (row) => { return row.status == '5' || row.status == '4' || row.theoryScore != undefined; } }, { name: '实操回放', handleClick: this.playBack, type: '', - showControl: (row) => { return row.status == '4'; } + showControl: (row) => { return row.status == '4' || row.status == '6' || row.practiceScore != undefined; } }, { name: '修改', @@ -183,6 +183,17 @@ export default { this.$refs.theoryResult.doShow({row:row, raceId:this.$route.query.raceId}); // this.$router.replace({ path: `/jsxt/theory/result?raceId=${this.$route.query.raceId}&result=true` }); }, + covert(data) { + if (data != undefined) { + if (data > 0) { + return data; + } else { + return '0'; + } + } else { + return ''; + } + }, handleAdd() { const loading = this.$loading({ lock: true, diff --git a/src/views/jsxt/refereeList/theoryResult.vue b/src/views/jsxt/refereeList/theoryResult.vue index 9f545408d..e9f9e6630 100644 --- a/src/views/jsxt/refereeList/theoryResult.vue +++ b/src/views/jsxt/refereeList/theoryResult.vue @@ -1,10 +1,12 @@ + diff --git a/src/views/newMap/jointTrainingNew/index.vue b/src/views/newMap/jointTrainingNew/index.vue index 76bb4eb7a..f5b8feb10 100644 --- a/src/views/newMap/jointTrainingNew/index.vue +++ b/src/views/newMap/jointTrainingNew/index.vue @@ -117,7 +117,8 @@ export default { countdownTime: '00:00:00', practicalTime: 0, countdown: null, - questionList: [] + questionList: [], + practicalExamTime: 0 }; }, computed: { @@ -392,15 +393,14 @@ export default { const paperResp = await getTestPaperDatail(this.$route.query.raceId); if (paperResp.data && paperResp.data.practicalQuestions) { this.questionList = []; + this.practicalExamTime = paperResp.data.practicalExamTime; const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical'; const startTime = localStore.get(storeKey); if (startTime) { const dt = new Date().getTime() - startTime; this.practicalTime = paperResp.data.practicalExamTime * 60 - Math.floor(dt / 1000); } else { - this.practicalTime = paperResp.data.practicalExamTime * 60; - const storeValue = new Date().getTime(); - localStore.set(storeKey, storeValue); + this.practicalTime = this.practicalExamTime * 60; } this.countdownTime = this.computationTime(this.practicalTime); paperResp.data.practicalQuestions.forEach(elem => { @@ -436,6 +436,12 @@ export default { } }, startCounting() { + const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical'; + const startTime = localStore.get(storeKey); + if (!startTime) { + const storeValue = new Date().getTime(); + localStore.set(storeKey, storeValue); + } this.countdown = setInterval(() => { if (this.practicalTime <= 0) { if (this.countdown) { diff --git a/src/views/scriptManage/scriptRecord/addAction.vue b/src/views/scriptManage/scriptRecord/addAction.vue index 66bb76afc..46d315955 100644 --- a/src/views/scriptManage/scriptRecord/addAction.vue +++ b/src/views/scriptManage/scriptRecord/addAction.vue @@ -75,7 +75,7 @@ import Vue from 'vue'; import Cookies from 'js-cookie'; import ConstConfig from '@/scripts/ConstConfig'; import CommandOperation from './command'; -import {addScriptAction, addScriptActionNew, modifyScriptAction, getAvailableDeviceCommand, getScriptPlayMember, getScriptPlayMemberNew} from '@/api/simulation'; +import {addScriptAction, addScriptActionNew, modifyScriptAction, modifyScriptActionNew, getAvailableDeviceCommand, getScriptPlayMember, getScriptPlayMemberNew} from '@/api/simulation'; export default { name: 'AddAction', components:{ @@ -451,20 +451,39 @@ export default { } else { const actionId = this.modalData.actionVO.id; - modifyScriptAction(group, actionId, data).then(response=>{ - this.modifying = false; - this.isNotModify = true; - this.$emit('setDisabled', this.isNotModify); - this.buttonName = this.$t('scriptRecord.addConversitionButton'); - this.operateType = 'add'; - this.$message.success(this.$t('scriptRecord.modifyConversitionSuccess')); - this.$emit('create'); - // this.$parent.$parent.$refs['addRole'].resetData([this.modalData.action.memberId,this.modalData.action.targetId]); - this.initActionData(); - }).catch(error => { - this.modifying = false; - this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`); - }); + if (this.drawWay) { + data.id = actionId; + modifyScriptActionNew(group, data).then(response=>{ + this.modifying = false; + this.isNotModify = true; + this.$emit('setDisabled', this.isNotModify); + this.buttonName = this.$t('scriptRecord.addConversitionButton'); + this.operateType = 'add'; + this.$message.success(this.$t('scriptRecord.modifyConversitionSuccess')); + this.$emit('create'); + // this.$parent.$parent.$refs['addRole'].resetData([this.modalData.action.memberId,this.modalData.action.targetId]); + this.initActionData(); + }).catch(error => { + this.modifying = false; + this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`); + }); + } else { + modifyScriptAction(group, actionId, data).then(response=>{ + this.modifying = false; + this.isNotModify = true; + this.$emit('setDisabled', this.isNotModify); + this.buttonName = this.$t('scriptRecord.addConversitionButton'); + this.operateType = 'add'; + this.$message.success(this.$t('scriptRecord.modifyConversitionSuccess')); + this.$emit('create'); + // this.$parent.$parent.$refs['addRole'].resetData([this.modalData.action.memberId,this.modalData.action.targetId]); + this.initActionData(); + }).catch(error => { + this.modifying = false; + this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`); + }); + } + } } else { console.log('error submit!!'); diff --git a/src/views/scriptManage/scriptRecord/getAction.vue b/src/views/scriptManage/scriptRecord/getAction.vue index 3de960ade..0d78946cd 100644 --- a/src/views/scriptManage/scriptRecord/getAction.vue +++ b/src/views/scriptManage/scriptRecord/getAction.vue @@ -20,7 +20,7 @@
- {{ $t('scriptRecord.modifyConversitionButton') }} + {{ $t('scriptRecord.modifyConversitionButton') }}
@@ -158,8 +158,8 @@ export default { // memberVOList = memberVOList.replace(new RegExp(rolename, 'g'), element.label); // }); // memberVOList = JSON.parse(memberVOList); - const lastData = JSON.stringify(response.data); - const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew); + const lastData = JSON.stringify(response.data.memberVOList); + const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleType); const actionList = response.data.actionVOList; @@ -218,9 +218,7 @@ export default { this.loadInitData(); }, modifyAction(row) { - if (!this.drawWay) { - this.$emit('setAction', row); - } + this.$emit('setAction', row); } } };