popupModal.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. { id: 1, label: '图片识别', },
  33. {
  34. id: 2, label: '巡检任务面板', children: [
  35. { label: '早班', },
  36. { label: '中班' },
  37. { label: '夜班' },
  38. ]
  39. },
  40. { id: 3, label: '瓦斯巡检填报' },
  41. ],
  42. }
  43. },
  44. mounted() { },
  45. methods: {
  46. handlerClick(item){
  47. let data=item.label
  48. this.$emit('handlerClick',data)
  49. }
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .popupModal {
  55. height: 100%;
  56. }
  57. </style>