duhanyu
杜函宇 2 years ago
parent be8a77fc46
commit 2989abc4b7

@ -2,33 +2,55 @@
<div class="ifram-view" :style="iframViewStyle"> <div class="ifram-view" :style="iframViewStyle">
<!-- <span>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</span> --> <!-- <span>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</span> -->
<!-- <iframe src="https://dev-mssm-liaoning.imian.org.cn/ggfw/#/firmContent/drugInfo" frameborder="0" style="width: 100%;height: 100%;"></iframe> --> <!-- <iframe src="https://dev-mssm-liaoning.imian.org.cn/ggfw/#/firmContent/drugInfo" frameborder="0" style="width: 100%;height: 100%;"></iframe> -->
<iframe :src="url" frameborder="0" style="width: 100%;height: 100%;"></iframe> <iframe
:src="url"
frameborder="0"
style="width: 100%; height: 100%"
id="iframes"
></iframe>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
iframViewStyle:{ iframViewStyle: {
height:"", height: "",
}, },
// url: `https://dev-mssm-liaoning.imian.org.cn/ggfw-iframe/#/productinformation?type=${
url:`https://dev-mssm-liaoning.imian.org.cn/ggfw-iframe/#/productinformation?type=${this.$route.query.type}&flag=${this.$route.query.flag}&data=${this.$route.query.data}&token=${localStorage.getItem('MSSM-LIAONING__TOKEN')}` // this.$route.query.type
} // }&flag=${this.$route.query.flag}&data=${
// this.$route.query.data
// }&token=${localStorage.getItem("MSSM-LIAONING__TOKEN")}`,
url: `https://dev-mssm-liaoning.imian.org.cn/ggfw-iframe/#/productinformation`
};
}, },
methods:{ methods: {},
created() {
this.$nextTick(() => {
let oFrame = this.$refs.iframes;
oFrame.contentWindow.postMessage(
{
type: this.$route.query.type,
flag: this.$route.query.flag,
data: this.$route.query.data,
token: localStorage.getItem("MSSM-LIAONING__TOKEN"),
},
"*"
);
});
}, },
mounted() { mounted() {
this.$nextTick(()=>{ this.$nextTick(() => {
let dom = document.getElementsByClassName('ifram-view'); let dom = document.getElementsByClassName("ifram-view");
let height = dom[0].getBoundingClientRect(); let height = dom[0].getBoundingClientRect();
// let windowWidth = window.innerWidth; // let windowWidth = window.innerWidth;
let windowHeight = window.innerHeight; let windowHeight = window.innerHeight;
let relativeHeight = windowHeight - height.top let relativeHeight = windowHeight - height.top;
this.iframViewStyle.height = relativeHeight + 'px' this.iframViewStyle.height = relativeHeight + "px";
}) });
}, },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.ifram-view { .ifram-view {

Loading…
Cancel
Save