detailedPath.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view class="detailed" style="font-size: 30upx">
  3. <view class="detailedContent">
  4. <web-view update-title="消防报告详情" :src="pathUrl" allow></web-view>
  5. </view>
  6. </view>
  7. </template>
  8. <script setup>
  9. import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
  10. import { ref, onMounted, inject, shallowRef, reactive, watchEffect, getCurrentInstance, toRefs } from "vue";
  11. import publicStore from "@/store/modules/public";
  12. import lineEcharts from "./echarts.vue";
  13. import {} from "@/api/business/mhxf/informationSelect";
  14. const { proxy } = getCurrentInstance();
  15. const publicStores = publicStore(); //全局公共Store
  16. const dataList = reactive({
  17. pathUrl: "",
  18. viewerUrl: "/static/pdf/web/viewer.html",
  19. });
  20. const { pathUrl, viewerUrl } = toRefs(dataList);
  21. watchEffect(() => {});
  22. // 自定义导航事件
  23. onNavigationBarButtonTap((e) => {
  24. if (e.float == "right") {
  25. uni.navigateTo({
  26. url: "/pages/business/mhxf/xunJian/collect/components/collectRecord",
  27. });
  28. } else {
  29. }
  30. });
  31. onLoad((options) => {
  32. if (options.reportPath) {
  33. let fileUrl = encodeURIComponent(options.reportPath); // encodeURIComponent 函数可把字符串作为 URI 组件进行编码。
  34. pathUrl.value = viewerUrl.value + "?file=" + fileUrl;
  35. }
  36. });
  37. onReady(() => {});
  38. onMounted(() => {});
  39. </script>
  40. <style lang="scss">
  41. .detailed {
  42. height: calc(100vh - 44px);
  43. .detailedContent {
  44. }
  45. }
  46. </style>