BatteryStatus.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <div>
  3. <div class="communication">
  4. <div><img src="../assets/cangwei.png" />{{storeCode}}号仓位</div>
  5. <div :class="statustext[1]">{{statustext[0]}}</div>
  6. </div>
  7. <div class="battery-number">
  8. <span>电池编号</span><span>{{sn}}</span>
  9. </div>
  10. <div class="percent">
  11. <div><span>{{5}}</span></div>
  12. <div>%</div>
  13. </div>
  14. <div class="line"><span></span><span></span></div>
  15. <div class="power">
  16. <div class="power-percent">
  17. <span v-for="item in 100" :key="item"></span>
  18. </div>
  19. <div class="power-text">
  20. <span>电池电量</span>
  21. <span>预计<em>{{chgEstimatedTime}}</em>后充满</span>
  22. </div>
  23. </div>
  24. </div>
  25. </template>
  26. <script>
  27. export default {
  28. name: "BatteryStatus",
  29. props:['storeCode','comState','sn','chgEstimatedTime'],
  30. computed:{
  31. statustext(){
  32. if(this.comState===1){
  33. return ['通讯正常','success']
  34. }else{
  35. return ['通讯异常','warning']
  36. }
  37. }
  38. }
  39. };
  40. </script>
  41. <style lang="scss" scoped>
  42. .communication {
  43. display: flex;
  44. div {
  45. line-height: 36px;
  46. font-size: 16px;
  47. font-weight: 600;
  48. height: 36px;
  49. width: 136px;
  50. text-align: center;
  51. }
  52. div:first-child {
  53. background-color: #1b263a;
  54. border: #25334d solid 1px;
  55. color: white;
  56. line-height: 34px;
  57. img {
  58. vertical-align: middle;
  59. }
  60. }
  61. .success {
  62. color: #92fdb9;
  63. }
  64. .warning {
  65. color: #ff4d4f;
  66. }
  67. }
  68. .battery-number {
  69. margin-top: 1vh;
  70. display: flex;
  71. :last-child {
  72. color: white;
  73. padding-left: 16px;
  74. font-size: 16px;
  75. font-weight: 600;
  76. }
  77. }
  78. .percent {
  79. margin-top: 1vh;
  80. display: flex;
  81. div:first-child {
  82. background-color: #181e2a;
  83. width: 90%;
  84. border-radius: 5px;
  85. height: 10px;
  86. span {
  87. color: white;
  88. font-weight: 600;
  89. font-size: 16px;
  90. position: relative;
  91. bottom: 5px;
  92. }
  93. }
  94. :last-child {
  95. position: relative;
  96. bottom: 4px;
  97. width: 30px;
  98. text-align: right;
  99. font-weight: 500;
  100. }
  101. }
  102. .line {
  103. display: flex;
  104. :first-child {
  105. width: 1%;
  106. background-color: white;
  107. height: 2px;
  108. }
  109. :last-child {
  110. height: 2px;
  111. width: 97%;
  112. background-color: #14172a;
  113. margin-left: 5px;
  114. }
  115. }
  116. .power {
  117. display: flex;
  118. flex-direction: column;
  119. margin-top: 1vh;
  120. .power-percent {
  121. width: 100%;
  122. display: flex;
  123. span {
  124. background-color: #1e2535;
  125. height: 6px;
  126. width: 2px;
  127. margin-right: 1px;
  128. }
  129. }
  130. .power-text {
  131. display: flex;
  132. width: 100%;
  133. margin-top: 1.2vh;
  134. margin-bottom: 0.8vh;
  135. justify-content: space-between;
  136. em {
  137. color: #87edab;
  138. font-weight: 500;
  139. font-style: normal;
  140. }
  141. }
  142. }
  143. </style>