details.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <DetailTabPage
  3. :load="load"
  4. :extraTabs="[
  5. {
  6. id: 5,
  7. name: '传习所',
  8. visible: true,
  9. },
  10. {
  11. id: 6,
  12. name: '传承人',
  13. visible: true,
  14. },
  15. {
  16. id: 7,
  17. name: '非遗作品',
  18. visible: true,
  19. }
  20. ]"
  21. >
  22. <template #extraTabs="{ content, tabCurrentId }">
  23. <template v-if="tabCurrentId==5">
  24. <!-- 非遗传习中心 -->
  25. <CommonListPage
  26. :showSearch="false"
  27. :hasBg="false"
  28. :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'ichSitesList')"
  29. :detailsParams="{
  30. mainBodyColumnId: SeminarContent.mainBodyColumnId,
  31. modelId: SeminarContent.modelId,
  32. }"
  33. />
  34. </template>
  35. <template v-else-if="tabCurrentId==6">
  36. <!-- 非遗传承人 -->
  37. <CommonListPage
  38. :showSearch="false"
  39. :hasBg="false"
  40. :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'inheritorsList')"
  41. detailsPage="/pages/inhert/inheritor/details"
  42. :detailsParams="{
  43. mainBodyColumnId: InheritorContent.mainBodyColumnId,
  44. modelId: InheritorContent.modelId,
  45. }"
  46. />
  47. </template>
  48. <template v-else-if="tabCurrentId==7">
  49. <!-- 非遗产品(作品) -->
  50. <CommonListPage
  51. :showSearch="false"
  52. :hasBg="false"
  53. :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'associationMeList')"
  54. detailsPage="/pages/inhert/intangible/details"
  55. :detailsParams="{
  56. mainBodyColumnId: ProductsContent.mainBodyColumnId,
  57. modelId: ProductsContent.modelId,
  58. }"
  59. />
  60. </template>
  61. </template>
  62. <template #titleEnd="{ content }">
  63. <u-tag
  64. v-if="content.levelText"
  65. :text="content.levelText"
  66. size="mini" plain color="#d9492e"
  67. class="flex-shrink-0"
  68. />
  69. </template>
  70. <template #titleExtra="{ content }">
  71. <view class="d-flex flex-col">
  72. <IntroBlock
  73. small
  74. :descItems="[
  75. {
  76. label: '项目级别',
  77. value: content.levelText ,
  78. },
  79. {
  80. label: '项目类别',
  81. value: content.ichTypeText,
  82. },
  83. {
  84. label: '批次时间',
  85. value: content.batchText,
  86. },
  87. {
  88. label: '所属区域',
  89. value: content.regionText ,
  90. },
  91. {
  92. label: '保护单位',
  93. value: content.unit
  94. },
  95. ]"
  96. />
  97. </view>
  98. </template>
  99. </DetailTabPage>
  100. </template>
  101. <script setup lang="ts">
  102. import DetailTabPage from "@/pages/article/common/DetailTabPage.vue";
  103. import ProjectsContent from "@/api/inheritor/ProjectsContent";
  104. import CommonListPage from "@/pages/article/common/CommonListPage.vue";
  105. import type { TabControlItem } from "@/common/composeabe/TabControl";
  106. import type { Ref } from "vue";
  107. import InheritorContent from "@/api/inheritor/InheritorContent";
  108. import ProductsContent from "@/api/inheritor/ProductsContent";
  109. import SeminarContent from "@/api/inheritor/SeminarContent";
  110. import IntroBlock from "@/pages/article/common/IntroBlock.vue";
  111. import { useLoadQuerys } from "@/common/composeabe/LoadQuerys";
  112. async function load(id: number, tabsArray: Ref<TabControlItem[]>) {
  113. const d = await ProjectsContent.getContentDetail(
  114. id,
  115. undefined,
  116. querys.value.modelId > 0 ? querys.value.modelId : undefined
  117. );
  118. tabsArray.value[4].visible = Boolean(d.ichSitesList && (d.ichSitesList as any[]).length > 0);
  119. tabsArray.value[5].visible = Boolean(d.inheritorsList && (d.inheritorsList as any[]).length > 0);
  120. tabsArray.value[6].visible = Boolean(d.associationMeList && (d.associationMeList as any[]).length > 0);
  121. return d;
  122. }
  123. async function loadSubList(page: number, pageSize: number, content: any, subList: string) {
  124. const list = (content[subList] as any[] || [])
  125. .slice((page - 1) * pageSize, page * pageSize);
  126. if (subList == 'associationMeList') {
  127. list.forEach((p) => {
  128. p.bottomTags = [
  129. p.levelText,
  130. p.ichTypeText,
  131. p.batchText,
  132. ];
  133. })
  134. } else if (subList == 'ichSitesList') {
  135. list.forEach((p) => {
  136. p.bottomTags = [
  137. content.levelText,
  138. content.ichTypeText,
  139. ];
  140. })
  141. } else if (subList == 'inheritorsList') {
  142. list.forEach((p) => {
  143. p.bottomTags = [
  144. p.levelText,
  145. p.nation,
  146. content.ichTypeText,
  147. ];
  148. })
  149. }
  150. return {
  151. list,
  152. total: list.length,
  153. }
  154. }
  155. const { querys } = useLoadQuerys({ modelId: 0 })
  156. </script>
  157. <style lang="scss">
  158. </style>