rt-sim-training-client/src/views/display/menuSystemTime.vue

86 lines
1.9 KiB
Vue
Raw Normal View History

2019-07-26 13:32:43 +08:00
<template>
2019-08-29 17:16:33 +08:00
<div v-if="isShowSystemTime" class="display-card" :style="{top: offset+'px', right: right+'px'}">
<template v-if="pause">
2019-10-18 15:35:48 +08:00
<span class="display-pause">{{ $t('display.systemTime.timePause') }}</span>
2019-08-29 17:16:33 +08:00
</template>
<template v-else>
<system-time
class="display-time"
:time="time"
/>
2019-07-26 13:32:43 +08:00
2019-08-29 17:16:33 +08:00
</template>
</div>
</template>
2019-07-26 13:32:43 +08:00
<script>
2019-08-29 17:16:33 +08:00
import { prefixIntrger } from '@/utils/date';
import SystemTime from '@/views/components/systemTime/index';
2019-07-26 13:32:43 +08:00
2019-11-14 14:10:20 +08:00
// 顶部时间栏显示
2019-08-29 17:16:33 +08:00
export default {
name: 'MenuSystemTime',
components: {
SystemTime
},
props: {
offset: {
type: Number,
required: true
},
right: {
type: Number,
required: true
}
},
data() {
return {
time: '00:0000'
};
},
computed: {
isShowSystemTime() {
return this.$route.params.mode == 'demon' ||
2019-08-29 17:16:33 +08:00
this.$route.params.mode == 'dp' ||
this.$route.params.mode == 'plan' ||
this.$route.params.mode == 'script' ||
!this.$route.params.mode;
},
pause() {
return this.$store.state.scriptRecord.simulationPause;
}
},
watch: {
'$store.state.training.initTime': function (initTime) {
const date = new Date(initTime);
this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}${prefixIntrger(date.getSeconds(), 2)}`;
}
}
2019-08-29 17:16:33 +08:00
};
2019-07-26 13:32:43 +08:00
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.display-card {
z-index: 9;
display: inline;
position: absolute;
2019-08-29 17:16:33 +08:00
}
.display-pause {
font-size: 21px;
font-weight: bold;
color: yellow;
}
.display-time{
2019-10-18 18:31:14 +08:00
padding: 3px 5px;
2019-10-18 15:35:48 +08:00
box-shadow: 0px 0px 5px #eee;
border-radius: 3px;
2019-08-29 17:16:33 +08:00
}
2019-07-26 13:32:43 +08:00
.display-card .el-row {
line-height: 32px !important;
}
2019-08-29 17:16:33 +08:00
</style>