北交大客流策略 添加

This commit is contained in:
joylink_cuiweidong 2021-02-03 13:40:11 +08:00
parent f5e0539e6d
commit 2968b1ddfb
3 changed files with 128 additions and 2 deletions

View File

@ -158,7 +158,7 @@ export default {
this.commit(); this.commit();
} }
}, },
'selected': function(val) { 'selected': function(val) {
if (val) { if (val) {
const stand = this.$store.getters['map/getDeviceByCode'](val.code); const stand = this.$store.getters['map/getDeviceByCode'](val.code);
if (stand) { if (stand) {

View File

@ -154,6 +154,9 @@ function handle(state, data) {
case 'TRAIN_PFI_BL': case 'TRAIN_PFI_BL':
state.trainPfiBL = msg; state.trainPfiBL = msg;
break; break;
case 'LPF_STRATEGY_RECOMMEND':
state.LPFstrategy = msg;
break;
case 'Simulation_Scenes_Reload': case 'Simulation_Scenes_Reload':
if (msg) { if (msg) {
store.dispatch('training/start'); store.dispatch('training/start');
@ -299,6 +302,7 @@ const socket = {
standPfiNum:null, // 站台客流人数信息 standPfiNum:null, // 站台客流人数信息
trainPfiNum:null, // 列车客流当前人数信息 trainPfiNum:null, // 列车客流当前人数信息
trainPfiBL:null, // 列车客流乘降人数信息 trainPfiBL:null, // 列车客流乘降人数信息
LPFstrategy:[], // 北交大 大客流 推荐策略
isFirst:false, // 第一次是否已经订阅 isFirst:false, // 第一次是否已经订阅
competitionPracticeFinish:0, // 竞赛场景结束标识 competitionPracticeFinish:0, // 竞赛场景结束标识
simulationAlarmInfo: [] // 仿真报警信息 simulationAlarmInfo: [] // 仿真报警信息

View File

@ -20,6 +20,20 @@
<el-button v-if="messageBoard" size="small" @click="messageBoardShow">留言板</el-button> <el-button v-if="messageBoard" size="small" @click="messageBoardShow">留言板</el-button>
<el-button size="small" @click="contectUs">联系方式</el-button> <el-button size="small" @click="contectUs">联系方式</el-button>
</el-button-group> </el-button-group>
<div v-if="isShowStrategy" class="LPFstrategyList">
<div class="LPFstrategyTop">
<div class="LPFstrategyTitle">客流策略</div>
<div class="LPFstrategyClose" @click="closeLPFstrategy"><span class="el-icon-close" /></div>
</div>
<div class="LPFstrategyListOut">
<div v-for="(eachLPFstrategy,index) in LPFstrategyList" :key="index" class="eachLPFstrategy">
<div class="eachLPFstrategyData1">{{ eachLPFstrategy.description }}</div>
<div class="eachLPFstrategyData">时刻表偏移指标: {{ eachLPFstrategy.target1 }}</div>
<div class="eachLPFstrategyData">乘客等待指标: {{ eachLPFstrategy.target2 }}</div>
<div class="eachLPFstrategyData">综合指标: {{ eachLPFstrategy.coTarget }}</div>
</div>
</div>
</div>
<div class="trainExample"> <div class="trainExample">
<div class="currentFlowDataName">{{ currentFlowDataName }}</div> <div class="currentFlowDataName">{{ currentFlowDataName }}</div>
<div class="trainExampleL"> <div class="trainExampleL">
@ -129,7 +143,9 @@ export default {
currentFlowDataId:'', currentFlowDataId:'',
isDisabled:false, isDisabled:false,
loading:false, loading:false,
messageBoard: false messageBoard: false,
LPFstrategyList:[],
isShowStrategy:false
}; };
}, },
computed:{ computed:{
@ -219,6 +235,45 @@ export default {
const header = { group: this.group || '', 'X-Token': getToken() }; const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${jl3dTopic}\/${this.$route.query.group}`, header); creatSubscribe(`${jl3dTopic}\/${this.$route.query.group}`, header);
} }
},
'$store.state.socket.LPFstrategy':function(val) {
if (val && val.length > 0) {
this.LPFstrategyList = [];
val.forEach(strategy=>{
const eachStrategy = {};
switch (strategy.type) {
case 'JUMP': {
const stand = this.$store.getters['map/getDeviceByCode'](strategy.standCode);
const station = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
eachStrategy.description = '为列车[' + strategy.groupNumber +
'-' + strategy.serviceNumber + '|' + strategy.tripNumber +
'],设置站台' + station.name + '-' + (stand.right ? '右行' : '左行') +
stand.name + ' (' + stand.code + ') 跳停';
eachStrategy.target1 = strategy.target1;
eachStrategy.target2 = strategy.target2;
eachStrategy.coTarget = strategy.coTarget;
// [005-02|2057],--PF42(PF44165)",
// strategy.description;
break;
}
case 'PARK_TIME': {
const stand = this.$store.getters['map/getDeviceByCode'](strategy.standCode);
const station = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
// eachStrategy.description = strategy.description;
eachStrategy.target1 = strategy.target1;
eachStrategy.target2 = strategy.target2;
eachStrategy.coTarget = strategy.coTarget;
eachStrategy.description = '为站台[' + station.name + '-' + (stand.right ? '右行' : '左行') +
stand.name + '(' + stand.code + '设置停站时间,' + strategy.time + '秒';
break;
}
}
this.LPFstrategyList.push(eachStrategy);
});
if (!this.isShowStrategy) {
this.isShowStrategy = true;
}
}
} }
}, },
beforeDestroy() { beforeDestroy() {
@ -411,6 +466,9 @@ export default {
this.$messageBox(this.$t('display.demon.endSimulationFail')); this.$messageBox(this.$t('display.demon.endSimulationFail'));
}); });
}, },
closeLPFstrategy() {
this.isShowStrategy = false;
},
start(model) { // 仿 start(model) { // 仿
const data = { const data = {
time: model.initTime time: model.initTime
@ -520,4 +578,68 @@ export default {
left: 10px; left: 10px;
top: 15px; top: 15px;
} }
.LPFstrategyList{
position: absolute;
width: 360px;
left: 10px;
height: 500px;
top: 80px;
background: #f1f1f1;
border-radius: 6px;
z-index: 2;
}
.eachLPFstrategy{
width: 100%;
box-shadow: 0px 5px 5px #ccc;
border-top: 1px #dedede solid;
margin-top: 10px;
padding:10px;
background: #fff;
font-size: 14px;
}
.LPFstrategyTop{
background:#fff;
height: 35px;
border-bottom: 1px #d4d4d4 solid;
width: 100%;
border-radius: 5px 5px 0px 0px;
}
.LPFstrategyTitle{
float: left;
padding-top: 10px;
padding-left: 10px;
font-size: 15px;
}
.LPFstrategyClose{
float: right;
margin-right: 5px;
padding: 5px;
margin-top: 5px;
}
.LPFstrategyListOut{
height: 460px;
overflow: auto;
background: #f1f1f1;
padding-bottom: 10px;
&::-webkit-scrollbar {
width: 5px;
}
&::-webkit-scrollbar-thumb {
border-radius: 10px;
background: #c3c3c3;
}
&::-webkit-scrollbar-track {
border-radius: 0;
background: #f0f0f0;
}
}
.eachLPFstrategyData1{
line-height:160%;
}
.eachLPFstrategyData{
margin-top:10px;
}
</style> </style>