heyang 2 years ago
parent
commit
fb04ba6148
4 changed files with 82 additions and 46 deletions
  1. 3 2
      .env.development
  2. 2 2
      src/utils/request.js
  3. 18 35
      src/views/home.vue
  4. 59 7
      src/views/warningDetail.vue

+ 3 - 2
.env.development

@@ -15,13 +15,14 @@ VUE_APP_ENV = 'development'
 # 43服务器
 # VUE_APP_BASE_API = '192.168.1.43/labSystem/'
 # 柴
-VUE_APP_BASE_API = '192.168.1.9:8080'
+# VUE_APP_BASE_API = '192.168.1.9:8080'
 # 暨大
 # VUE_APP_BASE_API = 'lab.sxitdlc.com/jndxlabSystem/'
 # 矿大-文昌
 #VUE_APP_BASE_API = 'lab.sxitdlc.com/kdwclabSystem/'
 # 苏大
-# VUE_APP_BASE_API = 'lab.sxitdlc.com/sudalabSystem/'
+#VUE_APP_BASE_API = 'znyj.labcenter.suda.edu.cn/labSystem/'
+ VUE_APP_BASE_API = 'lab.sxitdlc.com/sudalabSystem/'
 
 
 

+ 2 - 2
src/utils/request.js

@@ -34,8 +34,8 @@ axios.defaults.withCredentials = false;
 
 // 允许跨域
 axios.defaults.headers.post["Access-Control-Allow-Origin-Type"] = "*";
-axios.defaults.headers.common["Authorization"] = 'Bearer 967babb7-e306-4701-820a-4086d68d3963';//`Bearer ${localStorage.getItem('access_token')`;
-// axios.defaults.headers.common["Authorization"] = 'Bearer '+localStorage.getItem('Authorization')+''
+//axios.defaults.headers.common["Authorization"] = 'Bearer e1944525-2273-4698-abeb-0927cb57f6e8';//`Bearer ${localStorage.getItem('access_token')`;
+ axios.defaults.headers.common["Authorization"] = 'Bearer '+localStorage.getItem('Authorization')+''
 
 //设置超时
 axios.defaults.timeout = 15000;

+ 18 - 35
src/views/home.vue

@@ -255,7 +255,7 @@
               <i>当前人数</i>
             </div>
             <div class="right_b_l_b_b" v-if="labList">
-              <li  v-for='(item,index10) in labList' :key="index10"><i>{{item.name}}</i><i>{{item.online}}</i></li>
+              <li  v-for='(item,index10) in labList' :key="index10"><a :name="item.name">{{item.name}}</a><i>{{item.online}}</i></li>
             </div>
             <div v-if="labList.length<=0" style="position:absolute;left: 36%; top:38%;color:#fff;">暂无数据</div>
           </div>
@@ -1303,7 +1303,7 @@ export default {
         series: [{
           type: 'pie',
           z: 3,
-          center: ['45%', '40%'],
+          center: ['45%', '55%'],
           radius: ['40%', '55%'],
           clockwise: true,
           avoidLabelOverlap: true,
@@ -2390,55 +2390,38 @@ export default {
             }
           }
           .right_b_l_b_b{
-            height: rh(241);
+            height: rh(190);
             overflow-y: auto;
             background: 0;
-            .str_move{
-              >li{
-                height: rh(40);
-                display: flex;
-                justify-content: flex-start;
-                border-bottom: 1px solid #00DFFF;
-                >i{
-                  display: inline-block;
-                  font-size: rh(14);
-                  font-family: Microsoft YaHei;
-                  font-weight: 400;
-                  color: #fff;
-                  line-height: rh(40);
-                  margin-left: rw(6);
-                }
-                >i:nth-of-type(1){
-                  width: rw(223);
-                }
-                >i:nth-of-type(2){
-                  width: rw(84);
-                  text-align: center;
-                  padding-right: rw(50);
-                }
-              }
-            }
             >li{
               height: rh(40);
               display: flex;
               justify-content: flex-start;
               border-bottom: 1px solid #00DFFF;
-              >i{
+              >a{
+                width: rw(223);
                 display: inline-block;
                 font-size: rh(14);
                 font-family: Microsoft YaHei;
                 font-weight: 400;
                 color: #fff;
                 line-height: rh(40);
-                margin-left: rw(28);
-              }
-              >i:nth-of-type(1){
-                width: rw(542);
+                margin-left: rw(6);
+                overflow:hidden;
+                text-overflow:ellipsis;
+                white-space:nowrap
               }
-              >i:nth-of-type(2){
-                width: rw(116);
+              >i{
+                width: rw(84);
                 text-align: center;
                 padding-right: rw(50);
+                display: inline-block;
+                font-size: rh(14);
+                font-family: Microsoft YaHei;
+                font-weight: 400;
+                color: #fff;
+                line-height: rh(40);
+                margin-left: rw(6);
               }
             }
 

+ 59 - 7
src/views/warningDetail.vue

@@ -10,7 +10,7 @@
         <div class="main_m">
             <div class="main_m_t">
                 <div class="main_m_t_l">首次报警时间 {{firstTime}}</div>
-                <div class="dowebok">
+                <div class="sensor_list">
                    <ul class="main_m_t_c_n">
                        <li v-for="(item,index) in weather" :key="index">
                          <img src="@/assets/image/subject/icon_bj_wd.png" v-if="item.funNum == 'wendu'">
@@ -119,6 +119,7 @@
 
 <script>
 import flvjs from "flv.js"
+import $ from 'jquery'
 import {
   abnormalLogOrderByList, bigviewFunctionList, bigviewSub, bigviewWarnMessage,
   controllerList,
@@ -153,6 +154,54 @@ export default {
     }
   },
   methods: {
+    /**
+     * 横向拖动触发滚动条拖动
+     * container:jquery选择器
+     */
+    dragMoveX(container){
+      var flag;
+      var downX;
+      var scrollLeft;
+      //鼠标按下
+      $(document.body).on("mousedown", container, function (event) {
+        // console.log('mousedown')
+        flag = true;
+        downX = event.clientX;
+        scrollLeft = $(this).scrollLeft();
+      });
+      //鼠标移动
+      $(document).on("mousemove", function (event) {
+        // console.log('mousemove')
+        if (flag) {
+          var moveX = event.clientX;
+          var scrollX = moveX - downX;
+          // console.log("moveX" + moveX);
+          // console.log("scrollX" + scrollX);
+          if (scrollX < 0 && scrollLeft > 0) {
+            $(container).scrollLeft(scrollLeft - scrollX)
+          }
+          else {
+            $(container).scrollLeft(scrollLeft - scrollX)
+          }
+        }
+      });
+      //鼠标释放
+      $(document).on("mouseup", function () {
+        // console.log('mouseup')
+        flag = false;
+      });
+      /**
+       * 注意:与 mouseout 事件不同,mouseleave 事件只有在鼠标指针离开被选元素时被触发,mouseout 事件在鼠标指针离开任意子元素时也会被触发。参见页面底部演示实例。
+       * 所以:如果mouseout的子元素存在溢出,并添加了超出加滚动,那么刚进入也会触发该事件,所以这里就不能使用。
+       * */
+      //鼠标移出元素
+      $(container).on("mouseleave", function (event) {
+        // console.log('mouseleave')
+        if (event.pageX < 0 || event.pageX > document.body.offsetWidth) {
+          flag = false;
+        }
+      });
+    },
     back(){
       this.$router.push('/')
     },
@@ -313,7 +362,11 @@ export default {
     this.subjectId=this.$route.query.subjectId
     _this.switchStateFun();
     _this.getAjaxData();
+
   },
+  beforeMount() {
+    this.dragMoveX('.sensor_list')
+  }
 }
 </script>
 
@@ -427,19 +480,18 @@ export default {
         line-height: rh(18);
         margin-left: rw(24);
       }
-      .dowebok{
-        width: rw(1370);
-        height: rh(80);
+      .sensor_list{
+        height: rh(70);
         background: 0;
         overflow-y: auto;
         .main_m_t_c_n{
           position: relative;
-          height:255px;
+          height:rh(70);
           white-space: nowrap;
           display: inline-flex;
           >li{
             width: rw(202);
-            height: 100%;
+            height: rh(70);
             float: left;
             position: relative;
             cursor: pointer;
@@ -455,7 +507,7 @@ export default {
               font-family: Microsoft YaHei;
               font-weight: 400;
               color: #FFFFFF;
-              line-height: rh(80);
+              line-height: rh(70);
               display: inline-block;
             }
             >i:nth-of-type(1){