Blame view

src/components/headerCommon.vue 2.32 KB
52c50939   liuqimichale   init
1
2
  <template>
    <div class="headercommon">
f58839aa   liuqimichale   dy
3
      <h3>丹阳停车运营监控中心</h3>
bb5e0f2c   Andy   add 全屏功能
4
      <div class="header-fullscreen" @click="handleFullScreen"></div>
9808a4b6   liuqimichale   公用头部
5
6
7
8
      <div class="time-wrap">
        <p>{{timedate}}</p>
        <p>{{time}}</p>
      </div>
52c50939   liuqimichale   init
9
10
11
12
    </div>
  </template>
  
  <script>
9808a4b6   liuqimichale   公用头部
13
  import { getNowFormatDate, getNowFormatTime } from '../utils/formatetime'
52c50939   liuqimichale   init
14
15
  export default {
    name: 'HelloWorld',
9808a4b6   liuqimichale   公用头部
16
17
    created() {
    },
52c50939   liuqimichale   init
18
19
    data() {
      return {
9808a4b6   liuqimichale   公用头部
20
        timedate: getNowFormatDate(),
bb5e0f2c   Andy   add 全屏功能
21
22
        time: getNowFormatTime(),
        fullscreen: false
52c50939   liuqimichale   init
23
      }
bb5e0f2c   Andy   add 全屏功能
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
    },
    methods:{
      handleFullScreen(){
        let element = document.documentElement;
        if (this.fullscreen) {
          if (document.exitFullscreen) {
            document.exitFullscreen();
          } else if (document.webkitCancelFullScreen) {
            document.webkitCancelFullScreen();
          } else if (document.mozCancelFullScreen) {
            document.mozCancelFullScreen();
          } else if (document.msExitFullscreen) {
            document.msExitFullscreen();
          }
        } else {
          if (element.requestFullscreen) {
            element.requestFullscreen();
          } else if (element.webkitRequestFullScreen) {
            element.webkitRequestFullScreen();
          } else if (element.mozRequestFullScreen) {
            element.mozRequestFullScreen();
          } else if (element.msRequestFullscreen) {
            // IE11
            element.msRequestFullscreen();
          }
        }
        this.fullscreen = !this.fullscreen;
      },
52c50939   liuqimichale   init
52
53
54
55
    }
  }
  </script>
  
33e9c5c3   liuqimichale   init
56
  
52c50939   liuqimichale   init
57
58
59
60
  <style scoped>
    .headercommon {
      width: 100%;
      height: 77px;
9808a4b6   liuqimichale   公用头部
61
62
63
64
65
66
67
68
69
70
71
72
73
74
      position: relative;
  
    }
    .headercommon h3{
      width: 1200px;
      margin: 0 auto;
      line-height: 77px;
      background: url("../assets/img/headerbg.svg") no-repeat center center;
      /*background: #f00;*/
      font-size: 27px;
      text-align: center;
      font-weight:800;
      color:rgba(255,255,255,1);
    }
bb5e0f2c   Andy   add 全屏功能
75
76
77
78
79
80
81
82
83
84
    .header-fullscreen{
      width: 18px;
      height: 18px;
      line-height: 18px;
      position: absolute;
      right: 150px;
      top:30px;
      cursor:pointer;
      background: url('../assets/img/righttopbarico_Bg.png');
    }
9808a4b6   liuqimichale   公用头部
85
86
87
88
89
90
91
92
93
94
95
    .time-wrap{
      position: absolute;
      right: 12px;
      top:20px;
      padding-left: 44px;
      background: url("../assets/img/time-wrap.png") no-repeat 0 center;
      text-align: left;
      font-size:16px;
      font-weight:400;
      color:rgba(255,255,255,1);
      line-height:18px;
52c50939   liuqimichale   init
96
97
    }
  </style>