Sfoglia il codice sorgente

产品下的运行数据

钞小赢 3 anni fa
parent
commit
0dfa9bff5d

BIN
src/assets/images/dew.png


BIN
src/assets/images/temp.png


BIN
src/assets/images/wet.png


+ 3 - 0
src/router/routes.js

@@ -1,6 +1,7 @@
1 1
 import layoutHeaderAside from '@/layout/header-aside'
2 2
 
3 3
 
4
+
4 5
 // 由于懒加载页面太多的话会造成webpack热更新太慢,所以开发环境不使用懒加载,只有生产环境使用懒加载
5 6
 const _import = require('@/libs/util.import.' + process.env.NODE_ENV)
6 7
 
@@ -113,6 +114,8 @@ const frameIn = [
113 114
           },
114 115
           component: _import('demo/productManage/productClassify')
115 116
         },
117
+      
118
+     
116 119
         //  设备管理/设备
117 120
         {
118 121
           path: 'equipment',

+ 2 - 1
src/views/demo/equipmentManage/equipment/index.vue

@@ -352,7 +352,8 @@ export default {
352 352
     },
353 353
     //查看
354 354
     goDetail(row) {
355
-      this.$router.push({ path: "equipmentInfo",query:{id:row.id,eqCode:row.eqCode} });
355
+      console.log(row,"设备。。")
356
+      this.$router.push({ path: "equipmentInfo",query:{id:row.id,eqCode:row.eqCode,labelCode:row.labelCode} });
356 357
     },
357 358
     //跳转产品分类
358 359
     goTag() {

+ 215 - 147
src/views/demo/equipmentManage/equipmentInfo/index.vue

@@ -39,7 +39,6 @@
39 39
                 />
40 40
               </el-tab-pane>
41 41
               <el-tab-pane label="定时任务" name="second">
42
-
43 42
                 <div class="infoTitle">
44 43
                   <h5>定时任务</h5>
45 44
                   <!-- <el-button
@@ -49,17 +48,45 @@
49 48
                     >修改定时任务</el-button
50 49
                   > -->
51 50
                 </div>
52
-                <div class="taskDiv" v-for="(item,index) in rwList" :key="index">
53
-                  <el-tooltip class="item" effect="dark" :content="item.taskName" placement="top">
54
-                    <span class="gdWidth">{{item.taskName}}</span>
55
-                  </el-tooltip>:
56
-                    <span class="normalBtn">{{JSON.parse(item.objTime).timeType}}</span>
57
-                    <span class="normalBtn" v-if="JSON.parse(item.objTime).timeType!='每小时'">{{JSON.parse(item.objTime).time}}</span>
58
-                    <span class="normalBtn" v-if="JSON.parse(item.objTime).timeType=='每周'">{{JSON.parse(item.objTime).week.toString()}}</span>
59
-                    <span class="normalBtn" v-if="JSON.parse(item.objTime).timeType=='每月'">{{JSON.parse(item.objTime).month.toString()}}</span>
60
-                    <span class="normalBtn" v-if="JSON.parse(item.objTime).timeType=='每年'">{{JSON.parse(item.objTime).dateTime}}</span>
51
+                <div
52
+                  class="taskDiv"
53
+                  v-for="(item, index) in rwList"
54
+                  :key="index"
55
+                >
56
+                  <el-tooltip
57
+                    class="item"
58
+                    effect="dark"
59
+                    :content="item.taskName"
60
+                    placement="top"
61
+                  >
62
+                    <span class="gdWidth">{{
63
+                      item.taskName
64
+                    }}</span> </el-tooltip
65
+                  >:
66
+                  <span class="normalBtn">{{
67
+                    JSON.parse(item.objTime).timeType
68
+                  }}</span>
69
+                  <span
70
+                    class="normalBtn"
71
+                    v-if="JSON.parse(item.objTime).timeType != '每小时'"
72
+                    >{{ JSON.parse(item.objTime).time }}</span
73
+                  >
74
+                  <span
75
+                    class="normalBtn"
76
+                    v-if="JSON.parse(item.objTime).timeType == '每周'"
77
+                    >{{ JSON.parse(item.objTime).week.toString() }}</span
78
+                  >
79
+                  <span
80
+                    class="normalBtn"
81
+                    v-if="JSON.parse(item.objTime).timeType == '每月'"
82
+                    >{{ JSON.parse(item.objTime).month.toString() }}</span
83
+                  >
84
+                  <span
85
+                    class="normalBtn"
86
+                    v-if="JSON.parse(item.objTime).timeType == '每年'"
87
+                    >{{ JSON.parse(item.objTime).dateTime }}</span
88
+                  >
61 89
                 </div>
62
-                
63 90
               </el-tab-pane>
64 91
               <el-tab-pane label="运行数据" name="third">
65 92
                 <!-- <span slot="label">
@@ -84,15 +111,15 @@
84 111
                 <div class="nowData">
85 112
                   <div>
86 113
                     <div>温度</div>
87
-                    <div>{{rightTempValue}}℃</div>
114
+                    <div>{{ rightTempValue }}℃</div>
88 115
                   </div>
89 116
                   <div>
90 117
                     <div>湿度</div>
91
-                    <div>{{rightWetValue}}%</div>
118
+                    <div>{{ rightWetValue }}%</div>
92 119
                   </div>
93 120
                   <div>
94 121
                     <div>露点温度</div>
95
-                    <div>{{rightDewValue}}℃</div>
122
+                    <div>{{ rightDewValue }}℃</div>
96 123
                   </div>
97 124
                 </div>
98 125
                 <h5 style="margin: 20px 0">历史定时任务数据</h5>
@@ -108,7 +135,8 @@
108 135
                         size="mini"
109 136
                         v-model="formTime.time"
110 137
                         type="date"
111
-                        placeholder="请选择">
138
+                        placeholder="请选择"
139
+                      >
112 140
                       </el-date-picker>
113 141
                     </el-form-item>
114 142
                     <el-form-item>
@@ -126,7 +154,10 @@
126 154
                         size="mini"
127 155
                         type="primary"
128 156
                         icon="el-icon-refresh-left"
129
-                        @click="formTime.time = '';getPoints()"
157
+                        @click="
158
+                          formTime.time = '';
159
+                          getPoints();
160
+                        "
130 161
                         >重置</el-button
131 162
                       >
132 163
                     </el-form-item>
@@ -153,13 +184,29 @@
153 184
                   ></el-table-column>
154 185
                   <el-table-column prop="time" label="检测时间" align="center">
155 186
                   </el-table-column>
156
-                  <el-table-column prop="device" label="设备编号" align="center">
187
+                  <el-table-column
188
+                    prop="device"
189
+                    label="设备编号"
190
+                    align="center"
191
+                  >
157 192
                   </el-table-column>
158
-                  <el-table-column prop="tempValue" label="温度(℃)" align="center">
193
+                  <el-table-column
194
+                    prop="tempValue"
195
+                    label="温度(℃)"
196
+                    align="center"
197
+                  >
159 198
                   </el-table-column>
160
-                  <el-table-column prop="wetValue" label="湿度(%)" align="center">
199
+                  <el-table-column
200
+                    prop="wetValue"
201
+                    label="湿度(%)"
202
+                    align="center"
203
+                  >
161 204
                   </el-table-column>
162
-                  <el-table-column prop="dewValue" label="露点温度(℃)" align="center">
205
+                  <el-table-column
206
+                    prop="dewValue"
207
+                    label="露点温度(℃)"
208
+                    align="center"
209
+                  >
163 210
                   </el-table-column>
164 211
                   <!-- <el-table-column
165 212
                     prop="houseName"
@@ -303,7 +350,12 @@
303 350
         </div>
304 351
       </el-dialog>
305 352
       <addDialog :dialogTitle="'设备基本信息'" ref="addDialog" />
306
-      <el-dialog title="检测详情" id="dialogStyle" width="800px" :visible.sync="checkDialog">
353
+      <el-dialog
354
+        title="检测详情"
355
+        id="dialogStyle"
356
+        width="800px"
357
+        :visible.sync="checkDialog"
358
+      >
307 359
         <!-- <detailTable ref="detailTable" :detail-table="checkInfo" :title="''" /> -->
308 360
         <div class="panel-height-add">
309 361
           <div style="padding: 2px">
@@ -385,7 +437,9 @@
385 437
         <div class="panel-height-add">
386 438
           <div style="padding: 2px">
387 439
             <div class="detBox">
388
-              <div class="title" v-for="(item, i) in checkInfo1" :key="i">{{item.title}}</div>
440
+              <div class="title" v-for="(item, i) in checkInfo1" :key="i">
441
+                {{ item.title }}
442
+              </div>
389 443
               <div
390 444
                 v-for="(item, i) in checkInfo1"
391 445
                 :key="i"
@@ -467,21 +521,21 @@
467 521
 <script>
468 522
 import addDialog from "../compontents/addDialog.vue";
469 523
 import api from "@/api";
470
-import mqtt from 'mqtt'
524
+import mqtt from "mqtt";
471 525
 
472 526
 import detailTable from "@/components/detailTable/index.vue";
473
-import log from '@/libs/util.log';
527
+import log from "@/libs/util.log";
474 528
 export default {
475 529
   name: "productInfo",
476 530
   components: { detailTable, addDialog },
477 531
   data() {
478 532
     return {
479
-   rightDewValue : 0,
480
-    rightTempValue : 0,
481
-    rightWetValue : 0,
482
-      alarmRecord:[],
483
-      pintsPageList:[],
484
-      rwList:[],
533
+      rightDewValue: null,
534
+      rightTempValue: null,
535
+      rightWetValue: null,
536
+      alarmRecord: [],
537
+      pintsPageList: [],
538
+      rwList: [],
485 539
       client: {},
486 540
       info: {},
487 541
       checkDialog: false,
@@ -560,14 +614,14 @@ export default {
560 614
       ],
561 615
       checkInfo1: [
562 616
         {
563
-          title:'设备1(编号/标识/设备名称)',
617
+          title: "设备1(编号/标识/设备名称)",
564 618
           name: "温度(℃)",
565 619
           val: [""],
566 620
           name1: "湿度(%RH)",
567 621
           val1: [""],
568 622
           name2: "露点温度(℃)",
569 623
           val2: [""],
570
-        }
624
+        },
571 625
       ],
572 626
       //分页
573 627
       pagination: {
@@ -600,10 +654,10 @@ export default {
600 654
   },
601 655
   created() {
602 656
     this.getBasic();
603
-    this.connect()
657
+    this.connect();
604 658
   },
605
-  destroyed(){
606
-    this.unconnect()
659
+  destroyed() {
660
+    this.unconnect();
607 661
   },
608 662
   methods: {
609 663
     connect() {
@@ -617,62 +671,66 @@ export default {
617 671
         //生产
618 672
         // username: "admin",
619 673
         // password: "admin@2Ld&DDrsk",
620
-        cleanSession : true,
621
-        keepAlive:60,
622
-        clientId: 'mqttjs_'+ Math.random().toString(16).substr(2, 8),
623
-        connectTimeout: 4000
624
-      }
674
+        cleanSession: true,
675
+        keepAlive: 60,
676
+        clientId: "mqttjs_" + Math.random().toString(16).substr(2, 8),
677
+        connectTimeout: 4000,
678
+      };
625 679
       //本地开发环境
626
-      this.client = mqtt.connect('ws://192.168.50.169:8083/mqtt',options);
680
+      this.client = mqtt.connect("ws://192.168.50.169:8083/mqtt", options);
627 681
       //测试环境
628
-        //  this.client = mqtt.connect('ws://172.16.0.5:8083/mqtt',options);
629
-        //正式环境
630
-         // this.client = mqtt.connect('ws://10.105.101.61:8083/mqtt',options);
631
-      this.client.on("connect", (e)=>{
632
-        console.log("成功连接服务器:",e);
682
+      //  this.client = mqtt.connect('ws://172.16.0.5:8083/mqtt',options);
683
+      //正式环境
684
+      // this.client = mqtt.connect('ws://10.105.101.61:8083/mqtt',options);
685
+      this.client.on("connect", (e) => {
686
+        console.log("成功连接服务器:", e);
633 687
         //订阅三个名叫'top/#', 'three/#'和'#'的主题
634
-        this.client.subscribe([
688
+        this.client.subscribe(
689
+          [
635 690
             // "/PUSH/c89512024085/DPUT/upload",
636 691
             // "/PUSH/X1XXXQ2206090069/DPUT/upload",
637 692
             "/PUSH/8951DQ2207200018/DPUT/upload",
638
-          ], { qos: 1 }, (err)=> {
639
-          if (!err) {
640
-            console.log("订阅成功");
641
-            //向主题叫“pubtop”发布一则内容为'hello,this is a nice day!'的消息
642
-            this.publish("pubtop", 'hello,this is a nice day!')
643
-          } else {
644
-            console.log('消息订阅失败!')
693
+          ],
694
+          { qos: 1 },
695
+          (err) => {
696
+            if (!err) {
697
+              console.log("订阅成功");
698
+              //向主题叫“pubtop”发布一则内容为'hello,this is a nice day!'的消息
699
+              this.publish("pubtop", "hello,this is a nice day!");
700
+            } else {
701
+              console.log("消息订阅失败!");
702
+            }
645 703
           }
646
-        });
704
+        );
647 705
       });
648 706
       //重新连接
649
-      this.reconnect()
707
+      this.reconnect();
650 708
       //是否已经断开连接
651
-      this.mqttError()
709
+      this.mqttError();
652 710
       //监听获取信息
653
-      this.getMessage()
711
+      this.getMessage();
654 712
     },
655
-//发布消息@topic主题  @message发布内容
656
-    publish(topic,message) {
713
+    //发布消息@topic主题  @message发布内容
714
+    publish(topic, message) {
657 715
       if (!this.client.connected) {
658
-        console.log('客户端未连接')
659
-        return
716
+        console.log("客户端未连接");
717
+        return;
660 718
       }
661
-      this.client.publish(topic,message,{qos: 1},(err) => {
662
-        if(!err) {
663
-          console.log('主题为'+topic+ "发布成功")
719
+      this.client.publish(topic, message, { qos: 1 }, (err) => {
720
+        if (!err) {
721
+          console.log("主题为" + topic + "发布成功");
664 722
         }
665
-      })
723
+      });
666 724
     },
667
-//监听接收消息
725
+    //监听接收消息
668 726
     getMessage() {
669 727
       this.client.on("message", (topic, message) => {
670
-        if(message) {
671
-          console.log('收到来着',topic,'的信息',message.toString())
672
-          const res = JSON.parse(message.toString())
673
-          this.runData=res.data
674
-          console.log(res, 'res',this.runData,'runData')
675
-          this.calcAve(this.runData)
728
+        if (message) {
729
+          console.log("收到来着", topic, "的信息", message.toString());
730
+          const res = JSON.parse(message.toString());
731
+          this.runData = res.data;
732
+          console.log(res, "res", this.runData, "runData");
733
+          this.calcAve(this.runData);
676 734
           // switch(topic) {
677 735
           //    case 'top/lll' :
678 736
           //      this.msg = res.msg
@@ -688,32 +746,31 @@ export default {
688 746
           //      this.msg = res
689 747
           //  }
690 748
           //  this.msg = message
691
-
692 749
         }
693 750
       });
694 751
     },
695
-//监听服务器是否连接失败
752
+    //监听服务器是否连接失败
696 753
     mqttError() {
697
-      this.client.on('error',(error) => {
698
-        console.log('连接失败:',error)
699
-        this.client.end()
700
-      })
754
+      this.client.on("error", (error) => {
755
+        console.log("连接失败:", error);
756
+        this.client.end();
757
+      });
701 758
     },
702 759
     unsubscribe() {
703
-      this.client.unsubscribe(this.mtopic, (error)=> {
704
-        console.log('主题为'+ this.mtopic+'取消订阅成功',error)
705
-      })
760
+      this.client.unsubscribe(this.mtopic, (error) => {
761
+        console.log("主题为" + this.mtopic + "取消订阅成功", error);
762
+      });
706 763
     },
707
-//断开连接
764
+    //断开连接
708 765
     unconnect() {
709
-      this.client.end()
710
-      this.client = null
711
-      console.log('服务器已断开连接!')
766
+      this.client.end();
767
+      this.client = null;
768
+      console.log("服务器已断开连接!");
712 769
     },
713
-//监听服务器重新连接
770
+    //监听服务器重新连接
714 771
     reconnect() {
715
-      this.client.on('reconnect', (error) => {
716
-          console.log('正在重连:', error)
772
+      this.client.on("reconnect", (error) => {
773
+        console.log("正在重连:", error);
717 774
       });
718 775
     },
719 776
     //公共方法计算平均值
@@ -725,24 +782,23 @@ export default {
725 782
       this.rightTempValue = 0;
726 783
       this.rightWetValue = 0;
727 784
 
728
-        arr.forEach((item) => {
729
-          avgNum++;
730
-          console.log(item, "item");
731
-          item.dewValue = parseInt(item.dewValue);
732
-          item.tempValue = parseInt(item.tempValue);
733
-          item.wetValue = parseInt(item.wetValue);
734
-          //露点均温
735
-          this.rightDewValue += item.dewValue;
736
-          //温度均温
737
-          this.rightTempValue += item.tempValue;
738
-          //湿度均温
739
-          this.rightWetValue += item.wetValue;
740
-          console.log(
741
-            this.rightDewValue,
742
-            this.rightTempValue,
743
-            this.rightWetValue
744
-          );
745
- 
785
+      arr.forEach((item) => {
786
+        avgNum++;
787
+        console.log(item, "item");
788
+        item.dewValue = parseInt(item.dewValue);
789
+        item.tempValue = parseInt(item.tempValue);
790
+        item.wetValue = parseInt(item.wetValue);
791
+        //露点均温
792
+        this.rightDewValue += item.dewValue;
793
+        //温度均温
794
+        this.rightTempValue += item.tempValue;
795
+        //湿度均温
796
+        this.rightWetValue += item.wetValue;
797
+        console.log(
798
+          this.rightDewValue,
799
+          this.rightTempValue,
800
+          this.rightWetValue
801
+        );
746 802
       });
747 803
       //取整
748 804
       console.log(this.rightDewValue, avgNum, "wwwwww");
@@ -858,34 +914,49 @@ export default {
858 914
     },
859 915
     tabsClick(v) {
860 916
       if (v.name == "fourth") {
861
-        this.$router.push({ path: "alarmRecord",query:{eqCode:this.$route.query.eqCode}});
862
-      }else if(v.name=="second"){
863
-        this.getRwList()
917
+        this.$router.push({
918
+          path: "alarmRecord",
919
+          query: { eqCode: this.$route.query.eqCode },
920
+        });
921
+      } else if (v.name == "second") {
922
+        this.getRwList();
864 923
       } else if (v.name == "third") {
865
-        this.getPoints()
924
+        this.getPoints();
866 925
       }
867 926
     },
868
-    getPoints(){
869
-      var condition = this.formTime;
927
+    getPoints() {
928
+      // var condition = this.formTime;
929
+      var condition = {
930
+        orgCode: localStorage.getItem("orgCode"),
931
+        labelCode: this.$route.query.labelCode,
932
+        device: this.$route.query.eqCode,
933
+        dataTime: this.formTime.time,
934
+      };
870 935
       condition = JSON.stringify(condition);
871 936
       var data = {
872
-          pageIndex: this.pagination2.curPage,
873
-          pageSize: this.pagination2.pageSize,
874
-          condition: condition,
875
-        };
876
-        api
877
-          .getPintsPageList(data)
878
-          .then((res) => {
879
-            if (res.code == 200) {
880
-              this.pintsPageList = res.data.records;
881
-              this.pagination2.pageSize = res.data.size;
882
-              this.pagination2.total = res.data.total;
883
-              this.calcAve( this.pintsPageList)
937
+        pageIndex: this.pagination2.curPage,
938
+        pageSize: this.pagination2.pageSize,
939
+        condition: condition,
940
+      };
941
+      api
942
+        .getPintsPageList(data)
943
+        .then((res) => {
944
+          if (res.code == 200) {
945
+            this.pintsPageList = res.data.records;
946
+            this.pagination2.pageSize = res.data.size;
947
+            this.pagination2.total = res.data.total;
948
+            if (this.pintsPageList.length > 0) {
949
+              this.calcAve(this.pintsPageList);
950
+            } else {
951
+              this.rightDewValue = 0;
952
+              this.rightTempValue = 0;
953
+              this.rightWetValue = 0;
884 954
             }
885
-          })
886
-          .catch((err) => {
887
-            console.log(err);
888
-          });
955
+          }
956
+        })
957
+        .catch((err) => {
958
+          console.log(err);
959
+        });
889 960
     },
890 961
     //获取定时任务列表数据
891 962
     getRwList() {
@@ -897,7 +968,7 @@ export default {
897 968
       //   condition: condition,
898 969
       // };
899 970
       api
900
-        .timingTaskEq(this.info.eqCode,localStorage.getItem("orgCode"))
971
+        .timingTaskEq(this.info.eqCode, localStorage.getItem("orgCode"))
901 972
         .then((res) => {
902 973
           if (res.code == 200) {
903 974
             this.rwList = res.data;
@@ -910,15 +981,13 @@ export default {
910 981
         });
911 982
     },
912 983
     //查询
913
-    search(){
914
-      
915
-    },
984
+    search() {},
916 985
     //重置
917
-    reset(){
918
-      this.formInline={}
986
+    reset() {
987
+      this.formInline = {};
919 988
     },
920 989
     //确定
921
-    sure(){},
990
+    sure() {},
922 991
     //表格序号
923 992
     indexMethod(index) {
924 993
       return (
@@ -996,16 +1065,16 @@ export default {
996 1065
         }
997 1066
       }
998 1067
     }
999
-    .taskDiv{
1068
+    .taskDiv {
1000 1069
       padding-bottom: 30px;
1001 1070
       padding-left: 100px;
1002
-      .normalBtn{
1071
+      .normalBtn {
1003 1072
         padding: 7px 15px;
1004 1073
         border-radius: 3px;
1005
-        border:1px solid #DCDFE6;
1074
+        border: 1px solid #dcdfe6;
1006 1075
         margin-right: 10px;
1007 1076
       }
1008
-      .gdWidth{
1077
+      .gdWidth {
1009 1078
         display: inline-block;
1010 1079
         position: absolute;
1011 1080
         text-align: right;
@@ -1016,7 +1085,6 @@ export default {
1016 1085
         text-overflow: ellipsis; /*超出部分文字以...显示*/
1017 1086
       }
1018 1087
     }
1019
-
1020 1088
   }
1021 1089
 }
1022 1090
 ::v-deep .el-tabs {
@@ -1096,7 +1164,7 @@ export default {
1096 1164
     border-left: 1px solid #e6e6e6;
1097 1165
     border-top: 1px solid #e6e6e6;
1098 1166
     margin-bottom: 30px;
1099
-    .title{
1167
+    .title {
1100 1168
       background: #f3f3f3;
1101 1169
       line-height: 40px;
1102 1170
       border-bottom: 1px solid #e6e6e6;
@@ -1167,23 +1235,23 @@ export default {
1167 1235
     }
1168 1236
   }
1169 1237
 }
1170
-.nowData{
1238
+.nowData {
1171 1239
   display: flex;
1172
-  >div{
1240
+  > div {
1173 1241
     width: 200px;
1174 1242
     position: relative;
1175 1243
     text-align: center;
1176
-    >div:nth-child(2){
1244
+    > div:nth-child(2) {
1177 1245
       color: #008775;
1178 1246
       font-weight: bold;
1179 1247
       margin-top: 10px;
1180 1248
     }
1181 1249
   }
1182
-  >div:not(:last-child)::after{
1250
+  > div:not(:last-child)::after {
1183 1251
     content: "";
1184 1252
     width: 1px;
1185 1253
     height: 20px;
1186
-    background-color: #EBEEF5;
1254
+    background-color: #ebeef5;
1187 1255
     position: absolute;
1188 1256
     right: 0;
1189 1257
     top: 50%;

+ 141 - 2
src/views/demo/productManage/productInfo/index.vue

@@ -132,6 +132,90 @@
132 132
                 </div>
133 133
               </el-tab-pane>
134 134
               <el-tab-pane label="运行数据" name="second">
135
+
136
+                <el-tabs v-model="runDataActiveName" @tab-click="runDataClick">
137
+    <el-tab-pane label="实时数据" name="realData">
138
+      <h5 style="margin: 20px 0">历史定时任务数据</h5>
139
+      <div class="topCalc">
140
+        <div class="temp">
141
+          <div class="tempName">
142
+            <div>
143
+              <img src="../../../../assets/images/temp.png" alt="" style="width:10px;height:15px;">
144
+            </div>
145
+            <div>温度 (℃)</div>
146
+          </div>
147
+          <div class="tempDetail">
148
+            <div class="bottom">
149
+              <div>最高</div>
150
+              <div style="color:#008775;font-size:16px;font-weight: bolder;">28.4</div>
151
+            </div>
152
+            <div class="Separator"></div>
153
+            <div class="bottom">
154
+              <div>最低</div>
155
+              <div style="color:#008775;font-size:16px;font-weight: bolder;">28.4</div>
156
+            </div>
157
+            <div class="Separator"></div>
158
+            <div class="bottom">
159
+              <div>平均</div>
160
+              <div style="color:#008775;font-size:16px;font-weight: bolder;">28.4</div>
161
+            </div>
162
+          </div>
163
+        </div>
164
+
165
+
166
+        <div class="temp">
167
+          <div class="tempName">
168
+            <div>
169
+              <img src="../../../../assets/images/wet.png" alt="" style="width:10px;height:15px;">
170
+            </div>
171
+            <div>湿度 (%RH)</div>
172
+          </div>
173
+          <div class="tempDetail">
174
+            <div class="bottom">
175
+              <div>最高</div>
176
+              <div style="color:#008775;font-size:16px;font-weight: bolder;">28.4</div>
177
+            </div>
178
+            <div class="Separator"></div>
179
+            <div class="bottom">
180
+              <div>最低</div>
181
+              <div style="color:#008775;font-size:16px;font-weight: bolder;">28.4</div>
182
+            </div>
183
+            <div class="Separator"></div>
184
+            <div class="bottom">
185
+              <div>平均</div>
186
+              <div style="color:#008775;font-size:16px;font-weight: bolder;">28.4</div>
187
+            </div>
188
+          </div>
189
+        </div>
190
+
191
+
192
+        <div class="temp">
193
+          <div class="tempName">
194
+            <div>
195
+              <img src="../../../../assets/images/dew.png" alt="" style="width:10px;height:15px;">
196
+            </div>
197
+            <div>露点温度 (℃)</div>
198
+          </div>
199
+          <div class="tempDetail">
200
+            <div class="bottom">
201
+              <div>最高</div>
202
+              <div style="color:#008775;font-size:16px;font-weight: bolder;">28.4</div>
203
+            </div>
204
+            <div class="Separator"></div>
205
+            <div class="bottom">
206
+              <div>最低</div>
207
+              <div style="color:#008775;font-size:16px;font-weight: bolder;">28.4</div>
208
+            </div>
209
+            <div class="Separator"></div>
210
+            <div class="bottom">
211
+              <div>平均</div>
212
+              <div style="color:#008775;font-size:16px;font-weight: bolder;">28.4</div>
213
+            </div>
214
+          </div>
215
+        </div>
216
+      </div>
217
+    </el-tab-pane>
218
+    <el-tab-pane label="历史定时任务" name="hisTask">
135 219
                 <h5 style="margin: 20px 0">历史定时任务数据</h5>
136 220
                 <div class="flex-between">
137 221
                   <el-form
@@ -253,7 +337,10 @@
253 337
                   layout="total, sizes, prev, pager, next, jumper"
254 338
                   :total="pagination2.total"
255 339
                 >
256
-                </el-pagination>
340
+                </el-pagination></el-tab-pane>
341
+  
342
+  </el-tabs>
343
+
257 344
               </el-tab-pane>
258 345
 
259 346
               <el-tab-pane label="报警记录" name="fourth"></el-tab-pane>
@@ -527,6 +614,8 @@ export default {
527 614
   components: { detailTable ,addDialog},
528 615
   data() {
529 616
     return {
617
+      runDataActiveName:'realData',
618
+      title:"",
530 619
       devSum:'',
531 620
       runData:[{}],
532 621
       checkDialog:false,
@@ -899,7 +988,7 @@ export default {
899 988
       if(v.name=='fourth'){
900 989
         this.$router.push({ path: "alarmRecord" ,query:{proCode:this.$route.query.proCode} })
901 990
       }else if(v.name=='second'){
902
-        this.getRun()
991
+        // this.getRun()
903 992
       }else if(v.name=='third'){
904 993
         this.getList()
905 994
         this.getList1()
@@ -968,6 +1057,13 @@ export default {
968 1057
       this.pagination2.curPage = val;
969 1058
       this.getRun();
970 1059
     },
1060
+    runDataClick(tab){
1061
+      if(tab.name=="realData"){
1062
+
1063
+      }else{
1064
+        this.getRun()
1065
+      }
1066
+    }
971 1067
   },
972 1068
   mounted() {},
973 1069
 };
@@ -1010,6 +1106,49 @@ export default {
1010 1106
         }
1011 1107
       }
1012 1108
     }
1109
+    .topCalc{
1110
+     display:flex;
1111
+
1112
+    .temp{
1113
+      width: 250px;
1114
+    height: 110px;
1115
+    background-color:rgba(240, 240, 240, 1);
1116
+    border:2px solid rgba(230, 230, 230, 1);
1117
+      display: flex;
1118
+    flex-direction: column;
1119
+    font-size: 12px;
1120
+    margin-right:20px;
1121
+  
1122
+    .tempName{
1123
+      height: 35px;
1124
+    display: flex;
1125
+    justify-content: center;
1126
+    align-items: center;
1127
+    color:#000000;
1128
+    border-bottom:2px solid rgba(230, 230, 230, 1);
1129
+
1130
+    
1131
+
1132
+    }
1133
+    .tempDetail{
1134
+    height: 75px;
1135
+    display: flex;
1136
+    justify-content: space-around;
1137
+    align-items: center;
1138
+    .bottom{
1139
+      height: 50px;
1140
+    display: flex;
1141
+    flex-direction: column;
1142
+    justify-content: space-around;
1143
+    }
1144
+    .Separator{
1145
+      height:15px;
1146
+      border:1px solid rgba(230, 230, 230, 1);
1147
+    }
1148
+    }
1149
+    }
1150
+   
1151
+    }
1013 1152
   }
1014 1153
 }
1015 1154
 ::v-deep .el-tabs {

+ 34 - 32
src/views/system/visualized/index.vue

@@ -288,8 +288,8 @@
288 288
         </div>
289 289
 
290 290
         <div class="left-bottom">
291
-          <lsyj></lsyj>
292
-          <yjxx></yjxx>
291
+          <lsyj v-bind:cfCode="cfCode" ref="lsyjCharts"></lsyj>
292
+          <yjxx ></yjxx>
293 293
           <wsdbh></wsdbh>
294 294
           <cn-temp></cn-temp>
295 295
         </div>
@@ -323,7 +323,7 @@ export default {
323 323
 
324 324
       tableDataLength: null,
325 325
       //下拉选选中的code
326
-      cfCode: "",
326
+      cfCode: null,
327 327
       //仓房列表
328 328
       deviceLists: [],
329 329
       //设备在线
@@ -429,7 +429,9 @@ export default {
429 429
     cfChange(val) {
430 430
       console.log(val, "val..");
431 431
       this.cfCode = val;
432
+      console.log(this.cfCode,"选择的code")
432 433
       this.getPointList();
434
+      this.$refs.lsyjCharts.getHisWarning()
433 435
     },
434 436
     connect() {
435 437
       let options = {
@@ -593,7 +595,7 @@ export default {
593 595
               },
594 596
               //资料管理的大小
595 597
               b: {
596
-                fontSize: 14,
598
+                fontSize: 12,
597 599
                 color: "#c2f3ff",
598 600
                 padding: [10, 0],
599 601
               },
@@ -606,6 +608,7 @@ export default {
606 608
             },
607 609
           },
608 610
         },
611
+       
609 612
         // legend: {
610 613
         //   type: "plain",
611 614
         //   orient: "vertical",
@@ -873,16 +876,16 @@ export default {
873 876
             center: ["50%", "50%"],
874 877
             startAngle: 0,
875 878
             endAngle: 359.9,
876
-            splitNumber: 128, //改变小格子宽度
879
+            splitNumber: 28, //改变小格子宽度
877 880
             hoverAnimation: true,
878 881
             axisTick: {
879 882
               show: false,
880 883
             },
881 884
             splitLine: {
882
-              length: 57,
885
+              length: 67,
883 886
               lineStyle: {
884
-                width: 5,
885
-                color: "#01423b", //改变小格子的线颜色
887
+                width: 2,
888
+                color: "#0e352e", //改变小格子的线颜色
886 889
               },
887 890
             },
888 891
             axisLabel: {
@@ -907,18 +910,16 @@ export default {
907 910
             ],
908 911
           },
909 912
         ],
910
-      };
911
-      setTimeout(() => {
912
-        that.sdtjAngle = that.sdtjAngle + 3;
913
-        myChart3.setOption(option, true);
914
-      }, 500);
915
-
916
-      window.addEventListener("resize", () => {
917
-        setTimeout(() => {
918
-          myChart3.resize();
919
-        }, 1000);
920
-      });
921
-    },
913
+ 
914
+
915
+
916
+      
917
+    }
918
+
919
+
920
+    that.sdtjAngle = that.sdtjAngle + 3,
921
+        myChart3.setOption(option, true)
922
+  },
922 923
 
923 924
     //点位列表
924 925
     getPointList() {
@@ -1139,11 +1140,6 @@ export default {
1139 1140
       });
1140 1141
       $(".area").mouseleave((e) => {
1141 1142
         this.isHover = false;
1142
-        // $("#imgPoint").css({
1143
-        //   top: top,
1144
-        //   left: left,
1145
-        // })
1146
-        // $("#scrollDiv").hide();
1147 1143
       });
1148 1144
     },
1149 1145
     scale() {
@@ -1206,10 +1202,7 @@ export default {
1206 1202
   },
1207 1203
   created() {
1208 1204
     this.connect();
1209
-    // setInterval(() =>{
1210
-    //   //用setInterval做动画感觉有问题
1211
-    //   this.drawSdtj();
1212
-    // }, 6000);
1205
+  
1213 1206
     api
1214 1207
       .equipmentTagList({ curPage: 1, pageSize: 99999 })
1215 1208
       .then((res) => {
@@ -1218,6 +1211,12 @@ export default {
1218 1211
           if (res.data.records.length > 1) {
1219 1212
             this.deviceLists = res.data.records;
1220 1213
             this.form.cfValue = res.data.records[0].labelCode;
1214
+            this.cfCode=res.data.records[0].labelCode;
1215
+            console.log(this.cfCode,"初始化仓房code")
1216
+             //点位列表初始化
1217
+           this.getPointList();
1218
+           this.$refs.lsyjCharts.getHisWarning()
1219
+           console.log("到这儿了。。。")
1221 1220
           }
1222 1221
         }
1223 1222
       })
@@ -1229,8 +1228,11 @@ export default {
1229 1228
     this.unconnect();
1230 1229
   },
1231 1230
   mounted() {
1232
-    //点位列表初始化
1233
-    this.getPointList();
1231
+    //   setInterval(() =>{
1232
+    //   //用setInterval做动画感觉有问题
1233
+    //   this.drawSdtj();
1234
+    // }, 100);
1235
+   
1234 1236
     // this.getWsdAlarmParams();
1235 1237
     this.getTempWetStatus();
1236 1238
     this.addArea();
@@ -1250,7 +1252,7 @@ export default {
1250 1252
 
1251 1253
   padding: 10px;
1252 1254
   display: flex;
1253
-  // background: #2c695f;
1255
+  // background: #0e352e;
1254 1256
   background: url("../../../assets/images/bigScreen/bg.png") no-repeat;
1255 1257
   background-size: cover;
1256 1258
   .screen-left {

+ 14 - 3
src/views/system/visualized/lsyj/index.vue

@@ -16,6 +16,12 @@
16 16
 import * as echarts from "echarts";
17 17
 import api from "@/api";
18 18
 export default {
19
+  props:{
20
+    cfCode:{
21
+      type:String,
22
+      required:true
23
+    }
24
+  },
19 25
     data(){
20 26
         return{
21 27
          lsyjData:[],
@@ -27,11 +33,13 @@ export default {
27 33
        //历史月趋势
28 34
     getHisWarning() {
29 35
       let params = {
30
-        labelCode: "307038864601222",
36
+        labelCode:this.cfCode,
37
+  
31 38
         orgCode: localStorage.getItem("orgCode"),
32 39
 
33 40
         round: 2,
34 41
       };
42
+      console.log(params,"yuequ")
35 43
       api.hisWarning(params).then((res) => {
36 44
         console.log(res, "月趋势");
37 45
         if(res.code==200){
@@ -160,11 +168,14 @@ export default {
160 168
         }
161 169
     },
162 170
     created(){
163
-    
164
-        this.getHisWarning()
171
+   
172
+        //this.getHisWarning()
165 173
   
166 174
    
167 175
        
176
+    },
177
+    mounted(){
178
+      console.log(this.cfCode,"创建时的cfCode")
168 179
     }
169 180
 }
170 181