inheritor.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <!-- 保护传承页 -->
  3. <div class="main-background main-background-type0">
  4. <!-- 轮播 -->
  5. <Carousel v-bind="carouselConfig" class="main-header-box small carousel-light">
  6. <Slide class="main-header-box small">
  7. <img src="@/assets/images/inheritor/Banner.jpg" />
  8. </Slide>
  9. <template #addons>
  10. <Navigation />
  11. <Pagination />
  12. </template>
  13. </Carousel>
  14. <!-- 数据统计 -->
  15. <section class="main-section main-background main-background-type2">
  16. <div class="content">
  17. <div class="title">
  18. <h2>数据统计</h2>
  19. </div>
  20. <SimplePageContentLoader :loader="statsData">
  21. <div class="d-flex row">
  22. <div
  23. class="col-12 col-md-6 col-lg-4 col-xl-4"
  24. v-for="(stat,key) in statsData.content.value"
  25. :key="key"
  26. >
  27. <div :class="`main-card-box type${stat.type}`">
  28. <div class="content">
  29. <h4>{{ stat.title || '\u200b' }}</h4>
  30. <div class="descs">
  31. <a
  32. v-for="(data, key2) in stat.datas"
  33. class="box"
  34. :key="key2"
  35. :href="data.link"
  36. >
  37. <h5>{{ data.title }}</h5>
  38. <p>{{ data.value }}</p>
  39. </a>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </SimplePageContentLoader>
  46. </div>
  47. </section>
  48. <!-- 非遗传承 -->
  49. <section class="main-section pb-0">
  50. <div class="content">
  51. <div class="title">
  52. <h2>非遗传承</h2>
  53. </div>
  54. <ThreeImageList :list="list1" />
  55. </div>
  56. </section>
  57. <!-- 世界文化遗产 -->
  58. <section class="main-section pb-0">
  59. <div class="content">
  60. <div class="title">
  61. <h2>世界文化遗产</h2>
  62. </div>
  63. <LeftRightBox
  64. title="世界文化遗产"
  65. :desc="overviewsLoader.content.value?.[0]"
  66. :image="Image9"
  67. :showExpand="false"
  68. :rightItems="(heritageData.content.value as any)"
  69. :moreLink="router.resolve('/inheritor/heritage').href"
  70. />
  71. </div>
  72. </section>
  73. <!-- 重要相关文物古迹 -->
  74. <section class="main-section pb-0">
  75. <div class="content">
  76. <div class="title">
  77. <h2>重要相关文物古迹</h2>
  78. </div>
  79. <ThreeImageList :list="list2" />
  80. </div>
  81. </section>
  82. <!-- 历史文化街区 -->
  83. <section class="main-section pb-0">
  84. <div class="content">
  85. <div class="title">
  86. <h2>历史文化街区</h2>
  87. </div>
  88. <LeftRightBox
  89. title="历史文化街区"
  90. :desc="overviewsLoader.content.value?.[1]"
  91. :image="Image11"
  92. :showExpand="false"
  93. left
  94. :rightItems="(areaData.content.value as any)"
  95. :moreLink="router.resolve('/inheritor/block').href"
  96. />
  97. </div>
  98. </section>
  99. <!-- 重要闽南记忆遗产 -->
  100. <section class="main-section">
  101. <div class="content">
  102. <div class="title">
  103. <h2>重要闽南记忆遗产</h2>
  104. </div>
  105. <LeftRightBox
  106. title="重要闽南记忆遗产"
  107. :desc="overviewsLoader.content.value?.[3]"
  108. :image="Image10"
  109. :showExpand="false"
  110. :rightItems="(minnanyuLoader.content.value as any)"
  111. :moreLink="router.resolve('/inheritor/language').href"
  112. />
  113. </div>
  114. </section>
  115. </div>
  116. </template>
  117. <script setup lang="ts">
  118. import { Carousel, Slide, Pagination, Navigation } from 'vue3-carousel'
  119. import { onMounted, ref } from 'vue';
  120. import Image1 from '@/assets/images/inheritor/Image1.jpg'
  121. import Image2 from '@/assets/images/inheritor/Image2.jpg'
  122. import Image3 from '@/assets/images/inheritor/Image3.jpg'
  123. import Image4 from '@/assets/images/inheritor/Image4.jpg'
  124. import Image5 from '@/assets/images/inheritor/Image5.jpg'
  125. import Image7 from '@/assets/images/inheritor/Image7.jpg'
  126. import Image8 from '@/assets/images/inheritor/Image8.jpg'
  127. import Image9 from '@/assets/images/inheritor/Image9.jpg'
  128. import Image10 from '@/assets/images/inheritor/Image10.jpg'
  129. import Image11 from '@/assets/images/inheritor/Image11.jpg'
  130. import LeftRightBox from '@/components/parts/LeftRightBox.vue';
  131. import ThreeImageList from '@/components/parts/ThreeImageList.vue';
  132. import { useSSrSimpleDataLoader } from '@/composeable/SimpleDataLoader';
  133. import CommonContent, { GetColumListParams, GetContentListParams } from '@/api/CommonContent';
  134. import SimplePageContentLoader from '@/components/content/SimplePageContentLoader.vue';
  135. import IndexContent from '@/api/introduction/IndexContent';
  136. import SeminarContent from '@/api/inheritor/SeminarContent';
  137. import UnmoveableContent from '@/api/inheritor/UnmoveableContent';
  138. const NO_CONTENT_STRING = '';
  139. const router = useRouter();
  140. const carouselConfig = {
  141. itemsToShow: 1,
  142. wrapAround: true,
  143. autoPlay: 5000,
  144. }
  145. const list1 = [
  146. {
  147. title: '非遗项目',
  148. desc: '让文化因传承而永存',
  149. image: Image1,
  150. link: router.resolve('/inheritor/projects').href,
  151. },
  152. {
  153. title: '非遗传承人',
  154. desc: '让文化因传承而永存',
  155. image: Image2,
  156. link: router.resolve('/inheritor/inheritor').href,
  157. },
  158. /* {
  159. title: '非遗作品',
  160. desc: '让文化因传承而永存',
  161. image: Image3,
  162. link: router.resolve('/inheritor/products').href,
  163. },
  164. {
  165. title: '非遗活动',
  166. desc: '让文化因传承而永存',
  167. image: Image4,
  168. link: router.resolve('/inheritor/activity').href,
  169. }, */
  170. {
  171. title: '非遗传习所',
  172. desc: '让文化因传承而永存',
  173. image: Image5,
  174. link: router.resolve('/inheritor/seminar').href,
  175. },
  176. ]
  177. const list2 = [
  178. {
  179. title: '不可移动文物',
  180. desc: '让文化因传承而永存',
  181. image: Image7,
  182. link: router.resolve('/inheritor/unmoveable').href,
  183. },
  184. {
  185. title: '可移动文物',
  186. desc: '让文化因传承而永存',
  187. image: Image8,
  188. link: router.resolve('/inheritor/moveable').href,
  189. },
  190. {
  191. title: '',
  192. desc: '',
  193. image: '',
  194. link: '',
  195. },
  196. ]
  197. const areaData = await useSSrSimpleDataLoader('area', async () =>
  198. (await CommonContent.getContentList(new GetContentListParams()
  199. .setModelId(17)
  200. .setMainBodyColumnId(286)
  201. , 1, 6)).list.map(p => p.toJSON())
  202. )
  203. const heritageData = await useSSrSimpleDataLoader('heritage', async () =>
  204. (await CommonContent.getContentList(new GetContentListParams()
  205. .setModelId(17)
  206. .setMainBodyColumnId(310)
  207. , 1, 6)).list.map(p => p.toJSON())
  208. )
  209. const blockData = await useSSrSimpleDataLoader('block', async () =>
  210. (await CommonContent.getContentList(new GetContentListParams()
  211. .setModelId(17)
  212. .setMainBodyColumnId(286)
  213. , 1, 6)).list.map(p => p.toJSON())
  214. )
  215. const minnanyuLoader = await useSSrSimpleDataLoader('minnanyu', async () =>
  216. (await CommonContent.getContentList(new GetContentListParams()
  217. .setModelId(18)
  218. .setMainBodyColumnId(318)
  219. , 1, 6)).list.map(p => p.toJSON())
  220. )
  221. const overviewsLoader = await useSSrSimpleDataLoader('overviews', async () => {
  222. return [
  223. (await IndexContent.getColumList(
  224. new GetColumListParams()
  225. .setModelId(17)
  226. .setMainBodyColumnId(310)
  227. )).list[0]?.overview || NO_CONTENT_STRING,
  228. (await IndexContent.getColumList(
  229. new GetColumListParams()
  230. .setModelId(17)
  231. .setMainBodyColumnId(286)
  232. )).list[0]?.overview || NO_CONTENT_STRING,
  233. (await IndexContent.getColumList(
  234. new GetColumListParams()
  235. .setModelId(17)
  236. .setMainBodyColumnId(235)
  237. )).list[0]?.overview || NO_CONTENT_STRING,
  238. (await IndexContent.getColumList(
  239. new GetColumListParams()
  240. .setModelId(18)
  241. .setMainBodyColumnId(318)
  242. )).list[0]?.overview || NO_CONTENT_STRING,
  243. ]
  244. });
  245. const statsData = await useSSrSimpleDataLoader('stats', async () => {
  246. const data = (await IndexContent.getStats());
  247. const semiCount = (await SeminarContent.getContentList(new GetContentListParams(), 1, 1)).total;
  248. const unmoveableCount = (await UnmoveableContent.getContentList(new GetContentListParams(), 1, 1)).total;
  249. return [
  250. {
  251. title: '非遗代表性项目',
  252. type: '1',
  253. datas: data.ichData.filter((p: any) => [ '人类非遗', '国家级', '省级', '市级' ].includes(p.level_text)).map((item: any) => {
  254. return {
  255. title: item.level_text,
  256. value: item.total,
  257. link: router.resolve({ path: '/inheritor/projects', query: { level: item.level } }).href,
  258. }
  259. })
  260. },
  261. {
  262. title: '非遗代表性传承人',
  263. type: '2',
  264. datas: data.inheritorData.filter((p: any) => [ '国家级', '省级', '市级'/* , '区县级' */ ].includes(p.title)).map((item: any) => {
  265. return {
  266. title: item.title,
  267. value: item.total,
  268. link: router.resolve({ path: '/inheritor/inheritor', query: { level: item.level } }).href
  269. }
  270. })
  271. },
  272. {
  273. title: '其他传承项目',
  274. type: '1',
  275. datas: [
  276. {
  277. title: '传习所',
  278. value: semiCount,
  279. link: router.resolve({ path: '/inheritor/seminar' }).href,
  280. },
  281. {
  282. title: '传统村落',
  283. value: data.villageData[0]?.total ?? 0,
  284. link: router.resolve({ path: '/village/index' }).href,
  285. },
  286. {
  287. title: '文物古迹',
  288. value: unmoveableCount,
  289. link: router.resolve({ path: '/inheritor/unmoveable' }).href,
  290. },
  291. ],
  292. },
  293. /*{
  294. title: '不可移动文物',
  295. type: '3',
  296. datas: data.crData.map((item: any) => {
  297. return {
  298. title: item.title,
  299. value: item.total
  300. }
  301. })
  302. },
  303. {
  304. title: '闽南文化重要相关文物古迹',
  305. type: '2',
  306. datas: data.minnanCr.map((item: any) => {
  307. return {
  308. title: item.title,
  309. value: item.total
  310. }
  311. })
  312. },
  313. {
  314. title: '重要相关历史风貌区',
  315. type: '1',
  316. datas: data.historyData.map((item: any) => {
  317. return {
  318. title: item.title,
  319. value: item.total
  320. }
  321. })
  322. },
  323. {
  324. title: '传习中心',
  325. type: '3',
  326. datas: data.ichCenter.map((item: any) => {
  327. return {
  328. title: item.title,
  329. value: item.total
  330. }
  331. })
  332. },*/
  333. ];
  334. });
  335. const carousel3Config = ref({
  336. itemsToShow: 4,
  337. mouseWheel: true,
  338. wrapAround: true,
  339. autoplay: 3000,
  340. });
  341. onMounted(() => {
  342. if (window.innerWidth <= 435) {
  343. carousel3Config.value.itemsToShow = 1;
  344. } else if (window.innerWidth <= 768) {
  345. carousel3Config.value.itemsToShow = 2;
  346. }
  347. })
  348. </script>
  349. <style lang="scss">
  350. @media (max-width: 425px) {
  351. }
  352. </style>