dedsudiyu 3 months ago
parent
commit
625f597364

+ 27 - 1
src/views/resourceDevice/pageComponent/cageDangerComponent.vue

@@ -100,6 +100,15 @@
               fontSize:18,
               fontSize:18,
               color: '#fff',
               color: '#fff',
             },
             },
+            formatter: (name, value) => {
+              let num = null
+              const item = list.find(i => {
+                if (name == i.name) {
+                  num = i.value
+                }
+              })
+              return name +' '+ num
+            }
           },
           },
           tooltip: {
           tooltip: {
             trigger: 'item',
             trigger: 'item',
@@ -116,7 +125,24 @@
               radius: ['40%', '50%'],
               radius: ['40%', '50%'],
               center: ['30%', '57%'],
               center: ['30%', '57%'],
               label: {
               label: {
-                show: false
+                show: true,
+                position: 'center',
+                normal: {
+                  formatter: '{yy|{d} %}',
+                  rich: {
+                    xx: {
+                      fontSize: 16,
+                      lineHeight: 32,
+                      color: '#fff'
+                    },
+                    yy: {
+                      fontSize: 16,
+                      fontWeight: 600,
+                      lineHeight: 32,
+                      color: '#fff'
+                    }
+                  }
+                }
               },
               },
               data: list
               data: list
             }
             }

+ 27 - 1
src/views/resourceDevice/pageComponent/equipmentDangerComponent.vue

@@ -99,6 +99,15 @@
               fontSize:18,
               fontSize:18,
               color: '#fff',
               color: '#fff',
             },
             },
+            formatter: (name, value) => {
+              let num = null
+              const item = list.find(i => {
+                if (name == i.name) {
+                  num = i.value
+                }
+              })
+              return name +' '+ num
+            }
           },
           },
           tooltip: {
           tooltip: {
             trigger: 'item',
             trigger: 'item',
@@ -115,7 +124,24 @@
               radius: ['40%', '50%'],
               radius: ['40%', '50%'],
               center: ['30%', '57%'],
               center: ['30%', '57%'],
               label: {
               label: {
-                show: false
+                show: true,
+                position: 'center',
+                normal: {
+                  formatter: '{yy|{d} %}',
+                  rich: {
+                    xx: {
+                      fontSize: 16,
+                      lineHeight: 32,
+                      color: '#fff'
+                    },
+                    yy: {
+                      fontSize: 16,
+                      fontWeight: 600,
+                      lineHeight: 32,
+                      color: '#fff'
+                    }
+                  }
+                }
               },
               },
               data: list
               data: list
             }
             }

+ 27 - 1
src/views/resourceDevice/pageComponent/instrumentDangerComponent.vue

@@ -100,6 +100,15 @@
               fontSize:18,
               fontSize:18,
               color: '#fff',
               color: '#fff',
             },
             },
+            formatter: (name, value) => {
+              let num = null
+              const item = list.find(i => {
+                if (name == i.name) {
+                  num = i.value
+                }
+              })
+              return name +' '+ num
+            }
           },
           },
           tooltip: {
           tooltip: {
             trigger: 'item',
             trigger: 'item',
@@ -116,7 +125,24 @@
               radius: ['40%', '50%'],
               radius: ['40%', '50%'],
               center: ['30%', '57%'],
               center: ['30%', '57%'],
               label: {
               label: {
-                show: false
+                show: true,
+                position: 'center',
+                normal: {
+                  formatter: '{yy|{d} %}',
+                  rich: {
+                    xx: {
+                      fontSize: 16,
+                      lineHeight: 32,
+                      color: '#fff'
+                    },
+                    yy: {
+                      fontSize: 16,
+                      fontWeight: 600,
+                      lineHeight: 32,
+                      color: '#fff'
+                    }
+                  }
+                }
               },
               },
               data: list
               data: list
             }
             }

+ 27 - 1
src/views/resourceDevice/pageComponent/resourceDangerComponent.vue

@@ -103,6 +103,15 @@
               fontSize:18,
               fontSize:18,
               color: '#fff',
               color: '#fff',
             },
             },
+            formatter: (name, value) => {
+              let num = null
+              const item = list.find(i => {
+                if (name == i.name) {
+                  num = i.value
+                }
+              })
+              return name +' '+ num
+            }
           },
           },
           tooltip: {
           tooltip: {
             trigger: 'item',
             trigger: 'item',
@@ -119,7 +128,24 @@
               radius: ['40%', '50%'],
               radius: ['40%', '50%'],
               center: ['30%', '57%'],
               center: ['30%', '57%'],
               label: {
               label: {
-                show: false
+                show: true,
+                position: 'center',
+                normal: {
+                  formatter: '{yy|{d} %}',
+                  rich: {
+                    xx: {
+                      fontSize: 16,
+                      lineHeight: 32,
+                      color: '#fff'
+                    },
+                    yy: {
+                      fontSize: 16,
+                      fontWeight: 600,
+                      lineHeight: 32,
+                      color: '#fff'
+                    }
+                  }
+                }
               },
               },
               data: list
               data: list
             }
             }

+ 19 - 2
src/views/safetyOverview/pageComponent/troubleRankingComponents.vue

@@ -68,12 +68,22 @@ import {
           let notRectifyNum = [];
           let notRectifyNum = [];
           let rectifyNum = [];
           let rectifyNum = [];
           let tempNum = [];
           let tempNum = [];
+          let num = 0;
           if (response.data[0]){
           if (response.data[0]){
             for(let i=0;i<response.data.length;i++){
             for(let i=0;i<response.data.length;i++){
               deptSortName.push(response.data[i].deptSortName)
               deptSortName.push(response.data[i].deptSortName)
               notRectifyNum.push(response.data[i].notRectifyNum)
               notRectifyNum.push(response.data[i].notRectifyNum)
               rectifyNum.push(response.data[i].rectifyNum)
               rectifyNum.push(response.data[i].rectifyNum)
               tempNum.push(response.data[i].tempNum)
               tempNum.push(response.data[i].tempNum)
+              if(response.data[i].notRectifyNum > num){
+                num = response.data[i].notRectifyNum;
+              }
+              if(response.data[i].rectifyNum > num){
+                num = response.data[i].rectifyNum;
+              }
+              if(response.data[i].tempNum > num){
+                num = response.data[i].tempNum;
+              }
             }
             }
           } else {
           } else {
             deptSortName = [''];
             deptSortName = [''];
@@ -81,7 +91,7 @@ import {
             rectifyNum = [0];
             rectifyNum = [0];
             tempNum = [0];
             tempNum = [0];
           }
           }
-          this.eChartsMethod(deptSortName,notRectifyNum,rectifyNum,tempNum);
+          this.eChartsMethod(deptSortName,notRectifyNum,rectifyNum,tempNum,num);
         });
         });
       },
       },
       checkButton(type){
       checkButton(type){
@@ -91,7 +101,7 @@ import {
         }
         }
       },
       },
       //
       //
-      eChartsMethod(deptSortName,notRectifyNum,rectifyNum,tempNum){
+      eChartsMethod(deptSortName,notRectifyNum,rectifyNum,tempNum,num){
         let option = {
         let option = {
           tooltip: {
           tooltip: {
             trigger: "axis",
             trigger: "axis",
@@ -269,6 +279,13 @@ import {
             },
             },
           ],
           ],
         };
         };
+        if(num < 5){
+          option.yAxis[0].max = 5;
+        }else{
+          option.yAxis[0].min= 0;
+          option.yAxis[0].max= num; // 计算最大值
+          option.yAxis[0].interval= Math.ceil(num / 5); // 平均分为5份
+        }
         let echartsBox = this.$echarts.init(document.getElementById('troubleRankingComponentsECharts'));
         let echartsBox = this.$echarts.init(document.getElementById('troubleRankingComponentsECharts'));
         echartsBox.clear();
         echartsBox.clear();
         echartsBox.setOption(option);
         echartsBox.setOption(option);

+ 22 - 2
src/views/safetyOverview/pageComponent/warningComponents.vue

@@ -148,9 +148,29 @@
       //获取数据
       //获取数据
       getData() {
       getData() {
         reportReportBigDataWarningHandle({ date: this.timeList[this.dayIndex].value }).then(response => {
         reportReportBigDataWarningHandle({ date: this.timeList[this.dayIndex].value }).then(response => {
-          this.$set(this, 'deptList', response.data)
+          let list = [];
+          for(let i=0;i<response.data.length;i++){
+            let obj = {
+              handleTotal:response.data[i].handleTotal,
+              rate:response.data[i].rate,
+              schoolName:response.data[i].schoolName,
+              todayHandleTotal:response.data[i].todayHandleTotal,
+              yesterdayHandleTotal:response.data[i].yesterdayHandleTotal,
+              warningHandleSubs:[],
+            }
+            for(let o=0;o<response.data[i].warningHandleSubs.length;o++){
+              if(o<18){
+                obj.warningHandleSubs.push(response.data[i].warningHandleSubs[o])
+              }
+            }
+            list.push(obj)
+          }
+          this.$set(this, 'deptList', list)
           this.$set(this, 'deptListIndex', 0)
           this.$set(this, 'deptListIndex', 0)
           this.$set(this, 'deptData', this.deptList[this.deptListIndex])
           this.$set(this, 'deptData', this.deptList[this.deptListIndex])
+          // this.$set(this, 'deptList', response.data)
+          // this.$set(this, 'deptListIndex', 0)
+          // this.$set(this, 'deptData', this.deptList[this.deptListIndex])
         })
         })
       }
       }
     },
     },
@@ -244,7 +264,7 @@
           .for-position-name-box-one {
           .for-position-name-box-one {
             border-radius: 8px;
             border-radius: 8px;
             display: inline-block;
             display: inline-block;
-            min-width: 130px;
+            min-width: 150px;
             height: 54px;
             height: 54px;
             border: 1px solid #D80707;
             border: 1px solid #D80707;
             box-shadow: inset 0px 0px 10px 0px #D80707;
             box-shadow: inset 0px 0px 10px 0px #D80707;