DetailsCommon.vue 8.8 KB

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