index.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <el-row
  3. class="top"
  4. v-loading="loading"
  5. element-loading-background="rgba(28,33,41,1)"
  6. >
  7. <el-col :span="6">
  8. <el-col :span="24" class="time">{{ date }}</el-col>
  9. </el-col>
  10. <el-col :span="12">
  11. <el-col :span="24" class="title">中国东信南宁总部大楼</el-col>
  12. </el-col>
  13. <el-col :span="6">
  14. <el-col :span="24" class="logo">
  15. <el-image :src="logo" fit="scale-down"> </el-image>
  16. </el-col>
  17. </el-col>
  18. </el-row>
  19. </template>
  20. <script>
  21. import logo from "@/assets/logo/logo-b.png";
  22. export default {
  23. data() {
  24. return {
  25. loading: true,
  26. date: new Date(),
  27. logo: logo,
  28. };
  29. },
  30. mounted() {
  31. let that= this;
  32. that.loading = false;
  33. this.timer = setInterval(function() {
  34. let myDate = new Date()
  35. let year = myDate.getFullYear() + '年'
  36. let month = myDate.getMonth() + 1 > 9 ? (myDate.getMonth() + 1) + '月' : '0' + (myDate.getMonth() + 1) + '月'
  37. let day = myDate.getDate() > 9 ? myDate.getDate() + '日' : '0' + myDate.getDate() + '日 '
  38. let s = myDate.getHours() > 9 ? myDate.getHours() : '0' + myDate.getHours()
  39. let f = myDate.getMinutes() > 9 ? myDate.getMinutes() : '0' + myDate.getMinutes()
  40. let m = myDate.getSeconds() > 9 ? myDate.getSeconds() : '0' + myDate.getSeconds()
  41. that.date = year + month + day + ' ' + s + ":" + f + ":" + m
  42. });
  43. },
  44. };
  45. </script>
  46. <style lang="scss" scoped>
  47. @import "@/assets/styles/common.scss";
  48. #main {
  49. .top {
  50. width: 100%;
  51. height: 100px;
  52. line-height: 100px;
  53. vertical-align: middle;
  54. position: absolute;
  55. z-index: 10;
  56. .time {
  57. font-size: 24px;
  58. color: $white;
  59. margin-left:6px;
  60. }
  61. .title {
  62. font-size: 40px;
  63. color: $white;
  64. letter-spacing: 2.22px;
  65. font-family: "MicrosoftYaHei-Bold";
  66. vertical-align: middle;
  67. text-align: center;
  68. }
  69. .logo {
  70. position: absolute;
  71. right:40px;
  72. width:100%;
  73. text-align: right;
  74. .el-image {
  75. height: 65px;
  76. vertical-align: middle;
  77. }
  78. }
  79. }
  80. }
  81. </style>