南昌市物联网技防平台-前端
Administrator
2021-04-08 b07ab75fb61fff925c7eafb8b9533350e20d64c8
src/views/alarmManagement/alarmAnalysis.vue
@@ -120,7 +120,11 @@
    mounted() {
      //默认是查询当月的数据
      this.getData(2);
      window.handleStartAlarm=this.handleStartAlarm;
      window.handleStartParcel=this.handleStartParcel;
      window.handleStartParcelKind=this.handleStartParcelKind;
      window.handleStartEquipment=this.handleStartEquipment;
      window.handleStartSuser=this.handleStartSuser;
    },
    methods: {
@@ -161,6 +165,12 @@
        that.statisToTalData.data = [
            {
              click: function (item) {
                  var data =[];
                  data.push({
                    waringType:'紧急求救',
                    status:0
                  })
                  window.parent.handleStartAlarm(data);
              },
              title: '警情总数',
              count: res.data.data[0].value,
@@ -169,6 +179,22 @@
            },
            {
              click: function (item) {
                var data =[];
                // 当前时间
                var date = new Date();
                //年
                var Y = date.getFullYear();
                //月
                var M = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
                //日
                var D = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
                data.push({
                startTime:Y + "-" + M + "-" + D + " 00:00:00",
                endTime: Y +"-" +M +"-" + D +  " 23:59:59",
                decisioDiagramResult:"contraband"
                  });
                window.parent.handleStartParcel(data);
              },
              title: '违禁包裹数',
              count: res.data.data[1].value,
@@ -177,6 +203,22 @@
            },
            {
              click: function (item) {
                var data = [];
                // 当前时间
                var date = new Date();
                //年
                var Y = date.getFullYear();
                //月
                var M = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
                //日
                var D = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
                data.push({
                startTime:Y + "-" + M + "-" + D + " 00:00:00",
                endTime: Y +"-" +M +"-" + D +  " 23:59:59",
                decisioDiagramResult:"contraband"
                  });
                window.parent.handleStartParcelKind(data);
              },
              title: '违禁物品数',
              count: res.data.data[2].value,
@@ -185,6 +227,12 @@
            },
            {
              click: function (item) {
                var data =[];
                data.push({
                  dxtype: 1
                });
                //console.log(data[0],111);
                window.parent.handleStartEquipment(data);
              },
              title: '在线设备数',
              count: res.data.data[3].value,
@@ -193,6 +241,7 @@
            },
            {
              click: function (item) {
                window.parent.handleStartSuser();
              },
              title: '客户数量',
              count: res.data.data[4].value,
@@ -201,6 +250,46 @@
            }
          ];
        }); 
      },
      //主动报警(一键求助,电话报警)分页数据
      handleStartAlarm(data) {
        this.$router.push({
          path: `/realTimePolice/index`,
          query: data[0],
        });
      },
      //包裹分页数据
      handleStartParcel(data) {
        debugger;
        this.$router.push({
          path: `/parcel/index`,
          query: data[0],
        });
      },
      //违禁品分页数据
      handleStartParcelKind(data) {
        this.$router.push({
          path: `/parcelKind/index`,
          query: data[0],
        });
      },
      //在线设备分页数据
      handleStartEquipment(data) {
        this.$router.push({
          path: `/clientManagement/index`,
          query: data[0],
        });
      },
      //客户管理分页数据
      handleStartSuser() {
        this.$router.push({
          path: `/suser/index`,
        });
      },
      //预警数量分布
@@ -245,7 +334,9 @@
          })
          let echarts = require('echarts');
          let myChart = echarts.init(document.getElementById('alarmNumberStatis'));
          var colors = ['#FF9836', '#1E90FF', '#F34A4A', '#8058A5'];
          let option = {
              color:colors,
              title: {
                textStyle: {
                          fontWeight: 'normal',
@@ -302,7 +393,7 @@
                click: function (item) {
                },
                title:'一键求助',
                color:'yellow',
                color:'#FF9836',
                target:'_blank',
                name:'日平均一键求助数',
                date:(res.data.data[0]/Math.round(day)).toFixed(2)
@@ -311,7 +402,7 @@
                click: function (item) {
                },
                title:'违禁品',
                color:'green',
                color:'#1E90FF',
                name:'日平均违禁品数',
                date:(res.data.data[1]/Math.round(day)).toFixed(2)
            },
@@ -319,7 +410,7 @@
                click: function (item) {
                },
                title:'红色健康码',
                color:'#3fa1ff',
                color:'#F34A4A',
                name:'日平均红色健康码数',
                date:(res.data.data[2]/Math.round(day)).toFixed(2)
            },
@@ -327,7 +418,7 @@
                click: function (item) {
                },
                title:'体温异常',
                color:'red',
                color:'#8058A5',
                name:'日平均体温异常数',
                date:(res.data.data[3]/Math.round(day)).toFixed(2)
            }
@@ -348,7 +439,9 @@
          )
          let echarts = require('echarts');
          let myChart = echarts.init(document.getElementById('alarmTypeProEcharts'));
          var colors = ['#FF9836', '#3fa1ff', '#F34A4A', '#8058A5'];
          let option = {
              color:colors,
              title: {
                textStyle: {
                          fontWeight: 'normal',
@@ -413,7 +506,7 @@
                click: function (item) {
                },
                title:'一键求助',
                color:'yellow',
                color:'#FF9836',
                target:'_blank',
                name:res.data.data[0],
                date:(res.data.data[0]/count*100).toFixed(2)+'%'
@@ -422,7 +515,7 @@
                click: function (item) {
                },
                title:'违禁品',
                color:'green',
                color:'#3fa1ff',
                name:res.data.data[1],
                date:(res.data.data[1]/count*100).toFixed(2)+'%'
            },
@@ -430,7 +523,7 @@
                click: function (item) {
                },
                title:'红色健康码',
                color:'#3fa1ff',
                color:'#F34A4A',
                name:res.data.data[2],
                date:(res.data.data[2]/count*100).toFixed(2)+'%'
            },
@@ -438,7 +531,7 @@
                click: function (item) {
                },
                title:'体温异常',
                color:'red',
                color:'#8058A5',
                name:res.data.data[3],
                date:(res.data.data[3]/count*100).toFixed(2)+'%'
            }
@@ -549,7 +642,9 @@
          var data = res.data.data;
          let echarts = require('echarts');
          let myChart = echarts.init(document.getElementById('confirmTimeProEcharts'));
          var colors = ['green','#3fa1ff','yellow','#F34A4A']
          let option = {
              color:colors,
              title: {
                textStyle: {
                          fontWeight: 'normal',
@@ -592,7 +687,7 @@
                          show: false
                      },
                      data: [
                          {value: data[0], name: '0-5分钟'},
                          {value: data[0], name: '小于5分钟'},
                          {value: data[1], name: '5-10分钟'},
                          {value: data[2], name: '10-30分钟'},
                          {value: data[3], name: '30分钟以上'}
@@ -616,7 +711,7 @@
                  click: function (item) {
                  },
                  title:'小于5分钟',
                  color:'yellow',
                  color:'green',
                  target:'_blank',
                  name:data[0]==0? 0:data[0]+"次",
              },
@@ -624,21 +719,21 @@
                  click: function (item) {
                  },
                  title:'5-10分钟',
                  color:'green',
                  color:'#3fa1ff',
                  name:data[1]==0? 0:data[1]+"次",
              },
              {
                  click: function (item) {
                  },
                  title:'10-30分钟',
                  color:'#3fa1ff',
                  color:'yellow',
                  name:data[2]==0? 0:data[2]+"次",
              },
              {
                  click: function (item) {
                  },
                  title:'30分钟以上',
                  color:'red',
                  color:'#F34A4A',
                  name:data[3]==0? 0:data[3]+"次",
              }
            ];
@@ -683,7 +778,9 @@
          var data = res.data;
          let echarts = require('echarts');
          let myChart = echarts.init(document.getElementById('alarmTimeDisEchars'));
          var colors = ['#FF9836', '#1E90FF', '#F34A4A', '#8058A5'];
          let option = {
              color: colors,
              title: {
                textStyle: {
                          fontWeight: 'normal',