character.vue 1.1 KB

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