#
whycq
2023-03-27 61090cc2a521db18ccfccb2e02a548ceacd03447
src/main/webapp/views/monitor.html
@@ -33,22 +33,42 @@
        <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-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>-->
                    <div class="canves1">
                        <div style="width: 30%;height: 100%;font-size: 30px;display: flex;flex-direction: column;justify-content: space-around">
                        <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 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;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>
@@ -309,8 +329,8 @@
                        </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" 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>
@@ -354,6 +374,7 @@
</body>
</html>
<script>
    var inputValue = ''
    $(function() {
        $(".label").click(function() {
            $(this).addClass("abc").siblings().removeClass("abc");
@@ -371,12 +392,17 @@
    });
    $('#sendMessage').click(function () {
        var sendMessage = $('#sendContent').val()
        $('input:checkbox[name=monitor]').each(function () {
            if ($(this).is(':checked')) {
                console.log(sendMessage)
            } else {
                console.log('m')
            }
        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)
                }
            })
        })
    })
@@ -384,7 +410,7 @@
        var sendMessage = 'K'
        $('input:checkbox[name=monitor]').each(function () {
            if ($(this).is(':checked')) {
                console.log(sendMessage)
                console.log($(this).find(':checked'))
            } else {
                console.log('m')
            }
@@ -419,12 +445,84 @@
        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 = {
        // backgroundColor: '#1b1b1b',