popupModal.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view class="popupModal">
  3. <u-popup :show="showModel" :zIndex="1" :overlay="true" :overlayStyle="{ 'z-index': 0 }" safeAreaInsetBottom
  4. safeAreaInsetTop :customStyle="{ width: '240px', margin: '44px 0px 51px 0px' }" mode="left">
  5. <view>
  6. <u-list>
  7. <u-list-item v-for="(item, index) in indexList" :key="index">
  8. <u-cell icon="star" :title="item.label" v-if="!item.children" @click="handlerClick(item)"></u-cell>
  9. <u-cell-group v-else :border="false" >
  10. <u-cell icon="star" :title="item.label" ></u-cell>
  11. <u-cell v-for="(ite,ind) in item.children" icon="minus" style="padding: '0px 30px'" :border="ind==2 ? true: false" :label="ite.label" @click="handlerClick(ite)"></u-cell>
  12. </u-cell-group>
  13. </u-list-item>
  14. </u-list>
  15. </view>
  16. </u-popup>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. name: 'popupModal',
  22. props: {
  23. showModel: {
  24. type: Boolean,
  25. default: false,
  26. }
  27. },
  28. data() {
  29. return {
  30. indexList: [
  31. { id: 1, label: '瓦斯巡检记录卡管理', },
  32. {
  33. id: 2, label: '巡检任务面板', children: [
  34. { label: '早班', },
  35. { label: '中班' },
  36. { label: '夜班' },
  37. ]
  38. },
  39. { id: 3, label: '瓦斯巡检填报' },
  40. ],
  41. }
  42. },
  43. mounted() { },
  44. methods: {
  45. handlerClick(item){
  46. let data=item.label
  47. this.$emit('handlerClick',data)
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. .popupModal {
  54. height: 100%;
  55. }
  56. </style>