InheritorView.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  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 pb-0">
  16. <div class="content">
  17. <div class="title">
  18. <h2>数据统计</h2>
  19. </div>
  20. <SimplePageContentLoader :loader="statsData">
  21. <Carousel ref="carousel3Ref" v-bind="carousel3Config">
  22. <Slide v-for="(stat,key) in statsData.content.value" :key="key">
  23. <div :class="`main-card-box type${stat.type}`">
  24. <h4>{{ stat.title }}</h4>
  25. <div class="descs">
  26. <div v-for="(data, key2) in stat.datas" :key="key2">
  27. <h5>{{ data.title }}</h5>
  28. <p>{{ data.value }}</p>
  29. </div>
  30. </div>
  31. </div>
  32. </Slide>
  33. <template #addons>
  34. <Navigation />
  35. </template>
  36. </Carousel>
  37. </SimplePageContentLoader>
  38. </div>
  39. </section>
  40. <!-- 非遗传承 -->
  41. <section class="main-section pb-0">
  42. <div class="content">
  43. <div class="title">
  44. <h2>非遗传承</h2>
  45. </div>
  46. <ThreeImageList :list="list1" />
  47. </div>
  48. </section>
  49. <!-- 文物保护 -->
  50. <section class="main-section pb-0">
  51. <div class="content">
  52. <div class="title">
  53. <h2>文物保护</h2>
  54. </div>
  55. <ThreeImageList :list="list2" />
  56. </div>
  57. </section>
  58. <!-- 自然遗产 -->
  59. <section class="main-section pb-0">
  60. <div class="content">
  61. <div class="title">
  62. <h2>自然遗产</h2>
  63. </div>
  64. <LeftRightBox
  65. title="自然遗产"
  66. :desc="overviewsLoader.content.value?.[0]"
  67. :image="Image9"
  68. :showExpand="false"
  69. @moreClick="navTo('/inheritor/heritage')"
  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. <LeftRightBox
  80. title="历史风貌区"
  81. :desc="overviewsLoader.content.value?.[1]"
  82. :image="Image11"
  83. :showExpand="false"
  84. left
  85. @moreClick="navTo('/inheritor/area')"
  86. />
  87. </div>
  88. </section>
  89. <!-- 重要相关文物和古迹 -->
  90. <section class="main-section pb-0">
  91. <div class="content">
  92. <div class="title">
  93. <h2>重要相关文物和古迹</h2>
  94. </div>
  95. <LeftRightBox
  96. title="传统村落"
  97. :desc="overviewsLoader.content.value?.[2]"
  98. :image="Image10"
  99. :showExpand="false"
  100. @moreClick="navTo('/village/index')"
  101. />
  102. </div>
  103. </section>
  104. <!-- 法律法规 -->
  105. <section class="main-section pb-0">
  106. <div class="content">
  107. <div class="title left-right">
  108. <h2>法律法规</h2>
  109. <div class="small-more" @click="navTo('/introduction/policy')">
  110. <span>更多信息</span>
  111. <img src="@/assets/images/index/ButtonMore.png" alt="更多" />
  112. </div>
  113. </div>
  114. <SimplePageContentLoader :loader="lawsData">
  115. <ImageTextSmallBlock
  116. v-for="(item, index) in lawsData.content.value"
  117. :key="index"
  118. :title="item.title"
  119. :image="item.image"
  120. :date="item.date"
  121. @click="navTo('/news/detail', { id: item.id })"
  122. />
  123. </SimplePageContentLoader>
  124. </div>
  125. </section>
  126. <!-- 申报入口 -->
  127. <section class="main-section">
  128. <div class="content">
  129. <div class="title">
  130. <h2>申报入口</h2>
  131. </div>
  132. <img
  133. class="main-clickable mt-4 w-100"
  134. src="@/assets/images/inheritor/SubmitButton.png"
  135. alt="申报入口按钮"
  136. @click="navTo('/inheritor/submit')"
  137. />
  138. </div>
  139. </section>
  140. </div>
  141. </template>
  142. <script setup lang="ts">
  143. import { Carousel, Slide, Pagination, Navigation } from 'vue3-carousel'
  144. import { onMounted, ref } from 'vue';
  145. import LawsTest from '@/assets/images/inheritor/LawsTest.jpg'
  146. import Image1 from '@/assets/images/inheritor/Image1.jpg'
  147. import Image2 from '@/assets/images/inheritor/Image2.jpg'
  148. import Image3 from '@/assets/images/inheritor/Image3.jpg'
  149. import Image4 from '@/assets/images/inheritor/Image4.jpg'
  150. import Image5 from '@/assets/images/inheritor/Image5.jpg'
  151. import Image6 from '@/assets/images/inheritor/Image6.jpg'
  152. import Image7 from '@/assets/images/inheritor/Image7.jpg'
  153. import Image8 from '@/assets/images/inheritor/Image8.jpg'
  154. import Image9 from '@/assets/images/inheritor/Image9.jpg'
  155. import Image10 from '@/assets/images/inheritor/Image10.jpg'
  156. import Image11 from '@/assets/images/inheritor/Image11.jpg'
  157. import LeftRightBox from '@/components/parts/LeftRightBox.vue';
  158. import ThreeImageList from '@/components/parts/ThreeImageList.vue';
  159. import ImageTextSmallBlock from '@/components/parts/ImageTextSmallBlock.vue';
  160. import { usePageAction } from '@/composeable/PageAction';
  161. import { useSimpleDataLoader } from '@/composeable/SimpleDataLoader';
  162. import PolicyContent from '@/api/introduction/PolicyContent';
  163. import { GetColumListParams, GetContentListParams } from '@/api/CommonContent';
  164. import DateUtils from '@/common/utils/DateUtils';
  165. import SimplePageContentLoader from '@/components/content/SimplePageContentLoader.vue';
  166. import { NO_CONTENT_STRING } from '@/common/ConstStrings';
  167. import IndexContent from '@/api/introduction/IndexContent';
  168. const { navTo } = usePageAction();
  169. const carouselConfig = {
  170. itemsToShow: 1,
  171. wrapAround: true,
  172. autoPlay: 5000,
  173. }
  174. const list1 = [
  175. {
  176. title: '非遗项目',
  177. desc: '让文化因传承而永存',
  178. image: Image1,
  179. onClick: () => navTo('/inheritor/projects'),
  180. },
  181. {
  182. title: '非遗传承人',
  183. desc: '让文化因传承而永存',
  184. image: Image2,
  185. onClick: () => navTo('/inheritor/inheritor'),
  186. },
  187. {
  188. title: '非遗产品(作品)',
  189. desc: '让文化因传承而永存',
  190. image: Image3,
  191. onClick: () => navTo('/inheritor/products'),
  192. },
  193. {
  194. title: '非遗活动',
  195. desc: '让文化因传承而永存',
  196. image: Image4,
  197. onClick: () => navTo('/inheritor/activity'),
  198. },
  199. {
  200. title: '非遗传习所',
  201. desc: '让文化因传承而永存',
  202. image: Image5,
  203. onClick: () => navTo('/inheritor/seminar'),
  204. },
  205. {
  206. title: '',//'非遗管理',
  207. desc: '',//'让文化因传承而永存',
  208. image: '',//Image6,
  209. }
  210. ]
  211. const list2 = [
  212. {
  213. title: '不可移动文物',
  214. desc: '让文化因传承而永存',
  215. image: Image7,
  216. onClick: () => navTo('/inheritor/unmoveable'),
  217. },
  218. {
  219. title: '可移动文物',
  220. desc: '让文化因传承而永存',
  221. image: Image8,
  222. onClick: () => navTo('/inheritor/moveable'),
  223. },
  224. {
  225. title: '',
  226. desc: '',
  227. image: ''
  228. },
  229. ]
  230. const lawsData = useSimpleDataLoader(async () =>
  231. (await PolicyContent.getContentList(new GetContentListParams(), 1, 8))
  232. .list?.map(item => ({
  233. id: item.id,
  234. title: item.title,
  235. image: item.image || LawsTest,
  236. date: DateUtils.formatDate(item.publish_at, DateUtils.FormatStrings.YearCommon),
  237. }))
  238. )
  239. const overviewsLoader = useSimpleDataLoader(async () => {
  240. return [
  241. (await IndexContent.getColumList(
  242. new GetColumListParams()
  243. .setModelId(17)
  244. .setMainBodyColumnId(310)
  245. )).list[0]?.overview || NO_CONTENT_STRING,
  246. (await IndexContent.getColumList(
  247. new GetColumListParams()
  248. .setModelId(17)
  249. .setMainBodyColumnId(286)
  250. )).list[0]?.overview || NO_CONTENT_STRING,
  251. (await IndexContent.getColumList(
  252. new GetColumListParams()
  253. .setModelId(17)
  254. .setMainBodyColumnId(235)
  255. )).list[0]?.overview || NO_CONTENT_STRING,
  256. ]
  257. });
  258. const carousel3Config = ref({
  259. itemsToShow: 4,
  260. mouseWheel: true,
  261. wrapAround: true,
  262. autoplay: 3000,
  263. });
  264. const carousel3Ref = ref<any>(null);
  265. onMounted(() => {
  266. if (window.innerWidth <= 435) {
  267. carousel3Config.value.itemsToShow = 1;
  268. } else if (window.innerWidth <= 768) {
  269. carousel3Config.value.itemsToShow = 2;
  270. }
  271. })
  272. const statsData = useSimpleDataLoader(async () => {
  273. const data = (await IndexContent.getStats());
  274. console.log(data);
  275. return [
  276. {
  277. title: '非遗项目',
  278. type: '1',
  279. datas: data.ichData.map((item: any) => {
  280. return {
  281. title: item.level_text,
  282. value: item.total
  283. }
  284. })
  285. },
  286. {
  287. title: '传承人',
  288. type: '2',
  289. datas: data.inheritorData.map((item: any) => {
  290. return {
  291. title: item.title,
  292. value: item.total
  293. }
  294. })
  295. },
  296. {
  297. title: '不可移动文物',
  298. type: '3',
  299. datas: data.crData.map((item: any) => {
  300. return {
  301. title: item.title,
  302. value: item.total
  303. }
  304. })
  305. },
  306. {
  307. title: '闽南文化重要相关文物古迹',
  308. type: '2',
  309. datas: data.minnanCr.map((item: any) => {
  310. return {
  311. title: item.title,
  312. value: item.total
  313. }
  314. })
  315. },
  316. {
  317. title: '重要相关历史风貌区',
  318. type: '1',
  319. datas: data.historyData.map((item: any) => {
  320. return {
  321. title: item.title,
  322. value: item.total
  323. }
  324. })
  325. },
  326. {
  327. title: '传习中心',
  328. type: '3',
  329. datas: data.ichCenter.map((item: any) => {
  330. return {
  331. title: item.title,
  332. value: item.total
  333. }
  334. })
  335. },
  336. ]
  337. });
  338. </script>
  339. <style lang="scss">
  340. @media (max-width: 425px) {
  341. }
  342. </style>