intangible.vue 6.7 KB

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