This commit is contained in:
sunzhenyu 2020-07-03 16:35:50 +08:00
commit 8213999c4f
24 changed files with 93 additions and 154 deletions

View File

@ -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) { export function addFailureRule(data) {
return request({ 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) { export function selectScriptMembersNew(group, data) {
return request({ return request({

View File

@ -427,6 +427,11 @@ class Jlmap {
// store.dispatch('map/updateTrainState', elem); // store.dispatch('map/updateTrainState', elem);
} else if (elem.deviceType === 'STAND') { } else if (elem.deviceType === 'STAND') {
store.dispatch('map/updateStationStand', elem); 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); const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
if (elem.dispose) { if (elem.dispose) {

View File

@ -82,13 +82,19 @@ export default class Line2 extends Group {
} }
setState(model) { setState(model) {
this.recover();
if (!this.isShowShape) return; if (!this.isShowShape) return;
/** 设置屏蔽门开关*/ /** 设置屏蔽门开关*/
model.screenDoorOpenStatus == 0 && this.openDoor(); /** 开门*/ if (model.fault == 'FAULT_PSD_OPEN') {
model.screenDoorOpenStatus != 0 && this.closeDoor(); /** 关门*/ this.doorFault();
this.openDoor();
} else {
model.screenDoorOpenStatus == 0 && this.openDoor(); /** 开门*/
model.screenDoorOpenStatus != 0 && this.closeDoor(); /** 关门*/
}
model.alarmStatus && this.alarm(); /** 收到警报(西安二号线样式) */ model.alarmStatus && this.alarm(); /** 收到警报(西安二号线样式) */
model.emergencyDepart && this.emergencyDepart(); /** 紧急出发按钮激活(西安二号线样式) */ model.emergencyDepart && this.emergencyDepart(); /** 紧急出发按钮激活(西安二号线样式) */
// /** 设置屏蔽门状态*/ // /** 设置屏蔽门状态*/
// switch (model.screenDoorStatus) { // switch (model.screenDoorStatus) {
// case '01': // case '01':

View File

@ -86,9 +86,10 @@ export function parser(data, skinCode, showConfig) {
zrUtil.each(data.espList || [], elem => { zrUtil.each(data.espList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Esp, elem, propConvert, showConfig); mapDevice[elem.code] = createDevice(deviceType.Esp, elem, propConvert, showConfig);
}, this); }, this);
// psd在stand后处理 -便于在stand上挂载关系
zrUtil.each(data.psdList || [], elem => { zrUtil.each(data.psdList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Psd, elem, propConvert, showConfig); mapDevice[elem.code] = createDevice(deviceType.Psd, elem, propConvert, showConfig);
mapDevice[elem.standCode].psdCode = elem.code;
}, this); }, this);
zrUtil.each(data.textList || [], elem => { zrUtil.each(data.textList || [], elem => {

View File

@ -14,12 +14,12 @@
<el-button v-if="isDemon && !isDesignPlatform && !isScheduling && !dataError" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{ $t('display.schema.loadScript') }}</el-button> <el-button v-if="isDemon && !isDesignPlatform && !isScheduling && !dataError" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{ $t('display.schema.loadScript') }}</el-button>
<el-button v-if="notScript && runing && !dataError" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('display.schema.previewRunDiagram') }}</el-button> <el-button v-if="notScript && runing && !dataError" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('display.schema.previewRunDiagram') }}</el-button>
<el-button v-if="!runing && notScript && !dataError" size="small" type="warning" @click="loadRunPlan">{{ $t('display.schema.loadRunDiagram') }}</el-button> <el-button v-if="!runing && notScript && !dataError" size="small" type="warning" @click="loadRunPlan">{{ $t('display.schema.loadRunDiagram') }}</el-button>
<el-button v-if="mode==OperateMode.FAULT && !dataError" size="small" type="danger" @click="setFault">{{ $t('display.schema.faultSetting') }}</el-button> <el-button v-if="mode==OperateMode.FAULT && !dataError" size="small" type="danger" @click="setFault">自动故障设置</el-button>
</el-button-group> </el-button-group>
<el-radio-group v-if="!isScheduling && !dataError" v-model="mode" size="small" @change="changeOperateMode(mode)"> <el-radio-group v-if="!isScheduling && !dataError" v-model="mode" size="small" @change="changeOperateMode(mode)">
<el-radio-button class="mode" :label="OperateMode.NORMAL">{{ $t('display.schema.normalOperation') }}</el-radio-button> <el-radio-button class="mode" :label="OperateMode.NORMAL">{{ $t('display.schema.normalOperation') }}</el-radio-button>
<el-radio-button class="mode" :label="OperateMode.FAULT">{{ $t('display.schema.faultOperation') }}</el-radio-button> <el-radio-button class="mode" :label="OperateMode.FAULT">故障模式</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
<fault-choose v-if="isDemon || isScript" ref="faultChoose" :group="group" :offset="offset" /> <fault-choose v-if="isDemon || isScript" ref="faultChoose" :group="group" :offset="offset" />
@ -39,7 +39,7 @@ import { OperateMode } from '@/scripts/ConstDic';
// import { getStationList } from '@/api/runplan'; // import { getStationList } from '@/api/runplan';
import { getByGroupStationList } from '@/api/jmap/map'; import { getByGroupStationList } from '@/api/jmap/map';
import {loadDraftScript, loadDraftScriptNew} from '@/api/designPlatform'; import {loadDraftScript, loadDraftScriptNew} from '@/api/designPlatform';
import { getEveryDayRunPlanNew, loadScriptNew, scriptExecuteNew } from '@/api/simulation'; import { getEveryDayRunPlanNew, loadScriptNew } from '@/api/simulation';
import Vue from 'vue'; import Vue from 'vue';
// //
@ -120,6 +120,10 @@ export default {
}, },
isLocalStation() { isLocalStation() {
return this.$store.state.training.prdType === '01'; return this.$store.state.training.prdType === '01';
},
drawWay() {
const drawWay = this.$route.query.drawWay;
return drawWay && JSON.parse(drawWay);
} }
}, },
watch: { watch: {
@ -201,6 +205,7 @@ export default {
async selectQuest(row, id, mapLocation, roleName) { async selectQuest(row, id, mapLocation, roleName) {
try { try {
let res; let res;
debugger;
if (this.isDesignPlatform) { if (this.isDesignPlatform) {
res = this.drawWay ? await loadDraftScriptNew(id, this.group) : await loadDraftScript(row.id, id, this.group); res = this.drawWay ? await loadDraftScriptNew(id, this.group) : await loadDraftScript(row.id, id, this.group);
} else { } else {
@ -212,10 +217,6 @@ export default {
const newMapLocation = {'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale}; const newMapLocation = {'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale};
Vue.prototype.$jlmap.setOptions(newMapLocation); Vue.prototype.$jlmap.setOptions(newMapLocation);
} }
scriptExecuteNew(this.group).then(data=>{
}).catch(error=>{
console.log(error);
});
} }
this.$emit('selectQuest', row); this.$emit('selectQuest', row);
} catch (error) { } catch (error) {

View File

@ -171,11 +171,6 @@ export default {
}; };
} }
}, },
watch: {
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// }
},
mounted() { mounted() {
}, },
methods: { methods: {

View File

@ -142,11 +142,6 @@ export default {
return form; return form;
} }
}, },
watch: {
// selected(val, oldVal) {
// this.deviceSelect(val);
// }
},
methods: { methods: {
deviceChange(code) { deviceChange(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);

View File

@ -22,6 +22,7 @@
</div> </div>
<div class="button-box"> <div class="button-box">
<el-button type="primary" size="mini" @click="handleScetionStationCode">{{ $t('map.setStationCode') }}</el-button> <el-button type="primary" size="mini" @click="handleScetionStationCode">{{ $t('map.setStationCode') }}</el-button>
<el-button type="" size="mini" @click="clearList">清空</el-button>
</div> </div>
</div> </div>
</div> </div>
@ -78,11 +79,6 @@ export default {
return list; return list;
} }
}, },
watch: {
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// }
},
mounted() { mounted() {
}, },
methods: { methods: {
@ -108,7 +104,7 @@ export default {
count++; count++;
} }
}); });
if (count == this.seclectDeviceList.length) { if (count && count == this.seclectDeviceList.length) {
this.stationCode = this.seclectDeviceList[0].stationCode; this.stationCode = this.seclectDeviceList[0].stationCode;
} else { } else {
this.stationCode = ''; this.stationCode = '';
@ -156,6 +152,27 @@ export default {
this.stationCode = ''; 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) { mouseenter(model) {
if (model._type == 'Section') { if (model._type == 'Section') {
model.instance.mouseover(); model.instance.mouseover();

View File

@ -247,9 +247,6 @@ export default {
} }
}, },
watch: { watch: {
// selected(val, oldVal) {
// this.deviceSelect(val);
// },
indicatorLightList(val) { indicatorLightList(val) {
this.handleIndicatorLightList(val); this.handleIndicatorLightList(val);
}, },

View File

@ -167,11 +167,6 @@ export default {
return form; return form;
} }
}, },
watch: {
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// }
},
mounted() { mounted() {
}, },
methods: { methods: {

View File

@ -149,11 +149,6 @@ export default {
return form; return form;
} }
}, },
watch: {
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// }
},
mounted() { mounted() {
}, },
methods: { methods: {

View File

@ -115,9 +115,6 @@ export default {
} }
}, },
watch: { watch: {
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// },
'$store.state.map.deleteCount': function (val) { '$store.state.map.deleteCount': function (val) {
this.deleteObj(); this.deleteObj();
} }

View File

@ -156,11 +156,6 @@ export default {
return form; return form;
} }
}, },
watch: {
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// }
},
mounted() { mounted() {
}, },
methods: { methods: {

View File

@ -198,11 +198,6 @@ export default {
return this.editModel.points.length > 0; return this.editModel.points.length > 0;
} }
}, },
watch: {
// selected(val, oldVal) {
// this.deviceSelect(val);
// }
},
mounted() { mounted() {
this.$Dictionary.lineType().then(list => { this.$Dictionary.lineType().then(list => {
this.LineTypeList = list; this.LineTypeList = list;

View File

@ -203,11 +203,6 @@ export default {
return this.editModel.points.length > 0; return this.editModel.points.length > 0;
} }
}, },
watch: {
// selected(val, oldVal) {
// this.deviceSelect(val);
// }
},
mounted() { mounted() {
this.$Dictionary.lineType().then(list => { this.$Dictionary.lineType().then(list => {
this.LineTypeList = list; this.LineTypeList = list;

View File

@ -199,14 +199,6 @@ export default {
return list; return list;
} }
}, },
watch: {
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// },
'$store.state.map.deleteCount': function (val) {
this.deleteObj();
}
},
mounted() { mounted() {
this.$Dictionary.doorLocationType().then(list => { this.$Dictionary.doorLocationType().then(list => {
this.DoorLocationTypeList = list; this.DoorLocationTypeList = list;

View File

@ -331,11 +331,6 @@ export default {
}; };
} }
}, },
watch: {
// selected(val, oldVal) {
// this.deviceSelect(val);
// }
},
mounted() { mounted() {
this.SignalLeftOrRightList = this.$ConstSelect.SignalLeftOrRightList; this.SignalLeftOrRightList = this.$ConstSelect.SignalLeftOrRightList;

View File

@ -133,11 +133,6 @@ export default {
}; };
} }
}, },
watch: {
// selected(val) {
// this.deviceSelect(val);
// }
},
methods: { methods: {
deviceSelect(selected) { deviceSelect(selected) {
this.$refs.dataform && this.$refs.dataform.resetFields(); this.$refs.dataform && this.$refs.dataform.resetFields();

View File

@ -189,7 +189,7 @@ export default {
{ prop: 'kmPost', label: this.$t('map.stationKmPost'), type: 'input' }, { prop: 'kmPost', label: this.$t('map.stationKmPost'), type: 'input' },
{ prop: 'kmPostFont', label: this.$t('map.stationKmPostFont'), type: 'font', placeholder: this.$t('tip.kilometerFont') }, { prop: 'kmPostFont', label: this.$t('map.stationKmPostFont'), type: 'font', placeholder: this.$t('tip.kilometerFont') },
{ prop: 'kmPostFontColor', label: this.$t('map.stationKmPostFontColor'), type: 'color' }, { 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', 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.x', firstLevel: 'controlModePoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px'},
{ prop: 'controlModePoint.y', firstLevel: 'controlModePoint', secondLevel: 'y', label: 'y:', 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'), name: this.$t('map.mapData'),
item: [ item: [
{ prop: 'ciStation', label: this.$t('map.isCIStation'), type: 'checkbox'}, { 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: '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: 'relStationCodeList', label: '联锁站关联车站:', type: 'multiSelect', optionLabel: 'name', optionValue: 'code', options: this.relStationList, isHidden: !this.idCiStation},
{ prop: 'runPlanName', label: this.$t('map.stationRunPlanName'), type: 'input' } { prop: 'runPlanName', label: this.$t('map.stationRunPlanName'), type: 'input' }
] ]
@ -292,71 +292,57 @@ export default {
this.controlled = !!beCentralizedStation[selected.code]; 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) { changeChargeStation(list) {
if (data.length > 0) { let lists = [];
if (list.length > 0) {
this.chargeStation.forEach(station=>{ this.chargeStation.forEach(station=>{
const newModal = Object.assign({}, station); lists = lists.concat(this.setStationStand(station, ''));
this.setStationStand(station, ''); list.forEach(each=>{
data.forEach(each=>{
switch (each) { switch (each) {
case station.code: { case station.code: {
this.setStationStand(station, this.editModel.code); lists = lists.concat(this.setStationStand(station, this.editModel.code));
break; break;
} }
} }
}); });
this.$emit('updateMapModel', newModal);
}); });
} else { } else {
// //
this.modifyChargeStation(); lists = lists.concat(this.modifyChargeStation());
} }
this.edit(); return lists;
}, },
changeCentralized(data) { changeCentralized(data) {
if (!data) { let list = [];
// if (!data) { //
this.editModel.chargeStationCodeList = []; this.editModel.chargeStationCodeList = [];
this.edit(); const arr = this.modifyChargeStation();
this.modifyChargeStation(); const arr1 = this.setStationStand(this.editModel, '');
this.setStationStand(this.editModel, ''); list = [...arr, ...arr1];
} else { } else {
this.setStationStand(this.editModel, this.editModel.code); list = list.concat(this.setStationStand(this.editModel, this.editModel.code));
} }
return list;
}, },
modifyChargeStation() { modifyChargeStation() {
let list = [];
this.chargeStation.forEach(station=>{ this.chargeStation.forEach(station=>{
const newModal = Object.assign({}, station); list = list.concat(this.setStationStand(station, ''));
// {}
this.setStationStand(station, '');
this.$emit('updateMapModel', newModal);
}); });
return list;
}, },
// {} // {}
setStationStand(station, code) { setStationStand(station, code) {
const list = [];
this.stationStandList.forEach(elem=>{ this.stationStandList.forEach(elem=>{
if (elem.stationCode == station.code) { if (elem.stationCode == station.code) {
const stationStand = Object.assign({}, elem); const stationStand = deepAssign({}, elem);
stationStand.deviceStationCode = code; stationStand.deviceStationCode = code;
this.$emit('updateMapModel', stationStand); list.push(stationStand);
} }
}); });
return list;
}, },
create() { create() {
this.$refs['make'].validate((valid) => { this.$refs['make'].validate((valid) => {
@ -401,7 +387,13 @@ export default {
edit() { edit() {
this.$refs['dataform'].validate((valid) => { this.$refs['dataform'].validate((valid) => {
if (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);
} }
}); });
}, },

View File

@ -266,16 +266,7 @@ export default {
return this.editModel.downDetainLamp; return this.editModel.downDetainLamp;
}, },
PhysicalSectionList() { PhysicalSectionList() {
let list = []; return this.sectionList.filter(elem => elem.type === '01');
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);
} }
}, },
mounted() { mounted() {

View File

@ -182,11 +182,6 @@ export default {
return form; return form;
} }
}, },
watch: {
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// }
},
methods: { methods: {
deviceChange(code) { deviceChange(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);

View File

@ -187,11 +187,6 @@ export default {
return this.$jlmap.style; return this.$jlmap.style;
} }
}, },
watch: {
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// }
},
methods: { methods: {
filterSections(query, item) { filterSections(query, item) {
return item.pinyin.indexOf(query) > -1; return item.pinyin.indexOf(query) > -1;

View File

@ -162,9 +162,6 @@ export default {
} }
}, },
watch: { watch: {
// selected(val, oldVal) {
// this.deviceSelect(val);
// },
stationList() { stationList() {
this.getConcertrateStation(); this.getConcertrateStation();
} }

View File

@ -45,12 +45,10 @@ export default {
rules() { rules() {
const crules = { const crules = {
name: [ name: [
{ validator: this.validateScriptName, trigger: 'blur' }, { required: true, validator: this.validateScriptName, trigger: 'blur' }
{ validator: this.validateScriptName, trigger: 'change' }
], ],
description: [ description: [
{ validator: this.validateDescription, trigger: 'blur' }, { required: true, validator: this.validateDescription, trigger: 'blur' }
{ validator: this.validateDescription, trigger: 'change' }
] ]
}; };
return crules; return crules;
@ -58,7 +56,7 @@ export default {
}, },
methods: { methods: {
validateScriptName(rule, value, callback) { validateScriptName(rule, value, callback) {
if (value.trim().length === 0) { if (value.trim().length == 0) {
this.formModel.name = this.formModel.name.replace(/\s/g, ''); this.formModel.name = this.formModel.name.replace(/\s/g, '');
return callback(new Error(this.$t('scriptRecord.inputScriptName'))); return callback(new Error(this.$t('scriptRecord.inputScriptName')));
} else { } else {
@ -66,7 +64,7 @@ export default {
} }
}, },
validateDescription(rule, value, callback) { validateDescription(rule, value, callback) {
if (value.trim().length === 0) { if (value.trim().length == 0) {
this.formModel.description = this.formModel.description.replace(/\s/g, ''); this.formModel.description = this.formModel.description.replace(/\s/g, '');
return callback(new Error(this.$t('scriptRecord.inputScriptDescription'))); return callback(new Error(this.$t('scriptRecord.inputScriptDescription')));
} else { } else {