管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-05-10 28eabcf57517e503618d9217e8bf6cd4b6b96cc7
src/views/PackageTwo/WareInspection.vue
@@ -1,8 +1,11 @@
<!--入库质检--->
<template>
  <div class="wareBox">
  <div
    class="wareBox"
    id="wareBox"
  >
    <iframe
      id="ifream"
      id="iframeContainer"
      style="border:none"
      width="100%"
      height="100%"
@@ -10,7 +13,8 @@
    ></iframe>
  </div>
</template>
<script>
import { getToken } from "@/utils/auth";
export default {
@@ -38,18 +42,21 @@
    }
  },
  methods: {
    closeNaveMenu() {
      this.$bus.$emit('closeNaveMenu', true)
    },
    langreash(res) {
       this.$router.push('/QualityInspection')
      this.$router.push('/QualityInspection')
    },
    refreash(res) {
     this.$router.push('/QualityInspection')
      this.$router.push('/QualityInspection')
    },
    showChangeIfream(res) {
      // debugger
      //
      console.log(res)
      if (this.$store.state.themeflag == true) {
        if (res.indexOf('theme=white') != -1) {
@@ -84,14 +91,15 @@
      this.url = res
      // sessionStorage.setItem('routerName', this.reportUrl)
      console.log("2", this.reportUrl)
      // window.addEventListener("message", this.handleMessage, false);
    },
    setLiClick(res, index) {
      var timer = setTimeout(function () {
        if (res.indexOf('http') != -1) {
            this.$store.reporturl = res;
            // sessionStorage.setItem('iframehttpurl', this.$store.reporturl)
            this.$router.push('/QualityInspection');
          this.$store.reporturl = res;
          // sessionStorage.setItem('iframehttpurl', this.$store.reporturl)
          this.$router.push('/QualityInspection');
          // if (location.href.indexOf('/WareInspection') == -1) {
          //   this.$store.reporturl = res.url;
          //   this.$router.push('/WareInspection');
@@ -112,12 +120,29 @@
        Vue.set(this.listMenu, index, newItem);
      }
    },
    getFunc() {
      console.log("closeMenuSecond")
      this.$bus.$emit('closeMenuSecond', false)
    }
  },
  mounted() {
    // console.log(sessionStorage.getItem('iframehttpurl'))
    // debugger
    // const iframe = document.querySelector('#iframeContainer')
    // // 处理兼容行问题
    // if (iframe.attachEvent) {
    //   iframe.attachEvent('onload', () => {
    //     // iframe加载完毕以后执行操作
    //     this.getFunc()
    //   })
    // } else {
    //   iframe.onload = () => {
    //     // iframe加载完毕以后执行操作
    //     this.getFunc()
    //   }
    // }
    if (sessionStorage.getItem('routerName') === '/WareInspection') {
      this.showChangeIfream(sessionStorage.getItem('iframehttpurl'))
      this.setLiClick(sessionStorage.getItem('iframehttpurl'))