policy.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <!-- 文化常识 - 相关政策 -->
  3. <CommonListPage
  4. :title="'相关政策'"
  5. :prevPage="{ title: '文化常识' }"
  6. :dropDownNames="[]"
  7. :pageSize="8"
  8. :rowCount="1"
  9. :load="loadData"
  10. :loadDetail="loadDetail"
  11. :defaultImage="LawsImage"
  12. />
  13. </template>
  14. <script setup lang="ts">
  15. import { GetContentListParams } from '@/api/CommonContent';
  16. import PolicyContent from '@/api/introduction/PolicyContent';
  17. import LawsImage from '@/assets/images/inheritor/LawsTest.jpg'
  18. import DateUtils from '@/common/utils/DateUtils';
  19. async function loadDetail(id: number, item: any) {
  20. return await PolicyContent.getContentDetail(id);
  21. }
  22. async function loadData(
  23. page: number,
  24. pageSize: number,
  25. selectedTag: number,
  26. searchText: string,
  27. dropDownValues: number[]
  28. ) {
  29. const res = await PolicyContent.getContentList(new GetContentListParams()
  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: DateUtils.formatDate(item.publishAt, DateUtils.FormatStrings.YearCommonShort),
  40. image: item.image,
  41. };
  42. }),
  43. }
  44. }
  45. </script>
  46. <style>
  47. </style>