policy.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <CommonListPage
  3. :title="'相关政策'"
  4. :prevPage="{ title: '文化常识' }"
  5. :dropDownNames="[]"
  6. :pageSize="8"
  7. :rowCount="1"
  8. :load="loadData"
  9. :loadDetail="loadDetail"
  10. :defaultImage="LawsImage"
  11. />
  12. </template>
  13. <script setup lang="ts">
  14. import { GetContentListParams } from '@/api/CommonContent';
  15. import PolicyContent from '@/api/introduction/PolicyContent';
  16. import LawsImage from '@/assets/images/inheritor/LawsTest.jpg'
  17. import { DateUtils } from '@imengyu/imengyu-utils';
  18. async function loadDetail(id: number, item: any) {
  19. return await PolicyContent.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 PolicyContent.getContentList(new GetContentListParams()
  29. .setKeywords(searchText)
  30. , page, pageSize);
  31. return {
  32. page: page,
  33. total: res.total,
  34. data: res.list.map((item, index) => {
  35. return {
  36. id: item.id,
  37. title: item.title,
  38. desc: DateUtils.formatDate(item.publishAt, DateUtils.FormatStrings.ShortDate),
  39. image: item.thumbnail || item.image,
  40. };
  41. }),
  42. }
  43. }
  44. </script>
  45. <style>
  46. </style>