浏览代码

fix:图例弹框适应1366

YaolongHan 4 年之前
父节点
当前提交
11f8528a61
共有 3 个文件被更改,包括 21 次插入5 次删除
  1. 15 3
      src/components/Legend/src/legend.vue
  2. 5 1
      src/router/index.js
  3. 1 1
      src/store/index.js

+ 15 - 3
src/components/Legend/src/legend.vue

@@ -8,7 +8,7 @@
         <div class='legend-container'>
             <div :class='showView===1?"legend2":"legend"' @click='showTl' v-if='(type==1 || floors.length>0)&& isMessage && legendTable.length>0 '>图例</div>
             <!-- 图里展示状态组件 -->
-            <el-collapse-transition v-if='(type==1 || floors.length>0)&& isMessage && legendTable.length>0 '>
+            <el-collapse-transition v-if='(type==1 || floors.length>0)&& isMessage && legendTable.length>0'>
                 <div class='legend-tab' v-if='showView===1'>
                     <div class='legend-table2' v-if='systemName=="土建装饰"'>
                         <lengend-view @changeSwitch='handleSwich' :remarksText='remarksText' ref='viewLengend' :systemName='systemName'></lengend-view>
@@ -512,6 +512,17 @@ export default {
                 console.log(remarksText)
                 this.$store.commit('SETREMARKSTEXT', remarksText)
             })
+        },
+        // 设置图例整体高度
+        setLengedHeight(){
+           let dom = document.getElementsByClassName('legend-table')[0];
+           console.log('asdfasfd',window.screen.height,window.screen.width)
+           if(window.screen.height>1000){
+            dom.style.maxHeight="768px"
+           }else{
+            dom.style.maxHeight="534px"
+           }
+
         }
     },
     mounted() {
@@ -529,7 +540,8 @@ export default {
         this.$once('hook:beforeDestroy', () => {
             clearInterval(this.timer)
         })
-
+        // 设置图例最大高度
+        this.setLengedHeight()
     }
 }
 </script>
@@ -571,7 +583,7 @@ export default {
         right: 47px;
         .legend-table {
             padding: 16px;
-            height: 460px;
+            // max-height: 768px;
             width: 385px;
             // width: 420px;
             overflow: auto;

+ 5 - 1
src/router/index.js

@@ -89,7 +89,11 @@ const router = new VueRouter({
 const ignore = ['/404']
 router.beforeEach(async (to, from, next) => {
     if (!ignore.includes(to.path)) {
-        const token = store.getters['ssoToken'] || query().token
+        let token = store.getters['ssoToken'] || query().token;
+        // 开发环境模式token有模式值
+        if(process.env.NODE_ENV=='aly'|| process.env.NODE_ENV=='serve'){
+            token = 'admin:chuyushu'
+         }
         if (token) {
             store.commit('SETSSOTOKEN', token)
             if (to.path == '/') {

+ 1 - 1
src/store/index.js

@@ -49,7 +49,7 @@ export default new Vuex.Store({
         plazaName: (state) => state.plazaName,
         accessLevel: (state) => state.accessLevel,
         isPreview: (state) => state.isPreview,
-        ssoToken: (state) => state.ssoToken,
+        ssoToken: (state) =>  state.ssoToken,
         lastRoute: (state) => state.lastRoute,
         floorsArr: (state) => state.floorsArr,
         floorSelect: (state) => state.floorSelect,