459242451@qq.com hace 3 años
padre
commit
a1c400ef70
Se han modificado 1 ficheros con 36 adiciones y 65 borrados
  1. 36 65
      ruoyi-ui/src/views/components/table/homeTable.vue

+ 36 - 65
ruoyi-ui/src/views/components/table/homeTable.vue

@@ -170,44 +170,9 @@ export default {
         endMonth: ''
       },
       shipDateArry: [],
-      heyDeviceData: [
-        {"name": "南京三桥黑烟1", "locations": [[118.643133, 31.969894]], "data": {'监测点': "南京三桥", '类型': '黑烟检测'}},
-        {"name": "南京三桥黑烟2", "locations": [[118.642232, 31.970804]], "data": {'监测点': "南京三桥", '类型': '黑烟检测'}},
-        {"name": "南京三桥黑烟3", "locations": [[118.6503, 31.965016]]},
-        {"name": "南京三桥黑烟4", "locations": [[118.638434, 31.973189]]},
-        {"name": "南京三桥黑烟5", "locations": [[118.643283, 31.970076]]},
-        {"name": "南京三桥黑烟6", "locations": [[118.647403, 31.967309]]},
-        {"name": "苏通大桥黑烟1", "locations": [[121.001581, 31.78503]]},
-        {"name": "苏通大桥黑烟2", "locations": [[120.997083, 31.76303]]},
-        {"name": "苏通大桥黑烟3", "locations": [[120.998929, 31.771094]]},
-        {"name": "苏通大桥黑烟4", "locations": [[121.002491, 31.791012]]},
-        {"name": "江阴大桥黑烟1", "locations": [[120.27317, 31.945522]]},
-        {"name": "江阴大桥黑烟2", "locations": [[120.274763, 31.942572]]},
-        {"name": "润扬大桥黑烟1", "locations": [[119.366033, 32.210959]]},
-        {"name": "润扬大桥黑烟2", "locations": [[119.370324, 32.202425]]},
-      ],
-      so2DeviceData: [
-        {"name": "南京三桥嗅探1", "locations": [[118.640237, 31.971992]]},
-        {"name": "南京三桥嗅探2", "locations": [[118.647447, 31.967359]]},
-        {"name": "南京三桥嗅探3", "locations": [[118.641632, 31.971064]]},
-        {"name": "苏通大桥嗅探1", "locations": [[121.003306, 31.792982]]},
-        {"name": "苏通大桥嗅探2", "locations": [[120.999529, 31.775326]]},
-        {"name": "江阴大桥嗅探1", "locations": [[120.272167, 31.947384]]},
-        {"name": "江阴大桥嗅探2", "locations": [[120.274441, 31.943087]]},
-        {"name": "润扬大桥嗅探1", "locations": [[119.367277, 32.209071]]},
-        {"name": "润扬大桥嗅探2", "locations": [[119.369466, 32.204568]]},
-      ],
-      aisDeviceData: [
-        {"name": "南京三桥光谱1", "locations": [[118.642876, 31.970445]]},
-        {"name": "南京三桥光谱2", "locations": [[118.648949, 31.966386]]},
-        {"name": "南京三桥光谱3", "locations": [[118.651223, 31.964747]]},
-        {"name": "苏通大桥光谱1", "locations": [[121.003134, 31.789772]]},
-        {"name": "苏通大桥光谱2", "locations": [[120.997985, 31.762921]]},
-        {"name": "江阴大桥光谱1", "locations": [[120.272044, 31.947069]]},
-        {"name": "江阴大桥光谱2", "locations": [[120.276078, 31.940587]]},
-        {"name": "润扬大桥光谱1", "locations": [[119.367235, 32.209107]]},
-        {"name": "润扬大桥光谱2", "locations": [[119.369724, 32.204459]]},
-      ],
+      heyDeviceData: [],
+      so2DeviceData: [],
+      aisDeviceData: [],
       allship: [],
       ship: [],
       ship1: [
@@ -219,7 +184,7 @@ export default {
         // {"name": "五号船", "locations": [[118.639711, 31.96602]], 'type': 2,"head":270},
         // {"name": "五号船", "locations": [[118.639711, 31.96602]], 'type': 2,"head":360},
       ],
-      devicenums:{},
+      devicenums: {},
       startMonth: {
         disabledDate: time => {
           if (this.shipDate.endMonth) {
@@ -284,10 +249,10 @@ export default {
     //  this.getChart();
   },
   methods: {
-    showdevicests(){
+    showdevicests() {
       this.dialogVisible = true;
       setTimeout(() => {
-        this.getChart([],this.devicenums);
+        this.getChart([], this.devicenums);
       }, 100);
 
     },
@@ -383,28 +348,28 @@ export default {
         }
 
         let devicesdata = {};
-        for(var i in data.data){
+        for (var i in data.data) {
           //设备列表
           var t = {};
           var objs = data.data[i];
-          for(var p in objs){
+          for (var p in objs) {
             var dd = objs[p];
-            if(t[dd.deviceType]==undefined||t[dd.deviceType]==null){
-              t[dd.deviceType]=1;
-            }else{
-              t[dd.deviceType]+=1;
+            if (t[dd.deviceType] == undefined || t[dd.deviceType] == null) {
+              t[dd.deviceType] = 1;
+            } else {
+              t[dd.deviceType] += 1;
             }
           }
-          devicesdata[i]=t;
+          devicesdata[i] = t;
         }
 
         // debugger
         this.devicenums = devicesdata;
 
-      // setTimeout(() => {
-      //   //  执行echarts画图方法
-      //   this.getChart([], devicesdata);
-      // }, 1000*4);
+        // setTimeout(() => {
+        //   //  执行echarts画图方法
+        //   this.getChart([], devicesdata);
+        // }, 1000*4);
 
         //  console.log(deviceList);
       });
@@ -762,7 +727,7 @@ export default {
     getChart(nameArry, dataArry) {
 
       var orgData = dataArry;
-      var that= this;
+      var that = this;
 
       var myChart = this.$echarts.init(document.getElementById('equipmentChart'));
       // var option = {
@@ -907,8 +872,6 @@ export default {
       // myChart.setOption(option);
 
 
-
-
       var xAxisData = []; //x轴坐标的集合
       // var dataData = [];
 
@@ -958,9 +921,10 @@ export default {
       var series = [];
       for (var d in orgList) {
         var ks = orgList[d];
-
         var ds = dataMap[ks];
+        // console.log("====" + ds);
         series.push({
+          name: ks,
           data: ds,
           type: "custom",
           itemStyle: {
@@ -985,21 +949,27 @@ export default {
         });
       }
       var option = {
+        color: ['#F56C6C', '#FFC53A', '#7CA870'],
         tooltip: {
           trigger: "axis",
           axisPointer: {
             type: "shadow",
           },
-          formatter:function(result){
+          formatter: function (result) {
             let text = "";
             let ele = "";
-            result.forEach(item=>{
+            result.forEach(item => {
               ele = item.axisValue;
               // console.log()
-              var c = "<span style=\"display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:"+newcolor(item)+";\"></span>"
-              text  += `${c} ${item.value[3]}:${item.value[2]}<br>`
+              // var c = "<span style=\"display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:" + newcolor(item) + ";\"></span>"
+              text += item.marker + `${item.value[3]}:${item.value[2]}<br>`
             })
-            return `${ele}<br>${text}`;
+            return `${text}`;
+          }
+        },
+        legend: {
+          textStyle: {
+            color: '#ffffff'  // 图例文字颜色
           }
         },
         xAxis:
@@ -1023,8 +993,8 @@ export default {
             },
 
           },
-          // type: "category",
-          // data: xAxisData,
+        // type: "category",
+        // data: xAxisData,
         // },
         yAxis: [{
           type: 'value',
@@ -1062,6 +1032,7 @@ export default {
           return orgList.indexOf(curOrg) - orgList.indexOf(preOrg) - 1;
         }
       }
+
       /**
        *自定义渐变颜色
        */
@@ -1103,7 +1074,7 @@ export default {
       }
 
       function renderItem(params, api) {
-        let newFill = newcolor(params);
+        // let newFill = newcolor(params);
         var yValue = api.value(2); //当前页面的累加时长
         var start = api.coord([api.value(0), yValue]);
         var size = api.size([api.value(1) - api.value(0), yValue]);
@@ -1118,7 +1089,7 @@ export default {
           //     color: "#fa6206",
           //   },
           // ]),
-          fill: newFill,
+          // fill: newFill,
         });
 
         var barWidth = 10;