demo.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <!-- -->
  2. <template>
  3. <MainPanel>
  4. <template v-slot:header>
  5. <Header :title="info.title" type="return" :on-back="() => onBack()">
  6. <!-- <ui-button type="primary" width="96px"> 完成 </ui-button> -->
  7. </Header>
  8. </template>
  9. <div class="explorate">
  10. <img :src="info.img" />
  11. </div>
  12. </MainPanel>
  13. </template>
  14. <script setup lang="ts">
  15. import { reactive, ref, toRefs, onBeforeMount, onMounted, nextTick, onActivated } from 'vue';
  16. import html2canvas from 'html2canvas';
  17. import { downloadImage, uploadImage } from '@/store/sync';
  18. import Message from '@/components/base/components/message/message.vue';
  19. import Header from '@/components/photos/header.vue';
  20. import MainPanel from '@/components/main-panel/index.vue';
  21. import { router } from '@/router';
  22. import img_1 from '@/assets/images/demo/1.png';
  23. import img_2 from '@/assets/images/demo/2.png';
  24. import img_3 from '@/assets/images/demo/3.png';
  25. import img_4 from '@/assets/images/demo/4.png';
  26. import img_5 from '@/assets/images/demo/5.png';
  27. import img_6 from '@/assets/images/demo/6.png';
  28. import img_7 from '@/assets/images/demo/7.png';
  29. const list = ref([
  30. { title: '道路交通事故现场勘查笔录', img: img_1 },
  31. { title: '询问笔录', img: img_2 },
  32. { title: '讯问笔录', img: img_3 },
  33. { title: '道路交通事故认定书', img: img_4 },
  34. { title: '当事人血样登记表', img: img_5 },
  35. { title: '道路交通事故现场遗留物品清单', img: img_6 },
  36. { title: '授权委托书', img: img_7 },
  37. ]);
  38. let index = Number(router.currentRoute.value.params.id);
  39. const info = ref(list.value[index - 1]);
  40. const onBack = () => {
  41. router.back();
  42. };
  43. onMounted(() => {});
  44. onActivated(() => {
  45. index = Number(router.currentRoute.value.params.id);
  46. info.value = list.value[index - 1];
  47. });
  48. </script>
  49. <style lang="scss" scoped>
  50. .explorate {
  51. width: 100%;
  52. height: 100%;
  53. overflow-y: auto;
  54. img {
  55. width: 100%;
  56. height: auto;
  57. }
  58. }
  59. </style>