intangible.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <!-- 非遗详情页 -->
  3. <TabDetailView
  4. :load="loadData"
  5. >
  6. <template #extraInfo="{ content }">
  7. <IntroBlock
  8. :descItems="[
  9. {
  10. label: '地址',
  11. value: content.address,
  12. },
  13. {
  14. label: '项目级别',
  15. value: content.levelText ,
  16. },
  17. {
  18. label: '项目类别',
  19. value: content.ichTypeText,
  20. },
  21. {
  22. label: '批次时间',
  23. value: content.batchText,
  24. },
  25. {
  26. label: '所属区域',
  27. value: content.regionText ,
  28. },
  29. {
  30. label: '保护单位',
  31. value: content.unit
  32. },
  33. {
  34. label: '其他级别项目',
  35. value: content.otherLevel && content.otherLevel.length > 0 ? `${content.otherLevel.length}个` : ''
  36. },
  37. ]"
  38. />
  39. <!-- 同级别非遗项目显示 -->
  40. <div v-if=" content.otherLevel && content.otherLevel.length > 0" class="mt-2 mb-3 d-flex flex-column">
  41. <span class="mb-2">其他级别项目</span>
  42. <NuxtLink
  43. v-for="(item, k) in content.otherLevel"
  44. :key="k"
  45. class="simple-link-item"
  46. :to="{ path: '/details/intangible', query: { id: item.id } }"
  47. >
  48. <div class="text">
  49. <div class="tag-button active">
  50. {{ item.levelText }}
  51. </div>
  52. <span class="ms-2">{{ item.title }}</span>
  53. <span v-if="item.regionText" class="ms-2">({{ item.regionText }})</span>
  54. </div>
  55. >
  56. </NuxtLink>
  57. </div>
  58. </template>
  59. <template #extraTab="{ currentTabId, content }">
  60. <!-- 非遗产品(作品) -->
  61. <CommonListBlock
  62. subName="worksMeList"
  63. :show="currentTabId==4"
  64. :showTotal="true"
  65. :showSearch="false"
  66. :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'worksMeList')"
  67. detailsPage="/details/intangible"
  68. :detailsParams="{
  69. mainBodyColumnId: ProjectsContent.mainBodyColumnId,
  70. modelId: ProjectsContent.modelId,
  71. }"
  72. />
  73. <!-- 非遗传习中心 -->
  74. <CommonListBlock
  75. subName="ichSitesList"
  76. :show="currentTabId==5"
  77. :showTotal="true"
  78. :showSearch="false"
  79. :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'ichSitesList')"
  80. detailsPage="/details/intangible"
  81. :detailsParams="{
  82. mainBodyColumnId: ProjectsContent.mainBodyColumnId,
  83. modelId: ProjectsContent.modelId,
  84. }"
  85. />
  86. <!-- 非遗传承人 -->
  87. <CommonListBlock
  88. subName="inheritorsList"
  89. :show="currentTabId==6"
  90. :showTotal="true"
  91. :showSearch="false"
  92. :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'inheritorsList')"
  93. detailsPage="/details/intangible"
  94. :detailsParams="{
  95. mainBodyColumnId: ProjectsContent.mainBodyColumnId,
  96. modelId: ProjectsContent.modelId,
  97. }"
  98. />
  99. <!-- 相关资讯 -->
  100. <CommonListBlock
  101. subName="associationMeList"
  102. :show="currentTabId==7"
  103. :showTotal="true"
  104. :showSearch="false"
  105. :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'associationMeList')"
  106. detailsPage="/details/intangible"
  107. :detailsParams="{
  108. mainBodyColumnId: ProjectsContent.mainBodyColumnId,
  109. modelId: ProjectsContent.modelId,
  110. }"
  111. />
  112. <!-- 传承谱系 -->
  113. <div v-show="currentTabId==10">
  114. <SimpleRichHtml
  115. class="news-content"
  116. :contents="[
  117. content.pedigree
  118. ]"
  119. />
  120. </div>
  121. <!-- 传承谱系 -->
  122. <div v-show="currentTabId==11">
  123. <SimpleRichHtml
  124. class="news-content"
  125. :contents="[
  126. content.prize
  127. ]"
  128. />
  129. </div>
  130. </template>
  131. </TabDetailView>
  132. </template>
  133. <script setup lang="ts">
  134. import TabDetailView from './TabDetailView.vue';
  135. import ProjectsContent from '@/api/inheritor/ProjectsContent';
  136. import CommonListBlock from '@/components/content/CommonListBlock.vue';
  137. import IntroBlock from '@/components/parts/IntroBlock.vue';
  138. import { useRoute } from 'vue-router';
  139. import InheritorContent from '~/api/inheritor/InheritorContent';
  140. const route = useRoute();
  141. async function loadSubList(page: number, pageSize: number, content: any, subList: string) {
  142. const list = content[subList] as any[] || [];
  143. if (subList == 'associationMeList') {
  144. list.forEach((p) => {
  145. p.bottomTags = [
  146. p.levelText,
  147. p.ichTypeText,
  148. p.batchText,
  149. ];
  150. })
  151. } else if (subList == 'ichSitesList') {
  152. list.forEach((p) => {
  153. p.bottomTags = [
  154. content.ichTypeText,
  155. ];
  156. })
  157. } else if (subList == 'inheritorsList') {
  158. list.forEach((p) => {
  159. p.bottomTags = [
  160. p.levelText,
  161. p.nation,
  162. content.ichTypeText,
  163. ];
  164. })
  165. }
  166. return {
  167. page: page,
  168. total: list.length,
  169. data: list.slice((page - 1) * pageSize, page * pageSize)
  170. };
  171. }
  172. async function loadData(id: number) {
  173. const d = await ProjectsContent.getContentDetail(id,
  174. route.query.modelId ? Number(route.query.modelId) : undefined
  175. );
  176. d.contentProps = {
  177. tabs: [
  178. { id: 0, text: '简介', visible: true },
  179. { id: 1, text: '相册', visible: d.images.length > 0 },
  180. { id: 2, text: '音频', visible: Boolean(d.audio) },
  181. { id: 3, text: '视频', visible: Boolean(d.video) },
  182. { id: 4, text: '非遗作品', visible: Boolean(d.worksList && (d.worksList as any[]).length > 0) },
  183. { id: 5, text: '非遗传习中心', visible: Boolean(d.ichSitesList && (d.ichSitesList as any[]).length > 0) },
  184. { id: 6, text: '非遗传承人', visible: Boolean(d.inheritorsList && (d.inheritorsList as any[]).length > 0) },
  185. { id: 10, text: '传承谱系', visible: Boolean(d.pedigree) },
  186. { id: 11, text: '荣誉奖项', visible: Boolean(d.prize) },
  187. { id: 7, text: '相关资讯', visible: Boolean(d.associationMeList && (d.associationMeList as any[]).length > 0) },
  188. ]
  189. };
  190. if (d.modelId === InheritorContent.modelId) {
  191. d.titleBox = Boolean(d.deathBirth);
  192. }
  193. return d;
  194. }
  195. </script>
  196. <style lang="scss">
  197. .simple-link-item {
  198. background-color: #fff;
  199. border-radius: 10px;
  200. display: flex;
  201. flex-direction: row;
  202. align-items: center;
  203. justify-content: space-between;
  204. text-decoration: none;
  205. color: #000;
  206. padding: 10px 20px;
  207. cursor: pointer;
  208. .text {
  209. display: flex;
  210. flex-direction: row;
  211. align-items: center;
  212. }
  213. .tag-button {
  214. border-radius: 15px;
  215. padding: 6px 10px;
  216. }
  217. }
  218. </style>