PublicDrawer.vue 2.6 KB

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