StorageInfo.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <template>
  2. <view class="storage-item" >
  3. <view class="container">
  4. <view class="container-header">
  5. <view class="battery" :class="showCode ==0?'showCodeActive':''" @click="showCode = 0">
  6. 电池(有)
  7. </view>
  8. <view class="a-gun battery" :class="showCode ==1?'showCodeActive':''" @click="showCode = 1">
  9. A枪
  10. </view>
  11. <view class="b-gun battery" :class="showCode ==2?'showCodeActive':''" @click="showCode = 2">
  12. B枪
  13. </view>
  14. </view>
  15. <view class="container-code">
  16. <view class="container-code-one">
  17. 通讯正常
  18. </view>
  19. <view class="container-code-two">
  20. <image src="../../../static/equipment/d5.png" mode=""></image>
  21. <image src="../../../static/equipment/c1.png" mode=""></image>
  22. </view>
  23. </view>
  24. <BatteryStatus
  25. :storeCode="storeCode"
  26. :comState="comState"
  27. :sn="sn"
  28. :soc="soc"
  29. :chgEstimatedTime="chgEstimatedTime"
  30. :showCode="showCode"
  31. ></BatteryStatus>
  32. <view class="battery-info">
  33. <view class="vim" v-if="showCode != 0">
  34. <text>vin码</text><text>123456789</text>
  35. </view>
  36. <BatteryInfo :num="current" unit="A" text="电流"></BatteryInfo>
  37. <BatteryInfo :num="voltage" unit="V" text="电压"></BatteryInfo>
  38. <BatteryInfo :num="soh" unit="%" text="SOH" v-if="showCode == 0"></BatteryInfo>
  39. <view class="info-right" :style="chargerColor">
  40. <image class="s1" :src="require('../../../static/equipment/'+`s${chargerState[0]}`+'.png')"><text>{{chargerState[1]}}</text>
  41. </view>
  42. <!-- <BatteryInfo :num="minTemperature" unit="℃" text="最低温度"></BatteryInfo>
  43. <BatteryInfo :num="maxTemperature" unit="℃" text="最高温度"></BatteryInfo>
  44. <BatteryInfo :num="maxCellVoltage" unit="V" text="最高单体电压"></BatteryInfo>
  45. <BatteryInfo :num="minCellVoltage" unit="V" text="最低单体电压"></BatteryInfo>
  46. <view class="info-right">
  47. <image class="s1" src="../../../static/equipment/s1.png"><text class="text">{{StateNum}}</text>
  48. </view>
  49. -->
  50. </view>
  51. <view class="battery-charger">
  52. <BatteryCharger
  53. :chargerCode="chargerInfoVo.chargerCode"
  54. :comState="chargerInfoVo.comState"
  55. :chgState="chargerInfoVo.chgState"
  56. :sn="sn"
  57. :storeState="storeState"
  58. v-show="chargerInfoVo.chargerCode"></BatteryCharger>
  59. <view class="battery-info" v-show="chargerInfoVo.chargerCode">
  60. <BatteryInfo :num="chargerInfoVo.demandCurrent" unit="A" text="需求电流"></BatteryInfo>
  61. <BatteryInfo :num="chargerInfoVo.demandVoltage" unit="V" text="需求电压"></BatteryInfo>
  62. <BatteryInfo :num="chargerInfoVo.chgCurrent" unit="A" text="充电电流"></BatteryInfo>
  63. <BatteryInfo :num="chargerInfoVo.chgVoltage" unit="V" text="充电电压"></BatteryInfo>
  64. <BatteryInfo :num="chargerInfoVo.chgCapacity" unit="kWh" text="累计充电电量"></BatteryInfo>
  65. </view>
  66. <view class="battery-charger-btn">
  67. <view class="Plug-gun-charging">
  68. 插枪充电
  69. </view>
  70. <view class="Settings Plug-gun-charging" @click="set">
  71. 设置
  72. </view>
  73. </view>
  74. <image src="../../../static/equipment/nodata.png" class="nodata" v-show="!chargerInfoVo.chargerCode">
  75. </view>
  76. </view>
  77. </view>
  78. </template>
  79. <script>
  80. import BatteryInfo from "./BatteryInfo.vue";
  81. import BatteryStatus from "./BatteryStatus.vue";
  82. import BatteryCharger from "./BatteryCharger.vue"
  83. export default {
  84. name:"StorageInfo",
  85. props:[
  86. 'storeCode',
  87. 'comState',
  88. 'sn',
  89. 'soc',
  90. 'chgEstimatedTime',
  91. 'current',
  92. 'voltage',
  93. 'minTemperature',
  94. 'maxTemperature',
  95. 'maxCellVoltage',
  96. 'minCellVoltage',
  97. 'soh',
  98. 'storeState',
  99. 'chargerInfoVo'
  100. ],
  101. components: {
  102. BatteryInfo,
  103. BatteryStatus,
  104. BatteryCharger
  105. },
  106. data(){
  107. return{
  108. showCode:0,//0电池1A枪2B枪
  109. }
  110. },
  111. methods:{
  112. set(){
  113. this.$emit('drawer')
  114. }
  115. },
  116. computed:{
  117. chargerState(){
  118. if(this.chargerInfoVo.chgState === 1){
  119. return [3,' 准备充电']
  120. }else if(this.chargerInfoVo.chgState === 2){
  121. return [1,' 充电中']
  122. }else if(this.chargerInfoVo.chgState === 3){
  123. return [2,' 充电完成']
  124. }else if(this.chargerInfoVo.chgState === 4){
  125. return [8,' 充电失败']
  126. }else if(this.chargerInfoVo.chgState === 5){
  127. return [6,' 预约']
  128. }else if(this.chargerInfoVo.chgState === 6){
  129. return [5,' 故障']
  130. }else if(this.chargerInfoVo.chgState === 0){
  131. return [7,' 空闲']
  132. }else{
  133. return [4,' 无法获取']
  134. }
  135. },
  136. chargerColor(){
  137. if(this.chargerInfoVo.chgState === 3){
  138. return 'background-color:rgb(19,33,39,0.9);border:#477c62 solid 1px'
  139. }else if(this.chargerInfoVo.chgState ===1 || this.chargerInfoVo.chgState === 5){
  140. return 'background-color:rgb(20,38,50,0.9);border:#4a9dab solid 1px'
  141. }else if(this.chargerInfoVo.chgState ===2 || this.chargerInfoVo.chgState === 0){
  142. return ''
  143. }else{
  144. return 'background-color:rgb(32,25,36,0.9);border:#94494d solid 1px'
  145. }
  146. },
  147. StateNum(){
  148. if(this.storeState === 0){
  149. return '空仓'
  150. }else if(this.storeState === 1){
  151. return '有电池'
  152. }else{
  153. return '连接异常'
  154. }
  155. }
  156. }
  157. };
  158. </script >
  159. <style lang="scss" scoped>
  160. .storage-item{
  161. width: 347px;
  162. background-color: #0a101c;
  163. height: 598px;
  164. margin-right: 22px;
  165. border: 1px solid #0a101c;
  166. .container{
  167. padding: 20px 24px;
  168. color: #404a63;
  169. font-size: 14px;
  170. .container-header{
  171. display: flex;
  172. .battery{
  173. width: 112px;
  174. height: 32px;
  175. background: #1C263A;
  176. color: #DEEFF9;
  177. line-height: 32px;
  178. text-align: center;
  179. margin-bottom: 10px;
  180. }
  181. .a-gun{
  182. width: 78px;
  183. margin-left: 12px;
  184. }
  185. .b-gun{
  186. width: 78px;
  187. margin-left: 12px;
  188. }
  189. .showCodeActive{
  190. background-color: #636C97;
  191. }
  192. }
  193. .container-code{
  194. display: flex;
  195. margin-bottom: 10px;
  196. justify-content: space-between;
  197. .container-code-one{
  198. font-size: 16px;
  199. color: #91FDB9;
  200. }
  201. .container-code-two{
  202. display: flex;
  203. image{
  204. width: 60px;
  205. height: 24px;
  206. }
  207. image:first-child{
  208. margin-right: 20px;
  209. }
  210. }
  211. }
  212. .battery-info{
  213. display: flex;
  214. margin-top: 16px;
  215. justify-content: space-between;
  216. flex-wrap: wrap;
  217. margin-bottom: 20px;
  218. min-height: 116px;
  219. .vim{
  220. width: 100%;
  221. margin: 0px 0px 12px 0px;
  222. text{
  223. font-size: 14px;
  224. color: #414A63;
  225. }
  226. text:last-child{
  227. display: inline-block;
  228. margin-left: 10px;
  229. font-weight: 600;
  230. color: #fff;
  231. }
  232. }
  233. .info-right{
  234. width: 46%;
  235. height: 32px;
  236. line-height:30px;
  237. text-align: center;
  238. font-size: 14px;
  239. font-weight: 500;
  240. color: white;
  241. background-color: #0e1f31;
  242. border: #1b71a4 solid 1px;
  243. .s1{
  244. vertical-align: middle;
  245. width: 18px;
  246. height: 18px;
  247. }
  248. }
  249. .info-warning{
  250. width: 46%;
  251. background-color: #201823;
  252. border: #834246 solid 1px;
  253. height: 34px;
  254. line-height:32px;
  255. text-align: center;
  256. font-size: 14px;
  257. font-weight: 500;
  258. color: white;
  259. // img{
  260. // vertical-align: middle;
  261. // }
  262. }
  263. }
  264. .battery-charger{
  265. width: 100%;
  266. min-height: 228px;
  267. .nodata{
  268. position: relative;
  269. left: calc(50% - 33px);
  270. margin-top: 6vh;
  271. width: 66px;
  272. height: 66px;
  273. }
  274. }
  275. }
  276. .battery-charger-btn{
  277. display: flex;
  278. position: absolute;
  279. bottom: 20px;
  280. .Plug-gun-charging{
  281. width: 135px;
  282. height: 32px;
  283. background: #69B889;
  284. text-align: center;
  285. line-height: 32px;
  286. font-size: 16px;
  287. font-family: PingFang SC-Medium, PingFang SC;
  288. font-weight: 500;
  289. color: #DEEFF9;
  290. }
  291. .Settings{
  292. background: #636C97;
  293. margin-left: 20px;
  294. }
  295. }
  296. }
  297. </style>