custom.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <!-- 文化概况 - 民间习俗 -->
  3. <CommonListPage
  4. :title="'民间习俗'"
  5. :prevPage="{ title: '文化概况' }"
  6. :dropDownNames="[]"
  7. :showSearch="true"
  8. :tagsData="tagsData"
  9. :pageSize="8"
  10. :defaultSelectTag="245"
  11. :load="loadData"
  12. :loadDetail="loadDetail"
  13. />
  14. </template>
  15. <script setup lang="ts">
  16. import { ref } from 'vue';
  17. import { GetContentListParams } from '@/api/CommonContent';
  18. import CustomContent from '@/api/introduction/CustomContent';
  19. async function loadDetail(id: number, item: any) {
  20. return await CustomContent.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 CustomContent.getContentList(new GetContentListParams().setSelfValues({
  30. mainBodyColumnId: 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.image,
  42. };
  43. }),
  44. }
  45. }
  46. //子分类
  47. const tagsData = ref([
  48. { id: 245, name: '全部' },
  49. { id: 246, name: '婚丧嫁娶' },
  50. { id: 111, name: '民俗节庆' },
  51. { id: 248, name: '信仰' },
  52. ]);
  53. </script>
  54. <style>
  55. </style>