artifact.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <!-- 文物详情页 -->
  3. <TabDetailView
  4. :load="loadData"
  5. name="artifact"
  6. >
  7. <template #extraInfo="{ content }">
  8. <IntroBlock
  9. :descItems="[
  10. {
  11. label: '地址',
  12. value: content.address
  13. },
  14. {
  15. label: '开放时间',
  16. value: content.openStatusText
  17. },
  18. {
  19. label: '年代',
  20. value: content.age
  21. },
  22. {
  23. label: '级别',
  24. value: content.levelText
  25. },
  26. {
  27. label: '所属区域',
  28. value: content.regionText ,
  29. },
  30. {
  31. label: '文物类型',
  32. value: content.crTypeText,
  33. },
  34. {
  35. label: '文物编码',
  36. value: content.code,
  37. }
  38. ]"
  39. />
  40. </template>
  41. <template #extraTab="{ currentTabId, content }">
  42. <template v-if="currentTabId==4">
  43. <!-- VR参观 -->
  44. <iframe :src="(content.vr as string)" style="width: 100%;height: 80vh"/>
  45. </template>
  46. <SimpleRichHtml :show="currentTabId==5" :contents="[ content.protectedArea as string ]" />
  47. <SimpleRichHtml :show="currentTabId==6" :contents="[ content.environment as string ]" />
  48. <SimpleRichHtml :show="currentTabId==7" :contents="[ content.value as string ]" />
  49. </template>
  50. </TabDetailView>
  51. </template>
  52. <script setup lang="ts">
  53. import UnmoveableContent from '@/api/inheritor/UnmoveableContent';
  54. import TabDetailView from './TabDetailView.vue';
  55. import IntroBlock from '@/components/parts/IntroBlock.vue';
  56. import SimpleRichHtml from '@/components/display/SimpleRichHtml.vue';
  57. async function loadData(id: number) {
  58. const d = await UnmoveableContent.getContentDetail(id);
  59. d.contentProps = {
  60. tabs: [
  61. { id: 0, text: '文物基础信息', visible: true },
  62. { id: 1, text: '文物相册', visible: true },
  63. { id: 2, text: '文物音频', visible: Boolean(d.audio) },
  64. { id: 3, text: '文物视频', visible: Boolean(d.video) },
  65. { id: 4, text: 'VR参观', visible: Boolean(d.vr) },
  66. { id: 5, text: '保护范围', visible: Boolean(d.protectedArea) },
  67. { id: 6, text: '建筑环境', visible: Boolean(d.environment) },
  68. { id: 7, text: '价值评估', visible: Boolean(d.value) },
  69. ]
  70. };
  71. return d;
  72. }
  73. </script>