| | |
| | | <!--入库质检---> |
| | | <template> |
| | | <div class="wareBox"> |
| | | <div |
| | | class="wareBox" |
| | | id="wareBox" |
| | | > |
| | | <iframe |
| | | id="iframeContainer" |
| | | style="border:none" |
| | | width="100%" |
| | | height="100%" |
| | |
| | | ></iframe> |
| | | </div> |
| | | </template> |
| | | |
| | | |
| | | |
| | | <script> |
| | | import { getToken } from "@/utils/auth"; |
| | | export default { |
| | | data() { |
| | | return { |
| | | reportUrl: '' |
| | | reportUrl: '', |
| | | url: '', |
| | | } |
| | | }, |
| | | computed: { |
| | | Obj() { |
| | | return this.$store.state.themeflag |
| | | }, |
| | | lang() { |
| | | return this.$store.state.language |
| | | } |
| | | }, |
| | | watch: { |
| | | Obj(newVal, oldVal) { |
| | | //可以对数据执行相应的操作 |
| | | this.refreash(newVal) |
| | | }, |
| | | lang(newVal, oldVal) { |
| | | this.langreash(newVal) |
| | | } |
| | | }, |
| | | methods: { |
| | | showChangeIfream(res) { |
| | | closeNaveMenu() { |
| | | this.$bus.$emit('closeNaveMenu', true) |
| | | }, |
| | | langreash(res) { |
| | | |
| | | this.$router.push('/QualityInspection') |
| | | |
| | | }, |
| | | refreash(res) { |
| | | |
| | | this.$router.push('/QualityInspection') |
| | | |
| | | }, |
| | | showChangeIfream(res) { |
| | | // |
| | | console.log(res) |
| | | if (this.$store.state.themeflag == true) { |
| | | if (res.indexOf('theme=white') != -1) { |
| | | res = res.replace('theme=white', 'theme=dark'); |
| | | } |
| | | } else if (this.$store.state.themeflag == false) { |
| | | if (res.indexOf('theme=dark') != -1) { |
| | | res = res.replace('theme=dark', 'theme=white'); |
| | | } |
| | | } |
| | | |
| | | if (this.$store.state.language == true) { |
| | | if (res.indexOf('lang=en') != -1) { |
| | | res = res.replace('lang=en', 'lang=zh'); |
| | | } |
| | | } else if (this.$store.state.language == false) { |
| | | if (res.indexOf('lang=zh') != -1) { |
| | | res = res.replace('lang=zh', 'lang=en'); |
| | | } |
| | | } |
| | | if (res.indexOf('{fmeHost}') != -1) { |
| | | |
| | | res = res.replace('{fmeHost}',fmeHost ) |
| | | |
| | | res = res.replace('{fmeHost}', fmeHost) |
| | | } |
| | | |
| | | if (res.indexOf('token=') != -1) { |
| | |
| | | |
| | | this.$store.state.reporturl = res; |
| | | this.reportUrl = res; |
| | | // console.log("2", this.reportUrl) |
| | | } |
| | | this.url = res |
| | | // sessionStorage.setItem('routerName', this.reportUrl) |
| | | console.log("2", this.reportUrl) |
| | | }, |
| | | |
| | | 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'); |
| | | // if (location.href.indexOf('/WareInspection') == -1) { |
| | | // this.$store.reporturl = res.url; |
| | | // this.$router.push('/WareInspection'); |
| | | // } else { |
| | | // this.$bus.$emit('changeNaveUrl', res.url); |
| | | // } |
| | | } |
| | | this.setShowFalseDiv(false) |
| | | }, 100) |
| | | clearTimeout(timer) |
| | | }, |
| | | setShowFalseDiv(bolean) { |
| | | var index = this.showFlag; |
| | | if (index != null) { |
| | | let newItem = this.listMenu[index]; |
| | | |
| | | newItem.show = bolean; |
| | | Vue.set(this.listMenu, index, newItem); |
| | | } |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.showChangeIfream(this.$store.reporturl) |
| | | // console.log("1", this.reportUrl) |
| | | this.$bus.$on('changeNaveUrl', (res) => { |
| | | this.showChangeIfream(res) |
| | | }); |
| | | |
| | | // var iframe = document.getElementById('iframeContainer'); |
| | | // iframe.onload = function (res) { |
| | | |
| | | // } |
| | | |
| | | // $('#iframeContainer').click = function () { |
| | | // console.log('点击了iframe页面') |
| | | // // if (window.sessionStorage.getItem('xxxLastTime') !== null) { |
| | | // // window.sessionStorage.setItem('xxxLastTime', new Date().getTime()) |
| | | // // } |
| | | // }; |
| | | if (sessionStorage.getItem('routerName') === '/WareInspection') { |
| | | |
| | | this.showChangeIfream(sessionStorage.getItem('iframehttpurl')) |
| | | this.setLiClick(sessionStorage.getItem('iframehttpurl')) |
| | | |
| | | this.$bus.$on('changeNaveUrl', (res) => { |
| | | this.showChangeIfream(res) |
| | | }); |
| | | } else { |
| | | this.showChangeIfream(this.$store.reporturl) |
| | | |
| | | this.$bus.$on('changeNaveUrl', (res) => { |
| | | this.showChangeIfream(res) |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |