PublicDrawer.vue 2.6 KB

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