北交大 客流站场仿真界面 代码调整

This commit is contained in:
joylink_cuiweidong 2020-11-20 14:53:50 +08:00
parent 756aca9281
commit fece30a51d
3 changed files with 57 additions and 12 deletions

View File

@ -52,18 +52,22 @@ class ESolidStand extends Group {
// 紧急停车
model.emergencyClosed && this.setColor(this.style.StationStand.solidStand.spareColor);
} else {
model.num && model.num > 0 && this.handlePassagerColor(model.num);
this.handlePassagerColor(model.num);
}
}
handlePassagerColor(num) {
const passagerNum = parseInt(num);
if (passagerNum < 40) {
this.setColor('#29a909');
} else if (passagerNum < 80 && passagerNum > 40) {
this.setColor('#ffa500');
if (num && num > 0) {
const passagerNum = parseInt(num);
if (passagerNum < 40) {
this.setColor('#29a909');
} else if (passagerNum < 80 && passagerNum > 40) {
this.setColor('#ffa500');
} else {
this.setColor('#F00');
}
} else {
this.setColor('#F00');
this.setColor('#29a909');
}
}
}

View File

@ -378,7 +378,8 @@ export default class Train extends Group {
}
handlePassagerColor(num) {
if (num && num > 0) {
if (num) {
// && num > 0
const passagerNum = parseInt(num);
if (passagerNum < 40) {
this.trainB && this.trainB.setTrainColor('#29a909');
@ -394,9 +395,9 @@ export default class Train extends Group {
this.trainR && this.trainR.setColor('#F00');
}
} else {
// this.trainB && this.trainB.setTrainColor('#606060');
this.trainL && this.trainL.setColor(this.style.Train.trainHead.trainHeadFillColor);
this.trainR && this.trainR.setColor(this.style.Train.trainHead.trainHeadFillColor);
this.trainB && this.trainB.setTrainColor('#29a909');
this.trainL && this.trainL.setColor('#29a909');
this.trainR && this.trainR.setColor('#29a909');
}
}

View File

@ -8,6 +8,21 @@
</el-button-group>
</div>
<menu-system-time ref="menuSystemTime" :offset="15" :group="group" />
<div class="trainExample">
<div class="trainExampleName">列车/车站 颜色图例</div>
<div class="eachTrainExample">
<span class="smallExample" />
<span class="eachTrainExampleName">0 ~ 40</span>
</div>
<div class="eachTrainExample">
<span class="mediumExample" />
<span class="eachTrainExampleName">40 ~ 80</span>
</div>
<div class="eachTrainExample">
<span class="bigExample" />
<span class="eachTrainExampleName">80及以上</span>
</div>
</div>
</div>
</template>
<script>
@ -138,8 +153,8 @@ export default {
async subscribe() {
this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${jl3dTopic}\/${this.$route.query.group}`, header);
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
creatSubscribe(`${jl3dTopic}\/${this.$route.query.group}`, header);
await this.$store.dispatch('training/setHasSubscribed');
},
clearSubscribe() {
@ -173,4 +188,29 @@ export default {
right: 15px;
bottom: 15px;
}
.trainExample{
position: absolute;
width: 260px;
padding: 10px;
left: 20px;
top: 20px;
color: #fff;
border: 1px #fff solid;
border-radius: 3px;
}
.trainExampleName{margin-bottom: 10px;}
.eachTrainExample{margin-top: 5px;}
.smallExample,.mediumExample,.bigExample{
width: 50px;
height: 20px;
display: inline-block;
}
.eachTrainExampleName{
vertical-align: top;
line-height: 23px;
margin-left: 8px;
}
.smallExample{background: #29a909;}
.mediumExample{background: #ffa500;}
.bigExample{background: #F00;}
</style>