Skip to content
beijian.html 15.2 KiB
Newer Older
zhangpux's avatar
zhangpux committed
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../static/js/jquery-1.8.1.min.js" type=text/javascript></script>
    <script src="../static/js/rem.js"></script>
    <link rel="stylesheet" type="text/css" href="../static/css/common.css" />
zhangpux's avatar
zhangpux committed
    <link rel="stylesheet" type="text/css" href="../static/css/workshop.css" />
    <link rel="stylesheet" type="text/css" href="../static/css/commonArea.css" />
zhangpux's avatar
zhangpux committed
    <title>上海市人民检察院</title>
</head>
<style type="text/css">
    .content {
        background: url('../static/images/bg.jpg') no-repeat;
        width: 100%;
        min-height: 100vh;
        background-size: cover;
    }
</style>
<script type="text/javascript">
    $(function () {
        // 1、点击上面的li,当前点击的li添加current类,其余兄弟移除类
        $(".tab_list li").click(function () {
            // 链式编程  当前li添加类,其余兄弟移除类
            $(this).addClass('current').siblings().removeClass('current');
            // 2、拿到当前点击的索引号
            var index = $(this).index();
            // 3、下面index对应的模块显示,其余的item隐藏
            $(".tab_con .item").eq(index).show().siblings().hide();
            updateData(index + 1);
        })
        updateData(1);
        //循环数组 打摄像头位置
        // var arr = [{
        //     top: '1.0rem',
        //     left: '2.25rem'
        // }, {
        //     top: '1rem',
        //     left: '6rem'
        // }, {
        //     top: '2.3rem',
        //     left: '0.4rem'
        // }, {
        //     top: '2.3rem',
        //     left: '1.7rem'
        // }, {
        //     top: '2.3rem',
        //     left: '3rem'
        // }, {
        //     top: '2.3rem',
        //     left: '4.25rem'
        // }, {
        //     top: '2.3rem',
        //     left: '5.5rem'
        // }, {
        //     top: '2.3rem',
        //     left: '6.8rem'
        // }, {
        //     top: '2.3rem',
        //     left: '8.05rem'
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '43%',
zhangpux's avatar
zhangpux committed
        //     left: '0.2rem'
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '46%',
zhangpux's avatar
zhangpux committed
        //     left: '1.3rem'
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '43%',
zhangpux's avatar
zhangpux committed
        //     left: '6.6rem'
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '52%',
zhangpux's avatar
zhangpux committed
        //     left: '6.6rem'
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '68%',
zhangpux's avatar
zhangpux committed
        //     left: '2.2rem'
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '68%',
zhangpux's avatar
zhangpux committed
        //     left: '6.0rem'
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '84%',
zhangpux's avatar
zhangpux committed
        //     left: '0.4rem'
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '84%',
zhangpux's avatar
zhangpux committed
        //     left: '1.7rem'
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '84%',
zhangpux's avatar
zhangpux committed
        //     left: '3rem'
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '84%',
zhangpux's avatar
zhangpux committed
        //     left: '4.3rem'
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '84%',
zhangpux's avatar
zhangpux committed
        //     left: '5.5rem'
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '84%',
zhangpux's avatar
zhangpux committed
        //     left: '6.8rem'
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '84%',
zhangpux's avatar
zhangpux committed
        //     left: '8.1rem'
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '94%',
zhangpux's avatar
zhangpux committed
        //     left: '1.9rem'
        // }, {
        //     top: "2.1rem",
        //     left: "10.8rem"
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '34%',
zhangpux's avatar
zhangpux committed
        //     left: "10.4rem"
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '48%',
zhangpux's avatar
zhangpux committed
        //     left: "10.4rem"
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '48%',
zhangpux's avatar
zhangpux committed
        //     left: "11.4rem"
        // }, {
zhangpux's avatar
zhangpux committed
        //     top: '87%',
zhangpux's avatar
zhangpux committed
        //     left: "10.8rem"
        // }]
        // var divElement = document.querySelector('.room_box');
        // console.log(divElement)
        // let htmlTxt = '<img class="bg_img" src="../static/images/beijian1.png" alt="">'
        // for (let i = 0; i < arr.length; i++) {
        //     console.log(divElement)
        //     htmlTxt = htmlTxt + '<img class="camera" src="../static/images/camera.png" ' + ' style=top:' + arr[i].top + ";left:" + arr[i].left + ' onclick="handleClick(' + i + ')"></img>'
        //     // 使用 innerHTML 添加元素

        // }
        // divElement.innerHTML = htmlTxt;
    });
    function updateData(index) {
        let dataList = {
            'arr1': [{
                top: '1.0rem',
                left: '2.25rem'
            }, {
                top: '1rem',
                left: '6rem'
            }, {
                top: '2.3rem',
                left: '0.4rem'
            }, {
                top: '2.3rem',
                left: '1.7rem'
            }, {
                top: '2.3rem',
                left: '3rem'
            }, {
                top: '2.3rem',
                left: '4.25rem'
            }, {
                top: '2.3rem',
                left: '5.5rem'
            }, {
                top: '2.3rem',
                left: '6.8rem'
            }, {
                top: '2.3rem',
                left: '8.05rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '43%',
zhangpux's avatar
zhangpux committed
                left: '0.2rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '46%',
zhangpux's avatar
zhangpux committed
                left: '1.3rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '43%',
zhangpux's avatar
zhangpux committed
                left: '6.6rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '52%',
zhangpux's avatar
zhangpux committed
                left: '6.6rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '68%',
zhangpux's avatar
zhangpux committed
                left: '2.2rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '68%',
zhangpux's avatar
zhangpux committed
                left: '6.0rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '0.4rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '1.7rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '3rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '4.3rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '5.5rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '6.8rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '8.1rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '94%',
zhangpux's avatar
zhangpux committed
                left: '1.9rem'
            }, {
                top: "2.1rem",
                left: "10.8rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '34%',
zhangpux's avatar
zhangpux committed
                left: "10.4rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '48%',
zhangpux's avatar
zhangpux committed
                left: "10.4rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '48%',
zhangpux's avatar
zhangpux committed
                left: "11.4rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '87%',
zhangpux's avatar
zhangpux committed
                left: "10.8rem"
            }],
            'arr2': [{
                top: '1.0rem',
                left: '2.25rem'
            }, {
                top: '1rem',
                left: '6rem'
            }, {
                top: '2.3rem',
                left: '0.4rem'
            }, {
                top: '2.3rem',
                left: '1.7rem'
            }, {
                top: '2.3rem',
                left: '3rem'
            }, {
                top: '2.3rem',
                left: '4.25rem'
            }, {
                top: '2.3rem',
                left: '5.5rem'
            }, {
                top: '2.3rem',
                left: '6.8rem'
            }, {
                top: '2.3rem',
                left: '8.05rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '46%',
zhangpux's avatar
zhangpux committed
                left: '1.3rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '43%',
zhangpux's avatar
zhangpux committed
                left: '6.6rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '52%',
zhangpux's avatar
zhangpux committed
                left: '6.6rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '68%',
zhangpux's avatar
zhangpux committed
                left: '2.2rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '68%',
zhangpux's avatar
zhangpux committed
                left: '6.0rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '0.4rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '1.7rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '3rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '4.3rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '5.5rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '6.8rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '8.1rem'
            }, {
                top: "0.1rem",
                left: "11.2rem"
            }, {
                top: "0.1rem",
                left: "11.2rem"
            }, {
                top: "1.4rem",
                left: "10.0rem"
            }, {
                top: "1.4rem",
                left: "10.8rem"
            }, {
                top: "1.4rem",
                left: "11.5rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '34%',
zhangpux's avatar
zhangpux committed
                left: "10.4rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '48%',
zhangpux's avatar
zhangpux committed
                left: "10.4rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '48%',
zhangpux's avatar
zhangpux committed
                left: "11.4rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '66%',
zhangpux's avatar
zhangpux committed
                left: "10.0rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '66%',
zhangpux's avatar
zhangpux committed
                left: "10.8rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '66%',
zhangpux's avatar
zhangpux committed
                left: "11.5rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: "94%",
zhangpux's avatar
zhangpux committed
                left: "10.8rem"
            }],
            'arr3': [{
                top: '1.0rem',
                left: '2.25rem'
            }, {
                top: '1rem',
                left: '6rem'
            }, {
                top: '2.3rem',
                left: '0.4rem'
            }, {
                top: '2.3rem',
                left: '1.7rem'
            }, {
                top: '2.3rem',
                left: '3rem'
            }, {
                top: '2.3rem',
                left: '4.25rem'
            }, {
                top: '2.3rem',
                left: '5.5rem'
            }, {
                top: '2.3rem',
                left: '6.8rem'
            }, {
                top: '2.3rem',
                left: '8.05rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '46%',
zhangpux's avatar
zhangpux committed
                left: '1.3rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '43%',
zhangpux's avatar
zhangpux committed
                left: '6.6rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '52%',
zhangpux's avatar
zhangpux committed
                left: '6.6rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '68%',
zhangpux's avatar
zhangpux committed
                left: '2.2rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '68%',
zhangpux's avatar
zhangpux committed
                left: '6.0rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '0.4rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '1.7rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '3rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '4.3rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '5.5rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '6.8rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '8.1rem'
            }, {
                top: "2.1rem",
                left: "10.8rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '34%',
zhangpux's avatar
zhangpux committed
                left: "10.4rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '48%',
zhangpux's avatar
zhangpux committed
                left: "10.4rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '48%',
zhangpux's avatar
zhangpux committed
                left: "11.4rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '87%',
zhangpux's avatar
zhangpux committed
                left: "10.8rem"
            }],
            'arr4': [{
                top: '1.0rem',
                left: '2.25rem'
            }, {
                top: '1rem',
                left: '6rem'
            }, {
                top: '2.3rem',
                left: '0.4rem'
            }, {
                top: '2.3rem',
                left: '1.7rem'
            }, {
                top: '2.3rem',
                left: '3rem'
            }, {
                top: '2.3rem',
                left: '4.25rem'
            }, {
                top: '2.3rem',
                left: '5.5rem'
            }, {
                top: '2.3rem',
                left: '6.8rem'
            }, {
                top: '2.3rem',
                left: '8.05rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '46%',
zhangpux's avatar
zhangpux committed
                left: '0.2rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '46%',
zhangpux's avatar
zhangpux committed
                left: '1.3rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '43%',
zhangpux's avatar
zhangpux committed
                left: '6.6rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '52%',
zhangpux's avatar
zhangpux committed
                left: '6.6rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '68%',
zhangpux's avatar
zhangpux committed
                left: '2.2rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '68%',
zhangpux's avatar
zhangpux committed
                left: '6.0rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '0.4rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '1.7rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '3rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '4.3rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '5.5rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '6.8rem'
            }, {
zhangpux's avatar
zhangpux committed
                top: '84%',
zhangpux's avatar
zhangpux committed
                left: '8.1rem'
            }, {
                top: "2.1rem",
                left: "10.8rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '34%',
zhangpux's avatar
zhangpux committed
                left: "10.4rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '48%',
zhangpux's avatar
zhangpux committed
                left: "10.4rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '48%',
zhangpux's avatar
zhangpux committed
                left: "11.4rem"
            }, {
zhangpux's avatar
zhangpux committed
                top: '87%',
zhangpux's avatar
zhangpux committed
                left: "10.8rem"
            }]
        };
        var divElement = document.querySelector('.room_box');
        console.log(divElement)
        let htmlTxt = '<img class="bg_img" src="../static/images/beijian' + index + '.png" alt="">'
        let _this = this;
        for (let i = 0; i < dataList[`arr${index}`].length; i++) {
            console.log(divElement)
            htmlTxt = htmlTxt + '<img class="camera" src="../static/images/camera.png" ' + ' style=top:' + dataList[`arr${index}`][i].top + ";left:" + dataList[`arr${index}`][i].left + ' onclick="handleClick(' + i + ')"></img>'
            // 使用 innerHTML 添加元素
        }
        divElement.innerHTML = htmlTxt;
    }
    function handleClick(areaNumber) {
        console.log('areaNumber==', areaNumber);
        alert(`点击了区域 ${areaNumber}`);
    }
</script>

<body>
    <div class="content">
        <div class="content_top"></div>
zhangpux's avatar
zhangpux committed
        <div class="padding_box2 clearfix">
zhangpux's avatar
zhangpux committed
            <div class="menu_box">
                <div class="menu_title_box">北监</div>
                <div class="tab_list">
                    <ul>
                        <li class="current">
                            <div class="flex-box">
zhangpux's avatar
zhangpux committed
                                <p class="tabName">一楼</p>
zhangpux's avatar
zhangpux committed
                                <p class="monitor">监控点<span>28</span></p>
                            </div>
                        </li>
                        <li>
                            <div class="flex-box">
zhangpux's avatar
zhangpux committed
                                <p class="tabName">二楼</p>
zhangpux's avatar
zhangpux committed
                                <p class="monitor">监控点<span>28</span></p>
                            </div>
                        </li>
                        <li>
                            <div class="flex-box">
zhangpux's avatar
zhangpux committed
                                <p class="tabName">三楼</p>
zhangpux's avatar
zhangpux committed
                                <p class="monitor">监控点<span>28</span></p>
                            </div>
                        </li>
                        <li>
                            <div class="flex-box">
                                <p>四楼</p>
                                <p class="monitor">监控点<span>28</span></p>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="content_box">
                <div class="room_box">

                </div>
            </div>
        </div>
    </div>
</body>

</html>