Sfoglia il codice sorgente

Merge branch 'master' of http://101.36.160.140:21044/csc/csc-szls-vue

GaoYuPeng 5 anni fa
parent
commit
0c08e71e55

+ 2 - 0
shanXiPlatform/src/layout/components/Sidebar/index.vue

@@ -94,10 +94,12 @@ export default {
94
 }
94
 }
95
 .el-submenu__title {
95
 .el-submenu__title {
96
   background-color: #037d41 !important;
96
   background-color: #037d41 !important;
97
+  font-size:16px !important;
97
 }
98
 }
98
 
99
 
99
 .el-menu-item {
100
 .el-menu-item {
100
   background: #037d41 !important;
101
   background: #037d41 !important;
102
+  font-size:16px !important;
101
 }
103
 }
102
 .el-submenu.is-active.is-opened .el-submenu__title {
104
 .el-submenu.is-active.is-opened .el-submenu__title {
103
   background: #006734 !important;
105
   background: #006734 !important;

+ 45 - 25
shanXiPlatform/src/utils/request.js

@@ -2,7 +2,8 @@ import axios from 'axios'
2
 import { MessageBox, Message } from 'element-ui'
2
 import { MessageBox, Message } from 'element-ui'
3
 import store from '@/store'
3
 import store from '@/store'
4
 import { getToken } from '@/utils/auth'
4
 import { getToken } from '@/utils/auth'
5
-import { closenewWebSocket,newWebSocket } from '@/api/sendMessageSocket'
5
+import { closenewWebSocket, newWebSocket } from '@/api/sendMessageSocket'
6
+
6
 
7
 
7
 // create an axios instance
8
 // create an axios instance
8
 const service = axios.create({
9
 const service = axios.create({
@@ -89,7 +90,7 @@ service.interceptors.response.use(
89
 
90
 
90
     // 走框架接口,会先在这里拿到服务器返回的数据,如果出现请求超时,或者token获取,或者一些公共错误,可以在这里判断拦截,然后在返回
91
     // 走框架接口,会先在这里拿到服务器返回的数据,如果出现请求超时,或者token获取,或者一些公共错误,可以在这里判断拦截,然后在返回
91
 
92
 
92
-  
93
+
93
 
94
 
94
     // if the custom code is not 20000, it is judged as an error.
95
     // if the custom code is not 20000, it is judged as an error.
95
     // if (res.code !== 20000) {
96
     // if (res.code !== 20000) {
@@ -99,18 +100,18 @@ service.interceptors.response.use(
99
     //     duration: 5 * 1000
100
     //     duration: 5 * 1000
100
     //   })
101
     //   })
101
 
102
 
102
-      // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
103
-      if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
104
-        // to re-login
105
-        MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {
106
-          confirmButtonText: 'Re-Login',
107
-          cancelButtonText: 'Cancel',
108
-          type: 'warning'
109
-        }).then(() => {
110
-          store.dispatch('user/resetToken').then(() => {
111
-            location.reload()
112
-          })
103
+    // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
104
+    if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
105
+      // to re-login
106
+      MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {
107
+        confirmButtonText: 'Re-Login',
108
+        cancelButtonText: 'Cancel',
109
+        type: 'warning'
110
+      }).then(() => {
111
+        store.dispatch('user/resetToken').then(() => {
112
+          location.reload()
113
         })
113
         })
114
+      })
114
       // }
115
       // }
115
       return Promise.reject(new Error(res.message || 'Error'))
116
       return Promise.reject(new Error(res.message || 'Error'))
116
     } else {
117
     } else {
@@ -119,7 +120,7 @@ service.interceptors.response.use(
119
   },
120
   },
120
   error => {
121
   error => {
121
     // console.log(JSON.stringify(error), "mmmmm")
122
     // console.log(JSON.stringify(error), "mmmmm")
122
-  
123
+
123
     // Message({
124
     // Message({
124
     //   message: error.message,
125
     //   message: error.message,
125
     //   type: 'error',
126
     //   type: 'error',
@@ -127,21 +128,40 @@ service.interceptors.response.use(
127
     // })
128
     // })
128
     // return Promise.reject(error)
129
     // return Promise.reject(error)
129
 
130
 
130
-    if (error.response.status == 401&& store.state.isAuthority) {
131
+    // if (error.response.status == 401&& store.state.isAuthority) {
132
+    //   store.state.isAuthority = false;
133
+    //   MessageBox.confirm('身份失效,请重新登录', '确认退出', {
134
+    //     confirmButtonText: '确定',
135
+    //     cancelButtonText: '取消',
136
+    //     type: 'warning'
137
+    //   }).then(() => {
138
+    //     store.dispatch('user/resetToken').then(() => {
139
+    //       location.reload()
140
+    //     })
141
+    //     closenewWebSocket(JSON.parse(getUser()).uid)
142
+    //   })
143
+    // }
144
+
145
+    if (error.response.status == 401 && store.state.isAuthority) {
146
+     
131
       store.state.isAuthority = false;
147
       store.state.isAuthority = false;
132
-      MessageBox.confirm('身份失效,请重新登录', '确认退出', {
148
+    
149
+      MessageBox.alert('身份失效,请重新登录', '确认退出', {
133
         confirmButtonText: '确定',
150
         confirmButtonText: '确定',
134
-        cancelButtonText: '取消',
135
-        type: 'warning'
136
-      }).then(() => {
137
-        store.dispatch('user/resetToken').then(() => {
138
-          location.reload()
139
-        })
140
-        closenewWebSocket(JSON.parse(getUser()).uid)
151
+        callback:()=>{
152
+          
153
+          store.dispatch('user/resetToken')
154
+          .then(() => {
155
+            location.reload()
156
+          })
157
+          closenewWebSocket(JSON.parse(getUser()).uid)
158
+          console.log("我到这儿le.....s")
159
+        }
160
+
141
       })
161
       })
142
-    }else if(error.response.status == 666&& store.state.isAuthority){
162
+    }else if (error.response.status == 666 && store.state.isAuthority) {
143
       this.$message.error('服务器神游中!');
163
       this.$message.error('服务器神游中!');
144
-    }else if(error.response.status == 504&& store.state.isAuthority){
164
+    } else if (error.response.status == 504 && store.state.isAuthority) {
145
       this.$message.error('请求超时,请稍后再试');
165
       this.$message.error('请求超时,请稍后再试');
146
     }
166
     }
147
   }
167
   }

+ 17 - 15
shanXiPlatform/src/views/home/staff.vue

@@ -85,7 +85,7 @@
85
           style="
85
           style="
86
             float: left;
86
             float: left;
87
             position: relative;
87
             position: relative;
88
-            height: 524px;
88
+            height: 580px;
89
             border-radius: 5px;
89
             border-radius: 5px;
90
             border: 1px solid #d8dce5;
90
             border: 1px solid #d8dce5;
91
           "
91
           "
@@ -247,11 +247,11 @@
247
               <!-- <div v-if="item.coordinate && !item.storageStatus" :style="{position:'absolute',width:'20px',height:'20px',backgroundColor:'blue',borderRadius:'50%',opacity:0.4,top:item.coordinate.split(',')[1]-10+ 'px',left:item.coordinate.split(',')[0]-10+ 'px'}"></div> -->
247
               <!-- <div v-if="item.coordinate && !item.storageStatus" :style="{position:'absolute',width:'20px',height:'20px',backgroundColor:'blue',borderRadius:'50%',opacity:0.4,top:item.coordinate.split(',')[1]-10+ 'px',left:item.coordinate.split(',')[0]-10+ 'px'}"></div> -->
248
             </span>
248
             </span>
249
           </map>
249
           </map>
250
-          <div style="height: 64px; line-height: 64px">
250
+          <div style="height: 120px; line-height: 120px">
251
             <img
251
             <img
252
               src="../../assets/images/zt.png"
252
               src="../../assets/images/zt.png"
253
               alt=""
253
               alt=""
254
-              style="position: absolute; left: 10px"
254
+              style="position: absolute; left: 17px; bottom: 26px;"
255
             />
255
             />
256
             <div
256
             <div
257
               v-if="!housestatusshow"
257
               v-if="!housestatusshow"
@@ -260,7 +260,7 @@
260
                 height: 18px;
260
                 height: 18px;
261
                 line-height: 18px;
261
                 line-height: 18px;
262
                 right: 30px;
262
                 right: 30px;
263
-                bottom: 12px;
263
+                bottom: 29px;
264
                 cursor: pointer;
264
                 cursor: pointer;
265
               "
265
               "
266
               @click="housestatusshowFn(1)"
266
               @click="housestatusshowFn(1)"
@@ -283,7 +283,7 @@
283
                 height: 18px;
283
                 height: 18px;
284
                 line-height: 18px;
284
                 line-height: 18px;
285
                 right: 30px;
285
                 right: 30px;
286
-                bottom: 12px;
286
+                bottom: 29px;
287
                 cursor: pointer;
287
                 cursor: pointer;
288
               "
288
               "
289
               @click="housestatusshowFn(2)"
289
               @click="housestatusshowFn(2)"
@@ -334,16 +334,17 @@
334
               :interval="5000"
334
               :interval="5000"
335
               arrow="always"
335
               arrow="always"
336
               height="200px"
336
               height="200px"
337
+              
337
               indicator-position="none"
338
               indicator-position="none"
338
             >
339
             >
339
               <el-carousel-item
340
               <el-carousel-item
340
                 v-for="item in bodyContentFooterOneData"
341
                 v-for="item in bodyContentFooterOneData"
341
                 :key="item.imgSrc"
342
                 :key="item.imgSrc"
342
-              >
343
-                <img :src="item.imgSrc" alt="" height="200px" width="350px" />
344
-                <div class="footerText">
343
+                style="text-align:center;width:320px">
344
+                <img :src="item.imgSrc" alt="" height="100%" />
345
+                <!-- <div class="footerText">
345
                   <span>{{ item.title }}</span>
346
                   <span>{{ item.title }}</span>
346
-                </div>
347
+                </div> -->
347
               </el-carousel-item>
348
               </el-carousel-item>
348
             </el-carousel>
349
             </el-carousel>
349
           </div>
350
           </div>
@@ -548,7 +549,7 @@ export default {
548
                 name: "圆环图系列名称", // 系列名称
549
                 name: "圆环图系列名称", // 系列名称
549
                 type: "pie", // 系列类型
550
                 type: "pie", // 系列类型
550
                 center: ["50%", "50%"], // 饼图的中心(圆心)坐标,数组的第一项是横坐标,第二项是纵坐标。[ default: ['50%', '50%'] ]
551
                 center: ["50%", "50%"], // 饼图的中心(圆心)坐标,数组的第一项是横坐标,第二项是纵坐标。[ default: ['50%', '50%'] ]
551
-                radius: ["20%", "35%"], // 饼图的半径,数组的第一项是内半径,第二项是外半径。[ default: [0, '75%'] ]
552
+                radius: ["28%", "55%"], // 饼图的半径,数组的第一项是内半径,第二项是外半径。[ default: [0, '75%'] ]
552
                 hoverAnimation: true, // 是否开启 hover 在扇区上的放大动画效果。[ default: true ]
553
                 hoverAnimation: true, // 是否开启 hover 在扇区上的放大动画效果。[ default: true ]
553
                 color: ["#44a64b", "#f3c800", "#ff7800"], // 圆环图的颜色
554
                 color: ["#44a64b", "#f3c800", "#ff7800"], // 圆环图的颜色
554
                 label: {
555
                 label: {
@@ -625,6 +626,7 @@ export default {
625
             {
626
             {
626
               data: grainvalue,
627
               data: grainvalue,
627
               type: "bar",
628
               type: "bar",
629
+              barWidth:"30%",
628
               itemStyle: {
630
               itemStyle: {
629
                 normal: {
631
                 normal: {
630
                   label: {
632
                   label: {
@@ -802,7 +804,7 @@ export default {
802
   width: 100%;
804
   width: 100%;
803
   /* height: calc(100vh - 124px); */
805
   /* height: calc(100vh - 124px); */
804
   /* overflow-y: scroll; */
806
   /* overflow-y: scroll; */
805
-  height: 1151px;
807
+  height: 1207px;
806
   padding: 10px 10px 41px 10px;
808
   padding: 10px 10px 41px 10px;
807
   background-color: #f3f3f3;
809
   background-color: #f3f3f3;
808
 }
810
 }
@@ -828,7 +830,7 @@ export default {
828
   box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
830
   box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
829
 }
831
 }
830
 .bodyContent {
832
 .bodyContent {
831
-  height: 844px;
833
+  height: 900px;
832
   margin-top: 10px;
834
   margin-top: 10px;
833
   background-color: #ffffff;
835
   background-color: #ffffff;
834
   margin-bottom: 40px;
836
   margin-bottom: 40px;
@@ -839,15 +841,15 @@ export default {
839
   padding-left: 10px;
841
   padding-left: 10px;
840
 }
842
 }
841
 .bodyContentMiddle {
843
 .bodyContentMiddle {
842
-  height: 524px;
844
+  height: 580px;
843
   padding: 0 10px;
845
   padding: 0 10px;
844
   /* border-bottom: 1px solid #d8dce5; */
846
   /* border-bottom: 1px solid #d8dce5; */
845
   /* box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04); */
847
   /* box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04); */
846
 }
848
 }
847
 .bodyContentMiddleText {
849
 .bodyContentMiddleText {
848
   width: calc(100% - 830px);
850
   width: calc(100% - 830px);
849
-  height: 524px;
850
-  max-height: 524px;
851
+  height: 580px;
852
+  max-height: 580px;
851
   padding: 10px;
853
   padding: 10px;
852
   overflow-y: auto;
854
   overflow-y: auto;
853
   border: 1px solid #d8dce5;
855
   border: 1px solid #d8dce5;