yusijie
2023-10-31 2875e3c55666e30378fa4fa4bc2bb48664cffdac
WebTM/views/ÖÊÁ¿¹ÜÀí/Ê×¼þ¼ìÑéµ¥/QC_FirstPieceCheckReport_ZDQX.html
@@ -2,7 +2,7 @@
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>首检正态分布图报表</title>
    <title>首检震荡曲线图形报表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
@@ -14,6 +14,7 @@
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script src='../../../layuiadmin/lib/extend/echarts.min.js'></script>
    <style type="text/css">
        input.layui-input.layui-unselect {
            padding-right: 0;
@@ -118,7 +119,7 @@
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin: 10px 0 10px">
                                    <div class="layui-row" style="margin: 10px 0 10px;display:none;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">过滤</label>
                                            <div class="layui-input-block">
@@ -148,7 +149,15 @@
                                </div>
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
                        <div>
                            <table class="" id="mainTable" lay-filter="mainTable"></table>
                            <div id="histogram_Avg" style="width:99.5%;height:calc(35vh);margin-top:5px;">
                            </div>
                            <div id="histogram_Diff" style="width:99.5%;height:calc(35vh);margin-top:5px;">
                            </div>
                        </div>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>退出</button>
@@ -190,6 +199,142 @@
            set_ClearBill();
            //#endregion
            //#region【折线图】
            //平均值
            var chartDom = document.getElementById('histogram_Avg');
            var myChart = echarts.init(chartDom);
            var option_ZXT_Avg;
            let H_X = [];//x轴标题
            let HAvg = [];//平均值
            for (let i = 1; i <= 25; i++) {
                H_X.push(i);
            }
            for (let j = 1; j <= 25; j++) {
                var avg = 0;
                for (let i = 0; i < option.data.length; i++) {
                    avg += Number(option.data[i][j]);
                }
                avg = avg / option.data.length;
                HAvg.push(avg.toFixed(2));
            }
            option_ZXT_Avg = {
                grid: {
                    x: '3%', //相当于距离左边效果:padding-left
                    //y: '5%',  //相当于距离上边效果:padding-top
                    bottom: '5%',
                    containLabel: true
                },
                xAxis: {
                    type: 'category',
                    data: H_X
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data: HAvg,
                        type: 'line',
                        areaStyle: {//填充的颜色
                            color: {//线性渐变前四个参数分别是 x0, y0, x2, y2, èŒƒå›´ä»Ž 0 - 1,相当于在图形包围盒中的百分比,如果 globalCoord ä¸º `true`,则该四个值是绝对的像素位置
                                type: 'linear',
                                x: 0,
                                y: 1,
                                x2: 0,
                                y2: 0,
                                colorStops: [{
                                    offset: 0, color: 'rgba(232,247,247)' // 0% å¤„的颜色
                                }, {
                                        offset: 1, color: 'rgba(183,252,252)' // 100% å¤„的颜色
                                }],
                                globalCoord: false// ç¼ºçœä¸º false
                            }
                        },
                        markLine: {
                            symbol: 'none',//去掉箭头
                            data: [
                                { type: 'max', name: 'Max', lineStyle: { color: 'red' }},
                                { type: 'average', name: 'Avg', lineStyle: { color: 'blue' } },
                                { type: 'min', name: 'Min', lineStyle: { color: 'green' } },
                            ]
                        },
                    }
                ]
            };
            option_ZXT_Avg && myChart.setOption(option_ZXT_Avg);
            //差值
            var chartDom = document.getElementById('histogram_Diff');
            var myChart = echarts.init(chartDom);
            var option_ZXT_Diff;
            let HDifference = [];//差值
            var HArr = []; //装检验值
            for (let j = 1; j <= 25; j++) {
                HArr = [];
                for (let i = 0; i < option.data.length; i++) {
                    HArr.push(option.data[i][j]);
                }
                var HMaxValue = Math.max(...HArr);//获取数组中的最大值
                var HMinValue = Math.min(...HArr);//获取数组中的最小值
                HDifference.push(Number(HMaxValue) - Number(HMinValue));
            }
            option_ZXT_Diff = {
                grid: {
                    x: '3%', //相当于距离左边效果:padding-left
                    //y: '5%',  //相当于距离上边效果:padding-top
                    bottom: '5%',
                    containLabel: true
                },
                xAxis: {
                    type: 'category',
                    data: H_X
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data: HDifference,
                        type: 'line',
                        areaStyle: {//填充的颜色
                            color: {//线性渐变前四个参数分别是 x0, y0, x2, y2, èŒƒå›´ä»Ž 0 - 1,相当于在图形包围盒中的百分比,如果 globalCoord ä¸º `true`,则该四个值是绝对的像素位置
                                type: 'linear',
                                x: 0,
                                y: 1,
                                x2: 0,
                                y2: 0,
                                colorStops: [{
                                    offset: 0, color: 'rgba(255,240,170,0)' // 0% å¤„的颜色
                                }, {
                                    offset: 1, color: 'rgba(255,240,170,1)' // 100% å¤„的颜色
                                }],
                                globalCoord: false// ç¼ºçœä¸º false
                            }
                        },
                        markLine: {
                            symbol: 'none',//去掉箭头
                            data: [
                                { type: 'max', name: 'Max', lineStyle: { color: 'red' } },
                                { type: 'average', name: 'Avg', lineStyle: { color: 'blue' } },
                                { type: 'min', name: 'Min', lineStyle: { color: 'green' } },
                            ]
                        },
                    }
                ]
            };
            option_ZXT_Diff && myChart.setOption(option_ZXT_Diff);
            //#endregion
            //#region ç‚¹å‡»äº‹ä»¶åŒ…括on form事件等
            //头工具栏事件
@@ -269,7 +414,7 @@
                //初始化表格
                set_InitGrid();
                //加载数据到网格
                get_FastQuery();
                //get_FastQuery();
                DisPlay_HideColumn();
            }
@@ -278,14 +423,111 @@
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , height: 'full-450'
                    , page: true
                    , height: 'full-430'
                    //, page: true
                    , totalRow: true
                    , cellMinWidth: 90
                    , cellMinWidth: 70
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    , cols: [[
                        { type: 'checkbox', fixed: 'left', totalRowText: '∑X' }
                        ,{ field: 'xh', title: '序号' }
                        , { field: '1', title: '1' , totalRow: true}
                        , { field: '2', title: '2' , totalRow: true}
                        , { field: '3', title: '3' , totalRow: true}
                        , { field: '4', title: '4' , totalRow: true}
                        , { field: '5', title: '5' , totalRow: true}
                        , { field: '6', title: '6' , totalRow: true}
                        , { field: '7', title: '7' , totalRow: true}
                        , { field: '8', title: '8' , totalRow: true}
                        , { field: '9', title: '9', totalRow: true}
                        , { field: '10', title: '10' , totalRow: true}
                        , { field: '11', title: '11' , totalRow: true}
                        , { field: '12', title: '12' , totalRow: true}
                        , { field: '13', title: '13' , totalRow: true}
                        , { field: '14', title: '14' , totalRow: true}
                        , { field: '15', title: '15' , totalRow: true}
                        , { field: '16', title: '16' , totalRow: true}
                        , { field: '17', title: '17' , totalRow: true}
                        , { field: '18', title: '18' , totalRow: true}
                        , { field: '19', title: '19' , totalRow: true}
                        , { field: '20', title: '20' , totalRow: true}
                        , { field: '21', title: '21' , totalRow: true}
                        , { field: '22', title: '22' , totalRow: true}
                        , { field: '23', title: '23' , totalRow: true}
                        , { field: '24', title: '24' , totalRow: true}
                        , { field: '25', title: '25', totalRow: true}
                    ]]
                    , data: []
                }
                var sj = [];
                for (let i = 0; i < 5; i++) {
                    var obj = {
                        xh : i+1,
                        1: (Math.random() * (15 - 13) ).toFixed(2),
                        2: (Math.random() * (15 - 13) ).toFixed(2),
                        3: (Math.random() * (15 - 13) ).toFixed(2),
                        4: (Math.random() * (15 - 13) ).toFixed(2),
                        5: (Math.random() * (15 - 13) ).toFixed(2),
                        6: (Math.random() * (15 - 13) ).toFixed(2),
                        7: (Math.random() * (15 - 13) ).toFixed(2),
                        8: (Math.random() * (15 - 13) ).toFixed(2),
                        9: (Math.random() * (15 - 13) ).toFixed(2),
                        10: (Math.random() * (15 - 13) ).toFixed(2),
                        11: (Math.random() * (15 - 13) ).toFixed(2),
                        12: (Math.random() * (15 - 13) ).toFixed(2),
                        13: (Math.random() * (15 - 13) ).toFixed(2),
                        14: (Math.random() * (15 - 13) ).toFixed(2),
                        15: (Math.random() * (15 - 13) ).toFixed(2),
                        16: (Math.random() * (15 - 13) ).toFixed(2),
                        17: (Math.random() * (15 - 13) ).toFixed(2),
                        18: (Math.random() * (15 - 13) ).toFixed(2),
                        19: (Math.random() * (15 - 13) ).toFixed(2),
                        20: (Math.random() * (15 - 13) ).toFixed(2),
                        21: (Math.random() * (15 - 13) ).toFixed(2),
                        22: (Math.random() * (15 - 13) ).toFixed(2),
                        23: (Math.random() * (15 - 13) ).toFixed(2),
                        24: (Math.random() * (15 - 13) ).toFixed(2),
                        25: (Math.random() * (15 - 13) ).toFixed(2)
                    };
                    sj.push(obj);
                }
                //var FH = ['∑X','X','R']
                //for (let i = 0; i < 3;i++) {
                //    var obj = {
                //        xh: FH[i],
                //        1: (Math.random() * (15 - 13)).toFixed(2),
                //        2: (Math.random() * (15 - 13)).toFixed(2),
                //        3: (Math.random() * (15 - 13)).toFixed(2),
                //        4: (Math.random() * (15 - 13)).toFixed(2),
                //        5: (Math.random() * (15 - 13)).toFixed(2),
                //        6: (Math.random() * (15 - 13)).toFixed(2),
                //        7: (Math.random() * (15 - 13)).toFixed(2),
                //        8: (Math.random() * (15 - 13)).toFixed(2),
                //        9: (Math.random() * (15 - 13)).toFixed(2),
                //        10: (Math.random() * (15 - 13)).toFixed(2),
                //        11: (Math.random() * (15 - 13)).toFixed(2),
                //        12: (Math.random() * (15 - 13)).toFixed(2),
                //        13: (Math.random() * (15 - 13)).toFixed(2),
                //        14: (Math.random() * (15 - 13)).toFixed(2),
                //        15: (Math.random() * (15 - 13)).toFixed(2),
                //        16: (Math.random() * (15 - 13)).toFixed(2),
                //        17: (Math.random() * (15 - 13)).toFixed(2),
                //        18: (Math.random() * (15 - 13)).toFixed(2),
                //        19: (Math.random() * (15 - 13)).toFixed(2),
                //        20: (Math.random() * (15 - 13)).toFixed(2),
                //        21: (Math.random() * (15 - 13)).toFixed(2),
                //        22: (Math.random() * (15 - 13)).toFixed(2),
                //        23: (Math.random() * (15 - 13)).toFixed(2),
                //        24: (Math.random() * (15 - 13)).toFixed(2),
                //        25: (Math.random() * (15 - 13)).toFixed(2)
                //    };
                //    sj.push(obj);
                //}
                option.data = sj;
                table.render(option);
            }
            //加载网格