history.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <CommonListPage
  3. :title="'闽南文化历史地理背景'"
  4. :prevPage="{ title: '文化常识' }"
  5. :dropDownNames="[]"
  6. :showSearch="true"
  7. :tagsData="tagsData"
  8. :pageSize="8"
  9. :defaultSelectTag="233"
  10. :loadDetail="loadDetail"
  11. :load="loadData"
  12. />
  13. </template>
  14. <script setup lang="ts">
  15. import { ref } from 'vue';
  16. import { GetContentListParams } from '@/api/CommonContent';
  17. import HistoryContent from '@/api/introduction/HistoryContent';
  18. async function loadDetail(id: number, item: any) {
  19. return await HistoryContent.getContentDetail(id);
  20. }
  21. async function loadData(
  22. page: number,
  23. pageSize: number,
  24. selectedTag: number,
  25. searchText: string,
  26. dropDownValues: number[]
  27. ) {
  28. const res = await HistoryContent.getContentList(new GetContentListParams()
  29. .setMainBodyColumnId([ 233, 250, 251 ])
  30. .setKeywords(searchText)
  31. , page, pageSize);
  32. return {
  33. page: page,
  34. total: res.total,
  35. data: res.list.map((item, index) => {
  36. return {
  37. id: item.id,
  38. title: item.title,
  39. desc: item.desc,
  40. image: item.thumbnail || item.image,
  41. };
  42. }),
  43. }
  44. }
  45. //子分类
  46. const tagsData = ref([
  47. ]);
  48. </script>
  49. <style>
  50. </style>