#
luxiaotao1123
2020-11-18 a699b98fbbd52eec1a125425fea4de1babf837c3
src/main/webapp/views/monitor/monitor.html
@@ -18,11 +18,13 @@
    <style>
        .crn-speed {
            width: 100%;
            height: 35%;
            height: 75%;
            position: absolute;
            text-align: center;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            top: -15%;
            /*border-bottom: 1px solid rgba(0, 0, 0, 0.3);*/
        }
@@ -33,13 +35,20 @@
            font-family:'Pacifico',serif
        }
        .speed-content {
            display: inline-block;
            height: 100%;
        }
        .speed-chart {
            float: left;
            width: 100%;
            height: 100%;
        }
        .scroll-pane {
            position: absolute;
            top: 42%;
            width: 100%;
            height: 65%;
            height: 58%;
        }
        .scroll-bar {
            float: left;
@@ -70,6 +79,7 @@
                transform:translateY(-200px)
            }
        }
    </style>
</head>
@@ -124,40 +134,40 @@
                        <img src="img/a.png">
                        <div class="info-detail">
                            <div class="real-data">
                                <i class="count">7777</i>
                                <span class="unit">个</span>
                                <i class="count" id="xDistance">0</i>
                                <span class="unit">km</span>
                            </div>
                            <div class="content">库位总数(个)</div>
                            <div class="content">累计走行距离(千米)</div>
                        </div>
                    </div>
                    <div class="charge-info-elem">
                        <img src="img/b.png">
                        <div class="info-detail">
                            <div class="real-data">
                                <i class="count">777</i>
                                <span class="unit">个</span>
                                <i class="count" id="yDistance">0</i>
                                <span class="unit">km</span>
                            </div>
                            <div class="content">使用中库位(个)</div>
                            <div class="content">累计升降距离(千米)</div>
                        </div>
                    </div>
                    <div class="charge-info-elem">
                        <img src="img/c.png">
                        <div class="info-detail">
                            <div class="real-data">
                                <i class="count">33</i>
                                <span class="unit">托</span>
                                <i class="count" id="xDuration">0</i>
                                <span class="unit">h</span>
                            </div>
                            <div class="content">今日入库(托)</div>
                            <div class="content">累计走行时长(小时)</div>
                        </div>
                    </div>
                    <div class="charge-info-elem">
                        <img src="img/d.png">
                        <div class="info-detail">
                            <div class="real-data">
                                <i class="count">14296</i>
                                <span class="unit">千瓦时</span>
                                <i class="count" id="yDuration">0</i>
                                <span class="unit">h</span>
                            </div>
                            <div class="content">今日电总量(千瓦时)</div>
                            <div class="content">累计升降时长(小时)</div>
                        </div>
                    </div>
                </div>
@@ -166,7 +176,7 @@
                    <div class="image-border image-border2"></div>
                    <div class="image-border image-border3"></div>
                    <div class="image-border image-border4"></div>
                    <span>中扬物流客户服务中心</span>
                    <span>浙江中扬物流装备有限公司</span>
                    <img src="img/wxCode.jpg">
                </div>
            </div>
@@ -183,24 +193,26 @@
                    <!-- 中上 -->
                    <div class="crn-speed">
                        <div class="speed-content">
                            <div>
                                <span>堆垛机走行速度:</span><span class="counter">5.00</span><span>米/秒</span>
                            <div id="crn-chart" class="speed-chart">
                            </div>
                            <div>
                                <span>堆垛机升降速度:</span><span class="counter">5.00</span><span>米/秒</span>
                            </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 carousel-item>
                                <div style="background-color: red">条目1</div>
                                <div style="background-color: gold">条目2</div>
                                <div style="background-color: #333333">条目3</div>
                                <div style="background-color: #00FF00">条目4</div>
                                <div style="background-color: #5FB878">条目5</div>
                                <div class="item-img" id="img-1" style="background-color: red"></div>
                                <div class="item-img" id="img-2" style="background-color: gold"></div>
                                <div class="item-img" id="img-3" style="background-color: green"></div>
                                <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>
@@ -313,10 +325,10 @@
                        <div class="elem-header" id="elem-header-third">
                        </div>
                        <div class="elem-main">
                            使用中
                            禁用
                        </div>
                        <div class="elem-footer">
                            <span id="used-count">0</span>
                            <span id="none-count">0</span>
                        </div>
                    </div>
                </div>
@@ -337,9 +349,12 @@
                    </div>
                </div>
                <div class="progress-bar-modal">
                    <div class="bar-container">
                        <div class="bar-proportion"><span>实际使用</span></div>
                    <div class="layui-progress layui-progress-big" lay-filter="used-progress" style="background-color: #233751;width: 80%;display: inline-block">
                        <div class="layui-progress-bar layui-bg-red" lay-percent="0%"></div>
                    </div>
<!--                    <div class="bar-container">-->
<!--                        <div class="bar-proportion"><span>实际使用</span></div>-->
<!--                    </div>-->
                    <i class="bar-container-count"><span id="used">0</span></i>
                </div>
            </div>
@@ -348,8 +363,9 @@
    </div>
</body>
<script>
    layui.use('carousel', function(){
    layui.use(['element', 'carousel'], function(){
        var carousel = layui.carousel;
        var element = layui.element;
        //建造实例
        carousel.render({
            elem: '#test1'
@@ -359,8 +375,290 @@
        });
    });
    // 计数动画
    $('.counter').countUp();
    /***********************************************************************************/
    /************************************ 堆垛机速度 *************************************/
    /***********************************************************************************/
    var crnChart = echarts.init(document.getElementById('crn-chart'));
    crnChartOption = {
        // backgroundColor: '#1b1b1b',
        tooltip: {
            formatter: '{a} <br/>{c} {b}'
        },
        toolbox: {
            show: true,
            feature: {
                mark: {show: true},
                restore: {show: true},
                saveAsImage: {show: true}
            }
        },
        series: [
            {
                name: '走行速度',
                type: 'gauge',
                min: 0,
                max: 110,
                splitNumber: 11,
                radius: '50%',
                axisLine: {            // 坐标轴线
                    lineStyle: {       // 属性lineStyle控制线条样式
                        color: [[0.09, 'lime'], [0.82, '#1e90ff'], [1, '#ff4500']],
                        width: 3,
                        shadowColor: '#fff', //默认透明
                        shadowBlur: 10
                    }
                },
                axisLabel: {            // 坐标轴小标记
                    fontWeight: 'bolder',
                    color: '#fff',
                    shadowColor: '#fff', //默认透明
                    shadowBlur: 10
                },
                axisTick: {            // 坐标轴小标记
                    length: 15,        // 属性length控制线长
                    lineStyle: {       // 属性lineStyle控制线条样式
                        color: 'auto',
                        shadowColor: '#fff', //默认透明
                        shadowBlur: 10
                    }
                },
                splitLine: {           // 分隔线
                    length: 25,         // 属性length控制线长
                    lineStyle: {       // 属性lineStyle(详见lineStyle)控制线条样式
                        width: 3,
                        color: '#fff',
                        shadowColor: '#fff', //默认透明
                        shadowBlur: 10
                    }
                },
                pointer: {           // 分隔线
                    shadowColor: '#fff', //默认透明
                    shadowBlur: 5
                },
                title: {
                    textStyle: {       // 其余属性默认使用全局文本样式,详见TEXTSTYLE
                        fontWeight: 'bolder',
                        fontSize: 20,
                        fontStyle: 'italic',
                        color: '#fff',
                        shadowColor: '#fff', //默认透明
                        shadowBlur: 10
                    }
                },
                detail: {
                    backgroundColor: 'rgba(30,144,255,0.8)',
                    borderWidth: 1,
                    borderColor: '#fff',
                    shadowColor: '#fff', //默认透明
                    shadowBlur: 5,
                    offsetCenter: [0, '50%'],       // x, y,单位px
                    textStyle: {       // 其余属性默认使用全局文本样式,详见TEXTSTYLE
                        fontWeight: 'bolder',
                        color: '#fff'
                    }
                },
                data: [{value: 40, name: 'm/min'}]
            },
            {
                name: '升降速度',
                type: 'gauge',
                center: ['25%', '55%'],    // 默认全局居中
                radius: '30%',
                min: 0,
                max: 30,
                endAngle: 30,
                splitNumber: 6,
                axisLine: {            // 坐标轴线
                    lineStyle: {       // 属性lineStyle控制线条样式
                        color: [[0.29, 'lime'], [0.86, '#1e90ff'], [1, '#ff4500']],
                        width: 2,
                        shadowColor: '#fff', //默认透明
                        shadowBlur: 10
                    }
                },
                axisLabel: {            // 坐标轴小标记
                    fontWeight: 'bolder',
                    color: '#fff',
                    shadowColor: '#fff', //默认透明
                    shadowBlur: 10
                },
                axisTick: {            // 坐标轴小标记
                    length: 12,        // 属性length控制线长
                    lineStyle: {       // 属性lineStyle控制线条样式
                        color: 'auto',
                        shadowColor: '#fff', //默认透明
                        shadowBlur: 10
                    }
                },
                splitLine: {           // 分隔线
                    length: 20,         // 属性length控制线长
                    lineStyle: {       // 属性lineStyle(详见lineStyle)控制线条样式
                        width: 3,
                        color: '#fff',
                        shadowColor: '#fff', //默认透明
                        shadowBlur: 10
                    }
                },
                pointer: {
                    width: 5,
                    shadowColor: '#fff', //默认透明
                    shadowBlur: 5
                },
                title: {
                    offsetCenter: [0, '-30%'],       // x, y,单位px
                    textStyle: {       // 其余属性默认使用全局文本样式,详见TEXTSTYLE
                        fontWeight: 'bolder',
                        fontStyle: 'italic',
                        color: '#fff',
                        shadowColor: '#fff', //默认透明
                        shadowBlur: 10
                    }
                },
                detail: {
                    //backgroundColor: 'rgba(30,144,255,0.8)',
                    // borderWidth: 1,
                    borderColor: '#fff',
                    shadowColor: '#fff', //默认透明
                    shadowBlur: 5,
                    width: 80,
                    height: 30,
                    offsetCenter: [25, '20%'],       // x, y,单位px
                    textStyle: {       // 其余属性默认使用全局文本样式,详见TEXTSTYLE
                        fontWeight: 'bolder',
                        color: '#fff'
                    }
                },
                data: [{value: 1.5, name: 'm/min'}]
            },
            // 货叉最大速度,3.几米
            {
                name: '货叉速度',
                type: 'gauge',
                center: ['75%', '50%'],    // 默认全局居中
                radius: '30%',
                min: 0,
                max: 4,
                startAngle: 135,
                endAngle: 45,
                splitNumber: 2,
                axisLine: {            // 坐标轴线
                    lineStyle: {       // 属性lineStyle控制线条样式
                        color: [[0.2, 'lime'], [0.8, '#1e90ff'], [1, '#ff4500']],
                        width: 2,
                        shadowColor: '#fff', //默认透明
                        shadowBlur: 10
                    }
                },
                axisTick: {            // 坐标轴小标记
                    length: 12,        // 属性length控制线长
                    lineStyle: {       // 属性lineStyle控制线条样式
                        color: 'auto',
                        shadowColor: '#fff', //默认透明
                        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';
                        }
                    }
                },
                splitLine: {           // 分隔线
                    length:15,         // 属性length控制线长
                    lineStyle: {       // 属性lineStyle(详见lineStyle)控制线条样式
                        width:3,
                        color: '#fff',
                        shadowColor: '#fff', //默认透明
                        shadowBlur: 10
                    }
                },
                pointer: {
                    width:2,
                    shadowColor: '#fff', //默认透明
                    shadowBlur: 5
                },
                title: {
                    show: false
                },
                detail: {
                    show: false
                },
                data: [{value: 0.5, name: 'gas'}]
            },
            {
                name: '水表',
                type: 'gauge',
                center: ['75%', '50%'],    // 默认全局居中
                radius: '30%',
                min: 0,
                max: 2,
                startAngle: 315,
                endAngle: 225,
                splitNumber: 2,
                axisLine: {            // 坐标轴线
                    lineStyle: {       // 属性lineStyle控制线条样式
                        color: [[0.2, 'lime'], [0.8, '#1e90ff'], [1, '#ff4500']],
                        width: 2,
                        shadowColor: '#fff', //默认透明
                        shadowBlur: 10
                    }
                },
                axisTick: {            // 坐标轴小标记
                    show: false
                },
                axisLabel: {
                    fontWeight: 'bolder',
                    color: '#fff',
                    shadowColor: '#fff', //默认透明
                    shadowBlur: 10,
                    formatter: function(v){
                        switch (v + '') {
                            case '0': return 'H';
                            case '1': return 'Water';
                            case '2': return 'C';
                        }
                    }
                },
                splitLine: {           // 分隔线
                    length: 15,         // 属性length控制线长
                    lineStyle: {       // 属性lineStyle(详见lineStyle)控制线条样式
                        width: 3,
                        color: '#fff',
                        shadowColor: '#fff', //默认透明
                        shadowBlur: 10
                    }
                },
                pointer: {
                    width: 2,
                    shadowColor: '#fff', //默认透明
                    shadowBlur: 5
                },
                title: {
                    show: false
                },
                detail: {
                    show: false
                },
                data:[{value: 0.5, name: 'gas'}]
            }
        ]
    };
    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);
    /***********************************************************************************/
    /************************************* 折线图 ***************************************/
@@ -543,6 +841,8 @@
                    $('#usedPr').text(res.data.usedPr);
                    $('#used').text(res.data.used);
                    layui.element.progress('used-progress', res.data.usedPr + '%');
                } else if (res.code === 403){
                    top.location.href = "/";
                } else {