#
zjj
2024-04-23 01a2d01abeadef5488a100ddf58a22dbcf7b95d6
src/main/webapp/views/monitor.html
@@ -33,27 +33,51 @@
        <div style="padding: 10px;height: 100%">
            <div style="width: 100%;height: 100%;">
                <div class="head">
                    <label for="" class="label ">TV1</label>
                    <label for="" class="label">TV2</label>
                    <label for="" class="label">TV3</label>
                    <label id="lcd-100" class="label lcd">LCD1</label>
                    <label id="lcd-110" class="label lcd">LCD2</label>
                    <label id="lcd-113" class="label lcd">LCD3</label>
                </div>
                <div class="body">
                    <!--<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>-->
                    <!--</div>-->
                    <div class="canves1">
                        <div style="width: 30%;height: 100%;font-size: 30px;display: flex;flex-direction: column;justify-content: space-around">
                            <div style="width: 100%;height: 100px;line-height: 100px;text-align: center">累计行走:10869米</div>
                            <div style="width: 100%;height: 100px;line-height: 100px;text-align: center">累计行走:10869米</div>
                            <div style="width: 100%;height: 100px;line-height: 100px;text-align: center">累计行走:10869米</div>
                            <div style="width: 100%;height: 100px;line-height: 100px;text-align: center">累计行走:10869米</div>
                    <div class="canves1 aData">
                        <div style="width: 25%;height: 100%;font-size: 30px;display: flex;flex-direction: column;justify-content: space-around;">
                            <div style="width: 100%;height: 100px;line-height: 100px;text-align: center">累计走行距离:<span id="xDistance"></span>米</div>
                            <div style="width: 100%;height: 100px;line-height: 100px;text-align: center">累计升降距离:<span id="yDistance"></span>米</div>
                            <div style="width: 100%;height: 100px;line-height: 100px;text-align: center">累计走行时长:<span id="xDuration"></span>秒</div>
                            <div style="width: 100%;height: 100px;line-height: 100px;text-align: center">累计升降时长:<span id="yDuration"></span>秒</div>
                        </div>
                        <div style="width: 70%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center">
                        <div id="ledData" style="width: 50%;height: 100%;font-size: 30px;display: flex;flex-direction: column;justify-content: space-around;background-color: #93D1FF;text-align: center;">
                            AUTOMATIC WAREHOUSE WCS MONITORING DIAGRAM
                        </div>
                        <div style="width: 25%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center;">
                            <div style="width: 80%;height: 40%">
                                <div id="line-charts"></div>
                            </div>
                            <div style="width: 80%;height: 40%">
                                <div id="pie-charts"></div>
                            </div>
                        </div>
                    </div>
                    <div class="canves1 bData">
                        <!--展示出库信息-->
                        <div id="ledData4" style="width: 100%;height: 100%;font-size: 30px;display: flex;flex-direction: column;background-color: #93D1FF;display: none">
                            <div class="info-head">
                                <!--头部-->
                                <div style="flex: 2">托盘码:80001289</div>
                                <div style="flex: 2">商品编号</div>
                                <div style="flex: 2">商品名称</div>
                                <div style="flex: 2">规格</div>
                                <div style="flex: 1">数量</div>
                            </div>
                            <div class="info-context">
                                <div style="flex: 2">index</div>
                                <div style="flex: 2">77008945781523</div>
                                <div style="flex: 2">西瓜</div>
                                <div style="flex: 2">500g</div>
                                <div style="flex: 1">30</div>
                            </div>
                        </div>
                    </div>
@@ -92,7 +116,7 @@
                                            <img src="monitor/img/a1.png">
                                            <div class="info-detail">
                                                <div class="real-data">
                                                    <i class="count" id="xDistance">0</i>
                                                    <i class="count" id="xDistance0">0</i>
                                                    <span class="unit">m</span>
                                                </div>
                                                <div class="content">累计走行距离(米)</div>
@@ -102,7 +126,7 @@
                                            <img src="monitor/img/b1.png">
                                            <div class="info-detail">
                                                <div class="real-data">
                                                    <i class="count" id="yDistance">0</i>
                                                    <i class="count" id="yDistance0">0</i>
                                                    <span class="unit">m</span>
                                                </div>
                                                <div class="content">累计升降距离(米)</div>
@@ -112,7 +136,7 @@
                                            <img src="monitor/img/c1.png">
                                            <div class="info-detail">
                                                <div class="real-data">
                                                    <i class="count" id="xDuration">0</i>
                                                    <i class="count" id="xDuration0">0</i>
                                                    <span class="unit">s</span>
                                                </div>
                                                <div class="content">累计走行时长(秒)</div>
@@ -122,7 +146,7 @@
                                            <img src="monitor/img/d1.png">
                                            <div class="info-detail">
                                                <div class="real-data">
                                                    <i class="count" id="yDuration">0</i>
                                                    <i class="count" id="yDuration0">0</i>
                                                    <span class="unit">s</span>
                                                </div>
                                                <div class="content">累计升降时长(秒)</div>
@@ -134,7 +158,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="../static/images/barcode.png">
                                    </div>
                                </div>
@@ -308,34 +332,9 @@
                            <button id="unSelectAll">取消全选</button>
                        </div>
                        <div id="checked" style="overflow-y: scroll;height: 80%;border: 1px solid #888" >
                            <label for=""><input type="checkbox" name="monitor" checked="checked" value="1">1号显示器</label>
                            <label for=""><input type="checkbox" name="monitor" >2号显示器</label>
                            <label for=""><input type="checkbox" name="monitor">3号显示器</label>
                            <label for=""><input type="checkbox" name="monitor">4号显示器</label>
                            <label for=""><input type="checkbox" name="monitor">5号显示器</label>
                            <label for=""><input type="checkbox" name="monitor">6号显示器</label>
                            <label for=""><input type="checkbox" name="monitor">7号显示器</label>
                            <label for=""><input type="checkbox" name="monitor">1号显示器</label>
                            <label for=""><input type="checkbox" name="monitor">2号显示器</label>
                            <label for=""><input type="checkbox">3号显示器</label>
                            <label for=""><input type="checkbox">4号显示器</label>
                            <label for=""><input type="checkbox">5号显示器</label>
                            <label for=""><input type="checkbox">6号显示器</label>
                            <label for=""><input type="checkbox">7号显示器</label>
                            <label for=""><input type="checkbox">1号显示器</label>
                            <label for=""><input type="checkbox">2号显示器</label>
                            <label for=""><input type="checkbox">3号显示器</label>
                            <label for=""><input type="checkbox">4号显示器</label>
                            <label for=""><input type="checkbox">5号显示器</label>
                            <label for=""><input type="checkbox">6号显示器</label>
                            <label for=""><input type="checkbox">7号显示器</label>
                            <label for=""><input type="checkbox">1号显示器</label>
                            <label for=""><input type="checkbox">2号显示器</label>
                            <label for=""><input type="checkbox">3号显示器</label>
                            <label for=""><input type="checkbox">4号显示器</label>
                            <label for=""><input type="checkbox">5号显示器</label>
                            <label for=""><input type="checkbox">6号显示器</label>
                            <label for=""><input type="checkbox">7号显示器</label>
                            <label for=""><input type="checkbox" name="monitor" checked="checked" value="100">1号显示器</label>
                            <label for=""><input type="checkbox" name="monitor" value="110">2号显示器</label>
                            <label for=""><input type="checkbox" name="monitor" value="113">3号显示器</label>
                        </div>
                    </div>
                    <!--文本内容-->
@@ -354,46 +353,6 @@
</body>
</html>
<script>
    $(function() {
        $(".label").click(function() {
            $(this).addClass("abc").siblings().removeClass("abc");
        });
    });
    $("#selectAll").click(function(){
        $('input:checkbox[name=monitor]').each(function () {
            $(this).prop("checked",true);
        })
    });
    $("#unSelectAll").click(function(){
        $('input:checkbox[name=monitor]').each(function () {
            $(this).prop("checked",false);
        })
    });
    $('#sendMessage').click(function () {
        var sendMessage = $('#sendContent').val()
        $('input:checkbox[name=monitor]').each(function () {
            if ($(this).is(':checked')) {
                console.log(sendMessage)
            } else {
                console.log('m')
            }
        })
    })
    $('#removeMessage').click(function () {
        var sendMessage = 'K'
        $('input:checkbox[name=monitor]').each(function () {
            if ($(this).is(':checked')) {
                console.log(sendMessage)
            } else {
                console.log('m')
            }
        })
    })
</script>
<script>
    layui.use(['element', 'carousel'], function(){
        var carousel = layui.carousel;
        var element = layui.element;
@@ -419,12 +378,152 @@
        full();
    });
    var crnId = 1;
    var lcdId = 100;
    var lcdData = 'TEST DATA'
    var lcdControll = 1;
    $('.lcd').click(function () {
        var id = this.id.split("-")[1];
        switch (id) {
            case '100':
                crnId = 1;
                lcdId = 100;
                break;
            case '110':
                crnId = 1;
                lcdId = 110;
                break;
            case '113':
                crnId = 2;
                lcdId = 113;
                break;
        }
        getOther2(crnId,lcdId)
    })
    // lcd切换按钮
    $(function() {
        $(".label").click(function() {
            $(this).addClass("abc").siblings().removeClass("abc");
        });
    });
    // 全选按钮
    $("#selectAll").click(function(){
        $('input:checkbox[name=monitor]').each(function () {
            $(this).prop("checked",true);
        })
    });
    // 取消全选按钮
    $("#unSelectAll").click(function(){
        $('input:checkbox[name=monitor]').each(function () {
            $(this).prop("checked",false);
        })
    });
    // 发送节目按钮
    $('#sendMessage').click(function () {
        var sendMessage = $('#sendContent').val()
        $('input:checkbox[name=monitor]:checked').each(function () {
            var ledId = parseInt($(this).val())
            console.log(typeof ledId,ledId,sendMessage)
            $.ajax({
                url: baseUrl+"/monitor/led/add/program",
                data: {ledId:ledId,msg:sendMessage},
                method: 'GET',
                success: function (res) {
                    console.log(res)
                }
            })
        })
    })
    // 移除节目按钮
    $('#removeMessage').click(function () {
        var sendMessage = ''
        inputValue = ''
        $('input:checkbox[name=monitor]:checked').each(function () {
            var ledId = parseInt($(this).val())
            console.log(ledId)
            $.ajax({
                url: baseUrl+"/monitor/led/add/program",
                data: {ledId:ledId,msg:sendMessage},
                method: 'GET',
                success: function (res) {
                    console.log(res)
                }
            })
        })
    })
    setInterval(function () {
        setDate();
        initlineChart();
        initPieChart();
        getOther2(crnId,lcdId)
        getInfo(lcdId);
        getError(lcdId);
        getProgram(lcdId)
    }, 1000);
    // 出库信息
    function getInfo(ledId) {
        $.ajax({
            url: baseUrl+"/monitor/led",
            data: {ledId:ledId},
            method: 'GET',
            success: function (res) {
                if (lcdControll < 3) {
                    $('.aData').attr('display','none')
                    $('.bData').attr('display','flex')
                }
            }
        });
    }
    // 异常信息
    function getError(ledId) {
        $.ajax({
            url: baseUrl+"/monitor/led/error",
            data: {ledId:ledId},
            method: 'GET',
            success: function (res) {
                if (lcdControll < 4) {
                    if (res.data == null) {
                        lcdControll = 0
                    } else {
                        lcdControll = 3
                        $('.bData').attr('display','none')
                        $('.aData').attr('display','flex')
                        $('#ledData').text(res.data)
                    }
                }
            }
        });
    }
    // 节目信息
    function getProgram(ledId) {
        $.ajax({
            url: baseUrl+"/monitor/led/program",
            data: {ledId:ledId},
            method: 'GET',
            success: function (res) {
                if (res.data != '') {
                    lcdControll = 4
                    $('.bData').attr('display','none')
                    $('.aData').attr('display','flex')
                    $('#ledData').text(res.data)
                } else {
                    lcdControll = 0
                }
            }
        });
    }
    /***********************************************************************************/
    /************************************ 堆垛机速度 *************************************/
    /***********************************************************************************/
    var crnChart = echarts.init(document.getElementById('crn-chart'));
    crnChartOption = {
        // backgroundColor: '#1b1b1b',