BinInfomation.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. <template>
  2. <div class="bin-bottom">
  3. <div class="bin-carbg">
  4. <img src="../assets/car1x.png" class="car" />
  5. <div class="battery-yellow" :class="yellowBattery" v-if="BatteryOnCar">
  6. <div class="battery-yellow-img">
  7. <img src="../assets/yellow.png">
  8. </div>
  9. <div class="battery-yellow-text">
  10. <p>SOC</p>
  11. <p>{{ BatteryOnCar }}%</p>
  12. </div>
  13. </div>
  14. </div>
  15. <div class="bin-battery">
  16. <div class="battery-list" v-for="(item, index) in storeInfoList" :key="index">
  17. <div class="battery-listbg" :class="[greenBattery(index),setBatteryBg(index)]" v-if="Carconnection(index)">
  18. <template v-if="step >= 3 && swapCode === index">
  19. <p v-show="swapSoc">SOC {{ swapSoc }}%</p>
  20. <p v-show="swapCurrent">{{ swapCurrent }} A</p>
  21. </template>
  22. <template v-else>
  23. <p v-show="item.soc">SOC {{ item.soc }}%</p>
  24. <p v-show="item.current">{{ item.current }} A</p>
  25. </template>
  26. </div>
  27. <div class="battery-defaultcls defaultbg" v-if="swapCode === index">
  28. <p v-show="item.soc && yellowBattery.yellowshow">SOC {{ item.soc }}%</p>
  29. <p v-show="item.current && yellowBattery.yellowshow">{{ item.current }} A</p>
  30. </div>
  31. <div class="battery-liststatus">
  32. <img src="../assets/status0.png" v-show="item.chargerInfoVo.chgState === 0">
  33. <img src="../assets/status1.png" v-show="item.chargerInfoVo.chgState === 1">
  34. <img src="../assets/status2.png" v-show="item.chargerInfoVo.chgState === 2">
  35. <img src="../assets/status3.png" v-show="item.chargerInfoVo.chgState === 3">
  36. </div>
  37. </div>
  38. </div>
  39. <div class="battery-num">
  40. <img src="../assets/nostatus.png" v-for="(index) in 8" :key="index">
  41. </div>
  42. </div>
  43. </template>
  44. <script>
  45. /*
  46. * @step:动画步骤
  47. * @BatteryOnCar:控制车上亏电电池是否亮起
  48. * @storeInfoList:充电仓电池列表
  49. * @swapCode:换电电池编号
  50. * @connectionState:车站连接状态 1已连接 0断开连接
  51. * @swapCurrent:绿电池缓存电流,
  52. * @swapSoc:绿电池缓存SOC,
  53. */
  54. export default {
  55. props: ["BatteryOnCar","storeInfoList","swapCode","connectionState","swapCurrent","swapSoc","step"],
  56. data() {
  57. return {
  58. };
  59. },
  60. watch:{
  61. },
  62. computed:{
  63. //设置黄电池动画
  64. yellowBattery:{
  65. get(){
  66. let cls={}
  67. if(this.step === 0 || this.step === 1) {
  68. cls['onestepPotion'] =true
  69. }else if(this.step === 2){
  70. cls['onestepPotion'] =true
  71. cls['yellowAnimationOne']=true
  72. }else if(this.step === 3){
  73. cls['twostepPotion']=true
  74. }
  75. else if(this.step === 4){
  76. cls['twostepPotion']=true
  77. if(this.swapCode === 1){
  78. cls['yellowAnimationSwapone']=true
  79. }else if(this.swapCode === 2){
  80. cls['SwaptwoPotion']=true
  81. cls['yellowAnimationSwaptwo']=true
  82. }else if(this.swapCode === 0){
  83. cls['SwapZeroPotion']=true
  84. cls['yellowAnimationSwapZero']=true
  85. }else if(this.swapCode === 4){
  86. cls['SwapthreePotion']=true
  87. cls['yellowAnimationSwapthree']=true
  88. }else if(this.swapCode === 5){
  89. cls['SwapfourPotion']=true
  90. cls['yellowAnimationSwapfour']=true
  91. }else if(this.swapCode === 6){
  92. cls['SwapfivePotion']=true
  93. cls['yellowAnimationSwapfive']=true
  94. }else if(this.swapCode === 7){
  95. cls['SwapsixPotion']=true
  96. cls['yellowAnimationSwapsix']=true
  97. }
  98. }
  99. return cls
  100. },
  101. set(val){
  102. return val
  103. }
  104. },
  105. },
  106. methods: {
  107. //设置车辆断开状态
  108. Carconnection(index){
  109. if(this.swapCode === index && this.connectionState === 0 && this.step >=3){
  110. return false
  111. }else{
  112. return true
  113. }
  114. },
  115. //设置换电电池背景
  116. setBatteryBg(index){
  117. if(this.swapCode === index && this.step !== 5){
  118. return 'lightbg'
  119. }else{
  120. return 'defaultbg'
  121. }
  122. },
  123. //设置绿电池动画
  124. greenBattery(index){
  125. let cls={}
  126. if(this.step === 3 && this.swapCode === index){
  127. if(this.swapCode === 1){
  128. cls['greenAnimationOne']=true
  129. }else if(this.swapCode ===2){
  130. cls['greenAnimationTwo']=true
  131. }else if(this.swapCode ===0){
  132. cls['greenAnimationZero']=true
  133. }else if(this.swapCode ===4){
  134. cls['greenAnimationThree']=true
  135. }else if(this.swapCode ===5){
  136. cls['greenAnimationFour']=true
  137. }else if(this.swapCode ===6){
  138. cls['greenAnimationFive']=true
  139. }else if(this.swapCode ===7){
  140. cls['greenAnimationSix']=true
  141. }
  142. }
  143. if(this.step === 4 && this.swapCode === index){
  144. if(this.swapCode === 1){
  145. cls['greenStepOnePotion']=true
  146. } else if(this.swapCode ===2){
  147. cls['greenStepTwoPotion']=true
  148. }else if(this.swapCode ===0){
  149. cls['greenStepZeroPotion']=true
  150. }else if(this.swapCode === 4){
  151. cls['greenStepThreePotion']=true
  152. }else if(this.swapCode === 5){
  153. cls['greenStepFourPotion']=true
  154. }else if(this.swapCode === 6){
  155. cls['greenStepFivePotion']=true
  156. }else if(this.swapCode === 7){
  157. cls['greenStepSixPotion']=true
  158. }
  159. }
  160. return cls
  161. }
  162. },
  163. mounted() {
  164. },
  165. };
  166. </script>
  167. <style lang="scss" scoped>
  168. .yellowshow{
  169. visibility: hidden;
  170. }
  171. .battery-defaultcls {
  172. width: 73px;
  173. height: 36px;
  174. display: flex;
  175. font-size: 13px;
  176. font-weight: 600;
  177. display: flex;
  178. flex-direction: column;
  179. }
  180. .defaultbg{
  181. background-image: url("../assets/statusbg.png");
  182. background-size: 100% 100%;
  183. color: #73cb95;
  184. }
  185. .yellowbg{
  186. background-image: url("../assets/yellow.png");
  187. background-size: 100% 100%;
  188. color: #f6bb47;
  189. }
  190. .lightbg{
  191. background-image: url("../assets/lightbg.png");
  192. background-size: 100% 100%;
  193. color: #233C39;
  194. position: absolute;
  195. z-index:99999
  196. }
  197. .yellowAnimationOne{
  198. animation: yellowOnestep 2s linear forwards
  199. }
  200. @keyframes yellowOnestep{
  201. 0%{
  202. transform: translate(0);
  203. }
  204. 100% {
  205. transform: translate(119px, 28px);
  206. }
  207. }
  208. .greenAnimationZero{
  209. animation: greenZerostep 2s linear forwards
  210. }
  211. @keyframes greenZerostep{
  212. 0%{
  213. transform: translate(0);
  214. }
  215. 100% {
  216. transform: translate(-119px, 110px);
  217. }
  218. }
  219. .greenAnimationOne{
  220. animation: greenOnestep 2s linear forwards
  221. }
  222. @keyframes greenOnestep{
  223. 0%{
  224. transform: translate(0);
  225. }
  226. 100% {
  227. transform: translate(-119px, 63px);
  228. }
  229. }
  230. .greenAnimationTwo{
  231. animation: greenTwostep 2s linear forwards
  232. }
  233. @keyframes greenTwostep{
  234. 0%{
  235. transform: translate(0);
  236. }
  237. 100% {
  238. transform: translate(-119px, 18px);
  239. }
  240. }
  241. .greenAnimationThree{
  242. animation: greenThreestep 2s linear forwards
  243. }
  244. @keyframes greenThreestep{
  245. 0%{
  246. transform: translate(0);
  247. }
  248. 100% {
  249. transform: translate(-119px, -74.5px);
  250. }
  251. }
  252. .greenAnimationFour{
  253. animation: greenFourstep 2s linear forwards
  254. }
  255. @keyframes greenFourstep{
  256. 0%{
  257. transform: translate(0);
  258. }
  259. 100% {
  260. transform: translate(-119px, -121px);
  261. }
  262. }
  263. .greenAnimationFive{
  264. animation: greenFivestep 2s linear forwards
  265. }
  266. @keyframes greenFivestep{
  267. 0%{
  268. transform: translate(0);
  269. }
  270. 100% {
  271. transform: translate(-119px, -166px);
  272. }
  273. }
  274. .greenAnimationSix{
  275. animation: greenSixstep 4s linear forwards
  276. }
  277. @keyframes greenSixstep{
  278. 0%{
  279. transform: translate(0);
  280. }
  281. 100% {
  282. transform: translate(-119px, -212px);
  283. }
  284. }
  285. .greenStepZeroPotion{
  286. left:-117px;
  287. top:110px;
  288. }
  289. .greenStepOnePotion{
  290. left:-117px;
  291. top:63px;
  292. }
  293. .greenStepTwoPotion{
  294. left:-117px;
  295. top:18px;
  296. }
  297. .greenStepThreePotion{
  298. left:-117px;
  299. top:-74.5px;
  300. }
  301. .greenStepFourPotion{
  302. left:-117px;
  303. top:-121px;
  304. }
  305. .greenStepFivePotion{
  306. left:-117px;
  307. top:-166px;
  308. }
  309. .greenStepSixPotion{
  310. left:-117px;
  311. top:-212px;
  312. }
  313. .onestepPotion{
  314. top: 114px;
  315. left: 27%;
  316. }
  317. .twostepPotion{
  318. top:142px;
  319. left:158px
  320. }
  321. .threestepPotion{
  322. top:52px;
  323. left:158px
  324. }
  325. .yellowAnimationSwapone{
  326. animation: yellowThreestep 2s linear forwards
  327. }
  328. @keyframes yellowThreestep{
  329. 0%{
  330. transform: translate(0);
  331. }
  332. 100% {
  333. transform: translate(0, -92.5px);
  334. }
  335. }
  336. .yellowAnimationSwaptwo{
  337. transition: top 2s;
  338. }
  339. .yellowAnimationSwapthree{
  340. transition: top 2s;
  341. }
  342. .yellowAnimationSwapfour{
  343. transition: top 2s;
  344. }
  345. .yellowAnimationSwapfive{
  346. transition: top 4s;
  347. }
  348. .yellowAnimationSwapsix{
  349. transition: top 5s;
  350. }
  351. .SwaptwoPotion{
  352. top:96px
  353. }
  354. .SwapthreePotion{
  355. top:188px
  356. }
  357. .SwapfourPotion{
  358. top:233px
  359. }
  360. .SwapfivePotion{
  361. top:279px
  362. }
  363. .SwapsixPotion{
  364. top:325px
  365. }
  366. .yellowAnimationSwapZero{
  367. transition: top 4s;
  368. }
  369. .SwapZeroPotion{
  370. top:4px
  371. }
  372. .bin-bottom {
  373. width: 100%;
  374. display: flex;
  375. flex-wrap: wrap;
  376. flex-direction: row;
  377. justify-content: space-around;
  378. height: 100%;
  379. }
  380. .bin-carbg {
  381. width: 38%;
  382. position: relative;
  383. padding-top: 5px;
  384. }
  385. .bin-carbg .car {
  386. position: absolute;
  387. width: 137px;
  388. height: 362px;
  389. left: 5%;
  390. }
  391. .bin-carbg .battery-yellow {
  392. position: relative;
  393. width: 73px;
  394. z-index: 9999;
  395. }
  396. .battery-yellow .battery-yellow-img {
  397. width: 73px;
  398. position: absolute;
  399. }
  400. .battery-yellow .battery-yellow-text {
  401. width: 73px;
  402. display: flex;
  403. position: absolute;
  404. z-index: 99;
  405. align-items: center;
  406. font-size: 13px;
  407. font-weight: 600;
  408. text-align: center;
  409. color: #f6bb47;
  410. padding-left: 3px;
  411. }
  412. .battery-yellow-text p {
  413. padding-left: 6px;
  414. }
  415. .bin-battery {
  416. position: relative;
  417. display: flex;
  418. flex-wrap: wrap;
  419. flex-direction: column;
  420. align-items: center;
  421. justify-content: space-around;
  422. padding-left: 10px;
  423. flex: 1;
  424. .battery-list {
  425. width: 98%;
  426. position: relative;
  427. display: flex;
  428. flex-direction: row;
  429. margin-top: 5px;
  430. padding-left: 2%;
  431. }
  432. .battery-list .battery-listbg {
  433. width: 73px;
  434. height: 36px;
  435. display: flex;
  436. font-size: 13px;
  437. font-weight: 600;
  438. display: flex;
  439. flex-direction: column;
  440. }
  441. .battery-listbg p:first-child,.battery-defaultcls p:first-child {
  442. margin-top: 4px;
  443. }
  444. .battery-listbg p,.battery-defaultcls p {
  445. margin: 0;
  446. padding:0 3px;
  447. margin-top: 2px;
  448. text-align: right;
  449. }
  450. .battery-list .battery-lightbg {
  451. width: 73px;
  452. height: 36px;
  453. display: flex;
  454. font-size: 12px;
  455. font-weight: 600;
  456. z-index: 999;
  457. position: absolute;
  458. }
  459. .battery-list .battery-liststatus {
  460. width: 25px;
  461. height: 31px;
  462. margin-top: 3px;
  463. margin-left: 5px;
  464. }
  465. }
  466. .battery-num {
  467. width: 101px;
  468. flex-wrap: wrap;
  469. display: flex;
  470. flex-direction: column;
  471. justify-content: space-between;
  472. align-items: center;
  473. margin-top: 5px;
  474. }
  475. .battery-num img {
  476. width: 101px;
  477. height: 35px;
  478. }
  479. </style>