character.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <!-- 文化概况 - 历史人物 -->
  3. <CommonListPage
  4. :title="'历史人物'"
  5. :prevPage="{ title: '文化概况' }"
  6. :dropDownNames="[]"
  7. :pageSize="8"
  8. :rowCount="2"
  9. :load="loadData"
  10. :loadDetail="loadDetail"
  11. />
  12. </template>
  13. <script setup lang="ts">
  14. import { GetContentListParams } from '@/api/CommonContent';
  15. import CharacterContentApi from '@/api/introduction/CharacterContent';
  16. async function loadDetail(id: number, item: any) {
  17. return await CharacterContentApi.getContentDetail(id);
  18. }
  19. async function loadData(
  20. page: number,
  21. pageSize: number,
  22. selectedTag: number,
  23. searchText: string,
  24. dropDownValues: number[]
  25. ) {
  26. const res = await CharacterContentApi.getContentList(new GetContentListParams(), page, pageSize);
  27. return {
  28. page: page,
  29. total: res.total,
  30. data: res.list.map((item, index) => {
  31. console.log(item);
  32. return {
  33. id: item.id,
  34. title: item.title,
  35. desc: item.desc,
  36. image: item.image,
  37. keywords: item.keywords,
  38. };
  39. }),
  40. }
  41. }
  42. </script>
  43. <style>
  44. </style>