123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- <template>
- <div>
- <div class="communication">
- <div><img src="../assets/cangwei.png" />{{storeCode}}号仓位</div>
- <div :class="statustext[1]">{{statustext[0]}}</div>
- </div>
- <div class="battery-number">
- <span>电池编号</span><span>{{sn}}</span>
- </div>
- <div class="percent">
- <div><span>{{5}}</span></div>
- <div>%</div>
- </div>
- <div class="line"><span></span><span></span></div>
- <div class="power">
- <div class="power-percent">
- <span v-for="item in 100" :key="item"></span>
- </div>
- <div class="power-text">
- <span>电池电量</span>
- <span>预计<em>{{chgEstimatedTime}}</em>后充满</span>
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- name: "BatteryStatus",
- props:['storeCode','comState','sn','chgEstimatedTime'],
- computed:{
- statustext(){
- if(this.comState===1){
- return ['通讯正常','success']
- }else{
- return ['通讯异常','warning']
- }
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .communication {
- display: flex;
- div {
- line-height: 36px;
- font-size: 16px;
- font-weight: 600;
- height: 36px;
- width: 136px;
- text-align: center;
- }
- div:first-child {
- background-color: #1b263a;
- border: #25334d solid 1px;
- color: white;
- line-height: 34px;
- img {
- vertical-align: middle;
- }
- }
- .success {
- color: #92fdb9;
- }
- .warning {
- color: #ff4d4f;
- }
- }
- .battery-number {
- margin-top: 1vh;
- display: flex;
- :last-child {
- color: white;
- padding-left: 16px;
- font-size: 16px;
- font-weight: 600;
- }
- }
- .percent {
- margin-top: 1vh;
- display: flex;
- div:first-child {
- background-color: #181e2a;
- width: 90%;
- border-radius: 5px;
- height: 10px;
- span {
- color: white;
- font-weight: 600;
- font-size: 16px;
- position: relative;
- bottom: 5px;
- }
- }
- :last-child {
- position: relative;
- bottom: 4px;
- width: 30px;
- text-align: right;
- font-weight: 500;
- }
- }
- .line {
- display: flex;
- :first-child {
- width: 1%;
- background-color: white;
- height: 2px;
- }
- :last-child {
- height: 2px;
- width: 97%;
- background-color: #14172a;
- margin-left: 5px;
- }
- }
- .power {
- display: flex;
- flex-direction: column;
- margin-top: 1vh;
- .power-percent {
- width: 100%;
- display: flex;
- span {
- background-color: #1e2535;
- height: 6px;
- width: 2px;
- margin-right: 1px;
- }
- }
- .power-text {
- display: flex;
- width: 100%;
- margin-top: 1.2vh;
- margin-bottom: 0.8vh;
- justify-content: space-between;
- em {
- color: #87edab;
- font-weight: 500;
- font-style: normal;
- }
- }
- }
- </style>
|