PublicDrawer.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. }else if(this.title=='绑定FRID'){
  34. this.$emit('BindFRIDHandle')
  35. }
  36. else if(this.title == '编辑车牌'){
  37. //修改车牌号
  38. this.$emit('HandleEditPlate')
  39. }else if(this.title == '充电设置'){
  40. }else if(this.title=='新增仓位'){
  41. this.$emit('AddCanginfo')
  42. }else if(this.title=='编辑仓位'){
  43. this.$emit('EditCangInfo')
  44. }else if(this.title=='编辑电池'){
  45. this.$emit('EditBatteryInfo')
  46. }else if(this.title=='新增电池'){
  47. this.$emit('AddBatteryinfo')
  48. }
  49. },
  50. close(){
  51. this.$emit('closeDrawer')
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .drawerBox{
  58. display: flex;
  59. flex-direction: column;
  60. height: 100%;
  61. .top{
  62. width: 100%;
  63. height: 74px;
  64. line-height: 54px;
  65. border-bottom: 1px solid rgba(65, 74, 99, 0.5);
  66. box-sizing: border-box;
  67. z-index: 999;
  68. padding: 0px 20px;
  69. display: flex;
  70. padding-top: 20px;
  71. background-color: #141A25;
  72. position:fixed;
  73. top: 0;
  74. .title{
  75. min-width: 74px;
  76. white-space: nowrap;
  77. font-size: 16px;
  78. font-weight: 500;
  79. color: #FFFFFF;
  80. position: relative;
  81. }
  82. .title::before{
  83. content: '';
  84. width: 100%;
  85. position: absolute;
  86. height: 2px;
  87. background: #FFFFFF;
  88. box-shadow: 0px 0px 6px 0px rgba(255,255,255,0.8);
  89. bottom: -1px;
  90. }
  91. .close{
  92. width: 24px;
  93. height: 24px;
  94. color: #FFFFFF;
  95. margin-left: auto;
  96. font-size: 14px;
  97. text-align: center;
  98. vertical-align:middle;
  99. }
  100. .handler{
  101. display: flex;
  102. margin-left: auto;
  103. height: 54px;
  104. align-items: center;
  105. .cancel{
  106. width: 60px;
  107. height: 54px;
  108. border-radius: 2px;
  109. border: 1px solid #263042;
  110. font-size: 14px;
  111. font-weight: 400;
  112. color: #FFFFFF;
  113. text-align: center;
  114. line-height: 54px;
  115. }
  116. .save{
  117. width: 60px;
  118. height: 54px;
  119. background: #91FDB9;
  120. border-radius: 2px;
  121. text-align: center;
  122. line-height: 54px;
  123. font-size: 14px;
  124. font-weight: 400;
  125. color: black;
  126. }
  127. }
  128. }
  129. .footer{
  130. padding: 20px;
  131. width: 100%;
  132. box-sizing: border-box;
  133. margin-top: 74px;
  134. }
  135. }
  136. </style>