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">
|
|
|
|
<span class="display-pause">暂停中</span>
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
<system-time
|
|
|
|
class="display-time"
|
|
|
|
:time="time"
|
|
|
|
:zoom="1.3"
|
|
|
|
:width="110"
|
|
|
|
:height="32"
|
|
|
|
:fine="2"
|
|
|
|
:top="2"
|
|
|
|
/>
|
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-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' ||
|
|
|
|
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-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-07-26 13:32:43 +08:00
|
|
|
border: 2px solid white;
|
|
|
|
border-radius: 4px;
|
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>
|