MainHeader.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div class="td-header">
  3. <DateTime></DateTime>
  4. <div class="v-title">智慧矿山三维可视化平台</div>
  5. <ul class="buttons">
  6. <li v-for="(item,index) in buttons" v-on:click="menuClicked(item)">
  7. <img style="float: left;" v-bind:src="item.icon" />
  8. <span class="lds" >{{item.name}}</span>
  9. </li>
  10. </ul>
  11. </div>
  12. </template>
  13. <script>
  14. import DateTime from "./DateTime.vue";
  15. export default {
  16. name: "MainHeader",
  17. components: {
  18. DateTime
  19. },
  20. data: function () {
  21. return {
  22. buttons: [
  23. { index: 0, name: "退出", icon: "img/home/sysout.png" },
  24. ]
  25. };
  26. },
  27. methods: {
  28. //菜单点击
  29. menuClicked: function (menu) {
  30. if (menu.index === 0) {
  31. //退出
  32. this.logout();
  33. }
  34. },
  35. //退出系统
  36. logout() {
  37. this.$router.push('/Login');
  38. }
  39. }
  40. };
  41. </script>
  42. <style>
  43. .v-title{
  44. font-size: 35px;
  45. font-weight: bold;
  46. text-align: center;
  47. height: 40px;
  48. line-height: 40px;
  49. margin-top: 30px;
  50. }
  51. .lds {
  52. height: 31px;
  53. line-height: 31px;
  54. vertical-align: middle;
  55. float: left;
  56. margin-left: 4px;
  57. text-shadow: 4px -4px 28px black;
  58. font-weight: bold;
  59. }
  60. .td-header {
  61. position: absolute;
  62. top: 0px;
  63. width: 100%;
  64. height: 102px;
  65. color: #ffffff;
  66. text-align: center;
  67. background: url(../../../public/img/home/bg.png) no-repeat;
  68. }
  69. .td-header .title {
  70. position: absolute;
  71. left: calc(50% - 210px);
  72. width: 420px;
  73. display: inline-block;
  74. margin-top: 12px;
  75. font-size: 30px;
  76. font-family: "Microsoft YaHei";
  77. text-shadow: 2px 2px 4px #6b6b6b;
  78. }
  79. .buttons {
  80. position: absolute;
  81. right: calc(50% - 960px);
  82. color: #fff;
  83. top: 8px;
  84. background-image: -webkit-gradient( linear, 0 0, 0 bottom, from(rgba(255, 255, 255, 1)), to(rgba(141, 211, 255, 1)) );
  85. font-weight: bold;
  86. -webkit-background-clip: text;
  87. -webkit-text-fill-color: transparent;
  88. text-shadow: 0 0 0 10px black;
  89. }
  90. .buttons li {
  91. list-style: none;
  92. float: right;
  93. margin-left: 18px;
  94. margin-right: 18px;
  95. cursor: pointer;
  96. }
  97. </style>