panel.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="popup-warpper"
  3. :class="{
  4. 'popup-warpper-show': isShow
  5. }"
  6. >
  7. <u-overlay
  8. :show="isShow"
  9. @click="close"
  10. v-if="isShow"
  11. :duration="350"
  12. :opacity="0.5"
  13. ></u-overlay>
  14. <view class="popup-container">
  15. <view class="munes"
  16. :class="{
  17. 'events-none': $store.state.realtimeWatch.loading
  18. }"
  19. >
  20. <view v-for="(item,index) in typeList" :key="index"
  21. class="munes-item"
  22. :class="{
  23. 'munes-item-active': item.value == tabStyle
  24. }"
  25. @click="handleActive(item)"
  26. >
  27. <text>{{item.label}}</text>
  28. </view>
  29. </view>
  30. <eleChoose v-if="tabStyle=='vehicle'" ref="eleChooseRef" :queryType='2' key="vehicle" @getDataed="getDataed"></eleChoose>
  31. <eleChoose v-else-if="tabStyle=='personnel'" ref="eleChooseRef" :queryType='1' key="personnel" @getDataed="getDataed"></eleChoose>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import {isArray,clone,isObject } from 'lodash'
  37. import {realTimeList, realTimeMap} from '@/api/realtimeWatch.js'
  38. import {getImages} from '@/plugins/images'
  39. import {copyProps,clearProps} from '@/utils/gdtq.js'
  40. //资源引入
  41. import eleChoose from './eleChoose.vue'
  42. export default {
  43. props: {
  44. },
  45. components: {
  46. eleChoose
  47. },
  48. data() {
  49. return {
  50. isShow: false,
  51. tabStyle: 'vehicle',
  52. typeList: [
  53. {label: '车辆',value: 'vehicle'},
  54. {label: '人员',value: 'personnel'},
  55. ],
  56. firstLoade: true,
  57. }
  58. },
  59. mounted() {
  60. },
  61. methods: {
  62. handleActive(item) {
  63. if(this.tabStyle == item.value) return
  64. this.tabStyle = item.value
  65. this.$store.dispatch('setVheicleCheckArr',[])
  66. this.$store.dispatch('setPeopleCheckArr',[])
  67. },
  68. show() {
  69. this.isShow= true;
  70. },
  71. getDataed() {
  72. if(this.firstLoade) {
  73. setTimeout(() => {
  74. this.$refs.eleChooseRef.handleChooseAll()
  75. this.close()
  76. this.firstLoade = false
  77. },500)
  78. }
  79. },
  80. close() {
  81. this.$refs.eleChooseRef.getChoosed()
  82. this.isShow = false
  83. },
  84. },
  85. }
  86. </script>
  87. <style lang="scss" scoped>
  88. .popup-warpper-show {
  89. bottom: 0 !important;
  90. }
  91. .popup-warpper {
  92. position: fixed;
  93. bottom: -100vh;
  94. right: 0;
  95. width: 100%;
  96. height: 100vh;
  97. z-index: 90000;
  98. transition: all ease 0.35s;
  99. .popup-container {
  100. position: absolute;
  101. bottom: 0;
  102. right: 0;
  103. width: 100%;
  104. z-index: 90002;
  105. background: #fff;
  106. max-height: 85vh;
  107. .munes {
  108. height: 80rpx;
  109. display: flex;
  110. justify-content: center;
  111. align-items: center;
  112. background: #fff;
  113. .munes-item {
  114. flex: 1;
  115. height: 100%;
  116. // background: #F2f2f2;
  117. display: flex;
  118. justify-content: center;
  119. align-items: center;
  120. font-size: 30rpx;
  121. font-weight: bold;
  122. }
  123. .munes-item-active {
  124. // background: #fff;
  125. color: #2979ff;
  126. position: relative;
  127. &::after {
  128. position: absolute;
  129. bottom: 0;
  130. content: '';
  131. width: 50rpx;
  132. border-bottom: 4rpx solid #2979ff;
  133. }
  134. }
  135. }
  136. }
  137. }
  138. .choosed-image {
  139. width: 40rpx;
  140. height: 40rpx;
  141. margin-right: 10rpx;
  142. }
  143. .events-none {
  144. pointer-events: none;
  145. }
  146. </style>