<!--入库质检--->
|
<template>
|
<div class="wareBox">
|
<iframe
|
id="ifream"
|
style="border:none"
|
width="100%"
|
height="100%"
|
v-bind:src="reportUrl"
|
></iframe>
|
</div>
|
</template>
|
|
<script>
|
import { getToken } from "@/utils/auth";
|
export default {
|
data() {
|
return {
|
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: {
|
langreash(res) {
|
|
this.$router.push('/QualityInspection')
|
|
},
|
refreash(res) {
|
|
this.$router.push('/QualityInspection')
|
|
},
|
showChangeIfream(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)
|
}
|
|
if (res.indexOf('token=') != -1) {
|
res = res + getToken();
|
}
|
|
this.$store.state.reporturl = res;
|
this.reportUrl = res;
|
this.url = res
|
console.log("2", this.reportUrl)
|
}
|
},
|
mounted() {
|
this.showChangeIfream(this.$store.reporturl)
|
|
this.$bus.$on('changeNaveUrl', (res) => {
|
this.showChangeIfream(res)
|
});
|
}
|
|
}
|
</script>
|
|
<style lang="less" scoped>
|
.wareBox {
|
width: 100%;
|
height: 100%;
|
margin: 0;
|
padding: 0;
|
overflow: hidden;
|
background: #303030;
|
}
|
</style>
|