communicate.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <CommonListPage
  3. itemType="article-common"
  4. :dropDownNames="dropdownNames"
  5. :tabs="[
  6. { id: 0, text: '世界走透透' },
  7. { id: 1, text: '海洋文化' },
  8. ]"
  9. :startTabIndex="startTab"
  10. :load="loadData"
  11. />
  12. </template>
  13. <script setup lang="ts">
  14. import { ref } from 'vue';
  15. import { GetContentListParams } from '@/api/CommonContent';
  16. import SeaContent from '@/api/introduction/SeaContent';
  17. import NewsIndexContent from '@/api/news/NewsIndexContent';
  18. import CommonListPage, { type DropDownNames } from '@/pages/article/common/CommonListPage.vue';
  19. import ResultContent from '@/api/research/ResultContent';
  20. const dropdownNames = ref<DropDownNames[]>([]);
  21. const startTab = ref(0);
  22. async function loadData(
  23. page: number,
  24. pageSize: number,
  25. searchText: string,
  26. dropDownValues: number[],
  27. tabSelect: number,
  28. ) {
  29. let res;
  30. switch (tabSelect) {
  31. case 0:
  32. res = (await NewsIndexContent.getContentList(new GetContentListParams()
  33. .setKeywords(searchText)
  34. .setMainBodyColumnId([260, 261, 262])
  35. , page, pageSize))
  36. break;
  37. default:
  38. case 1:
  39. res = (await SeaContent.getContentList(new GetContentListParams()
  40. .setKeywords(searchText)
  41. , page, pageSize));
  42. break;
  43. }
  44. res.list.forEach((item) => {
  45. item.desc = item.from ? `来源:${item.from}` : '';
  46. item.bottomTags = [
  47. item.levelText,
  48. item.mainBodyColumnName,
  49. item.ichTypeText,
  50. item.batchText,
  51. ]
  52. })
  53. return res;
  54. }
  55. </script>