activity.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <!-- 文化传承 - 非遗活动 -->
  3. <CommonListPage
  4. :title="'非遗活动'"
  5. :prevPage="{ title: '保护传承' }"
  6. :dropDownNames="[]"
  7. :showSearch="true"
  8. :pageSize="8"
  9. :load="loadData"
  10. :loadDetail="loadDetail"
  11. :tagsData="tagsData"
  12. :defaultSelectTag="tagsData[0].id"
  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: 290, name: '全部' },
  49. { id: 291, name: '闽南音乐' },
  50. { id: 187, name: '讲古' },
  51. { id: 292, name: '方言' },
  52. { id: 293, name: '民俗习俗' },
  53. ]);
  54. </script>
  55. <style>
  56. </style>