SubTitle.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <div class="border-style">
  3. <div class="inner-style">
  4. <div class="statelist">
  5. <div class="white-border"></div>
  6. <div class="align-center">
  7. <div class="name">{{ name }}</div>
  8. <div class="statement">{{ statement }}</div>
  9. <div class="warn"><img src="../assets/warn.png" v-if="logInfo"><span>{{ logInfo }}</span></div>
  10. </div>
  11. </div>
  12. <div class="timestate">
  13. <div class="times" v-if="swapTime">
  14. 换电时间:<font>{{ swapTime }}</font>
  15. </div>
  16. <div class="store-list active" @click="changePower" v-if="logInfo">开始换电</div>
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import { beginSwap } from '@/api/equipment'
  23. export default {
  24. name: "SubTitle",
  25. props: ["name", "statement","logInfo","swapTime"],
  26. methods:{
  27. // 手动发起换电
  28. changePower() {
  29. this.loading=true
  30. this.$confirm('请确认站控系统手动发起换电?', '开始换电', {
  31. confirmButtonText: '确认',
  32. cancelButtonText: '取消',
  33. type: 'warning'
  34. })
  35. .then(async() => {
  36. const res = await beginSwap()
  37. this.$message({
  38. type: 'success',
  39. message: res.msg,
  40. })
  41. this.loading=false
  42. })
  43. .catch(err => { console.error(err) })
  44. },
  45. }
  46. };
  47. </script>
  48. <style scoped>
  49. .timestate{
  50. display: flex;
  51. align-items: center;
  52. }
  53. .times {
  54. color: #596189;
  55. font-size: 14px;
  56. font-weight: 600;
  57. margin-right: 40px;
  58. }
  59. .times font{
  60. color: white;
  61. font-size: 14px;
  62. }
  63. .warn{
  64. color: red;
  65. font-size: 14px;
  66. display: flex;
  67. }
  68. .warn img{
  69. width: 16px;
  70. height: 16px;
  71. vertical-align: middle;
  72. margin-right: 5px;
  73. }
  74. .border-style {
  75. border: 1px solid rgb(25, 34, 51);
  76. padding: 3px;
  77. }
  78. .inner-style {
  79. background: #121a29;
  80. padding: 3px;
  81. display: flex;
  82. height: 38px;
  83. flex-direction: row;
  84. justify-content: space-between;
  85. }
  86. .statelist{
  87. display: flex;
  88. }
  89. .white-border {
  90. width: 28px;
  91. height: 18px;
  92. background-image: url("../assets/ico2.png");
  93. background-size: 100% 100%;
  94. }
  95. .align-center {
  96. display: flex;
  97. margin: 0 5px;
  98. align-items: center;
  99. }
  100. .name {
  101. color: white;
  102. font-size: 1.2rem;
  103. font-weight: 600;
  104. text-shadow: 0 0 3px #1753ce,0 0 4px #1753ce,0 0 3px #1753ce,0 0 3px #1753ce;
  105. margin-left: -4.2%;
  106. }
  107. .statement {
  108. color: #324264;
  109. font-size: 0.6rem;
  110. margin: 0 8px;
  111. font-weight: 600;
  112. padding-top: 6px;
  113. width: 220px;
  114. }
  115. .store-list {
  116. padding: 0 12px;
  117. height: 32px;
  118. text-align: center;
  119. line-height: 32px;
  120. border: #414a63 solid 1px;
  121. color: #84988c;
  122. font-size: 14px;
  123. font-weight: 600;
  124. margin-right: 15px;
  125. cursor: pointer;
  126. }
  127. .active {
  128. border: #91fdb9 solid 1px;
  129. color: #91fdb9;
  130. }
  131. </style>