list.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <CommonListPage
  3. title="闽南民俗"
  4. itemType="image-large-2"
  5. :detailsPage="[
  6. '/pages/inhert/intangible/details',
  7. '/pages/article/details',
  8. ]"
  9. showTotal
  10. :dropDownNames="dropdownNames"
  11. :load="loadData"
  12. :detailsParams="{
  13. modelId: 4,
  14. }"
  15. />
  16. <!-- :tabs="[
  17. { id: 0, name: '非遗民俗' },
  18. { id: 1, name: '民俗资讯' },
  19. ]" -->
  20. </template>
  21. <script setup lang="ts">
  22. import { ref } from 'vue';
  23. import CommonListPage, { type DropDownNames } from '@/pages/article/common/CommonListPage.vue';
  24. import CommonContent, { GetContentListParams } from '@/api/CommonContent';
  25. import ProjectsContent from '@/api/inheritor/ProjectsContent';
  26. const dropdownNames = ref<DropDownNames[]>([]);
  27. async function loadData(
  28. page: number,
  29. pageSize: number,
  30. searchText: string,
  31. dropDownValues: number[],
  32. tabSelect: number,
  33. ) {
  34. let res;
  35. switch (tabSelect) {
  36. /* case 0:
  37. res = await ProjectsContent.getContentList(new GetContentListParams()
  38. .setKeywords('民俗 ' + searchText)
  39. , page, pageSize);
  40. res.list.forEach((item) => {
  41. item.bottomTags = [
  42. item.levelText,
  43. item.ichTypeText,
  44. item.batchText,
  45. item.regionText,
  46. ]
  47. })
  48. break;
  49. case 1: */
  50. default:
  51. res = await CommonContent.getContentList(new GetContentListParams()
  52. .setKeywords(searchText)
  53. .setModelId(4)
  54. .setMainBodyColumnId([ 245,248 ])
  55. , page, pageSize);
  56. break;
  57. }
  58. return { list: res.list, total: res.total }
  59. }
  60. </script>