list.vue 1.5 KB

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