<template>
  <BillListView ref="viewRef" :module-key="moduleKey" />
</template>

<script setup lang="ts">
/**
 * 报表列表页壳（只读）：module 参数驱动
 */
import { ref } from 'vue'
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import BillListView from '@/modules/bill/BillListView.vue'

const moduleKey = ref('')
const viewRef = ref<InstanceType<typeof BillListView> | null>(null)

onLoad((options) => {
  moduleKey.value = options?.module || ''
})

onReachBottom(() => {
  viewRef.value?.loadMore()
})

onPullDownRefresh(async () => {
  await viewRef.value?.refresh()
  uni.stopPullDownRefresh()
})
</script>
