center.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <div id="center">
  3. <div class="middle_top_list">
  4. <div class="list_title">瓦斯泵工作时间</div>
  5. <div class="list_num list_num1"><span class="counter-value">{{workTime}}</span></div>
  6. </div>
  7. <div class="middle_top_list">
  8. <div class="list_title">瓦斯泵平均功率</div>
  9. <div class="list_num list_num2"><span class="counter-value">{{averagePower}}</span></div>
  10. </div>
  11. <div class="middle_top_list">
  12. <div class="list_title">管道瓦斯含量</div>
  13. <div class="list_num list_num2"><span class="counter-value">{{gasContent}}</span></div>
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. workTime:0.6,
  22. averagePower:20,
  23. gasContent:30,
  24. };
  25. },
  26. mounted() {
  27. let interval = setInterval(() => {
  28. this.workTime = this.getRandomNumWithDecimals(1,2.00)
  29. this.averagePower = this.getRandomNumWithDecimals(20,30)
  30. this.gasContent = this.getRandomNumWithDecimals(10,25)
  31. }, 3000);
  32. this.$once("hook:beforeDestroy", () => {
  33. clearInterval(interval);
  34. });
  35. },
  36. };
  37. </script>
  38. <style lang="scss" scoped>
  39. #center {
  40. // margin: auto;
  41. width: 400px;
  42. height: 300px;
  43. display: flex;
  44. flex-direction: column;
  45. padding:6px;
  46. margin:5px;
  47. background: url(../../../assets/img/tunneling/dataBg.png) no-repeat;
  48. background-size: 100%;
  49. // border:3px solid #96c2f1;background:#77bedf;
  50. // padding:6px;border:3px solid #96c2f1;background:#eff7ff
  51. // background-image: linear-gradient(to top, #cfd9df 0%, #e2ebf0 100%);
  52. // background-image: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
  53. }
  54. .middle_top_list {
  55. float: left;
  56. width: 35.2%;
  57. height: 18%;
  58. margin-top: 10%;
  59. margin-left: 28%;
  60. text-align: center;
  61. color: #4ADEFE;
  62. }
  63. .middle_top_list span {
  64. color: #F3DB5C;
  65. }
  66. .list_title {
  67. font-size: 18px;
  68. margin-top: -15%;
  69. }
  70. /* .control{
  71. margin-top: 20px;
  72. } */
  73. .list_num {
  74. margin-top: 3%;
  75. font-size: 16px;
  76. }
  77. .list_num span {
  78. font-size: 30px;
  79. }
  80. </style>