#
whycq
2023-03-27 61090cc2a521db18ccfccb2e02a548ceacd03447
src/main/webapp/views/monitor.html
@@ -2,7 +2,7 @@
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>WCS输送设备管理</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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
@@ -15,24 +15,67 @@
    <script src="../static/layui/layui.js"></script>
    <script src="../static/js/common.js"></script>
    <script src="monitor/js/monitor.js"></script>
    <style>
        .abc {
            border-top: 3px solid rgb(239, 177, 102);
            border-right: 1px solid #FFF;
            border-left: 1px solid #FFF;
        }
    </style>
</head>
<body>
    <div style="padding: 10px;height: 100%;float: left;width: 6%">
        <div class="button-window">111</div>
        <div class="button-window"></div>
    </div>
    <div style="height: 100%;padding-left: 6%">
        <div style="padding: 10px;height: 100%">
            <div style="width: 100%;height: 100%;background-color: #93D1FF">
            <div style="width: 100%;height: 100%;">
                <div class="head">
                    <label for="">TV1</label>
                    <label for="">TV2</label>
                    <label for="">TV3</label>
                    <label id="lcd-1" class="label lcd">LCD1</label>
                    <label id="lcd-2" class="label lcd">LCD2</label>
                    <label id="lcd-3" 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 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: 25%;height: 100%;font-size: 30px;display: flex;flex-direction: column;justify-content: space-around;display: none">
                            <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>
                        <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;display: none">
                            AUTOMATIC WAREHOUSE WCS MONITORING DIAGRAM
                        </div>
                        <div id="ledData1" style="width: 100%;height: 100%;font-size: 30px;display: flex;flex-direction: column;background-color: #93D1FF;">
                            <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 style="width: 25%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center;display: none">
                            <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="canves" style="display: none">
                        <!--头部-->
@@ -173,7 +216,7 @@
                                        </div>
                                    </div>
                                    <!--折线图-->
                                    <div id="line-charts"></div>
                                    <!--<div id="line-charts"></div>-->
                                </div>
                                <div class="container-side-box right-middle">
                                    <div class="image-border image-border1"></div>
@@ -191,7 +234,7 @@
                                        </div>
                                    </div>
                                    <div class="top-main">
                                        <div id="pie-charts"></div>
                                        <!--<div id="pie-charts"></div>-->
                                    </div>
                                    <div class="top-footer">
                                        <div class="top-footer-elem">
@@ -255,7 +298,7 @@
                        </div>
                    </div>
                    <div class="canves">
                    <div class="canves" style="display: none">
                        <div class="canves-header" >
                            <div class="button-left"></div>
                            <div class="button-right"></div>
@@ -277,13 +320,106 @@
                        </div>
                    </div>
                </div>
                <div class="monitor-operate">
                    <!--显示器选择-->
                    <div class="monitor-operate-item">
                        <div style="width: 100%" class="item-top">
                            <button id="selectAll">全选</button>
                            <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" value="113">2号显示器</label>
                            <label for=""><input type="checkbox" name="monitor" value="3">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>
                        </div>
                    </div>
                    <!--文本内容-->
                    <div class="monitor-operate-item"  style="height: 100%;min-width: 200px;display: flex;align-items: center;">
                            <textarea name="textarea" id="sendContent" cols="50" rows="3" style="font-size: 20px" placeholder="显示内容"></textarea>
                    </div>
                    <!--操作-->
                    <div class="monitor-operate-item"  style="height: 100%;min-width: 260px;display: flex;justify-content: space-around">
                            <button id="sendMessage">发送</button>
                            <button id="removeMessage">重置</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script>
    var inputValue = ''
    $(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()
        inputValue = ''
        $('input:checkbox[name=monitor]:checked').each(function () {
            var ledId = parseInt($(this).val())
            $.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 = 'K'
        $('input:checkbox[name=monitor]').each(function () {
            if ($(this).is(':checked')) {
                console.log($(this).find(':checked'))
            } else {
                console.log('m')
            }
        })
    })
</script>
<script>
    layui.use(['element', 'carousel'], function(){
        var carousel = layui.carousel;
        var element = layui.element;
@@ -309,11 +445,83 @@
        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 1:
                crnId = 1;
                lcdId = 100;
                break;
            case 2:
                crnId = 2;
                lcdId = 110;
                break;
        }
        getOther2(crnId,lcdId)
    })
    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) {
                    $('#ledData')
                }
            }
        });
    }
    function getError(ledId) {
        $.ajax({
            url: baseUrl+"/monitor/led/error",
            data: {ledId:ledId},
            method: 'GET',
            success: function (res) {
                if (lcdControll == 2) {
                    $('#ledData').text(res.data)
                }
            }
        });
    }
    function getProgram(ledId) {
        console.log(ledId)
        $.ajax({
            url: baseUrl+"/monitor/led/program",
            data: {ledId:ledId},
            method: 'GET',
            success: function (res) {
                console.log(res)
            }
        });
    }
    /***********************************************************************************/
    /************************************ 堆垛机速度 *************************************/
    /***********************************************************************************/
    var crnChart = echarts.init(document.getElementById('crn-chart'));
    crnChartOption = {
@@ -634,13 +842,13 @@
            data:  ['1', '2', '3', '4', '5', '6', '7'],
            axisLabel: {
                textStyle:{
                    color:'#aaa',  //坐标的字体颜色
                    fontSize: 6,
                    color:'#ffffff',  //坐标的字体颜色
                    fontSize: 20,
                },
            },
            axisLine:{
                lineStyle:{
                    color:'#3590ac', // 坐标轴颜色
                    color:'#ffffff', // 坐标轴颜色
                }
            }
        },
@@ -648,19 +856,19 @@
            type: 'value',
            axisLabel: {
                textStyle:{
                    color:'#aaa',  //坐标的字体颜色
                    fontSize: 5
                    color:'#ffffff',  //坐标的字体颜色
                    fontSize: 20
                },
            },
            axisLine:{
                lineStyle:{
                    color:'#3590ac', // 坐标轴颜色
                    color:'#ffffff', // 坐标轴颜色
                }
            },
            splitLine:{
                show: true,
                lineStyle:{
                    color:'#517a9b', // 分割线颜色
                    color:'#ffffff', // 分割线颜色
                }
            }