whycq
2023-09-06 5d6ea49e6f45e855a4368b15384c44bd9e0ae5ef
src/main/webapp/views/monitor/index.html
@@ -15,7 +15,7 @@
        <div class="head">
            <div class="head-title">自动仓库监控平台</div>
            <div class="time-tools">
                <span id="bar-year"></span>-<span id="bar-month"></span>-<span id="bar-day"></span> <span id="bar-hour"></span>:<span id="bar-minute"></span>:<span id="bar-second"></span>&nbsp;&nbsp;<span id="bar-week"></span>
                <span id="bar-year"></span>-<span id="bar-month"></span>-<span id="bar-day"></span> <span id="bar-hour"></span>:<span id="bar-minute"></span>:<span id="bar-second"></span>
            </div>
        </div>
        <div class="body">
@@ -23,7 +23,7 @@
                <div class="box">
                    <div class="box-title">测试状态</div>
                    <div class="box-body">
                        <div class="table-head" style="display: flex"><div style="flex: 1">库位号</div><div style="flex: 1">库位状态</div><div style="flex: 1">包号</div><div style="flex: 1">测试状态</div></div>
                        <div class="table-head" style="display: flex"><div style="flex: 1">库位号</div><div style="flex: 1">库位状态</div><div style="flex: 3">包号</div><div style="flex: 1">测试状态</div></div>
                        <div class="swiper" style="height: 85%">
                            <div class="swiper-wrapper table-item">
                            </div>
@@ -56,8 +56,51 @@
</body>
</html>
<script>
    let url = 'http://192.168.4.34:8080/fnwms'
    var item = []
    // 左
    $('.time-tools').click(function () {
        exitFull();
    });
    $('.head-title').click(function () {
        full();
    });
    //开始全屏
    function full() {
        var docElm = document.documentElement;
        //W3C
        if (docElm.requestFullscreen) {
            docElm.requestFullscreen();
        }
        //FireFox
        else if (docElm.mozRequestFullScreen) {
            docElm.mozRequestFullScreen();
        }
        //Chrome等
        else if (docElm.webkitRequestFullScreen) {
            docElm.webkitRequestFullScreen();
        }
        //IE11
        else if (elem.msRequestFullscreen) {
            elem.msRequestFullscreen();
        }
    }
    //退出全屏
    function exitFull() {
        if (document.exitFullscreen) {
            document.exitFullscreen();
        }
        else if (document.mozCancelFullScreen) {
            document.mozCancelFullScreen();
        }
        else if (document.webkitCancelFullScreen) {
            document.webkitCancelFullScreen();
        }
        else if (document.msExitFullscreen) {
            document.msExitFullscreen();
        }
    }
    let url = 'http://192.168.4.188:8088/fnwms'
    var item = [{locNo: '1',locSts: '1',mk: '1',packStatus$: '1'}]
    var year = '2020';
    var month = '05';
    var day = '01';
@@ -80,13 +123,25 @@
        //location.reload()
    },10000)
    function initTest() {
        console.log(item)
        var box = ''
        var el
        var len = item.length
        var autoplay = true
        var css = 'table-td'
        if (len == 0) {
            box = "<div class='swiper-none'>暂无测试数据</div>"
        } else if (len < 5) {
            var itemInfo = {locNo: '',locSts: '',mk: '',packStatus$: ''}
            for (var j = 0; j < 5-len;j++) {
                css = 'table-td2'
                autoplay = false
                item.push(itemInfo)
            }
        }
        for (var i = 0; i < item.length; i++) {
            el = "<div class='swiper-slide table-td'><div style='flex: 1'>"
            el = "<div class='swiper-slide "+ css + " '><div style='flex: 1'>"
                + item[i].locNo + "</div><div style='flex: 1'>"
                + item[i].locSts  + "</div><div style='flex: 1'>"
                + item[i].locSts  + "</div><div style='flex: 3'>"
                + item[i].mk  + "</div><div style='flex: 1'>"
                + item[i].packStatus$
                + "</div></div>"
@@ -96,7 +151,7 @@
        var mySwiper = new Swiper ('.swiper', {
            direction: 'vertical', // 垂直切换选项
            loop: true, // 循环模式选项
            autoplay:true,
            autoplay:autoplay,
            slidesPerView: 5,
        })
    }
@@ -261,26 +316,27 @@
            {
                name: '合格',
                type: 'bar',
                itemStyle: {
                  normal: {
                      label: {
                          show: true,
                          position: 'top'
                      }
                  }
                stack: 'Ad',
                label: {
                    show: true,
                    fontSize: 16,
                    fontWeight: 'bold',
                    position: 'top',
                    color: '#FFF',
                    offset: [15,5],
                },
                z:99,
                barWidth:'50%',
                data: [10, 1]
            },
            {
                name: '不合格',
                type: 'bar',
                itemStyle: {
                    normal: {
                        label: {
                            show: true,
                            position: 'top'
                        }
                    }
                stack: 'Ad',
                label: {
                    show: true,
                    fontSize: 16,fontWeight: 'bold',
                    position: 'top',offset: [-15,5],
                },
                data: [9, 3]
            }
@@ -409,7 +465,6 @@
            }
        });
    }
    function initBasicInformation() {
        $.ajax({
            url: url+"/mobile/pack/basic/information",
@@ -420,7 +475,7 @@
                    for (var i = 0; i < res.data.length; i++) {
                        array.push(res.data[i])
                    }
                    item =  array
                    item = array
                }
            }
        });