artifact.vue 2.4 KB

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