StorageInfo.vue 8.5 KB

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