index.vue 9.8 KB

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