YCQ
whycq
2021-12-15 3d02f54506aa0e09c6232017e26946bcf41a9509
src/main/webapp/views/monitor/monitor.html
@@ -80,6 +80,16 @@
            }
        }
        #led-content {
            display: none;
        }
        #led-p-content {
            text-align: center;
            padding: 20px 40px;
            font-size: 35px;
            font-weight: bold;
            /*color: #FF5722;*/
        }
    </style>
</head>
@@ -131,43 +141,43 @@
                        <p class="english">warehouse data</p>
                    </div>
                    <div class="charge-info-elem">
                        <img src="img/a.png">
                        <img src="img/a1.png">
                        <div class="info-detail">
                            <div class="real-data">
                                <i class="count" id="xDistance">0</i>
                                <span class="unit">km</span>
                                <span class="unit">m</span>
                            </div>
                            <div class="content">累计走行距离(千米)</div>
                            <div class="content">累计走行距离(米)</div>
                        </div>
                    </div>
                    <div class="charge-info-elem">
                        <img src="img/b.png">
                        <img src="img/b1.png">
                        <div class="info-detail">
                            <div class="real-data">
                                <i class="count" id="yDistance">0</i>
                                <span class="unit">km</span>
                                <span class="unit">m</span>
                            </div>
                            <div class="content">累计升降距离(千米)</div>
                            <div class="content">累计升降距离(米)</div>
                        </div>
                    </div>
                    <div class="charge-info-elem">
                        <img src="img/c.png">
                        <img src="img/c1.png">
                        <div class="info-detail">
                            <div class="real-data">
                                <i class="count" id="xDuration">0</i>
                                <span class="unit">h</span>
                                <span class="unit">s</span>
                            </div>
                            <div class="content">累计走行时长(小时)</div>
                            <div class="content">累计走行时长(秒)</div>
                        </div>
                    </div>
                    <div class="charge-info-elem">
                        <img src="img/d.png">
                        <img src="img/d1.png">
                        <div class="info-detail">
                            <div class="real-data">
                                <i class="count" id="yDuration">0</i>
                                <span class="unit">h</span>
                                <span class="unit">s</span>
                            </div>
                            <div class="content">累计升降时长(小时)</div>
                            <div class="content">累计升降时长(秒)</div>
                        </div>
                    </div>
                </div>
@@ -176,8 +186,8 @@
                    <div class="image-border image-border2"></div>
                    <div class="image-border image-border3"></div>
                    <div class="image-border image-border4"></div>
                    <span>浙江中扬物流装备有限公司</span>
                    <img src="img/wxCode.jpg">
                    <span>浙江中扬立库技术有限公司</span>
                    <img src="../../static/image/barcode.png">
                </div>
            </div>
        </div>
@@ -195,18 +205,12 @@
                        <div class="speed-content">
                            <div id="crn-chart" class="speed-chart">
                            </div>
<!--                            <div id="xSpeed-chart" class="speed-chart">-->
<!--&lt;!&ndash;                                <span>堆垛机走行速度:</span><span id="xSpeed" class="counter">5.00</span><span>米/秒</span>&ndash;&gt;-->
<!--                            </div>-->
<!--                            <div id="ySpeed-chart" class="speed-chart">-->
<!--&lt;!&ndash;                                <span>堆垛机升降速度:</span><span id="ySpeed" class="counter">5.00</span><span>米/秒</span>&ndash;&gt;-->
<!--                            </div>-->
                        </div>
                    </div>
                    <!-- 中下 -->
                    <div class="scroll-pane">
                        <div class="layui-carousel" id="test1">
                        <div class="layui-carousel" id="banner">
                            <div carousel-item>
                                <div class="item-img" id="img-1" style="background-color: red"></div>
                                <div class="item-img" id="img-2" style="background-color: gold"></div>
@@ -214,6 +218,10 @@
                                <div class="item-img" id="img-4" style="background-color: white"></div>
                                <div class="item-img" id="img-5" style="background-color: darkgoldenrod"></div>
                            </div>
                        </div>
                        <div id="led-content">
                            <pre id="led-p-content"></pre>
                        </div>
<!--                        &lt;!&ndash; 中左 &ndash;&gt;-->
@@ -271,7 +279,7 @@
                <div class="image-border image-border4"></div>
                <div class="line-chart-title">
                    <div class="order-report">
                        <span class="order-report-left" >入库单统计</span>
                        <span class="order-report-left" >入出库统计</span>
                        <span class="order-report-right">31</span>
                    </div>
                    <div class="order-report-english english">
@@ -366,14 +374,29 @@
    layui.use(['element', 'carousel'], function(){
        var carousel = layui.carousel;
        var element = layui.element;
        //建造实例
        // 轮播图
        carousel.render({
            elem: '#test1'
            elem: '#banner'
            ,width: '100%' //设置容器宽度
            ,arrow: 'always' //始终显示箭头
            //,anim: 'updown' //切换动画方式
            ,arrow: 'hover' // 切换箭头默认显示状态,可选值为 hover(悬停显示) always(始终显示) none(始终不显示)
            ,interval: '3000' // 自动切换的时间间隔,单位:ms(毫秒),不能低于800
            ,anim: 'fade'
        });
    });
    /***********************************************************************************/
    /************************************* 头部按钮 *************************************/
    /***********************************************************************************/
    // 左
    $('.button-left').click(function () {
        exitFull();
    });
    // 右
    $('.button-right').click(function () {
        full();
    });
    /***********************************************************************************/
    /************************************ 堆垛机速度 *************************************/
@@ -385,31 +408,31 @@
        tooltip: {
            formatter: '{a} <br/>{c} {b}'
        },
        toolbox: {
            show: true,
            feature: {
                mark: {show: true},
                restore: {show: true},
                saveAsImage: {show: true}
            }
        },
        // toolbox: {  // 保存图片
        //     show: true,
        //     feature: {
        //         mark: {show: true},
        //         restore: {show: true},
        //         saveAsImage: {show: true}
        //     }
        // },
        series: [
            {
                name: '速度',
                name: '走行速度',
                type: 'gauge',
                min: 0,
                max: 220,
                splitNumber: 11,
                max: 160,
                splitNumber: 16,
                radius: '50%',
                axisLine: {            // 坐标轴线
                    lineStyle: {       // 属性lineStyle控制线条样式
                        color: [[0.09, 'lime'], [0.82, '#1e90ff'], [1, '#ff4500']],
                        color: [[0.09, '#0fe507'], [0.82, '#1e90ff'], [1, '#ff4500']],
                        width: 3,
                        shadowColor: '#fff', //默认透明
                        shadowBlur: 10
                    }
                },
                axisLabel: {            // 坐标轴小标记
                axisLabel: {            // 坐标轴数字
                    fontWeight: 'bolder',
                    color: '#fff',
                    shadowColor: '#fff', //默认透明
@@ -436,7 +459,7 @@
                    shadowColor: '#fff', //默认透明
                    shadowBlur: 5
                },
                title: {
                title: {    // 速度单位
                    textStyle: {       // 其余属性默认使用全局文本样式,详见TEXTSTYLE
                        fontWeight: 'bolder',
                        fontSize: 20,
@@ -446,7 +469,7 @@
                        shadowBlur: 10
                    }
                },
                detail: {
                detail: {   // 速度值
                    backgroundColor: 'rgba(30,144,255,0.8)',
                    borderWidth: 1,
                    borderColor: '#fff',
@@ -458,20 +481,20 @@
                        color: '#fff'
                    }
                },
                data: [{value: 40, name: 'km/h'}]
                data: [{value: 40, name: 'x\nm/min'}]
            },
            {
                name: '转速',
                name: '升降速度',
                type: 'gauge',
                center: ['25%', '55%'],    // 默认全局居中
                radius: '30%',
                min: 0,
                max: 7,
                endAngle: 45,
                splitNumber: 7,
                max: 40,
                endAngle: 40,
                splitNumber: 5,
                axisLine: {            // 坐标轴线
                    lineStyle: {       // 属性lineStyle控制线条样式
                        color: [[0.29, 'lime'], [0.86, '#1e90ff'], [1, '#ff4500']],
                        color: [[0.32, '#0fe507'], [0.86, '#1e90ff'], [1, '#ff4500']],
                        width: 2,
                        shadowColor: '#fff', //默认透明
                        shadowBlur: 10
@@ -523,31 +546,37 @@
                    shadowBlur: 5,
                    width: 80,
                    height: 30,
                    offsetCenter: [25, '20%'],       // x, y,单位px
                    offsetCenter: [35, '20%'],       // x, y,单位px
                    textStyle: {       // 其余属性默认使用全局文本样式,详见TEXTSTYLE
                        fontWeight: 'bolder',
                        color: '#fff'
                    }
                },
                data: [{value: 1.5, name: 'x1000 r/min'}]
                data: [{value: 1.5, name: 'y'}]
            },
            {
                name: '油表',
                name: '货叉速度',
                type: 'gauge',
                center: ['75%', '50%'],    // 默认全局居中
                radius: '30%',
                min: 0,
                max: 2,
                max: 50,
                startAngle: 135,
                endAngle: 45,
                endAngle: 50,
                splitNumber: 2,
                axisLine: {            // 坐标轴线
                    lineStyle: {       // 属性lineStyle控制线条样式
                        color: [[0.2, 'lime'], [0.8, '#1e90ff'], [1, '#ff4500']],
                        color: [[0.2, '#0fe507'], [0.8, '#1e90ff'], [1, '#ff4500']],
                        width: 2,
                        shadowColor: '#fff', //默认透明
                        shadowBlur: 10
                    }
                },
            axisLabel: {            // 坐标轴小标记
                    fontWeight: 'bolder',
                    color: '#fff',
                    shadowColor: '#fff', //默认透明
                    shadowBlur: 10
                },
                axisTick: {            // 坐标轴小标记
                    length: 12,        // 属性length控制线长
@@ -557,19 +586,19 @@
                        shadowBlur: 10
                    }
                },
                axisLabel: {
                    fontWeight: 'bolder',
                    color: '#fff',
                    shadowColor: '#fff', //默认透明
                    shadowBlur: 10,
                    formatter: function (v){
                        switch (v + '') {
                            case '0': return 'E';
                            case '1': return 'Gas';
                            case '2': return 'F';
                        }
                    }
                },
                // axisLabel: {
                //     fontWeight: 'bolder',
                //     color: '#fff',
                //     shadowColor: '#fff', //默认透明
                //     shadowBlur: 10,
                //     formatter: function (v){
                //         switch (v + '') {
                //             case '0': return 'E';
                //             case '1': return 'Gas';
                //             case '2': return 'F';
                //         }
                //     }
                // },
                splitLine: {           // 分隔线
                    length:15,         // 属性length控制线长
                    lineStyle: {       // 属性lineStyle(详见lineStyle)控制线条样式
@@ -585,15 +614,33 @@
                    shadowBlur: 5
                },
                title: {
                    show: false
                    offsetCenter: [0, '-30%'],       // x, y,单位px
                    textStyle: {       // 其余属性默认使用全局文本样式,详见TEXTSTYLE
                        fontWeight: 'bolder',
                        fontStyle: 'italic',
                        color: '#fff',
                        shadowColor: '#fff', //默认透明
                        shadowBlur: 10
                    }
                },
                detail: {
                    show: false
                    //backgroundColor: 'rgba(30,144,255,0.8)',
                    // borderWidth: 1,
                    borderColor: '#fff',
                    shadowColor: '#fff', //默认透明
                    shadowBlur: 5,
                    width: 80,
                    height: 30,
                    offsetCenter: [40, '5%'],       // x, y,单位px
                    textStyle: {       // 其余属性默认使用全局文本样式,详见TEXTSTYLE
                        fontWeight: 'bolder',
                        color: '#fff'
                    }
                },
                data: [{value: 0.5, name: 'gas'}]
                data: [{value: 0.5, name: 'z'}]
            },
            {
                name: '水表',
                name: '货叉位置',
                type: 'gauge',
                center: ['75%', '50%'],    // 默认全局居中
                radius: '30%',
@@ -604,7 +651,7 @@
                splitNumber: 2,
                axisLine: {            // 坐标轴线
                    lineStyle: {       // 属性lineStyle控制线条样式
                        color: [[0.2, 'lime'], [0.8, '#1e90ff'], [1, '#ff4500']],
                        color: [[0.2, '#0fe507'], [0.8, '#1e90ff'], [1, '#ff4500']],
                        width: 2,
                        shadowColor: '#fff', //默认透明
                        shadowBlur: 10
@@ -620,9 +667,9 @@
                    shadowBlur: 10,
                    formatter: function(v){
                        switch (v + '') {
                            case '0': return 'H';
                            case '1': return 'Water';
                            case '2': return 'C';
                            case '0': return '右';
                            case '1': return '中';
                            case '2': return '左';
                        }
                    }
                },
@@ -650,13 +697,6 @@
            }
        ]
    };
    setInterval(function (){
        crnChartOption.series[0].data[0].value = (Math.random()*100).toFixed(2) - 0;
        crnChartOption.series[1].data[0].value = (Math.random()*7).toFixed(2) - 0;
        crnChartOption.series[2].data[0].value = (Math.random()*2).toFixed(2) - 0;
        crnChartOption.series[3].data[0].value = (Math.random()*2).toFixed(2) - 0;
        crnChart.setOption(crnChartOption);
    }, 1000);
    /***********************************************************************************/
@@ -678,7 +718,7 @@
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: ['1', '2', '3', '4', '5', '6', '7'],
            data:  ['1', '2', '3', '4', '5', '6', '7'],
            axisLabel: {
                textStyle:{
                    color:'#aaa',  //坐标的字体颜色
@@ -712,45 +752,57 @@
            }
        },
        series: [{
            data: [820, 932, 901, 934, 1290, 1330, 1320],
            type: 'line',
            areaStyle: {
                color: '#7494ae' // 折线区域颜色
        series: [
            {
                data: [820, 932, 901, 934, 1290, 1330, 1320],
                type: 'line',
                // areaStyle: {
                //     color: '#7494ae' // 折线区域颜色
                // },
                itemStyle:{
                    normal:{
                        color:'#3590ac', //折点颜色
                        lineStyle:{
                            color:'#3590ac' //折线颜色
                        }
                    }
                }
            },
            itemStyle:{
                normal:{
                    color:'#3590ac', //折点颜色
                    lineStyle:{
                        color:'#3590ac' //折线颜色
            {
                data: [820, 932, 901, 934, 1290, 1330, 1320],
                type: 'line',
                // areaStyle: {
                //     color: '#d55b35' // 折线区域颜色
                // },
                itemStyle:{
                    normal:{
                        color:'#ef550e', //折点颜色
                        lineStyle:{
                            color:'#ec670f' //折线颜色
                        }
                    }
                }
            }
        }]
        ]
    };
    // 访问量报表加载
    function initlinChart() {
    function initlineChart() {
        var reportView = lineChartOption;
        var xAxisDate = [];
        var seriesDate=[];
        $.ajax({
            url: baseUrl+"/monitor/pakin/rep",
            url: baseUrl+"/monitor/line/charts",
            method: 'GET',
            success: function (res) {
                if (res.code === 200){
                    var json = res.data;
                    for (var i = 0; i < json.length; i++) {
                        xAxisDate[i]=json[i].node;
                        seriesDate[i]=json[i].val;
                    }
                    reportView.xAxis.data=xAxisDate;
                    reportView.series[0].data=seriesDate;
                    var json = res.data.rows;
                    reportView.xAxis.data=[getDateFormat(-11), getDateFormat(-10), getDateFormat(-9), getDateFormat(-8), getDateFormat(-7), getDateFormat(-6),
                        getDateFormat(-5), getDateFormat(-4), getDateFormat(-3), getDateFormat(-2), getDateFormat(-1), getDateFormat(-0)];
                    reportView.series[0].data=res.data.rows[0].data;
                    reportView.series[1].data=res.data.rows[1].data;
                    lineCharts.setOption(reportView)
                } else if (res.code === 403){
                    top.location.href = "/";
                } else {
                    layer.msg(res.msg);
                    console.log(res.msg);
                }
            }
        });
@@ -851,5 +903,13 @@
        });
    }
    // eCharts 跟随窗口改变
    window.onresize = function(){
        crnChart.resize();
        lineCharts.resize();
        pieCharts.resize();
    }
</script>
</html>