PublicDrawer.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view class="drawerBox">
  3. <view class="top">
  4. <view class="title">{{title}}</view>
  5. <view class="close" @click="close" v-if="flag">✕</view>
  6. <view class="handler" v-else>
  7. <view class="cancel" @click="close">取消</view>
  8. <view class="save" @click="SubmitPublic">保存</view>
  9. </view>
  10. </view>
  11. <view class="footer">
  12. <slot/>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. name:"PublicDrawer",
  19. props:['flag','title'],
  20. data() {
  21. return {
  22. };
  23. },
  24. methods:{
  25. //修改接口公共触发函数
  26. SubmitPublic(){
  27. if(this.title=='告警处理'){
  28. this.$emit('alarmDispose')
  29. }else if(this.title=='新增车辆'){
  30. this.$emit('AddCarinfo')
  31. }else if(this.title=='编辑车辆'){
  32. this.$emit('EditCarInfo')
  33. }
  34. else if(this.title == '编辑车牌'){
  35. //修改车牌号
  36. this.$emit('HandleEditPlate')
  37. }else if(this.title == '充电设置'){
  38. }else if(this.title=='新增仓位'){
  39. this.$emit('AddCanginfo')
  40. }else if(this.title=='编辑仓位'){
  41. this.$emit('EditCangInfo')
  42. }else if(this.title=='编辑电池'){
  43. this.$emit('EditBatteryInfo')
  44. }else if(this.title=='新增电池'){
  45. this.$emit('AddBatteryinfo')
  46. }
  47. },
  48. close(){
  49. this.$emit('closeDrawer')
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. .drawerBox{
  56. display: flex;
  57. flex-direction: column;
  58. height: 100%;
  59. .top{
  60. width: 100%;
  61. height: 74px;
  62. line-height: 54px;
  63. border-bottom: 1px solid rgba(65, 74, 99, 0.5);
  64. box-sizing: border-box;
  65. z-index: 999;
  66. padding: 0px 20px;
  67. display: flex;
  68. padding-top: 20px;
  69. background-color: #141A25;
  70. position:fixed;
  71. top: 0;
  72. .title{
  73. min-width: 74px;
  74. white-space: nowrap;
  75. font-size: 16px;
  76. font-weight: 500;
  77. color: #FFFFFF;
  78. position: relative;
  79. }
  80. .title::before{
  81. content: '';
  82. width: 100%;
  83. position: absolute;
  84. height: 2px;
  85. background: #FFFFFF;
  86. box-shadow: 0px 0px 6px 0px rgba(255,255,255,0.8);
  87. bottom: -1px;
  88. }
  89. .close{
  90. width: 24px;
  91. height: 24px;
  92. color: #FFFFFF;
  93. margin-left: auto;
  94. font-size: 14px;
  95. text-align: center;
  96. vertical-align:middle;
  97. }
  98. .handler{
  99. display: flex;
  100. margin-left: auto;
  101. height: 54px;
  102. align-items: center;
  103. .cancel{
  104. width: 60px;
  105. height: 54px;
  106. border-radius: 2px;
  107. border: 1px solid #263042;
  108. font-size: 14px;
  109. font-weight: 400;
  110. color: #FFFFFF;
  111. text-align: center;
  112. line-height: 54px;
  113. }
  114. .save{
  115. width: 60px;
  116. height: 54px;
  117. background: #91FDB9;
  118. border-radius: 2px;
  119. text-align: center;
  120. line-height: 54px;
  121. font-size: 14px;
  122. font-weight: 400;
  123. color: black;
  124. }
  125. }
  126. }
  127. .footer{
  128. padding: 20px;
  129. width: 100%;
  130. box-sizing: border-box;
  131. margin-top: 74px;
  132. }
  133. }
  134. </style>