<template>
  <view class="detailed" style="font-size: 30upx">
    <view class="detailedContent">
      <web-view update-title="消防报告详情" :src="pathUrl" allow></web-view>
    </view>
  </view>
</template>

<script setup>
import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
import { ref, onMounted, inject, shallowRef, reactive, watchEffect, getCurrentInstance, toRefs } from "vue";
import { publicStores, useStores } from "@/store/modules/index";

import lineEcharts from "./echarts.vue";

import {} from "@/api/business/mhxf/informationSelect";

const { proxy } = getCurrentInstance();

const publicStore = publicStores(); //全局公共Store

const dataList = reactive({
  pathUrl: "",
  viewerUrl: "",
});

const { pathUrl, viewerUrl } = toRefs(dataList);

let host;
//#ifdef APP-PLUS
host = uni.getStorageSync("serveUrl");
//#endif

//#ifdef H5
host = window.location.host;
//#endif

if (host.indexOf("172.16.120") != -1) {
  viewerUrl.value = "http://172.16.120.165:9300/statics/pdf_js/web/viewer.html";
} else {
  viewerUrl.value = "http://file.usky.cn/statics/pdf_js/web/viewer.html";
}

watchEffect(() => {});

// 自定义导航事件
onNavigationBarButtonTap((e) => {
  if (e.float == "right") {
    uni.navigateTo({
      url: "/pages/business/mhxf/xunJian/collect/components/collectRecord",
    });
  } else {
  }
});

onLoad((options) => {
  if (options.reportPath) {
    let fileUrl = encodeURIComponent(options.reportPath); // encodeURIComponent 函数可把字符串作为 URI 组件进行编码。
    pathUrl.value = viewerUrl.value + "?file=" + fileUrl;
  }
});

onShow(() => {
  //调用系统主题颜色
  proxy.$settingStore.systemThemeColor([1]);
});

onReady(() => {});

onMounted(() => {});
</script>

<style lang="scss">
.detailed {
  height: calc(100vh - 44px);
  .detailedContent {
  }
}
</style>
