2021-02-14 23:01:21 +08:00
|
|
|
<template>
|
2021-02-20 16:17:26 +08:00
|
|
|
<div v-loading="loading" :style="'height:'+ height">
|
|
|
|
<iframe ref="iframe" :src="src" frameborder="no" style="width: 100%;height: 100%" scrolling="auto" />
|
2021-02-14 23:01:21 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: "Server",
|
|
|
|
data() {
|
|
|
|
return {
|
2021-02-20 16:17:26 +08:00
|
|
|
src: process.env.VUE_APP_BASE_API + "/admin",
|
|
|
|
height: document.documentElement.clientHeight - 94.5 + "px;",
|
|
|
|
loading: true
|
2021-02-14 23:01:21 +08:00
|
|
|
};
|
|
|
|
},
|
2021-02-20 16:17:26 +08:00
|
|
|
mounted: function() {
|
|
|
|
const that = this;
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
// 模拟点击【应用】菜单
|
2021-02-20 17:49:42 +08:00
|
|
|
// that.$refs["iframe"].contentWindow.document.getElementsByClassName('navbar-item')[2].click(); // TODO 暂时去掉,存在跨域问题
|
2021-02-20 16:17:26 +08:00
|
|
|
// 取消加载中
|
|
|
|
this.loading = false;
|
|
|
|
}, 230);
|
|
|
|
|
|
|
|
// 大小变化的监听
|
|
|
|
window.onresize = function temp() {
|
|
|
|
that.height = document.documentElement.clientHeight - 94.5 + "px;";
|
|
|
|
};
|
2021-02-14 23:01:21 +08:00
|
|
|
}
|
|
|
|
};
|
2021-02-20 16:17:26 +08:00
|
|
|
</script>
|