diff --git a/src/api/simulation.js b/src/api/simulation.js index c5c494182..f01605202 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -27,6 +27,14 @@ export function setFailureModeNew(data, group) { }); } +/** 获取仿真待触发的故障列表*/ +export function getSimulationFaultRules(group) { + return request({ + url: `/simulation/${group}/faultMode/faultRule`, + method: 'get' + }); +} + // 创建故障规则(新版) export function addFailureRule(data) { return request({ @@ -345,14 +353,6 @@ 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/map.js b/src/jmapNew/map.js index a252b94f0..659c4e500 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -427,6 +427,11 @@ class Jlmap { // store.dispatch('map/updateTrainState', elem); } else if (elem.deviceType === 'STAND') { store.dispatch('map/updateStationStand', elem); + const psdDevice = this.mapDevice[this.mapDevice[elem.code].psdCode]; + if (psdDevice) { + psdDevice.fault = elem.fault; + this.$painter.update(psdDevice); + } } const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig); if (elem.dispose) { diff --git a/src/jmapNew/shape/Psd/index.js b/src/jmapNew/shape/Psd/index.js index e36d77cc9..c3d51d9f8 100644 --- a/src/jmapNew/shape/Psd/index.js +++ b/src/jmapNew/shape/Psd/index.js @@ -82,13 +82,19 @@ export default class Line2 extends Group { } setState(model) { + this.recover(); if (!this.isShowShape) return; /** 设置屏蔽门开关*/ - model.screenDoorOpenStatus == 0 && this.openDoor(); /** 开门*/ - model.screenDoorOpenStatus != 0 && this.closeDoor(); /** 关门*/ - + if (model.fault == 'FAULT_PSD_OPEN') { + this.doorFault(); + this.openDoor(); + } else { + model.screenDoorOpenStatus == 0 && this.openDoor(); /** 开门*/ + model.screenDoorOpenStatus != 0 && this.closeDoor(); /** 关门*/ + } model.alarmStatus && this.alarm(); /** 收到警报(西安二号线样式) */ model.emergencyDepart && this.emergencyDepart(); /** 紧急出发按钮激活(西安二号线样式) */ + // /** 设置屏蔽门状态*/ // switch (model.screenDoorStatus) { // case '01': diff --git a/src/jmapNew/utils/parser.js b/src/jmapNew/utils/parser.js index 271bfe881..c803229e2 100644 --- a/src/jmapNew/utils/parser.js +++ b/src/jmapNew/utils/parser.js @@ -86,9 +86,10 @@ export function parser(data, skinCode, showConfig) { zrUtil.each(data.espList || [], elem => { mapDevice[elem.code] = createDevice(deviceType.Esp, elem, propConvert, showConfig); }, this); - + // psd在stand后处理 -便于在stand上挂载关系 zrUtil.each(data.psdList || [], elem => { mapDevice[elem.code] = createDevice(deviceType.Psd, elem, propConvert, showConfig); + mapDevice[elem.standCode].psdCode = elem.code; }, this); zrUtil.each(data.textList || [], elem => { diff --git a/src/views/newMap/displayNew/menuSchema.vue b/src/views/newMap/displayNew/menuSchema.vue index 1a57e0656..f1f22cdbc 100644 --- a/src/views/newMap/displayNew/menuSchema.vue +++ b/src/views/newMap/displayNew/menuSchema.vue @@ -14,12 +14,12 @@ {{ $t('display.schema.loadScript') }} {{ $t('display.schema.previewRunDiagram') }} {{ $t('display.schema.loadRunDiagram') }} - {{ $t('display.schema.faultSetting') }} + 自动故障设置 {{ $t('display.schema.normalOperation') }} - {{ $t('display.schema.faultOperation') }} + 故障模式 @@ -39,7 +39,7 @@ import { OperateMode } from '@/scripts/ConstDic'; // import { getStationList } from '@/api/runplan'; import { getByGroupStationList } from '@/api/jmap/map'; import {loadDraftScript, loadDraftScriptNew} from '@/api/designPlatform'; -import { getEveryDayRunPlanNew, loadScriptNew, scriptExecuteNew } from '@/api/simulation'; +import { getEveryDayRunPlanNew, loadScriptNew } from '@/api/simulation'; import Vue from 'vue'; // 右上角操作 @@ -120,6 +120,10 @@ export default { }, isLocalStation() { return this.$store.state.training.prdType === '01'; + }, + drawWay() { + const drawWay = this.$route.query.drawWay; + return drawWay && JSON.parse(drawWay); } }, watch: { @@ -201,6 +205,7 @@ export default { async selectQuest(row, id, mapLocation, roleName) { try { let res; + debugger; if (this.isDesignPlatform) { res = this.drawWay ? await loadDraftScriptNew(id, this.group) : await loadDraftScript(row.id, id, this.group); } else { @@ -212,10 +217,6 @@ export default { const newMapLocation = {'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale}; Vue.prototype.$jlmap.setOptions(newMapLocation); } - scriptExecuteNew(this.group).then(data=>{ - }).catch(error=>{ - console.log(error); - }); } this.$emit('selectQuest', row); } catch (error) { diff --git a/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue b/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue index a8ed0b3ba..789c235db 100644 --- a/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue @@ -171,11 +171,6 @@ export default { }; } }, - watch: { - // selected: function (val, oldVal) { - // this.deviceSelect(val); - // } - }, mounted() { }, methods: { diff --git a/src/views/newMap/newMapdraft/mapoperate/arrow.vue b/src/views/newMap/newMapdraft/mapoperate/arrow.vue index eb1909ceb..c108ab4c5 100644 --- a/src/views/newMap/newMapdraft/mapoperate/arrow.vue +++ b/src/views/newMap/newMapdraft/mapoperate/arrow.vue @@ -142,11 +142,6 @@ export default { return form; } }, - watch: { - // selected(val, oldVal) { - // this.deviceSelect(val); - // } - }, methods: { deviceChange(code) { this.$emit('setCenter', code); diff --git a/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue b/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue index 5b4e35d38..d8626b3d0 100644 --- a/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue @@ -22,6 +22,7 @@
{{ $t('map.setStationCode') }} + 清空
@@ -78,11 +79,6 @@ export default { return list; } }, - watch: { - // selected: function (val, oldVal) { - // this.deviceSelect(val); - // } - }, mounted() { }, methods: { @@ -108,7 +104,7 @@ export default { count++; } }); - if (count == this.seclectDeviceList.length) { + if (count && count == this.seclectDeviceList.length) { this.stationCode = this.seclectDeviceList[0].stationCode; } else { this.stationCode = ''; @@ -156,6 +152,27 @@ export default { this.stationCode = ''; } }, + clearList() { // 清空数据 + this.stationCode = ''; + this.$store.dispatch('map/setSeclectDeviceList', []); + this.modelList = [ + { + type: 'Section', + name: '区段列表', + list: [] + }, + { + type: 'Switch', + name: '道岔列表', + list: [] + }, + { + type: 'Signal', + name: '信号机列表', + list: [] + } + ]; + }, mouseenter(model) { if (model._type == 'Section') { model.instance.mouseover(); diff --git a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue index 96830f268..ee82890b3 100644 --- a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue +++ b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue @@ -247,9 +247,6 @@ export default { } }, watch: { - // selected(val, oldVal) { - // this.deviceSelect(val); - // }, indicatorLightList(val) { this.handleIndicatorLightList(val); }, diff --git a/src/views/newMap/newMapdraft/mapoperate/counter.vue b/src/views/newMap/newMapdraft/mapoperate/counter.vue index d92995565..f52d7b9b5 100644 --- a/src/views/newMap/newMapdraft/mapoperate/counter.vue +++ b/src/views/newMap/newMapdraft/mapoperate/counter.vue @@ -167,11 +167,6 @@ export default { return form; } }, - watch: { - // selected: function (val, oldVal) { - // this.deviceSelect(val); - // } - }, mounted() { }, methods: { diff --git a/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue b/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue index e710c84b4..3b9f9e001 100644 --- a/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue +++ b/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue @@ -149,11 +149,6 @@ export default { return form; } }, - watch: { - // selected: function (val, oldVal) { - // this.deviceSelect(val); - // } - }, mounted() { }, methods: { diff --git a/src/views/newMap/newMapdraft/mapoperate/espDraft.vue b/src/views/newMap/newMapdraft/mapoperate/espDraft.vue index 3c1093231..b85992e8a 100644 --- a/src/views/newMap/newMapdraft/mapoperate/espDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/espDraft.vue @@ -115,9 +115,6 @@ export default { } }, watch: { - // selected: function (val, oldVal) { - // this.deviceSelect(val); - // }, '$store.state.map.deleteCount': function (val) { this.deleteObj(); } diff --git a/src/views/newMap/newMapdraft/mapoperate/lcControl.vue b/src/views/newMap/newMapdraft/mapoperate/lcControl.vue index 60ef3ed5c..b5e47c625 100644 --- a/src/views/newMap/newMapdraft/mapoperate/lcControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/lcControl.vue @@ -156,11 +156,6 @@ export default { return form; } }, - watch: { - // selected: function (val, oldVal) { - // this.deviceSelect(val); - // } - }, mounted() { }, methods: { diff --git a/src/views/newMap/newMapdraft/mapoperate/line.vue b/src/views/newMap/newMapdraft/mapoperate/line.vue index 43d1fbc2d..131780ab8 100644 --- a/src/views/newMap/newMapdraft/mapoperate/line.vue +++ b/src/views/newMap/newMapdraft/mapoperate/line.vue @@ -198,11 +198,6 @@ export default { return this.editModel.points.length > 0; } }, - watch: { - // selected(val, oldVal) { - // this.deviceSelect(val); - // } - }, mounted() { this.$Dictionary.lineType().then(list => { this.LineTypeList = list; diff --git a/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue b/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue index cf543a61f..995511a21 100644 --- a/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue @@ -203,11 +203,6 @@ export default { return this.editModel.points.length > 0; } }, - watch: { - // selected(val, oldVal) { - // this.deviceSelect(val); - // } - }, mounted() { this.$Dictionary.lineType().then(list => { this.LineTypeList = list; diff --git a/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue b/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue index bd0a7b507..bb86a0f58 100644 --- a/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue @@ -199,14 +199,6 @@ export default { return list; } }, - watch: { - // selected: function (val, oldVal) { - // this.deviceSelect(val); - // }, - '$store.state.map.deleteCount': function (val) { - this.deleteObj(); - } - }, mounted() { this.$Dictionary.doorLocationType().then(list => { this.DoorLocationTypeList = list; diff --git a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue index 5d86a5588..36fbb6690 100644 --- a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue @@ -331,11 +331,6 @@ export default { }; } }, - watch: { - // selected(val, oldVal) { - // this.deviceSelect(val); - // } - }, mounted() { this.SignalLeftOrRightList = this.$ConstSelect.SignalLeftOrRightList; diff --git a/src/views/newMap/newMapdraft/mapoperate/splitStation.vue b/src/views/newMap/newMapdraft/mapoperate/splitStation.vue index 4d88e5afe..c602364db 100644 --- a/src/views/newMap/newMapdraft/mapoperate/splitStation.vue +++ b/src/views/newMap/newMapdraft/mapoperate/splitStation.vue @@ -133,11 +133,6 @@ export default { }; } }, - watch: { - // selected(val) { - // this.deviceSelect(val); - // } - }, methods: { deviceSelect(selected) { this.$refs.dataform && this.$refs.dataform.resetFields(); diff --git a/src/views/newMap/newMapdraft/mapoperate/station.vue b/src/views/newMap/newMapdraft/mapoperate/station.vue index 10f64064a..3064f856c 100644 --- a/src/views/newMap/newMapdraft/mapoperate/station.vue +++ b/src/views/newMap/newMapdraft/mapoperate/station.vue @@ -189,7 +189,7 @@ export default { { prop: 'kmPost', label: this.$t('map.stationKmPost'), type: 'input' }, { prop: 'kmPostFont', label: this.$t('map.stationKmPostFont'), type: 'font', placeholder: this.$t('tip.kilometerFont') }, { prop: 'kmPostFontColor', label: this.$t('map.stationKmPostFontColor'), type: 'color' }, - { prop: 'createControlMode', label: '控制模式:', type: 'checkbox', change:true, deviceChange:this.changeControlMode}, + { prop: 'createControlMode', label: '控制模式:', type: 'checkbox' }, { prop: 'controlModePoint', label: this.$t('map.stationControlPosition'), type: 'coordinate', width: '120px', isHidden:!this.editModel.createControlMode, children: [ { prop: 'controlModePoint.x', firstLevel: 'controlModePoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px'}, { prop: 'controlModePoint.y', firstLevel: 'controlModePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px'} @@ -205,9 +205,9 @@ export default { name: this.$t('map.mapData'), item: [ { prop: 'ciStation', label: this.$t('map.isCIStation'), type: 'checkbox'}, - { prop: 'centralized', label: this.$t('map.centralized'), type: 'checkbox', disabled:this.controlled, change:true, deviceChange:this.changeCentralized }, + { prop: 'centralized', label: this.$t('map.centralized'), type: 'checkbox', disabled:this.controlled }, { prop: 'zcCode', label: this.$t('map.zcCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.zcList, isHidden: !this.isZcCode, disabled:true }, - { prop: 'chargeStationCodeList', label: this.$t('map.chargeStationList'), type: 'multiSelect', optionLabel: 'name', optionValue: 'code', options: this.chargeStation, isHidden: !this.isZcCode, deviceChange:this.changeChargeStation}, + { prop: 'chargeStationCodeList', label: '管理车站列表:', type: 'multiSelect', optionLabel: 'name', optionValue: 'code', options: this.chargeStation, isHidden: !this.isZcCode }, { prop: 'relStationCodeList', label: '联锁站关联车站:', type: 'multiSelect', optionLabel: 'name', optionValue: 'code', options: this.relStationList, isHidden: !this.idCiStation}, { prop: 'runPlanName', label: this.$t('map.stationRunPlanName'), type: 'input' } ] @@ -292,71 +292,57 @@ export default { this.controlled = !!beCentralizedStation[selected.code]; } }, - changeControlMode(data) { - if (data) { - this.editModel.controlModePoint = { - x:this.editModel.position.x, - y:this.editModel.position.y + 30 - }; - } else { - this.editModel.controlModePoint = { - x:0, - y:0 - }; - } - }, // 选择管理车站 - changeChargeStation(data) { - if (data.length > 0) { + changeChargeStation(list) { + let lists = []; + if (list.length > 0) { this.chargeStation.forEach(station=>{ - const newModal = Object.assign({}, station); - this.setStationStand(station, ''); - data.forEach(each=>{ + lists = lists.concat(this.setStationStand(station, '')); + list.forEach(each=>{ switch (each) { case station.code: { - this.setStationStand(station, this.editModel.code); + lists = lists.concat(this.setStationStand(station, this.editModel.code)); break; } } }); - this.$emit('updateMapModel', newModal); }); } else { // 没有选中数据,直接将其他车站设置为非控制 - this.modifyChargeStation(); + lists = lists.concat(this.modifyChargeStation()); } - this.edit(); + return lists; }, changeCentralized(data) { - if (!data) { - // 将当前车站选为非集中站 + let list = []; + if (!data) { // 将当前车站选为非集中站 this.editModel.chargeStationCodeList = []; - this.edit(); - this.modifyChargeStation(); - this.setStationStand(this.editModel, ''); + const arr = this.modifyChargeStation(); + const arr1 = this.setStationStand(this.editModel, ''); + list = [...arr, ...arr1]; } else { - this.setStationStand(this.editModel, this.editModel.code); + list = list.concat(this.setStationStand(this.editModel, this.editModel.code)); } + return list; }, modifyChargeStation() { + let list = []; this.chargeStation.forEach(station=>{ - const newModal = Object.assign({}, station); - - // 将原来被控制的车站下的站台,属性{所属设备集中站}设置为空 - this.setStationStand(station, ''); - - this.$emit('updateMapModel', newModal); + list = list.concat(this.setStationStand(station, '')); }); + return list; }, - // 设置属性{所属设备集中站} + // 设置站台 {设备集中站} setStationStand(station, code) { + const list = []; this.stationStandList.forEach(elem=>{ if (elem.stationCode == station.code) { - const stationStand = Object.assign({}, elem); + const stationStand = deepAssign({}, elem); stationStand.deviceStationCode = code; - this.$emit('updateMapModel', stationStand); + list.push(stationStand); } }); + return list; }, create() { this.$refs['make'].validate((valid) => { @@ -401,7 +387,13 @@ export default { edit() { this.$refs['dataform'].validate((valid) => { if (valid) { - this.$emit('updateMapModel', this.editModel); + const list = this.changeChargeStation(this.editModel.chargeStationCodeList); + let centralizedList = []; + if (this.editModel.centralized != this.selected.centralized) { + centralizedList = this.changeCentralized(this.editModel.centralized); + } + const models = [this.editModel, ...list, ...centralizedList]; + this.$emit('updateMapModel', models); } }); }, diff --git a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue index b1919861e..e6e1b5659 100644 --- a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue +++ b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue @@ -266,16 +266,7 @@ export default { return this.editModel.downDetainLamp; }, PhysicalSectionList() { - let list = []; - if (this.sectionList && this.sectionList.length) { - list = this.sectionList.filter(elem => { return elem.type === '01'; }); - } - return list; - } - }, - watch: { - selected: function (val, oldVal) { - this.deviceSelect(val); + return this.sectionList.filter(elem => elem.type === '01'); } }, mounted() { diff --git a/src/views/newMap/newMapdraft/mapoperate/text.vue b/src/views/newMap/newMapdraft/mapoperate/text.vue index 88b4d197d..1ec56c9ab 100644 --- a/src/views/newMap/newMapdraft/mapoperate/text.vue +++ b/src/views/newMap/newMapdraft/mapoperate/text.vue @@ -182,11 +182,6 @@ export default { return form; } }, - watch: { - // selected: function (val, oldVal) { - // this.deviceSelect(val); - // } - }, methods: { deviceChange(code) { this.$emit('setCenter', code); diff --git a/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue b/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue index b69c3af7c..5e6573b9b 100644 --- a/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue +++ b/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue @@ -187,11 +187,6 @@ export default { return this.$jlmap.style; } }, - watch: { - // selected: function (val, oldVal) { - // this.deviceSelect(val); - // } - }, methods: { filterSections(query, item) { return item.pinyin.indexOf(query) > -1; diff --git a/src/views/newMap/newMapdraft/mapoperate/zcControl.vue b/src/views/newMap/newMapdraft/mapoperate/zcControl.vue index e5779eb98..4ebb71aa5 100644 --- a/src/views/newMap/newMapdraft/mapoperate/zcControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/zcControl.vue @@ -162,9 +162,6 @@ export default { } }, watch: { - // selected(val, oldVal) { - // this.deviceSelect(val); - // }, stationList() { this.getConcertrateStation(); } diff --git a/src/views/scriptManage/create.vue b/src/views/scriptManage/create.vue index c6df9178f..a9bc78b37 100644 --- a/src/views/scriptManage/create.vue +++ b/src/views/scriptManage/create.vue @@ -45,12 +45,10 @@ export default { rules() { const crules = { name: [ - { validator: this.validateScriptName, trigger: 'blur' }, - { validator: this.validateScriptName, trigger: 'change' } + { required: true, validator: this.validateScriptName, trigger: 'blur' } ], description: [ - { validator: this.validateDescription, trigger: 'blur' }, - { validator: this.validateDescription, trigger: 'change' } + { required: true, validator: this.validateDescription, trigger: 'blur' } ] }; return crules; @@ -58,7 +56,7 @@ export default { }, methods: { validateScriptName(rule, value, callback) { - if (value.trim().length === 0) { + if (value.trim().length == 0) { this.formModel.name = this.formModel.name.replace(/\s/g, ''); return callback(new Error(this.$t('scriptRecord.inputScriptName'))); } else { @@ -66,7 +64,7 @@ export default { } }, validateDescription(rule, value, callback) { - if (value.trim().length === 0) { + if (value.trim().length == 0) { this.formModel.description = this.formModel.description.replace(/\s/g, ''); return callback(new Error(this.$t('scriptRecord.inputScriptDescription'))); } else {