123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <template>
- <div class="border-style">
- <div class="inner-style">
- <div class="statelist">
- <div class="white-border"></div>
- <div class="align-center">
- <div class="name">{{ name }}</div>
- <div class="statement">{{ statement }}</div>
- <div class="warn"><img src="../assets/warn.png" v-if="logInfo"><span>{{ logInfo }}</span></div>
- </div>
- </div>
- <div class="timestate">
- <div class="times" v-if="swapTime">
- 换电时间:<font>{{ swapTime }}</font>
- </div>
- <div class="store-list active" @click="changePower" v-if="logInfo">开始换电</div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { beginSwap } from '@/api/equipment'
- export default {
- name: "SubTitle",
- props: ["name", "statement","logInfo","swapTime"],
- methods:{
- // 手动发起换电
- changePower() {
- this.loading=true
- this.$confirm('请确认站控系统手动发起换电?', '开始换电', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(async() => {
- const res = await beginSwap()
- this.$message({
- type: 'success',
- message: res.msg,
- })
- this.loading=false
- })
- .catch(err => { console.error(err) })
- },
- }
- };
- </script>
- <style scoped>
- .timestate{
- display: flex;
- align-items: center;
- }
- .times {
- color: #596189;
- font-size: 14px;
- font-weight: 600;
- margin-right: 40px;
- }
- .times font{
- color: white;
- font-size: 14px;
- }
- .warn{
- color: red;
- font-size: 14px;
- display: flex;
- }
- .warn img{
- width: 16px;
- height: 16px;
- vertical-align: middle;
- margin-right: 5px;
- }
- .border-style {
- border: 1px solid rgb(25, 34, 51);
- padding: 3px;
- }
- .inner-style {
- background: #121a29;
- padding: 3px;
- display: flex;
- height: 38px;
- flex-direction: row;
- justify-content: space-between;
- }
- .statelist{
- display: flex;
- }
- .white-border {
- width: 28px;
- height: 18px;
- background-image: url("../assets/ico2.png");
- background-size: 100% 100%;
- }
- .align-center {
- display: flex;
- margin: 0 5px;
- align-items: center;
- }
- .name {
- color: white;
- font-size: 1.2rem;
- font-weight: 600;
- text-shadow: 0 0 3px #1753ce,0 0 4px #1753ce,0 0 3px #1753ce,0 0 3px #1753ce;
- margin-left: -4.2%;
- }
- .statement {
- color: #324264;
- font-size: 0.6rem;
- margin: 0 8px;
- font-weight: 600;
- padding-top: 6px;
- width: 220px;
- }
- .store-list {
- padding: 0 12px;
- height: 32px;
- text-align: center;
- line-height: 32px;
- border: #414a63 solid 1px;
- color: #84988c;
- font-size: 14px;
- font-weight: 600;
- margin-right: 15px;
- cursor: pointer;
- }
- .active {
- border: #91fdb9 solid 1px;
- color: #91fdb9;
- }
- </style>
|