BatteryCharger.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <div>
  3. <div class="communication">
  4. <div class="battery_title">
  5. <span class="first"><img src="../assets/cangwei.png" /><p> {{chargerCode}}号仓位充电机</p></span>
  6. <!-- <span><el-button :class="buttonState[0]" @click="sendCharger" :disabled="buttonState === 1">{{buttonState === 1 ?'不可操作':buttonState[1]}}</el-button></span> -->
  7. </div>
  8. <div :class="statustext[1]">{{statustext[0]}}</div>
  9. </div>
  10. </div>
  11. </template>
  12. <script>
  13. export default {
  14. name: "BatteryCharger",
  15. props:['chargerCode','comState'],
  16. data(){
  17. return{
  18. loading:false,
  19. }
  20. },
  21. computed:{
  22. statustext(){
  23. if(this.comState===1){
  24. return ['通讯正常','success']
  25. }else{
  26. return ['通讯异常','warning']
  27. }
  28. },
  29. buttonState(){
  30. if((this.chgState === 0 || this.chgState === 3) && this.storeState === 1){
  31. return ['btnState','充电']
  32. }else if(this.chgState === 2 && this.storeState === 1){
  33. return ['purple','断电']
  34. }else{
  35. return 1
  36. }
  37. }
  38. },
  39. methods:{
  40. }
  41. }
  42. </script>
  43. <style lang="scss" scoped>
  44. .communication {
  45. display: flex;
  46. margin-top: 10px;
  47. margin-bottom: 25px;
  48. div {
  49. line-height: 36px;
  50. font-size: 16px;
  51. font-weight: 600;
  52. height: 36px;
  53. width: 136px;
  54. text-align: center;
  55. }
  56. @media screen and (min-width: 1024px) and (max-width: 1153px) {
  57. div{
  58. font-weight: normal;
  59. font-size: 12px;
  60. white-space:nowrap;
  61. }
  62. .success,.warning{
  63. transform: scale(0.9);
  64. }
  65. }
  66. .battery_title{
  67. background-color: #1b263a;
  68. border: #25334d solid 1px;
  69. color: white;
  70. line-height: 34px;
  71. display: flex;
  72. justify-content: space-between;
  73. padding: 0 5px;
  74. width: 298px;
  75. .is-disabled{
  76. width:90px;
  77. height: 28px;
  78. padding: 0 0 0 18px;
  79. border-radius: 15px;
  80. color: #5f6571;
  81. border-color:#353c4c;
  82. background: url('../assets/d3.png') #353c4c no-repeat 6px center;
  83. background-size: 14px 14px;
  84. @media screen and (min-width: 1024px) and (max-width: 1153px) {
  85. :first-child{
  86. display: inline-block;
  87. transform:scale(0.9);
  88. color: white;
  89. margin-left: -18px;
  90. }
  91. .is-disabled{
  92. background-image: none;
  93. }
  94. }
  95. }
  96. @media screen and (min-width: 1024px) and (max-width: 1153px) {
  97. .is-disabled{
  98. background-image: none;
  99. }
  100. }
  101. .first{
  102. display: flex;
  103. img{
  104. width: 30px;
  105. height: 30px;
  106. margin-top: 2px;
  107. }
  108. p{
  109. flex: 1;
  110. margin: 0;
  111. padding: 0;
  112. }
  113. @media screen and (min-width: 1024px) and (max-width: 1153px) {
  114. p{
  115. font-weight: normal;
  116. white-space: nowrap;
  117. transform: scale(0.9);
  118. }
  119. }
  120. }
  121. .btnState{
  122. width:70px;
  123. height: 28px;
  124. padding: 0 0 0 15px;
  125. font-size: 14px;
  126. color: #fff;
  127. border-radius: 15px;
  128. line-height: 28px;
  129. margin-top: 2px;
  130. cursor: pointer;
  131. border: none;
  132. letter-spacing: 1px;
  133. background: url('../assets/d1.png') rgb(105, 184, 137) no-repeat 10px center;
  134. background-size: 14px 14px;
  135. }
  136. @media screen and (min-width: 1024px) and (max-width: 1153px) {
  137. .btnState{
  138. font-size: 12px;
  139. background-image: none;
  140. padding: 0;
  141. text-align: center;
  142. line-height: 28px;
  143. }
  144. }
  145. .btnState:hover{
  146. background-color:rgb(105, 184, 137,0.8);
  147. }
  148. .purple{
  149. width:70px;
  150. height: 28px;
  151. padding: 0 0 0 15px;
  152. font-size: 14px;
  153. color: #fff;
  154. border-radius: 15px;
  155. margin-top: 2px;
  156. cursor: pointer;
  157. border: none;
  158. letter-spacing: 1px;
  159. background: url('../assets/d2.png') rgb(224, 125, 68) no-repeat 10px center;
  160. background-size: 14px 14px;
  161. }
  162. .purple:hover{
  163. background-color:rgb(224, 125, 68,0.8);
  164. }
  165. img {
  166. vertical-align: middle;
  167. }
  168. }
  169. .success {
  170. color: #246CF9;
  171. text-align: right;
  172. }
  173. .warning {
  174. color: #c85e60;
  175. text-align: right;
  176. }
  177. }
  178. </style>