list.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <CommonListPage
  3. title="闽南歌曲"
  4. itemType="article-common"
  5. showTotal
  6. detailsPage="/pages/video/details"
  7. :dropDownNames="dropdownNames"
  8. :detailsParams="detailsParams"
  9. :tabsScrollable="true"
  10. :tabs="[
  11. /*{
  12. id: 191,
  13. text: '闽南语经典歌曲',
  14. width: 200,
  15. },
  16. {
  17. id: 190,
  18. text: '南音',
  19. width: 100,
  20. },
  21. {
  22. id: 189,
  23. text: '闽南童谣',
  24. },*/
  25. {
  26. id: 315,
  27. text: '闽南语原创歌曲',
  28. width: 200,
  29. },
  30. /*{
  31. id: -100,
  32. text: '常用闽南语',
  33. },*/
  34. {
  35. id: -101,
  36. text: '闽南语原声',
  37. jump: () => {
  38. navTo('/pages/inhert/language/list')
  39. },
  40. },
  41. ]"
  42. :load="loadData"
  43. />
  44. </template>
  45. <script setup lang="ts">
  46. import CommonContent, { GetContentListParams } from '@/api/CommonContent';
  47. import { navTo } from '@/components/utils/PageAction';
  48. import CommonListPage, { type DropDownNames } from '@/pages/article/common/CommonListPage.vue';
  49. import { onMounted, ref } from 'vue';
  50. const dropdownNames = ref<DropDownNames[]>([]);
  51. const modelDefine = [
  52. { modelId: 16, mainBodyColumnId: 191, id: 191, name: '闽南语经典歌曲' },
  53. { modelId: 16, mainBodyColumnId: 190, id: 190, name: '南音' },
  54. { modelId: 16, mainBodyColumnId: 189, id: 189, name: '闽南童谣' },
  55. { modelId: 16, mainBodyColumnId: 315, id: 315, name: '闽南语原创歌曲' },
  56. { modelId: 5, mainBodyColumnId: [ 257,235,237,210 ], id: -100, name: '常用闽南语' },
  57. { modelId: 5, mainBodyColumnId: 313, id: -101, name: '闽南语原声' },
  58. ]
  59. async function loadData(
  60. page: number,
  61. pageSize: number,
  62. searchText: string,
  63. dropDownValues: number[],
  64. tabId: number,
  65. ) {
  66. const model = modelDefine.find((p) => p.id === tabId);
  67. if (!model)
  68. throw new Error('tabId not found');
  69. detailsParams.value.mainBodyColumnId = model.mainBodyColumnId;
  70. const res = (await CommonContent.getContentList(new GetContentListParams()
  71. .setModelId(model.modelId)
  72. .setMainBodyColumnId(model.mainBodyColumnId!)
  73. .setKeywords(searchText)
  74. .setSelfValues({
  75. })
  76. , page, pageSize));
  77. res.list.forEach((p) => {
  78. p.desc = p.ichName as string;
  79. p.bottomTags = [
  80. p.levelText,
  81. p.batchText,
  82. p.ichTypeText,
  83. ];
  84. })
  85. return res;
  86. }
  87. const detailsParams = ref({
  88. mainBodyColumnId: 0 as any,
  89. modelId: 16,
  90. });
  91. onMounted(async () => {
  92. })
  93. </script>