dedsudiyu 5 maanden geleden
bovenliggende
commit
1218c33c4d

+ 4 - 4
.env.development

@@ -38,13 +38,13 @@ VUE_APP_VERSION_DIFFERENCE_FIELD = 'kuangYeDaXue_nanHu'
 # 柴
 # VUE_APP_BASE_LOCAL_API = '192.168.1.9:8080'
 # 小飞
-# VUE_APP_BASE_LOCAL_API = '192.168.1.17:8080'
+VUE_APP_BASE_LOCAL_API = '192.168.1.17:8080'
 # 志伟
 # VUE_APP_BASE_LOCAL_API = '192.168.1.20:8080'
 # 林总
 # VUE_APP_BASE_LOCAL_API = '192.168.1.24:8080'
 # 高升
-VUE_APP_BASE_LOCAL_API = '192.168.1.39:8080'
+# VUE_APP_BASE_LOCAL_API = '192.168.1.39:8080'
 
 # ####################外网接口配置####################
 
@@ -72,9 +72,9 @@ VUE_APP_BASE_LOCAL_API = '192.168.1.39:8080'
 # 志伟
 # VUE_APP_BASE_API = '192.168.1.20:8080'
 # 小飞
-# VUE_APP_BASE_API = '192.168.1.17:8080'
+VUE_APP_BASE_API = '192.168.1.17:8080'
 # 高升
-VUE_APP_BASE_API = '192.168.1.39:8080'
+# VUE_APP_BASE_API = '192.168.1.39:8080'
 
 
 # 矿大

+ 8 - 0
src/api/index.js

@@ -248,3 +248,11 @@ export function reportReportBsEquipDangerList (data) {
     data: data
   })
 }
+//资源设备统计-设备隐患统计
+export function laboratorySubRelInfoKeySubList  (data) {
+  return request({
+    url: '/laboratory/subRelInfo/keySubList ',
+    method: 'post',
+    data: data
+  })
+}

+ 32 - 7
src/views/safetyOverview/pageComponent/dangerComponents.vue

@@ -55,6 +55,8 @@
         newHazard:0,
         refreshNum:0,
         maxData:[],
+        maxNum:[],
+        mxaText:[],
         dataIndex:0,
       }
     },
@@ -97,30 +99,53 @@
           this.$set(this,'newHazard',response.data.newHazard?response.data.newHazard:0);
           let maxList = [];
           let list = [];
+          let maxNum = [];
+          let numList = [];
+          let mxaText = [];
+          let textList = [];
           let num = 0;
           for(let i=0;i<response.data.hazardTotalSortSubs.length;i++){
             if(num < 5){
               list.push(response.data.hazardTotalSortSubs[i])
+              numList.unshift(response.data.hazardTotalSortSubs[i].ratio)
+              textList.push(response.data.hazardTotalSortSubs[i].ratio+'%')
               num++
+              if((i+1)==response.data.hazardTotalSortSubs.length){
+                maxList.push(list);
+                maxList = JSON.parse(JSON.stringify(maxList));
+                maxNum.push(numList);
+                maxNum = JSON.parse(JSON.stringify(maxNum));
+                mxaText.push(textList);
+                mxaText = JSON.parse(JSON.stringify(mxaText));
+                list = [response.data.hazardTotalSortSubs[i]];
+                numList = [response.data.hazardTotalSortSubs[i].ratio];
+                textList = [response.data.hazardTotalSortSubs[i].ratio+'%'];
+              }
             }else{
               maxList.push(list);
               maxList = JSON.parse(JSON.stringify(maxList));
+              maxNum.push(numList);
+              maxNum = JSON.parse(JSON.stringify(maxNum));
+              mxaText.push(textList);
+              mxaText = JSON.parse(JSON.stringify(mxaText));
               list = [response.data.hazardTotalSortSubs[i]];
+              numList = [response.data.hazardTotalSortSubs[i].ratio];
+              textList = [response.data.hazardTotalSortSubs[i].ratio+'%'];
               num = 1;
             }
           }
-          maxList.push(list);
-          maxList = JSON.parse(JSON.stringify(maxList));
           this.$set(this,'maxData',maxList);
+          this.$set(this,'maxNum',maxNum);
+          this.$set(this,'mxaText',mxaText);
           this.$set(this,'dataIndex',0);
           this.setData();
         });
       },
-      eChartsMethod() {
+      eChartsMethod(list,text) {
         let msg = {
-          data: [25, 35.5, 46.5, 56.5, 63.5],
+          data: this.maxNum[this.dataIndex],
           total: 100,
-          percentdata: ['32%', '40%', '50%', '65%', '70%'],
+          percentdata: this.mxaText[this.dataIndex],
           leftname: [
             '',
             '',
@@ -134,8 +159,8 @@
         let totaldata = []
         let percentdata = []
         msg.data.forEach((value)=>{
-          totaldata.push(81.3)
-          data.push((81.3 * value) / 100)
+          totaldata.push(100)
+          data.push((55 * value) / 100)
           data2.push(100)
           percentdata.push(Math.round((value / msg.total) * 100) + '%')
         })

+ 24 - 4
src/views/safetyOverview/pageComponent/monitoringComponents.vue

@@ -16,7 +16,7 @@
   </div>
 </template>
 <script>
-  import { iotCameraFindByCondition } from "@/api/index";
+  import { laboratorySubRelInfoKeySubList,iotCameraFindByCondition } from "@/api/index";
   import H5PlayerVideo from '@/components/H5PlayerVideo/H5PlayerVideo.vue';
   export default {
     name: 'monitoringComponents',
@@ -34,16 +34,36 @@
           page:1,
           pageSize:4,
         },
+        //eCharts定时器
+        eChartsTimer:null,
       }
     },
     created () {
-      this.videoInitialize();
+      this.timedRefresh();
     },
     mounted () {
 
     },
     methods: {
-      videoInitialize() {
+      timedRefresh(){
+        let self = this;
+        self.getData();
+        //定时动画
+        window.clearInterval(self.eChartsTimer);
+        self.eChartsTimer = setInterval(function(){
+          self.getData();
+        },1000*30);
+      },
+      getData(){
+        laboratorySubRelInfoKeySubList({page:this.videoQueryParams.page,pageSize:this.videoQueryParams.pageSize}).then(response => {
+          let subList = [];
+          for(let i=0;i<response.data.records.length;i++){
+            subList.push(response.data.records[i].subId);
+          }
+          this.videoInitialize(subList);
+        });
+      },
+      videoInitialize(subList) {
         let self = this;
         self.$set(self, 'videoType', false);
         self.$set(self, 'videoList', []);
@@ -54,7 +74,7 @@
           buildId:'',
           floorId:'',
           passageway:'',
-          subIds:['1816062550345723905','1815299331689222145'],
+          subIds:subList,
         };
         iotCameraFindByCondition(obj).then(response => {
           let list = [];