Browse Source

waterAnalysisSharingEnginePush water.js 李欣儒 commit at 2021-02-25

李欣儒 4 years ago
parent
commit
6bb4c8b163
1 changed files with 160 additions and 0 deletions
  1. 160 0
      waterAnalysisSharingEnginePush/externalJs/water.js

+ 160 - 0
waterAnalysisSharingEnginePush/externalJs/water.js

@@ -1228,3 +1228,163 @@ function getListData(queryParam = {}) {
                 let location_description = [];
                 let start_pressure = [];
                 let end_pressure = [];
+                let leakage_data = leakage_investigation.leakage_data;
+                leakage_data.forEach(function(item, index) {
+
+                    //异常值
+                    abnormal_pressure.push(item.abnormal_pressure)
+
+                    //楼层
+                    location_description.push(item.location_description)
+
+                    //开始值
+                    start_pressure.push(item.start_pressure)
+
+                    //结束值
+                    end_pressure.push(item.end_pressure)
+                });
+
+                var xData = location_description;
+
+                // 基于准备好的dom,初始化echarts实例
+                var myChart = echarts.init(document.querySelector("#hiddenCheckChart1"));
+
+                var option = {
+                    backgroundColor: 'transparent',
+                    color: ['rgba(0,150,255,.5)', 'rgba(255,156,0,.5)'],
+                    tooltip: {
+                        //提示框组件
+                        trigger: 'axis',
+                        formatter: function(params) {
+                            // console.log(params)
+                            var res = '位置:' + params[0].axisValue + '<br />异常水压值 :' + abnormal_pressure[params[0].dataIndex];
+                            return res;
+                        },
+                        axisPointer: {
+                            type: 'shadow',
+                        },
+                        textStyle: {
+
+                            fontStyle: 'normal',
+                            fontFamily: '微软雅黑',
+                            fontSize: 12,
+                        },
+                    },
+                    grid: {
+                        left: '0',
+                        right: '0',
+                        bottom: '40',
+                        top: '0',
+                        containLabel: true,
+                    },
+                    legend: {
+                        // 如果series 对象有name 值,则 legend可以不用写data
+                        itemGap: 20,
+                        itemHeight: 2,
+                        itemWidth: 15,
+                        icon: 'rect',
+                        textStyle: {
+                            color: "#AAA"
+                        },
+                        top: "bottom",
+                    },
+
+                    xAxis: [{
+                        type: 'category',
+                        //	boundaryGap: true,//坐标轴两边留白
+                        data: xData,
+                        axisLabel: {
+                            interval: 0,
+                            // rotate: 340,
+                            // formatter: function(val) {
+                            //     return val.split("").join("\n");
+                            // }, //横轴信息文字竖直显示
+                            textStyle: {
+                                color: '#AAA',
+                                fontStyle: 'normal',
+                                fontFamily: '微软雅黑',
+                                fontSize: 12,
+                            },
+                        },
+
+                        axisTick: {
+                            //坐标轴刻度相关设置。
+                            show: false,
+                        },
+                        axisLine: {
+                            //坐标轴轴线相关设置
+
+                        },
+                        splitLine: {
+                            //坐标轴在 grid 区域中的分隔线。
+                            show: false,
+                        },
+                    }, ],
+                    yAxis: [{
+                        type: 'value',
+
+                        axisLabel: false,
+                        axisLine: {
+                            show: false,
+                        },
+                        axisTick: {
+                            show: false,
+                        },
+                        splitLine: {
+                            show: true,
+                            lineStyle: {
+                                color: "#aaa", // 分割线颜色
+                                opacity: '0.2'
+                            }
+                        },
+                        boundaryGap: ['0', '10%'],
+                    }],
+                    series: [{
+                            name: '起层',
+                            type: 'bar',
+                            data: start_pressure,
+                            barMaxWidth: '11',
+                            itemStyle: {
+                                borderColor: "#0096FF",
+                            },
+                            barGap: '50%',
+                        },
+                        {
+                            name: '始层',
+                            type: 'bar',
+                            data: end_pressure,
+                            barMaxWidth: '11',
+                            itemStyle: {
+                                borderColor: "#FF9C00",
+                            },
+                        },
+                    ],
+                };
+
+                myChart.setOption(option);
+
+                //echarts赋值到src
+                var img1 = document.getElementById('hiddenCheckChart1_img');
+                setTimeout(function() {
+                    img1.src = myChart.getDataURL();
+                }, 1000)
+
+            })();
+
+            // 跨设备数据关联
+            let device_association = result.RESULT[0].device_association;
+
+            // 结论数据渲染
+            var items = '';
+            var conclusion = device_association.conclusion
+            for (x in conclusion) {
+                xIndex = x.substr(x.length - 1, 1);
+                items += `<div>${xIndex}、${conclusion[x]}</div>`
+            }
+            $('.exportBox .device_association .summaryDetail').html(items);
+            // 跨设备数据关联1
+
+            // 喷淋末端、消火栓与水泵启停关联
+            let spray_end = [];
+            let fire_hydrant = [];
+            let pump_status = []