dedsudiyu hai 1 mes
pai
achega
0d0cf6af4d

BIN=BIN
src/assets/ZDimages/icon_zyssgl_bg@1x.png


BIN=BIN
src/assets/ZDimages/icon_zyssgl_ssrs@1x.png


BIN=BIN
src/assets/ZDimages/icon_zyssgl_sszs@1x.png


+ 1 - 4
src/utils/auth.js

@@ -32,11 +32,8 @@ export function removeExpiresIn() {
 }
 
 export function autoLogin() {
-  deleteCookie('JSESSIONID');
-  deleteCookie('rememberMe');
   login().then(res => {
     setToken(res.data.token)
-    window.location.reload();
   });
 }
 
@@ -68,7 +65,7 @@ export function autoLoginYiLi() {
     deleteCookie('JSESSIONID');
     deleteCookie('rememberMe');
     setTokenYiLi(res.access_token);
-    window.location.reload();
+    // window.location.reload();
   });
 }
 export function deleteCookie(name) {

+ 7 - 2
src/utils/request.js

@@ -26,7 +26,7 @@ const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分
   baseURL: urlText+judgmentNetworkReturnAddress(),
   // 超时
-  timeout: 10000
+  timeout: 20000
 })
 // request拦截器
 service.interceptors.request.use(config => {
@@ -37,7 +37,6 @@ service.interceptors.request.use(config => {
   if (getToken() && !isToken) {
     config.headers['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
   }
-  config.credentials= 'omit';
   // get请求映射params参数
   if (config.method === 'get' && config.params) {
     let url = config.url + '?' + tansParams(config.params);
@@ -99,6 +98,12 @@ service.interceptors.response.use(res => {
     }
   },
   error => {
+    //临时方案-报错后直接刷新页面
+    if(error.response){
+      if(error.response.config.url == '/auth/screenLogin' || error.response.config.url == '/system/config/info/getConfigByType'){
+        window.location.reload();
+      }
+    }
     // 弹层相关
     loadingCount --;
     if(loadingCount===0){

+ 1 - 9
src/utils/requestYiLi.js

@@ -30,7 +30,7 @@ const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分
   baseURL: urlText+judgmentNetworkReturnAddressYiLi(),
   // 超时
-  timeout: 10000
+  timeout: 20000
 })
 // request拦截器
 service.interceptors.request.use(config => {
@@ -38,14 +38,6 @@ service.interceptors.request.use(config => {
   loadingInstance = Loading.service(options)
   // 是否需要设置 token
   const isToken = (config.headers || {}).isToken === false
-  // if(config.url == '/oauth/token?grant_type=client_credentials'){
-  //   config.headers['Authorization'] = 'Basic '+encoded
-  // }else{
-  //   if (getTokenYiLi() && !isToken) {
-  //     config.headers['Authorization'] = 'Bearer '+getTokenYiLi()
-  //   }
-  // }
-  // config.credentials= 'omit';
   config.headers['appId'] = '1962714012644597761';
   config.headers['secret'] = 'c2789f8a360a4709a054a2e9f102d1b4';
   // get请求映射params参数

+ 84 - 2
src/views/components/overviewComponent.vue

@@ -2,7 +2,23 @@
 <template>
   <div class="overviewComponent">
     <p class="title-p">资源设施概览</p>
-    <div class="for-max-big-box back-1" style="margin-top:98px;">
+    <div class="num-max-big-box">
+      <div class="num-big-box left-num-box">
+        <img src="@/assets/ZDimages/icon_zyssgl_ssrs@1x.png">
+        <div>
+          <p>实时人数</p>
+          <p><span>{{userNum}}</span><span>人</span></p>
+        </div>
+      </div>
+      <div class="num-big-box right-num-box">
+        <img src="@/assets/ZDimages/icon_zyssgl_sszs@1x.png">
+        <div>
+          <p>设施总数</p>
+          <p><span>{{facilityNum}}</span><span>间</span></p>
+        </div>
+      </div>
+    </div>
+    <div class="for-max-big-box back-1">
       <img src="@/assets/ZDimages/icon_kxs@1x.png">
       <div>
         <p>空闲</p>
@@ -34,6 +50,7 @@
 </template>
 <script>
   import { dashboardsFacilitiesStatusOverview } from "@/api/yiLi";
+  import { getFloorMap } from '@/utils/mapList'
   export default {
     name: 'overviewComponent',
     data () {
@@ -43,6 +60,8 @@
         data3:'0',
         overviewSwitchTime:600000,
         overviewTimer:null,
+        userNum:0,
+        facilityNum:0,
       }
     },
     created(){
@@ -63,15 +82,20 @@
           codeData[item.split('=')[0]] = item.split('=')[1]
         })
         dashboardsFacilitiesStatusOverview({floorid:codeData.floorId}).then(res => {
+          let maxNum = 0;
           for(let i=0;i<res.data.types.length;i++){
             if( res.data.types[i].type == '空闲'){
+              maxNum = self.accAdd(maxNum,res.data.types[i].count);
               self.$set(self,'data1',res.data.types[i].count);
             }else if( res.data.types[i].type == '租用'){
+              maxNum = self.accAdd(maxNum,res.data.types[i].count);
               self.$set(self,'data2',res.data.types[i].count);
             }else if( res.data.types[i].type == '维修中'){
+              maxNum = self.accAdd(maxNum,res.data.types[i].count);
               self.$set(self,'data3',res.data.types[i].count);
             }
           }
+          this.$set(this,'facilityNum',maxNum);
         });
       },
       //设施状态概览定时器
@@ -114,10 +138,68 @@
       font-family: Source Han Sans, Source Han Sans;
       padding-left:24px;
     }
+    .num-max-big-box{
+      display: flex;
+      margin:63px 0 0;
+      .num-big-box{
+        width:171px;
+        height:66px;
+        background-image: url("../../assets/ZDimages/icon_zyssgl_bg@1x.png");
+        background-size: 100% 100%;
+        display: flex;
+        div{
+          width:90px;
+          p:nth-child(1){
+            margin-top:10px;
+            height:16px;
+            line-height:16px;
+            font-size: 16px;
+          }
+          p:nth-child(2){
+            margin-top:5px;
+            height:30px;
+            line-height:30px;
+            display: flex;
+            span:nth-child(1){
+              display: inline-block;
+              width:40px;
+              text-align: right;
+              line-height:30px;
+              font-size: 26px;
+              font-weight: bold;
+              background: -webkit-linear-gradient(#FFFFFF, #0183FA);
+              -webkit-background-clip: text;
+              color: transparent;
+              margin-right:5px;
+            }
+            span:nth-child(2){
+              display: inline-block;
+              font-size: 16px;
+              line-height:33px;
+            }
+          }
+        }
+      }
+      .left-num-box{
+        margin:0 20px 0 20px;
+        img{
+          width:36px;
+          height:32px;
+          margin:17px 24px 0 20px;
+        }
+      }
+      .right-num-box{
+        img{
+          width:33px;
+          height:32px;
+          margin:17px 24px 0 20px;
+        }
+      }
+    }
     .for-max-big-box{
       width: 358px;
       height: 100px;
-      margin:0 20px 32px 20px;
+      margin:20px 20px 0 20px;
       display: flex;
       img{
         width:70px;

+ 68 - 55
src/views/components/usageRateComponent.vue

@@ -2,24 +2,25 @@
 <template>
   <div class="usageRateComponent">
     <p class="title-p">设施使用率排行</p>
-    <!--<dv-scroll-board :config="config" style="width:470px;height:435px" v-if="config.data[0]"/>-->
-    <div class="for-max-big-box">
-      <div class="for-title-box">
-        <p>设施房间</p>
-        <p>使用人次</p>
-        <p>使用率</p>
-      </div>
-      <div class="for-big-sl-box" id="scrollListBox">
-        <div class="for-big-box" v-for="(item,index) in maxList" :key="index">
-          <p :class="item.id=='0'?'one-p':(item.id=='1'?'tow-p':'none-p')"><span>{{item.id != '0' && item.id != '1'?item.id+1:''}}</span></p>
-          <p>{{item.name}}</p>
-          <p>{{item.num}}</p>
-          <p>{{item.value}}</p>
-        </div>
-      </div>
-    </div>
-    <!--<p class="position-null-p" v-if="!config.data[0]">暂无数据</p>-->
-    <p class="position-null-p" v-if="!maxList[0]">暂无数据</p>
+    <p class="back-null-p"></p>
+    <dv-scroll-board :config="config" style="width:470px;height:435px" v-if="config.data[0]"/>
+    <!--<div class="for-max-big-box">-->
+      <!--<div class="for-title-box">-->
+        <!--<p>设施房间</p>-->
+        <!--<p>使用人次</p>-->
+        <!--<p>使用率</p>-->
+      <!--</div>-->
+      <!--<div class="for-big-sl-box" id="scrollListBox">-->
+        <!--<div class="for-big-box" v-for="(item,index) in maxList" :key="index">-->
+          <!--<p :class="item.id=='0'?'one-p':(item.id=='1'?'tow-p':'none-p')"><span>{{item.id != '0' && item.id != '1'?item.id+1:''}}</span></p>-->
+          <!--<p>{{item.name}}</p>-->
+          <!--<p>{{item.num}}</p>-->
+          <!--<p>{{item.value}}</p>-->
+        <!--</div>-->
+      <!--</div>-->
+    <!--</div>-->
+    <p class="position-null-p" v-if="!config.data[0]">暂无数据</p>
+    <!--<p class="position-null-p" v-if="!maxList[0]">暂无数据</p>-->
     <img class="position-left-top" src="@/assets/ZDimages/img_min_icon.png">
     <img class="position-right-top" src="@/assets/ZDimages/img_min_icon.png">
     <img class="position-left-bottom" src="@/assets/ZDimages/img_min_icon.png">
@@ -34,12 +35,14 @@
     data() {
       return {
         config: {
-          rowNum: 7,
-          headerBGC: 'rgba(0,66,138,0.5)',
+          rowNum: 8,
+          // headerBGC: 'rgba(0,66,138,0.5)',
+          headerBGC: '#032D6A',
           oddRowBGC: 'rgba(0,66,138,0.0)',
           evenRowBGC: 'rgba(0,66,138,0.0)',
           header: ['', '设施房间', '使用人次', '使用率'],
-          carousel:'page',
+          hoverPause:false,
+          // carousel:'page',
           data: [
             // ['<span class="span_1"><span></span></span>','行1列1', '行1列2', '行1列3'],
             // ['<span class="span_2"><span></span></span>','行2列1', '行2列2', '行2列3'],
@@ -96,25 +99,10 @@
         this.$set(this.config,'data',[]);
         clearInterval(this.scrollInterval);
         dashboardsResearchUsage(this.roomNames).then(res => {
-          let list = [];
-          for (let i = 0; i < res.data.length; i++) {
-            let obj = {
-              id:i,
-              name: res.data[i].roomNumValue,
-              num: res.data[i].usageCount,
-              value: this.accMul(res.data[i].usageRate,100).toFixed(0)+'%'
-              // value: res.data[i].usageRate
-            }
-            list.push(obj)
-          }
-          this.$set(this,'maxList',JSON.parse(JSON.stringify(list)));
-          setTimeout(function() {
-            self.startScrolling()
-          },500)
-          // this.startTimer();
-          // let list = []
+          // let list = [];
           // for (let i = 0; i < res.data.length; i++) {
           //   let obj = {
+          //     id:i,
           //     name: res.data[i].roomNumValue,
           //     num: res.data[i].usageCount,
           //     value: this.accMul(res.data[i].usageRate,100).toFixed(0)+'%'
@@ -122,20 +110,36 @@
           //   }
           //   list.push(obj)
           // }
-          // // list = this.sortByPercentageDesc(list)
-          // let newList = [];
-          // for(let i=0;i<list.length;i++){
-          //   if(i==0){
-          //     newList.push(['<span class="span_1"><span></span></span>',list[i].name, list[i].num+'', list[i].value])
-          //   }else if(i==1){
-          //     newList.push(['<span class="span_2"><span></span></span>',list[i].name, list[i].num+'', list[i].value])
-          //   }else if(i==1){
-          //     newList.push(['<span class="span_3"><span></span></span>',list[i].name, list[i].num+'', list[i].value])
-          //   }else{
-          //     newList.push(['<span class="span_num"><span>'+(i+1)+'</span></span>',list[i].name, list[i].num+'', list[i].value])
-          //   }
-          // }
-          // this.$set(this.config,'data',newList)
+          // this.$set(this,'maxList',JSON.parse(JSON.stringify(list)));
+          // setTimeout(function() {
+          //   self.startScrolling()
+          // },500)
+
+          this.startTimer();
+          let list = []
+          for (let i = 0; i < res.data.length; i++) {
+            let obj = {
+              name: res.data[i].roomNumValue,
+              num: res.data[i].usageCount,
+              value: this.accMul(res.data[i].usageRate,100).toFixed(0)+'%'
+              // value: res.data[i].usageRate
+            }
+            list.push(obj)
+          }
+          // list = this.sortByPercentageDesc(list)
+          let newList = [];
+          for(let i=0;i<list.length;i++){
+            if(i==0){
+              newList.push(['<span class="span_1"><span></span></span>',list[i].name, list[i].num+'', list[i].value])
+            }else if(i==1){
+              newList.push(['<span class="span_2"><span></span></span>',list[i].name, list[i].num+'', list[i].value])
+            }else if(i==1){
+              newList.push(['<span class="span_3"><span></span></span>',list[i].name, list[i].num+'', list[i].value])
+            }else{
+              newList.push(['<span class="span_num"><span>'+(i+1)+'</span></span>',list[i].name, list[i].num+'', list[i].value])
+            }
+          }
+          this.$set(this.config,'data',newList)
         })
       },
 
@@ -306,6 +310,15 @@
       z-index: 1;
       transform: rotate(180deg);
     }
+    .back-null-p{
+      z-index: 1;
+      position: absolute;
+      top: 89px;
+      left: 30px;
+      height: 2px;
+      width: 470px;
+      background-color: #032D6A;
+    }
     ::v-deep .dv-scroll-board {
       margin: 54px 0 0 30px;
       .header {
@@ -323,9 +336,9 @@
         }
       }
       .row-item {
-        height: 50px !important;
-        line-height: 50px !important;
-        border-bottom: 1px dashed rgba(216, 216, 216, 0.1);
+        /*height: 50px !important;*/
+        /*line-height: 50px !important;*/
+        border-top: 1px dashed rgba(216, 216, 216, 0.1);
         .ceil {
           width: 137px !important;
         }