瀏覽代碼

efAnalysisdataVisualization eleFire.js 韩正义 commit at 2020-12-07

韩正义 4 年之前
父節點
當前提交
3dfb42ad6b
共有 1 個文件被更改,包括 101 次插入0 次删除
  1. 101 0
      efAnalysisdataVisualization/externalJs/eleFire.js

+ 101 - 0
efAnalysisdataVisualization/externalJs/eleFire.js

@@ -687,3 +687,104 @@ function getListData(queryParam = {}) {
                                     ),
                                     shadowColor: "rgba(0, 0, 0, 0.1)"
                                 }
+                            },
+
+
+                            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(0,150,255,0.5)"
+                                            },
+                                            {
+                                                offset: 0.8,
+                                                color: "rgba(0,150,255, 0.1)"
+                                            }
+                                        ],
+                                        false
+                                    ),
+                                    shadowColor: "rgba(0, 0, 0, 0.1)"
+                                }
+                            },
+
+                            data: sortData[0].data[1]
+                        }
+                    ]
+                };
+
+                myChart.setOption(option);
+                window.addEventListener("resize", function() {
+                    myChart.resize();
+                });
+
+                // 点击切换效果
+                $(".oldAnalysis .tab-line").on("click", "a", function() {
+                    $(this).addClass('active').siblings().removeClass('active')
+                    var obj = sortData[$(this).index()];
+                    option.series[0].data = obj.data[0];
+                    option.series[1].data = obj.data[1];
+                    // 重新渲染
+                    myChart.setOption(option);
+
+                });
+            })();
+
+            // 折线图定制 (热老化分析)
+            (function() {
+
+                let thermal_aging = result.RESULT[0].thermal_aging;
+
+                // 结论数据渲染
+                var items = '';
+                var conclusion = thermal_aging.conclusion
+                for (x in conclusion) {
+                    xIndex = x.substr(x.length - 1, 1);
+                    items += `<p>${xIndex}、${conclusion[x]}</p>`
+                }
+                $('.hotAnalysis .summaryDetail').html(items);
+
+
+                // 热老化
+                let a = [];
+                let b = [];
+                let c = [];
+                let data_time = [];
+                let visualization = thermal_aging.visualization;
+                visualization.forEach(function(item, index) {
+                    a.push(item.generation_temperature)
+                    b.push(item.ambient_temperature)
+                    c.push(item.Cable_temperature)
+                    data_time.push(item.data_time)
+                });
+
+                var sortData = [{
+                    data: [
+                        // 三个数组是因为有3条线
+                        a, b, c
+                    ]
+                }];
+
+                var xData = function() {
+                    var data = [];
+                    for (var i = 1; i < visualization.length + 1; i++) {
+                        data.push(i);
+                    }
+                    return data;
+                }();
+
+                // 1. 实例化对象
+                var myChart = echarts.init(document.querySelector(".hotAnalysis .chart"));
+                // 2.指定配置
+                var option = {
+