This commit is contained in:
zyy 2020-10-12 16:45:37 +08:00
commit f85edb85cd
13 changed files with 163 additions and 36 deletions

View File

@ -54,7 +54,7 @@ class Jlmap {
this.previewOrMapDraw = opts.showConfig.previewOrMapDraw;
this.$zr = zrender.init(opts.dom, deepAssign({ renderer, devicePixelRatio, width, height }, opts.config));
this.$zr.dom.setAttribute('tabIndex', -1);
this.$zr.dom.setAttribute('tabIndex', -1);
this.$options = new Options(deepAssign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {}), (dataZoom) => { this.$mouseController.trigger(this.events.DataZoom, dataZoom); }); // 缩放
this.$painter = new Painter(this);
@ -501,6 +501,14 @@ class Jlmap {
psdDevice.fault = elem.fault;
this.$painter.update(psdDevice);
}
} else if (elem.deviceType === 'DIRECTION_ROD') {
store.state.map.directionRodList.forEach(item => {
if (elem.uniqueCode && elem.uniqueCode === `${item.startStationCode}-${item.endStationCode}-${item.right}`) {
this.$painter.update(elem);
} else if (!elem.uniqueCode) {
this.$painter.update(elem);
}
});
}
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
if (elem.dispose) {

View File

@ -29,7 +29,7 @@ export default class DirectionRod extends Group {
zlevel: this.zlevel,
z: this.z,
origin: [model.position.x + (style.DirectionRod.rodLength / 2), model.position.y],
rotation: model.right ? 0 : Math.PI,
rotation: model.right ? Math.PI : 0,
shape: {
points: [
[model.position.x, model.position.y],
@ -75,6 +75,15 @@ export default class DirectionRod extends Group {
setState(model) {
// if (!this.isShowShape) return;
// this.recover();
if (model.reverse && this.model.right) {
this.rod.attr('rotation', 0);
} else if (!model.reverse && this.model.right) {
this.rod.attr('rotation', Math.PI);
} else if (model.reverse && !this.model.right) {
this.rod.attr('rotation', Math.PI);
} else if (!model.reverse && !this.model.right) {
this.rod.attr('rotation', 0);
}
}
createMouseEvent() {
@ -88,6 +97,9 @@ export default class DirectionRod extends Group {
} else {
this.hideMode();
}
}
drawSelected() {
}
setShowStation(stationCode) {
if (!stationCode || this.model.stationCode === stationCode) {

View File

@ -103,7 +103,8 @@ export default {
signalParamList: [],
stationParamList: [],
standParamList: [],
routeParamList: []
routeParamList: [],
directionRodParamList: []
};
},
computed: {
@ -153,6 +154,9 @@ export default {
case 'StationStand':
this.handleStandMenu();
break;
case 'DirectionRod':
this.handleDirectionRodMenu();
break;
}
}
}).catch((error) => {
@ -368,6 +372,21 @@ export default {
speedLimitValue: '5'
};
},
handleDirectionRodMenu() {
this.clearAllMenuShow();
this.deviceHighLight(this.oldDevice, false);
this.deviceHighLight(this.selectedObj, true);
this.oldDevice = this.selectedObj;
this.centralizedStationList = new Array(15).fill({});
this.directionRodParamList.forEach((directionRod, index) => {
this.centralizedStationList[index] = directionRod;
});
this.tempData = [];
this.tempData.push(this.selectedObj);
this.param = {
directionRodCode: `${this.selectedObj.startStationCode}-${this.selectedObj.endStationCode}-${this.selectedObj.right}`
};
},
handleBasicMenu() {
this.deviceHighLight(this.oldDevice, false);
if (this.oldClickObj) {
@ -557,6 +576,10 @@ export default {
{ name: '越站', cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP, operate: OperationEvent.StationStand.setJumpStop.menuButton, show: false, securityCommand: true },
{ name: '取消越站', cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP, operate: OperationEvent.StationStand.cancelJumpStop.menuButton, show: false, securityCommand: true }
];
this.directionRodParamList = [
{ name: '切换左向', cmdType: CMD.DirectionRod.CMD_DIRECTION_CHANGE, operate: OperationEvent.StationStand.setDetainTrain.menuButton, show: false },
{ name: '切换右向', cmdType: CMD.DirectionRod.CMD_DIRECTION_CHANGE, operate: OperationEvent.StationStand.setDetainTrain.menuButton, show: false }
];
},
initRouteMenus() {
this.routeParamList = [];

View File

@ -150,7 +150,8 @@ export default {
{ label: '车次窗', value: 'TrainWindow' },
{ label: '全线限速', value: 'LimitControl' },
{ label: '司机', value: 'Driver' },
{ label: '列车', value: 'Train' }
{ label: '列车', value: 'Train' },
{ label: '方向杆', value: 'DirectionRod'}
],
simulationDeviceList:[

View File

@ -260,5 +260,8 @@ export default {
},
LimitControl: {
CMD_CANCEL_ALL_LIMIT_SPEED: {value: 'Cancel_All_Limit_Speed', label: '取消全线临时限速'}
},
DirectionRod: {
CMD_DIRECTION_CHANGE: {value: 'Direction_Change', label: '切换方向'}
}
};

View File

@ -13,7 +13,8 @@ const scriptRecord = {
updateRoleStatus:0, // 剧本更新角色标志
updateRoleId:'', // 剧本更新角色id
updateCoversitionStatus:0, // 剧本仿真更新会话信息
userRole:null // 剧本更新的角色
userRole:null, // 剧本更新的角色
operationalItemVOs:{} // 剧本场景的运营统计数据缓存
},
getters: {
mapLocation: (state)=>{
@ -72,6 +73,9 @@ const scriptRecord = {
},
updateCoversitionInfo:(state) => {
state.updateCoversitionStatus += 1;
},
updateOperationalItemVOs:(state, operationalItemVOs) => {
state.operationalItemVOs = operationalItemVOs;
}
},
actions: {
@ -101,6 +105,9 @@ const scriptRecord = {
},
updateCoversitionInfo:({ commit }) => {
commit('updateCoversitionInfo');
},
updateOperationalItemVOs:({ commit }, operationalItemVOs) => {
commit('updateOperationalItemVOs', operationalItemVOs);
}
}
};

View File

@ -401,7 +401,7 @@ export default {
}
});
// { label: '', value: 'allConcentrateStation', active: false, sign: 'DEVICE_STATION' },
stationSupervisorList['ALL_STATION'] = { label: '全部车站', value: 'allStation', active: false, sign: 'ALL_STATION' };
stationSupervisorList['ALL_STATION'] = { label: '所有车站', value: 'allStation', active: false, sign: 'ALL_STATION' };
driverList['ALL_TRAIN'] = { label: '所有司机', value: 'allTrain', show: false, active: false, sign: 'ALL_TRAIN' };
this.treeData = [{
label: '行调',

View File

@ -23,7 +23,7 @@
</el-table-column>
<el-table-column prop="condition" label="触发设备" width="150">
<template slot-scope="scope">
<span>{{ `${deviceMap[scope.row.condition.triggerDeviceType]}${formatNameByCode(scope.row.condition.triggerDeviceCode)}` }}</span>
<span>{{ `${deviceMap[scope.row.condition.triggerDeviceType] || ''}${formatNameByCode(scope.row.condition.triggerDeviceCode)}` }}</span>
</template>
</el-table-column>
<el-table-column prop="condition" label="触发状态">
@ -103,8 +103,10 @@
</el-form-item>
<el-form-item v-if="triggerMode === 'TIME'" label="触发时间">
<el-date-picker
v-model="faultRule.condition.triggeringTime"
v-model="faultRule.condition.triggerTime"
size="small"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="选择日期时间"
/>
@ -153,7 +155,7 @@ export default {
triggerDeviceStatus:'',
triggerDeviceType :'',
type:'DEVICE',
triggeringTime: '',
triggerTime: '',
triggerAssociatedDeviceCode: ''
}
},
@ -230,6 +232,9 @@ export default {
return name;
},
formatTriggerStatus(condition) {
if (!condition.triggerDeviceType) {
return '';
}
const faultStatus = FaultStatusEnum[condition.triggerDeviceType];
return faultStatus[condition.triggerDeviceStatus];
},
@ -330,7 +335,7 @@ export default {
triggerDeviceStatus:'',
triggerDeviceType :'',
type:'DEVICE',
triggeringTime: '',
triggerTime: '',
triggerAssociatedDeviceCode: ''
}
};
@ -385,11 +390,11 @@ export default {
this.$messageBox('请选择触发状态');
return;
}
if (this.triggerMode === 'DEVICE' && this.faultRule.faultType == '') {
if (this.faultRule.faultType == '') {
this.$messageBox('请选择故障类型');
return;
}
if (this.triggerMode === 'TIME' && this.faultRule.condition.triggeringTime) {
if (this.triggerMode === 'TIME' && this.faultRule.condition.triggerTime == '') {
this.$messageBox('请选择触发时间');
return;
}
@ -397,7 +402,20 @@ export default {
this.$messageBox('请选择关联设备');
return;
}
setFailureModeNew(this.faultRule, this.$route.query.group).then(res=>{
const param = {
targetDeviceCode:this.targetDevice.code,
targetDeviceType:this.covertType(this.targetDevice._type),
faultType: this.faultRule.faultType,
condition:{
triggerDeviceCode: this.faultRule.condition.triggerDeviceCode || null,
triggerDeviceStatus:this.faultRule.condition.triggerDeviceStatus || null,
triggerDeviceType :this.faultRule.condition.triggerDeviceType || null,
type:this.faultRule.condition.type,
triggerTime: this.faultRule.condition.triggerTime || null,
triggerAssociatedDeviceCode: this.faultRule.condition.triggerAssociatedDeviceCode || null
}
};
setFailureModeNew(param, this.$route.query.group).then(res=>{
this.$message.success('创建故障成功!');
this.resetForm();
}).catch((error)=>{

View File

@ -256,6 +256,7 @@ export default {
clearTimeout(this.time);
}
this.$store.dispatch('scriptRecord/updateSimulationPause', false);
this.$store.dispatch('scriptRecord/updateOperationalItemVOs', {});
this.$store.dispatch('map/resetActiveTrainList', true);
},
mounted() {
@ -391,6 +392,7 @@ export default {
competitionPracticalSceneExit(this.group).then(resp => {
getSimulationInfoNew(this.group).then((res)=>{
EventBus.$emit('quitScene');
this.$store.dispatch('scriptRecord/updateOperationalItemVOs', {});
this.quitQuest();
// this.initLoadPage();
this.clearAllData();

View File

@ -10,6 +10,7 @@
<div v-for="(item,index) in resultData.itemVOS" :key="index" style="margin-top:10px;">
<span style="margin-left: 20px;">{{ item.description+':' }}</span>
<el-time-picker
v-if="item.type=='Time'"
v-model="dataList[index]"
value-format="HH:mm"
format="HH:mm"
@ -18,6 +19,7 @@
:placeholder="item.description"
@change="((val)=>{changeData(val,index)}) "
/>
<el-input v-if="item.type=='Non_Time'" v-model="dataList[index]" type="text" :style="{width: '125px'}" size="small" :maxlength="100" @change="((val)=>{changeNoTimeData(val,index)}) " />
</div>
<span slot="footer" class="dialog-footer">
@ -45,6 +47,20 @@ export default {
this.dialogShow = true;
this.resultData.score = resultData.score;
this.resultData.itemVOS = resultData.itemVOS;
const operationalItemVOs = this.$store.state.scriptRecord.operationalItemVOs;
if (JSON.stringify(operationalItemVOs) !== '{}') {
this.resultData.itemVOS = operationalItemVOs;
const itemVOs = Object.values(operationalItemVOs);
itemVOs.forEach((item, index)=>{
if (item.type == 'Time') {
this.dataList.push(item.timeFilledInByUser.slice(0, item.timeFilledInByUser.length - 3));
} else if (item.type == 'Non_Time') {
this.dataList.push(item.userAnswer);
}
});
} else {
this.dataList = [];
}
},
roleDoClose() {
this.dialogShow = false;
@ -53,7 +69,7 @@ export default {
let result = true;
if (this.resultData.itemVOS.length > 0) {
this.resultData.itemVOS.forEach(item=>{
if (!item.timeFilledInByUser) {
if (!item.timeFilledInByUser && !item.userAnswer) {
result = result && false;
}
});
@ -63,6 +79,7 @@ export default {
} else {
submitOperationalStatistics(this.$route.query.group, this.resultData).then(res=>{
this.$message.success('运营统计数据提交成功');
this.$store.dispatch('scriptRecord/updateOperationalItemVOs', this.resultData.itemVOS);
this.dialogShow = false;
}).catch(error=>{
this.$message.error('运营统计数据提交失败:' + error.message);
@ -71,6 +88,9 @@ export default {
},
changeData(val, index) {
this.resultData.itemVOS[index].timeFilledInByUser = val + ':00';
},
changeNoTimeData(val, index) {
this.resultData.itemVOS[index].userAnswer = val;
}
}
};

View File

@ -31,8 +31,8 @@
</template>
<script>
import { ScriptMode } from '@/scripts/ConstDic';
import {getDraftScriptByGroupNew } from '@/api/script';
import {loadCompetitionPracticalScene} from '@/api/competition';
import { getDraftScriptByGroupNew } from '@/api/script';
import {loadCompetitionPracticalScene, getCompetitionPracticalScene} from '@/api/competition';
import { EventBus } from '@/scripts/event-bus';
export default {
@ -52,7 +52,7 @@ export default {
// operationType: '',
mainSceneData: [
{type: '车辆故障', scene: '列车救援'},
{type: '信号系统故障', scene: '道岔故障', id: '9'},
{type: '信号系统故障', scene: '道岔故障'},
{type: '信号系统故障', scene: '区域控制器故障'},
{type: '信号系统故障', scene: '联锁故障'},
{type: '供电系统故障', scene: '接触轨(网)断电'},
@ -71,18 +71,33 @@ export default {
};
},
mounted() {
if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {
this.mainSceneData = [
{type: '车辆故障', scene: '列车救援'},
{type: '信号系统故障', scene: '道岔故障', id: '12'},
{type: '信号系统故障', scene: '区域控制器故障'},
{type: '信号系统故障', scene: '联锁故障'},
{type: '供电系统故障', scene: '接触轨(网)断电'},
{type: '供电系统故障', scene: '车站照明熄灭影响乘降'},
{type: '车站机电设备故障', scene: '站台门故障'},
{type: '轨道故障', scene: '线路故障影响列车运行'}
];
}
getCompetitionPracticalScene({pageSize:100, pageNum:1}).then(res=>{
if (res.data.list && res.data.list.length > 0) {
res.data.list.forEach(each=>{
if (each.name == '场景1') {
this.mainSceneData[1].id = each.id;
} else if (each.name == '场景4') {
this.mainSceneData[0].id = each.id;
} else if (each.name == '场景5') {
this.mainSceneData[4].id = each.id;
} else if (each.name == '场景9') {
this.mainSceneData[6].id = each.id;
}
});
}
});
// if (process.env.NODE_ENV ==;= 'development' || process.env.NODE_ENV === 'test') {
// this.mainSceneData = [
// {type: '', scene: ''},
// {type: '', scene: '', id: '12'},
// {type: '', scene: ''},
// {type: '', scene: ''},
// {type: '', scene: '()'},
// {type: '', scene: ''},
// {type: '', scene: ''},
// {type: '', scene: '线'}
// ];
// }
},
methods:{
doShow(param) {

View File

@ -26,7 +26,8 @@ export default {
watch:{
//
'$store.state.socket.simulationScriptTip':function(val, old) {
if (val && this.$store.state.training.scriptOperationType === 'teach') {
// && this.$store.state.training.scriptOperationType === 'teach'
if (val) {
if (val.type == 'Accept_Conversation_Invitation') {
this.scriptTipMessage = '请接受会话邀请';
} else if (val.type == 'Conversation') {
@ -39,11 +40,19 @@ export default {
} else if (val.type == 'Start_Conversation' ) {
const inviteMember = [];
this.$emit('allowCreatCoversition');
val.conversationMemberIds.forEach(id=>{
if (val.memberId != id) {
inviteMember.push((this.memberData[id] || {labelName: ''}).labelName);
if (val.communicationObject) {
if (val.communicationObject == 'ALL_STATION') {
inviteMember.push('所有车站');
} else if (val.communicationObject == 'ALL_TRAIN') {
inviteMember.push('所有司机');
}
});
} else {
val.conversationMemberIds.forEach(id=>{
if (val.memberId != id) {
inviteMember.push((this.memberData[id] || {labelName: ''}).labelName);
}
});
}
this.scriptTipMessage = '请创建会话,选择' + inviteMember.toString();
} else if (val.type == 'Command') {
const targetName = this.memberData[val.commandInitiateVO.targetMemberId];

View File

@ -106,6 +106,15 @@ export default {
isButtonType() {
return this.field == 'locationSectionCode';
},
centralizedStationList() {
const list = [];
this.stationList.forEach(item => {
if (item.centralized) {
list.push(item);
}
});
return list;
},
dataForm() {
const form = {
labelWidth: '130px',
@ -126,7 +135,7 @@ export default {
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] },
{ prop: 'stationCode', label: '所属车站', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.stationList}
{ prop: 'deviceStationCode', label: '所属集中站车站', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.centralizedStationList}
]
},
map: {
@ -201,7 +210,7 @@ export default {
name: this.addModel.name,
startStationCode: this.addModel.startStationCode,
endStationCode: this.addModel.endStationCode,
stationCode: section.stationCode,
deviceStationCode: section.stationCode,
position: {
x: section.points[0].x,
y: section.points[0].y - this.addModel.height