Commit fef3b6dd authored by ninglx's avatar ninglx

去除蒙自大屏路由拦截 修改大屏自适应方案

parent e8ee156e
<template>
<div class="full-w full-h situation-main screen" id="screen">
<vision-header />
<!-- <vision-header /> -->
<router-view class="router-view-main" />
</div>
</template>
......@@ -17,40 +17,39 @@ export default {
computed: {},
created() {},
mounted() {
window.onkeydown = () => {
// alt + e 编辑
if (event.ctrlKey && event.altKey && event.keyCode === 69) {
this.$store.commit("troggleEditorStatus");
}
// alt + 1
if (event.altKey && event.keyCode === 49) {
this.$router.push("/home");
}
// alt + 2
if (event.altKey && event.keyCode === 50) {
this.$router.push("/situation0");
}
// alt + 3
if (event.altKey && event.keyCode === 51) {
this.$router.push("/situation1");
}
// alt + 4
if (event.altKey && event.keyCode === 52) {
this.$router.push("/situation2");
}
// alt + 5
if (event.altKey && event.keyCode === 53) {
this.$router.push("/situation3");
}
};
this.handleScreenAuto();
window.onresize = () => this.handleScreenAuto();
// window.onkeydown = () => {
// // alt + e 编辑
// if (event.ctrlKey && event.altKey && event.keyCode === 69) {
// this.$store.commit("troggleEditorStatus");
// }
// // alt + 1
// if (event.altKey && event.keyCode === 49) {
// this.$router.push("/home");
// }
// // alt + 2
// if (event.altKey && event.keyCode === 50) {
// this.$router.push("/situation0");
// }
// // alt + 3
// if (event.altKey && event.keyCode === 51) {
// this.$router.push("/situation1");
// }
// // alt + 4
// if (event.altKey && event.keyCode === 52) {
// this.$router.push("/situation2");
// }
// // alt + 5
// if (event.altKey && event.keyCode === 53) {
// this.$router.push("/situation3");
// }
// };
// this.handleScreenAuto();
// window.onresize = () => this.handleScreenAuto();
},
methods: {
handleScreenAuto() {
const designDraftWidth = this.$store.state.dataset.clientWidth || 3840; //设计稿的宽度
const designDraftHeight = this.$store.state.dataset.clientHeight || 1728; //设计稿的高度
console.log('hhhhhhhhh',designDraftWidth,designDraftHeight);
document.querySelector("#screen").style.width = `${designDraftWidth}px`;
document.querySelector("#screen").style.height = `${designDraftHeight}px`;
// 根据屏幕的变化适配的比例
......@@ -91,13 +90,13 @@ export default {
height: 100%;
}
}
.screen {
width: 3840px;
height: 1728px;
display: inline-block;
transform-origin: 0 0;
position: absolute;
left: 50%;
top: 50%;
}
// .screen {
// width: 3840px;
// height: 1728px;
// display: inline-block;
// transform-origin: 0 0;
// position: absolute;
// left: 50%;
// top: 50%;
// }
</style>
......@@ -18,8 +18,8 @@ router.beforeEach((to, from, next) => {
// // }
// // }
// });
const parentId = "1783337E5E9547B6A6E99C60443B90A2";
queryMenu({ parentId: parentId, isRecursion: true }).then((res) => {
// const parentId = "1783337E5E9547B6A6E99C60443B90A2";
// queryMenu({ parentId: parentId, isRecursion: true }).then((res) => {
// console.log('res',res);
// let routes = res.content;
// for (let route of routes) {
......@@ -27,6 +27,6 @@ router.beforeEach((to, from, next) => {
next();
// }
// }
});
// });
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment