Bläddra i källkod

Merge branch 'master' into kdwc-web

dedsudiyu 2 år sedan
förälder
incheckning
2366e17ad6

+ 31 - 32
src/App.vue

@@ -1,13 +1,10 @@
 <template>
-  <!--<dv-full-screen-container style="height:100%!important;">-->
     <div id="app">
       <router-view />
     </div>
-  <!--</dv-full-screen-container>-->
 </template>
 
 <script>
-  // import DevicePixelRatio from '@/utils/devicePixelRatio'
   export default  {
     name:  'App',
     metaInfo() {
@@ -18,47 +15,49 @@
         },
       }
     },
-    // created() {
-    //   new DevicePixelRatio().init()
-    // },
     mounted(){
-      let cssText1 = '.el-dialog{transform:scale('+document.documentElement.clientWidth / 1920+')}'
-      let cssText2 = '.el-message-box{transform:scale('+document.documentElement.clientWidth / 1920+')}'
-      let cssText3 = '.el-tooltip__popper{transform:scale('+document.documentElement.clientWidth / 1920+')}'
-      this.insertCSS(cssText1);
-      this.insertCSS(cssText2);
-      this.insertCSS(cssText3);
+      this.banZoom();
+      //根据当前浏览器宽度与额定尺寸计算transform缩放值
       document.getElementById('app').style.transform = `scale(${document.documentElement.clientWidth / 1920})`;
+      //根据当前浏览器宽度与额定尺寸计算当前浏览器可观看尺寸高度
       document.getElementById('app').style.height = (window.innerHeight/(document.documentElement.clientWidth / 1920*100))*100+'px';
+      //当尺寸改变后从新计算
       window.onresize = () => {
         return (() => {
           document.getElementById('app').style.transform = `scale(${document.documentElement.clientWidth / 1920})`;
           document.getElementById('app').style.height = (window.innerHeight/(document.documentElement.clientWidth / 1920*100))*100+'px';
+
         })();
       };
     },
     methods:{
-      insertCSS (cssStyle) {
-        var style = document.createElement("style");
-        var theHead = document.head || document.getElementsByTagName('head')[0];
-        style.type = "text/css"; //IE需要设置
-        if (style.styleSheet) { //IE
-          var ieInsertCSS = function() {
-            try {
-              style.styleSheet.cssText = cssStyle;
-            } catch (e) {}
-          };
-          //若当前styleSheet不能使用,则放到异步中
-          if (style.styleSheet.disable) {
-            setTimeout(ieInsertCSS, 10);
-          } else {
-            ieInsertCSS();
+      banZoom(){
+        // 禁止通过 ctrl + +/- 和  ctrl + 滚轮 对页面进行缩放
+        document.addEventListener('keydown', function (event) {
+          if ((event.ctrlKey === true || event.metaKey === true) &&
+            (event.which === 61 || event.which === 107 ||
+              event.which === 173 || event.which === 109 ||
+              event.which === 187 || event.which === 189)) {
+            event.preventDefault()
           }
-        } else { //W3c浏览器
-          style.appendChild(document.createTextNode(cssStyle));
-          theHead.appendChild(style);
-        }
-      }
+        }, false)
+        // Chrome IE 360
+        window.addEventListener('mousewheel', function (event) {
+          if (event.ctrlKey === true || event.metaKey) {
+            event.preventDefault()
+          }
+        }, {
+          passive: false
+        })
+        // firefox
+        window.addEventListener('DOMMouseScroll', function (event) {
+          if (event.ctrlKey === true || event.metaKey) {
+            event.preventDefault()
+          }
+        }, {
+          passive: false
+        })
+      },
     }
   }
 </script>

+ 2 - 1
src/assets/styles/ZDelement.scss

@@ -265,13 +265,14 @@ background: rgba(255,255,255,0);
 .el-switch.is-disabled .el-switch__core, .el-switch.is-disabled .el-switch__label{
   cursor: pointer!important;
 }
-/*============================表格无数据样式*/
+/*============================表格缺省样式*/
 .el-table__empty-text{
   color:rgba(0,0,0,0);
   width:100%;
   height:100%;
   background: url("../ZDimages/null-data-1.png") no-repeat 50% 50%;
 }
+/*============================小表格缺省样式*/
 .el-table-min-img-box{
   .el-table__empty-text{
     font-size:0;

+ 2 - 2
src/components/backAnimation/backAnimation.vue

@@ -35,8 +35,8 @@
     overflow: hidden;
   }
   .background {
-    width: 100vw;
-    height: 100vh;
+    width: 100%;
+    height: 100%;
     /*background: #3E1E68;*/
     /*backAnimation:#abe0bd;*/
     /*backAnimation:#b78da2;*/

+ 2 - 1
src/layout/components/Navbar.vue

@@ -4,7 +4,7 @@
     <div class="left-logo-box">
       <!--<img src="@/assets/ZDimages/icon_logo.png">-->
       <img :src="circularLogo">
-      <p>实验室安全智能监测与控制系统</p>
+      <p>{{VUE_APP_TITLE}}</p>
       <!--<p>危化品智能存储管理系统</p>-->
     </div>
     <!--<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>-->
@@ -77,6 +77,7 @@ export default {
   },
   data(){
     return{
+      VUE_APP_TITLE:process.env.VUE_APP_TITLE,
       circularLogo:localStorage.getItem('circularLogo'),
       userType:localStorage.getItem('userType'),
       initPage:localStorage.getItem('initPage'),

+ 3 - 3
src/layout/index.vue

@@ -13,9 +13,9 @@
           </div>
         </transition>
         <app-main />
-        <right-panel>
-          <settings />
-        </right-panel>
+        <!--<right-panel>-->
+          <!--<settings />-->
+        <!--</right-panel>-->
       </div>
     </div>
   </div>

+ 0 - 57
src/utils/devicePixelRatio.js

@@ -1,57 +0,0 @@
-class DevicePixelRatio {
-  constructor() {
-    // this.flag = false;
-  }
-  // 获取系统类型
-  _getSystem() {
-    // let flag = false;
-    var agent = navigator.userAgent.toLowerCase();
-    //		var isMac = /macintosh|mac os x/i.test(navigator.userAgent);
-    //		if(isMac) {
-    //			return false;
-    //		}
-    // 现只针对windows处理,其它系统暂无该情况,如有,继续在此添加
-    if (agent.indexOf('windows') >= 0) {
-      return true;
-    }
-  }
-  // 获取页面缩放比例
-  //	_getDevicePixelRatio() {
-  //		let t = this;
-  //	}
-  // 监听方法兼容写法
-  _addHandler(element, type, handler) {
-    if (element.addEventListener) {
-      element.addEventListener(type, handler, false);
-    } else if (element.attachEvent) {
-      element.attachEvent('on' + type, handler);
-    } else {
-      element['on' + type] = handler;
-    }
-  }
-  // 校正浏览器缩放比例
-  _correct() {
-    let t = this;
-    // 页面devicePixelRatio(设备像素比例)变化后,计算页面body标签zoom修改其大小,来抵消devicePixelRatio带来的变化。
-    document.getElementsByTagName('body')[0].style.zoom = 1 / window.devicePixelRatio;
-  }
-  // 监听页面缩放
-  _watch() {
-    let t = this;
-    t._addHandler(window, 'resize', function() { // 注意这个方法是解决全局有两个window.resize
-      // 重新校正
-      t._correct()
-    })
-  }
-  // 初始化页面比例
-  init() {
-    let t = this;
-    if (t._getSystem()) { // 判断设备,目前只在windows系统下校正浏览器缩放比例
-      // 初始化页面校正浏览器缩放比例
-      t._correct();
-      // 开启监听页面缩放
-      t._watch();
-    }
-  }
-}
-export default DevicePixelRatio;

+ 1 - 1
src/views/emergencyEvacuationBig.vue

@@ -223,7 +223,7 @@
             if (res.data.labHardwareVOList){
               for(let i=0;i<res.data.labHardwareVOList.length;i++){
                 if(res.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'VIDEO_MONITOR'){
-                  videoList.push(res.data.labHardwareVOList[i].hardwareNUM);
+                  videoList.unshift(res.data.labHardwareVOList[i].hardwareNUM);
                 }
               }
             }

+ 1 - 1
src/views/emergencyEvacuationBigOne.vue

@@ -225,7 +225,7 @@
             if (res.data.labHardwareVOList){
               for(let i=0;i<res.data.labHardwareVOList.length;i++){
                 if(res.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'VIDEO_MONITOR'){
-                  videoList.push(res.data.labHardwareVOList[i].hardwareNUM);
+                  videoList.unshift(res.data.labHardwareVOList[i].hardwareNUM);
                 }
               }
             }

+ 1 - 0
src/views/home.vue

@@ -451,6 +451,7 @@
     .max-big-home-box{
       position: relative;
       flex:1;
+      overflow: hidden;
       .max-home-button-box{
         /*width:1462px;*/
         width:1300px;

+ 2 - 1
src/views/homeNavbar.vue

@@ -3,7 +3,7 @@
     <div class="left-logo-box">
       <!--<img src="@/assets/ZDimages/icon_logo.png">-->
       <img :src="circularLogo">
-      <p>实验室安全智能监测与控制系统</p>
+      <p>{{VUE_APP_TITLE}}</p>
       <!--<p>危化品智能存储管理系统</p>-->
     </div>
     <div class="nav-icon-max-box">
@@ -51,6 +51,7 @@ export default {
   },
   data(){
     return{
+      VUE_APP_TITLE:process.env.VUE_APP_TITLE,
       circularLogo:localStorage.getItem('circularLogo'),
       userType:localStorage.getItem('userType'),
       routeData:{}

+ 160 - 3
vue.config.js

@@ -97,13 +97,170 @@ module.exports = {
                   priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
                   test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
                 },
+                echarts: {
+                  name: 'chunk-echarts',
+                  priority: 20,
+                  test: /[\\/]node_modules[\\/]_?echarts(.*)/
+                },
+                flv: {
+                  name: 'chunk-flv',
+                  priority: 20,
+                  test: /[\\/]node_modules[\\/]_?flv(.*)/
+                },
+                jsBeautify: {
+                  name: 'chunk-vue-js-beautify',
+                  priority: 20,
+                  test: /[\\/]node_modules[\\/]_?js-beautify(.*)/
+                },
+                jsencrypt: {
+                  name: 'chunk-vue-jsencrypt',
+                  priority: 20,
+                  test: /[\\/]node_modules[\\/]_?jsencrypt(.*)/
+                },
                 commons: {
                   name: 'chunk-commons',
                   test: resolve('src/components'), // can customize your rules
-                  minChunks: 3, //  minimum common number
-                  priority: 5,
+                  priority: 0,
+                  minSize: 0,
+                  minChunks: 1,
+                  enforce:true,
+                  reuseExistingChunk: true
+                },
+                comprehensive: {
+                  name: 'chunk-comprehensive',
+                  test: resolve('src/views/comprehensive'), // can customize your rules
+                  priority: 0,
+                  minSize: 0,
+                  minChunks: 1,
+                  enforce:true,
+                  reuseExistingChunk: true
+                },
+                creditViolation: {
+                  name: 'chunk-creditViolation',
+                  test: resolve('src/views/creditViolation'), // can customize your rules
+                  priority: 0,
+                  minSize: 0,
+                  minChunks: 1,
+                  enforce:true,
+                  reuseExistingChunk: true
+                },
+                dashboard: {
+                  name: 'chunk-dashboard',
+                  test: resolve('src/views/dashboard'), // can customize your rules
+                  priority: 0,
+                  minSize: 0,
+                  minChunks: 1,
+                  enforce:true,
+                  reuseExistingChunk: true
+                },
+                emergencyManagement: {
+                  name: 'chunk-emergencyManagement',
+                  test: resolve('src/views/emergencyManagement'), // can customize your rules
+                  priority: 0,
+                  minSize: 0,
+                  minChunks: 1,
+                  enforce:true,
+                  reuseExistingChunk: true
+                },
+                gasManage3_0: {
+                  name: 'chunk-gasManage3_0',
+                  test: resolve('src/views/gasManage3_0'), // can customize your rules
+                  priority: 0,
+                  minSize: 0,
+                  minChunks: 1,
+                  enforce:true,
+                  reuseExistingChunk: true
+                },
+                gasManage_syd: {
+                  name: 'chunk-gasManage_syd',
+                  test: resolve('src/views/gasManage_syd'), // can customize your rules
+                  priority: 0,
+                  minSize: 0,
+                  minChunks: 1,
+                  enforce:true,
+                  reuseExistingChunk: true
+                },
+                hazardManagement: {
+                  name: 'chunk-hazardManagement',
+                  test: resolve('src/views/hazardManagement'), // can customize your rules
+                  priority: 0,
+                  minSize: 0,
+                  minChunks: 1,
+                  enforce:true,
                   reuseExistingChunk: true
-                }
+                },
+                hierarchicalControl: {
+                  name: 'chunk-hierarchicalControl',
+                  test: resolve('src/views/hierarchicalControl'), // can customize your rules
+                  priority: 0,
+                  minSize: 0,
+                  minChunks: 1,
+                  enforce:true,
+                  reuseExistingChunk: true
+                },
+                medicUniversity_3_1: {
+                  name: 'chunk-medicUniversity-3_1',
+                  test: resolve('src/views/medicUniversity-3_1'), // can customize your rules
+                  priority: 0,
+                  minSize: 0,
+                  minChunks: 1,
+                  enforce:true,
+                  reuseExistingChunk: true
+                },
+                mine: {
+                  name: 'chunk-mine',
+                  test: resolve('src/views/mine'), // can customize your rules
+                  priority: 0,
+                  minSize: 0,
+                  minChunks: 1,
+                  enforce:true,
+                  reuseExistingChunk: true
+                },
+                safetyEducationExam: {
+                  name: 'chunk-safetyEducationExam',
+                  test: resolve('src/views/safetyEducationExam'), // can customize your rules
+                  priority: 0,
+                  minSize: 0,
+                  minChunks: 1,
+                  enforce:true,
+                  reuseExistingChunk: true
+                },
+                secureAccess: {
+                  name: 'chunk-secureAccess',
+                  test: resolve('src/views/secureAccess'), // can customize your rules
+                  priority: 0,
+                  minSize: 0,
+                  minChunks: 1,
+                  enforce:true,
+                  reuseExistingChunk: true
+                },
+                securityCheck: {
+                  name: 'chunk-securityCheck',
+                  test: resolve('src/views/securityCheck'), // can customize your rules
+                  priority: 0,
+                  minSize: 0,
+                  minChunks: 1,
+                  enforce:true,
+                  reuseExistingChunk: true
+                },
+                studentViews: {
+                  name: 'chunk-studentViews',
+                  test: resolve('src/views/studentViews'), // can customize your rules
+                  priority: 0,
+                  minSize: 0,
+                  minChunks: 1,
+                  enforce:true,
+                  reuseExistingChunk: true
+                },
+                system: {
+                  name: 'chunk-system',
+                  test: resolve('src/views/system'), // can customize your rules
+                  priority: 0,
+                  minSize: 0,
+                  minChunks: 1,
+                  enforce:true,
+                  reuseExistingChunk: true
+                },
               }
             })
           config.optimization.runtimeChunk('single'),