headerDecoration.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <!--
  2. * @Author: cyy szjbdcyy@126.com
  3. * @Date: 2023-03-09 15:33:26
  4. * @LastEditors: cyy szjbdcyy@126.com
  5. * @LastEditTime: 2023-03-09 15:36:54
  6. * @FilePath: \lh_firm_former\src\views\statistics\headerDecoration.vue
  7. * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  8. -->
  9. <template>
  10. <div id="top">
  11. <dv-decoration-8 class="header-left-decoration" />
  12. <dv-decoration-5 class="header-center-decoration" />
  13. <dv-decoration-8 class="header-right-decoration" :reverse="true" />
  14. <div class="center-title">实验室管理看板</div>
  15. <!-- <span class="showTime">当前时间为:{{sendTime}}</span> -->
  16. </div>
  17. </template>
  18. <script>
  19. export default {
  20. // props:['titleName'],
  21. data () {
  22. return {
  23. sendTime:''
  24. }
  25. },
  26. created(){
  27. this.currentTime()
  28. },
  29. methods:{
  30. currentTime() {
  31. setInterval(this.getNowTime, 500);
  32. },
  33. getNowTime(){
  34. const nowDate = new Date();
  35. const date = {
  36. year: nowDate.getFullYear(),
  37. month: nowDate.getMonth() + 1,
  38. day: nowDate.getDate(),
  39. hour: nowDate.getHours(),
  40. minute: nowDate.getMinutes(),
  41. second: nowDate.getSeconds()
  42. }
  43. this.sendTime = date.year + '年' + date.month + '月' + date.day + '日' +date.hour + '时' + date.minute + '分' + date.second + '秒'
  44. // var date = new Date()
  45. // var yy = date.getFullYear()
  46. // var mm = date.getMonth() + 1
  47. // var dd = date.getDate()
  48. // var hh = date.getHours()
  49. // var mm = date.getMinutes()
  50. // var ss = date.getSeconds()
  51. // document.querySelector(".showTime").innerHTML = "当前时间为" + yy + '年' + mm + '月' + dd + '日' + ss + '时' + mm + '分' + ss + '秒'
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="less">
  57. #top {
  58. position: relative;
  59. width: 100%;
  60. height: 100px;
  61. display: flex;
  62. justify-content: space-between;
  63. flex-shrink: 0;
  64. .header-center-decoration {
  65. width: 40%;
  66. height: 60px;
  67. margin-top: 30px;
  68. }
  69. .header-left-decoration, .header-right-decoration {
  70. width: 25%;
  71. height: 60px;
  72. }
  73. .center-title {
  74. position: absolute;
  75. font-size: 30px;
  76. font-weight: bold;
  77. left: 50%;
  78. top: 15px;
  79. transform: translateX(-50%);
  80. }
  81. }
  82. </style>