drawer.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <u-popup :show="scanBool" @close="close" @open="open" mode="bottom" :data-theme="'theme-' + proxy.$settingStore.themeColor.name">
  3. <template #default>
  4. <view class="mb15 mt15">
  5. <h4 style="font-size: 16px; color: #149eff; text-align: center; margin-bottom: 10px">请选择计划</h4>
  6. <view style="font-size: 12px; color: #b7b7b7; text-align: center"> 当前地点存在于多个计划,请选择目标计划 </view>
  7. </view>
  8. <scroll-view scroll-y class="pl15 pr15" style="height: calc(100vh - 30rem)">
  9. <view v-for="(scan, index) in scanArray" :key="index">
  10. <view style="display: flex; font-size: 15px; height: 50px; line-height: 50px">
  11. <view style="margin-right: 15px">
  12. <img src="@/static/images/xunjian/plan-scan-drawer.png" alt="" />
  13. </view>
  14. <view>{{ scan.planName }} </view>
  15. <view style="margin: auto"></view>
  16. <view style="margin: auto 0">
  17. <u-button type="primary" shape="circle" style="height: 25px; font-size: 13px" @click="reportClick(scan.siteId, scan.id)"> 上报 </u-button>
  18. </view>
  19. </view>
  20. <view style="border-bottom: 1.5px #dad7d7 solid"></view>
  21. </view>
  22. </scroll-view>
  23. </template>
  24. </u-popup>
  25. </template>
  26. <script setup>
  27. import { onLoad, onShow } from "@dcloudio/uni-app";
  28. import { ref, onMounted, inject, shallowRef, watchEffect } from "vue";
  29. import { publicStores, xunJianStores } from "@/store/modules/index";
  30. const xunJianStore = xunJianStores(); //全局变量值Store
  31. const props = defineProps({
  32. scanArray: {
  33. type: Object,
  34. default: null,
  35. },
  36. scanBool: {
  37. type: Boolean,
  38. default: null,
  39. },
  40. });
  41. const emit = defineEmits(["scanClose"]);
  42. const scanArray = ref(props.scanArray);
  43. const scanBool = ref(false);
  44. /**
  45. * @巡检上报
  46. * @按钮点击事件
  47. */
  48. function reportClick(siteId, planSonId) {
  49. xunJianStore.contentArray = {};
  50. xunJianStore.siteNubmber = undefined;
  51. xunJianStore.siteId = siteId;
  52. xunJianStore.planSonId = planSonId;
  53. uni.navigateTo({
  54. url: "/pages/business/mhxf/xunJian/plan/components/siteDetails",
  55. });
  56. }
  57. /**
  58. * @开启抽屉时执行
  59. */
  60. function open() {}
  61. /**
  62. * @关闭抽屉时执行
  63. */
  64. function close() {
  65. scanBool.value = false;
  66. emit("scanClose", false);
  67. }
  68. /**
  69. * @监听器
  70. */
  71. watchEffect((fn, options) => {
  72. scanBool.value = props.scanBool;
  73. });
  74. onLoad((options) => {});
  75. onMounted(() => {});
  76. </script>