list.vue 960 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <CommonListPage
  3. title="闽南文化资讯"
  4. :load="loadData"
  5. itemType="article-common"
  6. :detailsParams="{
  7. modelId: CommonContent.modelId,
  8. }"
  9. />
  10. </template>
  11. <script setup lang="ts">
  12. import CommonContent, { GetContentListParams } from '@/api/CommonContent';
  13. import CommonListPage from './common/CommonListPage.vue';
  14. import { DataDateUtils } from '@imengyu/js-request-transform';
  15. async function loadData(
  16. page: number,
  17. pageSize: number,
  18. searchText: string,
  19. dropDownValues: number[]
  20. ) {
  21. const res = await CommonContent.getContentList(new GetContentListParams()
  22. .setMainBodyColumnId([228/* , 298, 299 */])
  23. .setKeywords(searchText)
  24. , page, pageSize);
  25. return { list: res.list.map((item) => {
  26. return {
  27. id: item.id,
  28. image: item.thumbnail || item.image,
  29. title: item.title,
  30. date: DataDateUtils.formatDate(item.publishAt, 'YYYY-MM-dd'),
  31. }
  32. }), total: res.total }
  33. }
  34. </script>