index.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <script setup>
  2. import { userInfo } from '~/store/user'
  3. const { uo_type } = userInfo
  4. const isBureau = ref(false)// 当前用户是否局端
  5. isBureau.value = uo_type === '1'
  6. const list = ref([])
  7. const loading = ref(false)
  8. const finished = ref(false)
  9. let page = 1
  10. function onLoad() {
  11. loading.value = true
  12. request({
  13. url: '/jdbg/gwgl_gw/index',
  14. data: {
  15. page,
  16. limit: 20,
  17. gw_fb: 1,
  18. gw_fb_depart: isBureau ? '' : '1',
  19. },
  20. }).then((res) => {
  21. const data = res.data
  22. list.value = [...list.value, ...data.page_data]
  23. finished.value = data.total_page === page
  24. page++
  25. loading.value = false
  26. })
  27. }
  28. const router = useRouter()
  29. function cellClick(gw_id) {
  30. router.push({ path: '/officialDocumentManager/documentLibrary/detail', query: { gw_id } })
  31. }
  32. </script>
  33. <template>
  34. <div>
  35. <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
  36. <van-cell
  37. v-for="(item, index) in list" :key="item" :title="`${index + 1}. ${item.gw_title}`"
  38. @click="cellClick(item.gw_id)"
  39. />
  40. </van-list>
  41. </div>
  42. </template>