dedsudiyu 2 ヶ月 前
コミット
8005e3b96b
共有5 個のファイルを変更した97 個の追加278 個の削除を含む
  1. 0 30
      src/App.vue
  2. 10 10
      src/utils/mapList.js
  3. 86 73
      src/views/components/mapComponent.vue
  4. 1 1
      src/views/home.vue
  5. 0 164
      src/views/ssoLogin.vue

+ 0 - 30
src/App.vue

@@ -68,36 +68,6 @@
           passive: false
         })
       },
-      //更新检查
-      inspectRenewal(){
-        const self = this;
-        const intervalTime = 300000;
-        checkForUpdates();
-        self.timer = window.setInterval(checkForUpdates, intervalTime);
-        async function checkForUpdates() {
-          let xhr = new XMLHttpRequest();
-          xhr.open('GET', 'version.txt', true); // 替换为你要读取的txt文件路径
-          xhr.onreadystatechange = function() {
-            if (xhr.readyState === 4 && xhr.status === 200) {
-              let version = xhr.responseText;
-              if (version !== process.env.VUE_APP_RENEWAL_ENCODING){
-                MessageBox.confirm('发现新版本,是否立即刷新页面?', '系统提示', {
-                    confirmButtonText: '确定',
-                    showCancelButton:true,
-                    closeOnClickModal:false,
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                  }
-                ).then(() => {
-                  clearInterval(self.timer);
-                  location.reload(true);
-                }).catch(() => {});
-              }
-            }
-          };
-          xhr.send();
-        }
-      },
     },
     beforeDestroy() {
       //清除定时器

+ 10 - 10
src/utils/mapList.js

@@ -2,7 +2,7 @@ let mapList = [
   //1-3区mapComponent-map-1-3
   //1区
   {
-    floorId:'1',
+    floorId:process.env.VUE_APP_FLOOR_ID_1,
     floorName:'1区',
     list:[
       {
@@ -142,7 +142,7 @@ let mapList = [
   },
   //2区
   {
-    floorId:'2',
+    floorId:process.env.VUE_APP_FLOOR_ID_2,
     floorName:'2区',
     list:[
       {
@@ -282,7 +282,7 @@ let mapList = [
   },
   //3区
   {
-    floorId:'3',
+    floorId:process.env.VUE_APP_FLOOR_ID_3,
     floorName:'3区',
     list:[
       {
@@ -423,7 +423,7 @@ let mapList = [
   //4-5区mapComponent-map-4-5
   //4区
   {
-    floorId:'4',
+    floorId:process.env.VUE_APP_FLOOR_ID_4,
     floorName:'4区',
     list:[
       {
@@ -556,7 +556,7 @@ let mapList = [
   },
   //5区
   {
-    floorId:'5',
+    floorId:process.env.VUE_APP_FLOOR_ID_5,
     floorName:'5区',
     list:[
       {
@@ -690,7 +690,7 @@ let mapList = [
   //6-7区mapComponent-map-6-7
   //6区
   {
-    floorId:'6',
+    floorId:process.env.VUE_APP_FLOOR_ID_6,
     floorName:'6区',
     list:[
       {
@@ -809,7 +809,7 @@ let mapList = [
   },
   //7区
   {
-    floorId:'7',
+    floorId:process.env.VUE_APP_FLOOR_ID_7,
     floorName:'7区',
     list:[
       {
@@ -929,7 +929,7 @@ let mapList = [
   //8-10区mapComponent-map-8-10
   //8区
   {
-    floorId:'8',
+    floorId:process.env.VUE_APP_FLOOR_ID_8,
     floorName:'8区',
     list:[
       {
@@ -1062,7 +1062,7 @@ let mapList = [
   },
   //9区
   {
-    floorId:'9',
+    floorId:process.env.VUE_APP_FLOOR_ID_9,
     floorName:'9区',
     list:[
       {
@@ -1195,7 +1195,7 @@ let mapList = [
   },
   //10区
   {
-    floorId:'10',
+    floorId:process.env.VUE_APP_FLOOR_ID_10,
     floorName:'10区',
     list:[
       {

+ 86 - 73
src/views/components/mapComponent.vue

@@ -1,10 +1,10 @@
 <!--楼层布局-->
 <template>
-  <div :class="mapData.floorId == '1'||mapData.floorId == '2'||mapData.floorId == '3'?'mapComponent-map-1-3':(
-        mapData.floorId == '4'||mapData.floorId == '5'?'mapComponent-map-4-5':(
-        mapData.floorId == '6'||mapData.floorId == '7'?'mapComponent-map-6-7':(
-        mapData.floorId == '8'||mapData.floorId == '9'||mapData.floorId == '10'?'mapComponent-map-8-10':'')))"
-        class="mapComponent">
+  <div :class="getFloorId(mapData.floorId)==1?'mapComponent-map-1-3':(
+        getFloorId(mapData.floorId)==2?'mapComponent-map-4-5':(
+        getFloorId(mapData.floorId)==3?'mapComponent-map-6-7':(
+        getFloorId(mapData.floorId)==4?'mapComponent-map-8-10':'')))"
+       class="mapComponent">
     <div class="map-for-room-box"
          :class="checkIndex==index&&item.status==1?'check-idle-color':(
          checkIndex!=index&&item.status==1?'idle-color':(
@@ -35,126 +35,139 @@
   </div>
 </template>
 <script>
-  import { getFloorMap } from "@/utils/mapList";
+  import { getFloorMap } from '@/utils/mapList'
+
   export default {
     name: 'mapComponent',
-    data () {
+    data() {
       return {
-        mapData:{},
-        checkIndex:0,
+        mapData: {},
+        checkIndex: 0
       }
     },
-    created(){
+    created() {
 
     },
-    mounted(){
-      this.initialize();
+    mounted() {
+      this.initialize()
     },
-    methods:{
-      initialize(){
+    methods: {
+      initialize() {
         let text = window.location.href
-        let urlList = text.split("?")[1].split("&");
-        let codeData = {};
+        let urlList = text.split('?')[1].split('&')
+        let codeData = {}
         urlList.forEach((item) => {
-          codeData[item.split("=")[0]] = item.split("=")[1];
+          codeData[item.split('=')[0]] = item.split('=')[1]
         })
-        let list = getFloorMap(codeData.floorId);
-        for(let i=0;i<list.list.length;i++){
-          list.list[i].adminName = '人员'+i;
-          list.list[i].buildName = '学院'+i;
-          list.list[i].status = 1;
+        let list = getFloorMap(codeData.floorId)
+        for (let i = 0; i < list.list.length; i++) {
+          list.list[i].adminName = '人员' + i
+          list.list[i].buildName = '学院' + i
+          list.list[i].status = 1
         }
-        this.$set(this,'mapData',list);
+        this.$set(this, 'mapData', list)
       },
-    },
+      //匹配楼层ID
+      getFloorId(floorId) {
+        if (floorId == process.env.VUE_APP_FLOOR_ID_1 || floorId == process.env.VUE_APP_FLOOR_ID_2 || floorId == process.env.VUE_APP_FLOOR_ID_3) {
+          return 1
+        } else if (floorId == process.env.VUE_APP_FLOOR_ID_4 || floorId == process.env.VUE_APP_FLOOR_ID_5) {
+          return 2
+        } else if (floorId == process.env.VUE_APP_FLOOR_ID_6 || floorId == process.env.VUE_APP_FLOOR_ID_7) {
+          return 3
+        } else if (floorId == process.env.VUE_APP_FLOOR_ID_8 || floorId == process.env.VUE_APP_FLOOR_ID_9 || floorId == process.env.VUE_APP_FLOOR_ID_10) {
+          return 4
+        }
+      }
+    }
   }
 </script>
 <style scoped lang="scss">
-  .mapComponent{
-    width:1310px;
-    height:439px;
-    margin:10px 0 0 30px;
+  .mapComponent {
+    width: 1310px;
+    height: 439px;
+    margin: 10px 0 0 30px;
     position: relative;
-    border:2px solid #fff;
-    .map-for-room-box{
+    border: 2px solid #fff;
+    .map-for-room-box {
       position: relative;
-      z-index:2;
+      z-index: 2;
       display: inline-block;
-      .map-room-box{
+      .map-room-box {
         position: absolute;
-        height:44px;
+        height: 44px;
         display: flex;
-        img{
-          width:24px;
-          height:24px;
-          margin:10px 4px 0 10px;
+        img {
+          width: 24px;
+          height: 24px;
+          margin: 10px 4px 0 10px;
         }
-        p{
-          height:44px;
-          line-height:44px;
-          font-size:24px;
-          color:#fff;
+        p {
+          height: 44px;
+          line-height: 44px;
+          font-size: 24px;
+          color: #fff;
         }
       }
-      .map-build-user-box{
-        height:48px;
+      .map-build-user-box {
+        height: 48px;
         position: absolute;
-        div{
+        div {
           display: flex;
-          img{
-            width:18px;
-            height:18px;
-            margin:3px 4px 0 10px;
+          img {
+            width: 18px;
+            height: 18px;
+            margin: 3px 4px 0 10px;
           }
-          p{
-            height:24px;
-            line-height:24px;
-            font-size:14px;
-            color:#fff;
+          p {
+            height: 24px;
+            line-height: 24px;
+            font-size: 14px;
+            color: #fff;
           }
         }
       }
-      .door-img{
-        z-index:3;
+      .door-img {
+        z-index: 3;
         position: absolute;
-        width:25px;
-        height:24px;
+        width: 25px;
+        height: 24px;
       }
     }
-    .corridor-background{
-      z-index:1;
+    .corridor-background {
+      z-index: 1;
       position: absolute;
       text-align: center;
-      left:0;
-      width:1306px;
-      color:#009B03;
-      height:91px;
-      line-height:91px;
-      font-size:30px;
-      background: rgba(0,155,3,0.3);
+      left: 0;
+      width: 1306px;
+      color: #009B03;
+      height: 91px;
+      line-height: 91px;
+      font-size: 30px;
+      background: rgba(0, 155, 3, 0.3);
     }
     //空闲
-    .idle-color{
+    .idle-color {
       background-color: #173618;
     }
     //选中空闲
-    .check-idle-color{
+    .check-idle-color {
       background-color: #009b03;
     }
     //使用
-    .use-color{
+    .use-color {
       background-color: #174a48;
     }
     //选中使用
-    .check-use-color{
+    .check-use-color {
       background-color: #00fff6;
     }
     //维护
-    .maintenance-color{
+    .maintenance-color {
       background-color: #614316;
     }
     //选中维护
-    .check-maintenance-color{
+    .check-maintenance-color {
       background-color: #ff9c06;
     }
   }

+ 1 - 1
src/views/home.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="home">
-    <div class="home-page" v-if="showPage" @click="chemicalStockHazardClassStatistics()">
+    <div class="home-page" v-if="showPage">
       <headComponent></headComponent>
       <div class="top-max-big-box">
         <videoComponent></videoComponent>

+ 0 - 164
src/views/ssoLogin.vue

@@ -1,164 +0,0 @@
-<!-- 认证平台登录 -->
-<template>
-  <div class="sso-login-page">
-  </div>
-</template>
-
-<script>
-  //                      V3
-  import { encrypt, decrypt } from '@/utils/jsencrypt'
-  import { Encrypt,Decrypt} from '@/utils/secret'
-  import store from '@/store'
-  import { login,authInfo,getCodeImg,getConfigByType,configInfo} from "@/api/login";
-  import { setToken } from '@/utils/auth'
-
-  export default {
-    name: 'Login',
-    data() {
-      return {
-        redirect: undefined,
-        rectangleLogo: localStorage.getItem('rectangleLogo')
-      }
-    },
-    watch: {
-      $route: {
-        handler: function(route) {
-          this.redirect = route.query && route.query.redirect
-        },
-        immediate: true
-      }
-    },
-    created() {
-      localStorage.setItem('entranceJumpType','SCHOOL');
-      let url = window.location.href
-      if (url.indexOf('token') != -1) {
-        // console.log('找到了====>token')
-        setToken(url.split('=')[1])
-        this.getInfo();
-      } else if (url.indexOf('code') != -1) {
-        // console.log('找到了====>code')
-        //异常状态处理
-        if(url.split('=')[1] == '10100'){
-          //10100 用户信息不存在
-          this.$alert('当前用户不存在,请联系管理员!', '提示', {
-            confirmButtonText: '确定',
-            callback: action => {
-              store.dispatch('LogOut').then(() => {
-                window.location.href = process.env.VUE_APP_OUT_URL;
-              })
-            }
-          });
-        }else if(url.split('=')[1] == '500'){
-          //用户服务异常
-          this.$alert('服务异常,请稍候再试!', '提示', {
-            confirmButtonText: '确定',
-            callback: action => {
-              store.dispatch('LogOut').then(() => {
-                window.location.href = process.env.VUE_APP_OUT_URL;
-              })
-            }
-          });
-        }
-      } else {
-        window.location.href = process.env.VUE_APP_OUT_URL;
-      }
-      localStorage.setItem('windowHref', window.location.href)
-    },
-    mounted() {
-
-    },
-    methods: {
-      getInfo() {
-        //等待配置与字段获取到后跳转
-        Promise.all([
-          this.configInfo(),
-          this.getExploitConfig(),
-          this.fullScreen()
-        ]).then((result)=>{
-          this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
-        }).catch((error) => {})
-      },
-      //获取公共配置数据
-      configInfo(){
-        let self = this;
-        configInfo({ type: '1,2,3' }).then(response => {
-          let list = JSON.parse(response.data)
-          let newData = {};
-          list.forEach((item) => {
-            let obj = JSON.parse(item.configValue)
-            newData = {...newData,...obj}
-          })
-          setTimeout(function(){
-            self.$set(self,'rectangleLogo',newData.rectangleLogo);
-            localStorage.setItem('schoolName',newData.schoolName)
-            localStorage.setItem('circularLogo',newData.circularLogo)
-            localStorage.setItem('rectangleLogo',newData.rectangleLogo)
-            localStorage.setItem('videoCover',newData.videoCover)
-            localStorage.setItem('setSmartAlarmType',newData.smartLock)
-          },200);
-        });
-      },
-      //获取开发配置
-      getExploitConfig(){
-        getConfigByType({ category: 2, configType: 5 }).then(response => {
-          let obj = JSON.parse(response.data.configValue);
-          //判定http或者https
-          let urlText = window.location.href.split('://')[0]+'://';
-          let outerNet = window.location.href.indexOf(obj.ipIdentify) == -1//true外网 false 内网
-          if(outerNet){//外网
-            //MQTT地址
-            localStorage.setItem('mqttUrl','wss://'+Decrypt(obj.mqttExtranetUrl))
-            //MQTT账号
-            localStorage.setItem('mqttUser',Decrypt(obj.mqttExtranetUser))
-            //MQTT密码
-            localStorage.setItem('mqttPassword',Decrypt(obj.mqttExtranetPassword))
-            //PC端回跳地址
-            localStorage.setItem('pcUrl',urlText+obj.pcExtranetUrl)
-            localStorage.setItem('fileBrowseEnvironment',urlText+Decrypt(obj.fileBrowseEnvironmentExtranet))
-            localStorage.setItem('fileBrowseEnvironmentExtranet',urlText+Decrypt(obj.fileBrowseEnvironmentExtranet))
-          }else{
-            //MQTT地址
-            localStorage.setItem('mqttUrl','ws://'+Decrypt(obj.mqttIntranetUrl))
-            //MQTT账号
-            localStorage.setItem('mqttUser',Decrypt(obj.mqttIntranetUser))
-            //MQTT密码
-            localStorage.setItem('mqttPassword',Decrypt(obj.mqttIntranetPassword))
-            //PC端回跳地址
-            localStorage.setItem('pcUrl',urlText+obj.pcIntranetUrl)
-            localStorage.setItem('fileBrowseEnvironment',urlText+Decrypt(obj.fileBrowseEnvironment))
-            localStorage.setItem('fileBrowseEnvironmentExtranet',urlText+Decrypt(obj.fileBrowseEnvironmentExtranet))
-          }
-        });
-      },
-      //全屏
-      fullScreen() {
-        var element = document.documentElement;
-        if (element.requestFullscreen) {
-          element.requestFullscreen();
-        } else if (element.msRequestFullscreen) {
-          element.msRequestFullscreen();
-        } else if (element.mozRequestFullScreen) {
-          element.mozRequestFullScreen();
-        } else if (element.webkitRequestFullscreen) {
-          element.webkitRequestFullscreen();
-        }
-      },
-    }
-  }
-</script>
-
-<style rel="stylesheet/scss" lang="scss">
-  .sso-login-page {
-    height: 100%;
-    width: 100%;
-    background-image: url("../assets/ZDimages/basicsModules/icon_dl_bbg.png");
-    background-repeat: no-repeat;
-    background-size: cover;
-    -webkit-background-size: cover;
-    -o-background-size: cover;
-    position: relative;
-    * {
-      margin: 0;
-    }
-  }
-</style>