list.vue 1.5 KB

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