+
+
+

+
+
+ 合众未来
+ HEZHONGWEILAI
+
+
+
@@ -27,7 +36,9 @@
components: { RouteView },
mixins: [mixinDevice],
data () {
- return {}
+ return {
+ mobile:isMobile() //是否是mobile
+ }
},
mounted () {
document.body.classList.add('userLayout')
@@ -36,114 +47,88 @@
document.body.classList.remove('userLayout')
},
}
- /*
- * winWidth: 窗口可视宽度
- * company: 公司名字盒子
- * logo:logo图片
- * cCompany: 中文公司名
- * pCompany: 拼音公司名
- * */
- let winWidth,company,logo,oTop
+ // 判断当前设备
+ function isMobile() {
+ var userAgentInfo = navigator.userAgent;
- window.onload = ()=>{
- adaptation()
- }
- window.onresize = ()=>{
- throttling(adaptation(),1000)
- }
- // 节流
- let throttling = (fn, wait) => {
- let timer;
- let context, args;
+ var mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
- let run = () => {
- timer=setTimeout(()=>{
- fn.apply(context,args);
- clearTimeout(timer);
- timer=null;
- },wait);
- }
+ var mobile_flag = false;
- return function () {
- context=this;
- args=arguments;
- if(!timer){
- console.log("throttle, set");
- run();
- }else{
- console.log("throttle, ignore");
+ //根据userAgent判断是否是手机
+ for (var v = 0; v < mobileAgents.length; v++) {
+ if (userAgentInfo.indexOf(mobileAgents[v]) > 0) {
+ mobile_flag = true;
+ break;
}
}
+ var screen_width = window.screen.width;
+ var screen_height = window.screen.height;
- }
- function adaptation(){
- winWidth = document.body.clientWidth
- console.log(winWidth)
- console.log(document.body.clientHeight)
- logo = document.getElementById("logo")
- // oTop = document.getElementById("top")
- company = document.getElementById("company")
- company.style.height = logo.height + 'px'
- // oTop.style.height = logo.height + 'px'
+ //根据屏幕分辨率判断是否是手机
+ if (screen_width < 500 && screen_height < 800) {
+ mobile_flag = true;
+ }
+ return mobile_flag;
}
\ No newline at end of file
diff --git a/jero-web/src/components/page/GlobalLayout.vue b/jero-web/src/components/page/GlobalLayout.vue
index 0eedf3e9..0f96ee77 100644
--- a/jero-web/src/components/page/GlobalLayout.vue
+++ b/jero-web/src/components/page/GlobalLayout.vue
@@ -131,11 +131,11 @@
//--update-begin----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
//this.menus = this.mainRouters.find((item) => item.path === '/').children;
this.menus = this.permissionMenuList
-
+
//--update-begin----author:liusq---date:20210223------for:关于测边菜单遮挡内容问题详细说明 #2255
this.collapsed=!this.sidebarOpened;
//--update-begin----author:liusq---date:20210223------for:关于测边菜单遮挡内容问题详细说明 #2255
-
+
// 根据后台配置菜单,重新排序加载路由信息
//console.log('----加载菜单逻辑----')
//console.log(this.mainRouters)
@@ -182,8 +182,8 @@