route.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <CommonListPage
  3. :title="'文化旅游路线'"
  4. :prevPage="{ title: '文旅融合' }"
  5. :dropDownNames="[]"
  6. :showSearch="true"
  7. :tagsData="tagsData"
  8. :pageSize="8"
  9. :defaultSelectTag="274"
  10. :load="loadData"
  11. :loadDetail="loadDetail"
  12. />
  13. </template>
  14. <script setup lang="ts">
  15. import { ref } from 'vue';
  16. import { GetContentListParams } from '@/api/CommonContent';
  17. import ResultContent from '@/api/research/ResultContent';
  18. import RouteContent from '@/api/fusion/RouteContent';
  19. async function loadDetail(id: number, item: any) {
  20. return await ResultContent.getContentDetail(id);
  21. }
  22. async function loadData(
  23. page: number,
  24. pageSize: number,
  25. selectedTag: number,
  26. searchText: string,
  27. dropDownValues: number[]
  28. ) {
  29. const res = await RouteContent.getContentList(new GetContentListParams().setSelfValues({
  30. mainBodyColumnId: selectedTag == tagsData.value[0].id ? tagsData.value.map(p => p.id).join(',') : selectedTag,
  31. keywords: searchText,
  32. }), page, pageSize);
  33. return {
  34. page: page,
  35. total: res.total,
  36. data: res.list.map((item, index) => {
  37. return {
  38. id: item.id,
  39. title: item.title,
  40. desc: item.desc,
  41. image: item.thumbnail || item.image,
  42. };
  43. }),
  44. }
  45. }
  46. //子分类
  47. const tagsData = ref([
  48. { id: 274, name: '全部' },
  49. { id: 275, name: '非遗旅游路线' },
  50. { id: 276, name: '闽南红色文化旅游路线' },
  51. { id: 277, name: '闽南美食旅游路线' },
  52. ]);
  53. </script>
  54. <style>
  55. </style>