DetailsCommon.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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: `非遗${commonRefName}`,
  18. visible: true,
  19. },
  20. {
  21. id: 8,
  22. name: '地理位置',
  23. visible: true,
  24. }
  25. ]"
  26. >
  27. <template #extraTabs="{ content, tabCurrentId }">
  28. <template v-if="tabCurrentId==5">
  29. <!-- 非遗传习中心 -->
  30. <CommonListPage
  31. :showSearch="false"
  32. :hasBg="false"
  33. :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'ichSitesList')"
  34. detailsPage="/pages/inhert/intangible/details"
  35. :detailsParams="{
  36. mainBodyColumnId: SeminarContent.mainBodyColumnId,
  37. modelId: SeminarContent.modelId,
  38. }"
  39. />
  40. </template>
  41. <template v-else-if="tabCurrentId==6">
  42. <!-- 非遗传承人 -->
  43. <CommonListPage
  44. :showSearch="false"
  45. :hasBg="false"
  46. :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'inheritorsList')"
  47. detailsPage="/pages/inhert/inheritor/details"
  48. :detailsParams="{
  49. mainBodyColumnId: InheritorContent.mainBodyColumnId,
  50. modelId: InheritorContent.modelId,
  51. }"
  52. />
  53. </template>
  54. <template v-else-if="tabCurrentId==7">
  55. <!-- 非遗产品(作品) -->
  56. <CommonListPage
  57. :showSearch="false"
  58. :hasBg="false"
  59. :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'associationMeList')"
  60. :detailsPage="`/pages/inhert/${commonRefTarget}/details`"
  61. :detailsParams="{
  62. mainBodyColumnId: ProductsContent.mainBodyColumnId,
  63. modelId: ProductsContent.modelId,
  64. }"
  65. />
  66. </template>
  67. <template v-else-if="tabCurrentId==8">
  68. <!-- 地理位置 -->
  69. <view class="d-flex flex-col mt-3 mb-2">
  70. <HomeTitle title="地理位置" />
  71. <map id="map"
  72. class="w-100 height-350 mt-3"
  73. :latitude="content.latitude"
  74. :longitude="content.longitude"
  75. :markers="[
  76. {
  77. id: 1,
  78. latitude: content.latitude,
  79. longitude: content.longitude,
  80. iconPath: ImagesUrls.IconMarker,
  81. width: 40,
  82. height: 40,
  83. }
  84. ]"
  85. :scale="15"
  86. />
  87. <view class="d-flex flex-row justify-between bg-light radius-base p-2 mt-2">
  88. <view>
  89. <text class="iconfont icon-navigation"></text>
  90. <text class="address">{{ content.address }}</text>
  91. </view>
  92. <view class="d-flex flex-row align-center" @click="navTo('/pages/travel/nav/navto', {
  93. latitude: content.latitude,
  94. longitude: content.longitude,
  95. })">
  96. <text class="color-orange">去这里</text>
  97. <text class="iconfont icon-arrow-right"></text>
  98. </view>
  99. </view>
  100. </view>
  101. </template>
  102. </template>
  103. <template #titleEnd="{ content }">
  104. <u-tag
  105. v-if="content.levelText"
  106. :text="content.levelText"
  107. size="mini" plain color="#d9492e"
  108. class="flex-shrink-0"
  109. />
  110. </template>
  111. <template #titleExtra="{ content }">
  112. <view class="d-flex flex-col">
  113. <IntroBlock
  114. small
  115. :descItems="[
  116. {
  117. label: '地址',
  118. value: content.address,
  119. },
  120. {
  121. label: '项目级别',
  122. value: content.levelText ,
  123. },
  124. {
  125. label: '项目类别',
  126. value: content.ichTypeText,
  127. },
  128. {
  129. label: '批次时间',
  130. value: content.batchText,
  131. },
  132. {
  133. label: '所属区域',
  134. value: content.regionText ,
  135. },
  136. {
  137. label: '保护单位',
  138. value: content.unit
  139. },
  140. ]"
  141. />
  142. </view>
  143. </template>
  144. </DetailTabPage>
  145. </template>
  146. <script setup lang="ts">
  147. import DetailTabPage from "@/pages/article/common/DetailTabPage.vue";
  148. import ProjectsContent from "@/api/inheritor/ProjectsContent";
  149. import CommonListPage from "@/pages/article/common/CommonListPage.vue";
  150. import IntroBlock from "@/pages/article/common/IntroBlock.vue";
  151. import { useLoadQuerys } from "@/common/composeabe/LoadQuerys";
  152. import type { TabControlItem } from "@/common/composeabe/TabControl";
  153. import type { Ref } from "vue";
  154. import { navTo } from "@/common/utils/PageAction";
  155. import InheritorContent from "@/api/inheritor/InheritorContent";
  156. import ProductsContent from "@/api/inheritor/ProductsContent";
  157. import SeminarContent from "@/api/inheritor/SeminarContent";
  158. import ImagesUrls from "@/common/config/ImagesUrls";
  159. defineProps({
  160. commonRefName : {
  161. type: String,
  162. default: '',
  163. },
  164. commonRefTarget : {
  165. type: String,
  166. default: '',
  167. },
  168. })
  169. async function load(id: number, tabsArray: Ref<TabControlItem[]>) {
  170. const d = await ProjectsContent.getContentDetail(
  171. id,
  172. undefined,
  173. querys.value.modelId > 0 ? querys.value.modelId : undefined
  174. );
  175. tabsArray.value[4].visible = Boolean(d.ichSitesList && (d.ichSitesList as any[]).length > 0);
  176. tabsArray.value[5].visible = Boolean(d.inheritorsList && (d.inheritorsList as any[]).length > 0);
  177. tabsArray.value[6].visible = Boolean(d.associationMeList && (d.associationMeList as any[]).length > 0);
  178. tabsArray.value[7].visible = Boolean(d.longitude && d.latitude);
  179. return d;
  180. }
  181. async function loadSubList(page: number, pageSize: number, content: any, subList: string) {
  182. let list = (content[subList] as any[] || [])
  183. .slice((page - 1) * pageSize, page * pageSize);
  184. if (subList == 'associationMeList') {
  185. list.filter((p) => p.modelId == ProjectsContent.modelId).forEach((p) => {
  186. p.bottomTags = [
  187. p.levelText,
  188. p.ichTypeText,
  189. p.batchText,
  190. ];
  191. })
  192. } else if (subList == 'ichSitesList') {
  193. list.forEach((p) => {
  194. p.bottomTags = [
  195. content.ichTypeText,
  196. ];
  197. })
  198. } else if (subList == 'inheritorsList') {
  199. list.forEach((p) => {
  200. p.bottomTags = [
  201. p.levelText,
  202. p.nation,
  203. content.ichTypeText,
  204. ];
  205. })
  206. }
  207. return {
  208. list,
  209. total: list.length,
  210. }
  211. }
  212. const { querys } = useLoadQuerys({ modelId: 0 })
  213. </script>
  214. <style lang="scss">
  215. </style>