feature.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <!-- 文化常识 - 艺术特色 -->
  3. <CommonListPage
  4. :title="'艺术特色'"
  5. :prevPage="{ title: '文化常识' }"
  6. :dropDownNames="[]"
  7. :showSearch="true"
  8. :tagsData="tagsData"
  9. :pageSize="8"
  10. :defaultSelectTag="243"
  11. :loadDetail="loadDetail"
  12. :load="loadData"
  13. />
  14. </template>
  15. <script setup lang="ts">
  16. import { ref } from 'vue';
  17. import { GetContentListParams } from '@/api/CommonContent';
  18. import FeatureContentApi from '@/api/introduction/FeatureContent';
  19. async function loadDetail(id: number, item: any) {
  20. return await FeatureContentApi.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 FeatureContentApi.getContentList(new GetContentListParams().setSelfValues({
  30. mainBodyColumnId: selectedTag == tagsData.value[0].id ? tagsData.value.map(p => p.id) : 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: 243, name: '全部' },
  49. { id: 238, name: '音乐' },
  50. { id: 239, name: '舞蹈' },
  51. { id: 240, name: '戏曲' },
  52. { id: 241, name: '曲艺' },
  53. { id: 242, name: '民间工艺' },
  54. ]);
  55. </script>
  56. <style>
  57. </style>