فهرست منبع

efAnalysisdataVisualization eleFire.js 韩正义 commit at 2021-04-19

韩正义 4 سال پیش
والد
کامیت
398406a3b2
1فایلهای تغییر یافته به همراه193 افزوده شده و 0 حذف شده
  1. 193 0
      efAnalysisdataVisualization/externalJs/eleFire.js

+ 193 - 0
efAnalysisdataVisualization/externalJs/eleFire.js

@@ -2184,3 +2184,196 @@ function getListData(queryParam = {}) {
                         },
                         axisLine: {
                             show: false // 去除轴线
+                        }
+                    },
+
+                    yAxis: {
+                        type: "value",
+                        axisTick: {
+                            show: false // 去除刻度线
+                        },
+                        axisLabel: {
+                            show: false // 去除文本
+                        },
+                        axisLine: {
+                            show: false // 去除轴线
+                        },
+                        splitLine: {
+                            lineStyle: {
+                                color: "#aaa", // 分割线颜色
+                                opacity: .2
+                            }
+                        }
+                    },
+                    series: [{
+                            symbol: "none",
+                            name: "线缆产生的温度",
+                            type: "line",
+                            smooth: true, // true 可以让我们的折线显示带有弧度
+                            areaStyle: {
+                                normal: {
+                                    color: new echarts.graphic.LinearGradient(
+                                        0,
+                                        0,
+                                        0,
+                                        1, [{
+                                                offset: 0,
+                                                color: "rgba(5,238,231,.6)"
+                                            },
+                                            {
+                                                offset: 0.8,
+                                                color: "rgba(5,238,231, 0.4)"
+                                            }
+                                        ],
+                                        false
+                                    ),
+                                }
+                            },
+
+                            data: sortData[0].data[0]
+                        },
+                        {
+                            symbol: "none",
+                            name: "环境温度",
+                            type: "line",
+                            smooth: true,
+                            areaStyle: {
+                                normal: {
+                                    color: new echarts.graphic.LinearGradient(
+                                        0,
+                                        0,
+                                        0,
+                                        1, [{
+                                                offset: 0,
+                                                color: "rgba(153,153,255,.6)"
+                                            },
+                                            {
+                                                offset: 0.8,
+                                                color: "rgba(153,153,255, 0.4)"
+                                            }
+                                        ],
+                                        false
+                                    ),
+                                }
+                            },
+
+                            data: sortData[0].data[1]
+                        },
+                        {
+                            symbol: "none",
+                            name: "线缆温度",
+                            type: "line",
+                            smooth: true,
+                            areaStyle: {
+                                normal: {
+                                    color: new echarts.graphic.LinearGradient(
+                                        0,
+                                        0,
+                                        0,
+                                        1, [{
+                                                offset: 0,
+                                                color: "rgba(255,147,180,.6)"
+                                            },
+                                            {
+                                                offset: 0.8,
+                                                color: "rgba(255,147,180, 0.4)"
+                                            }
+                                        ],
+                                        false
+                                    ),
+                                }
+                            },
+
+                            data: sortData[0].data[2]
+                        }
+                    ]
+                };
+
+                myChart.setOption(option);
+                var img1 = document.getElementById('hotAnalysisChart1_img');
+                setTimeout(function() {
+                    img1.src = myChart.getDataURL();
+                }, 1000)
+
+
+            })();
+
+            /* 
+                 导出数据对接 end
+            */
+
+        } else {
+            // alert('暂无数据')
+            layui.use('layer', function() {
+                var layer = layui.layer;
+
+                layer.alert('暂无数据', { icon: 5 }, function() {
+                    location.reload();
+                });
+            });
+        }
+
+    }, function(errorMsg) {
+        layui.use('layer', function() {
+            var layer = layui.layer;
+            layer.alert('数据请求失败', { icon: 5 });
+        });
+    }, 1)
+};
+
+function getSearchParamObj() {
+    let queryParam = {};
+    let buildingVal = $('#building').val();
+    let chooseTime = $('#chooseTime').val();
+    queryParam.company_code = buildingVal;
+    queryParam.generation_time = chooseTime;
+    return queryParam;
+
+}
+
+// 打印
+(function() {
+
+    $("#btnPrint").click(function() {
+
+        print_detail()
+
+    });
+
+    var print_detail = function() {
+
+        //打印前echarts图表转换成图片 start 
+        $('#divergenceChart1_img,#divergenceChart2_img,#divergenceChart3_img,#divergenceChart4_img').show()
+        $('#divergenceChart1,#divergenceChart2,#divergenceChart3,#divergenceChart4').hide()
+        $('#oldAnalysisChart1_img,#oldAnalysisChart2_img').show()
+        $('#oldAnalysisChart1,#oldAnalysisChart2').hide()
+        $('#hotAnalysisChart1_img').show()
+        $('#hotAnalysisChart1').hide()
+            //  end
+
+        var div1_label1 = document.getElementById('printArea').innerHTML;
+        var hkey_key;
+        var hkey_root = 'HKEY_CURRENT_USER';
+        var hkey_path = '\\Software\\Micorsoft\\Internet Explorer\\PageSetup\\';
+        var print_win = window.open('打印窗口', '_blank');
+        var div = document.createElement('div');
+        div.setAttribute('width', '100%');
+        div.setAttribute('height', '100%');
+        var div_print = document.createElement('div');
+        div_print.setAttribute('style', 'width:595px;height:842px;padding:50px 20px;margin:0px auto 0px auto');
+        div_print.innerHTML = div1_label1;
+        div.appendChild(div_print);
+
+        print_win.document.write(div.innerHTML);
+        print_win.document.close();
+        try {
+            var RegWsh = new ActiveXObject('WScript.Shell');
+            hkey_key = 'header';
+            RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, '');
+            hkey_key = 'footer';
+            RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, '');
+        } catch (e) {}
+        print_win.print();
+        print_win.close();
+    }
+})()