Forráskód Böngészése

新增权限配置,权限新增页面 功能新增

ming 4 éve
szülő
commit
cca50a99b1
9 módosított fájl, 795 hozzáadás és 39 törlés
  1. 106 31
      add.html
  2. 91 0
      add2.html
  3. 108 0
      auth-add.html
  4. 164 0
      auth-manage.html
  5. 140 8
      css/common.css
  6. BIN
      image/arrow.png
  7. BIN
      image/auth-icon.jpg
  8. BIN
      image/call.png
  9. 186 0
      js/select.js

+ 106 - 31
add.html

@@ -7,7 +7,7 @@
     <meta name="viewport" content="width=750, initial-scale=1, maximum-scale=1, user-scalable=0" />
     <meta name="keywords" content="" />
     <meta name="description" content="" />
-    <title>新增</title>
+    <title>设备新增</title>
     <!-- FAVICON AND APPLE TOUCH -->
     <link href="favicon.ico" rel="shortcut icon" />
     <link rel="apple-touch-icon-precomposed" sizes="180x180" />
@@ -21,30 +21,74 @@
         <div class="fixed-section">
             <div class="nav-tit">
                 <a class="goBack" onclick="history.back()"></a>
-                新增
+                设备新增
             </div>
 
         </div>
-        <form action="" style="margin-top:40px">
+        <form action="__MODULE__/DeviceManagement/add" style="margin-top:40px">
             <div>
-                <span><i>*</i>站点名称:</span>
-                <input type="text" name="siteName">
+                <span><i>*</i>设备编号:</span>
+                <input type="text" name="owner_code">
             </div>
             <div>
-                <span><i>*</i>站点位置:</span>
-                <input type="text" name="siteplace">
+                <span><i>*</i>设备名称:</span>
+                <input type="text" name="owner_name">
             </div>
             <div>
-                <span><i>*</i>站点地址:</span>
-                <input type="text" name="siteAddress">
+                <span><i>*</i>安装位置:</span>
+                <input type="text" name="unitinfo">
             </div>
             <div>
-                <span><i>*</i>联系人:</span>
-                <input type="text" name="contactMan">
+                <span><i>*</i>所属楼层:</span>
+                <!-- <input type="text" name="louyu"> -->
+                <select name="louyu" id="">
+                    <option value="">请选择</option>
+                    <option value="1">楼层1</option>
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+                    <option value="2">楼层2</option>
+
+                </select>
             </div>
             <div>
-                <span><i>*</i>手机号码:</span>
-                <input type="text" name="mobile">
+                <span><i>*</i>站点ID:</span>
+                <select name="push_param2" id="">
+                    <option value="">请选择</option>
+                    <option value="1">站点一</option>
+                    <option value="2">站点二</option>
+                </select>
+
+                <!-- <input type="text" name="push_param2"> -->
             </div>
             <a class="submit-btn">提交</a>
 
@@ -54,36 +98,67 @@
     <script src="js/jquery-2.2.2.min.js"></script>
     <script>
         $('.submit-btn').click(function() {
-            if ($('input[name=siteName]').val().length == 0) {
-                alert('请输入站点名称')
+            if ($('input[name=owner_code]').val().length == 0) {
+                alert('请输入设备编号')
+                return false;
+            }
+            if ($('input[name=owner_name]').val().length == 0) {
+                alert('请输入设备名称')
                 return false;
             }
-            if ($('input[name=siteplace]').val().length == 0) {
-                alert('请输入站点位置')
+            if ($('input[name=unitinfo]').val().length == 0) {
+                alert('请输入安装位置')
                 return false;
             }
-            if ($('input[name=siteAddress]').val().length == 0) {
-                alert('请输入站点地址')
+            if (!$('select[name=louyu]').val()) {
+                alert('请选择所属楼层')
                 return false;
             }
-            if ($('input[name=contactMan]').val().length == 0) {
-                alert('请输入联系人')
+            if (!$('select[name=push_param2]').val()) {
+                alert('请选择站点ID')
                 return false;
             }
 
-            var mobile = $('input[name=mobile]').val();
-            if (mobile.length == 0) {
+            // if ($('input[name=push_param2]').val().length == 0) {
+            //     alert('请输入站点ID')
+            //     return false;
+            // }
 
-                alert('请填写手机号码');
-                return false;
-            } else {
-                var telre = /^(13[0-9]|14[0-9]|15[0-9]|17[0-9]|18[0-9])\d{8}$/;
-                if (!telre.test(mobile)) {
-                    alert('请输入有效的手机号码');
-                    return false;
+            // var mobile = $('input[name=mobile]').val();
+            // if (mobile.length == 0) {
+            //
+            //     alert('请填写手机号码');
+            //     return false;
+            // } else {
+            //     var telre = /^(13[0-9]|14[0-9]|15[0-9]|17[0-9]|18[0-9])\d{8}$/;
+            //     if (!telre.test(mobile)) {
+            //         alert('请输入有效的手机号码');
+            //         return false;
+            //     }
+            //
+            // }
+
+            var siteName = $('input[name=siteName]').val();
+            var siteplace = $('input[name=siteplace]').val();
+            var siteAddress = $('input[name=siteAddress]').val();
+            var contactMan = $('input[name=contactMan]').val();
+            $.post('__MODULE__/DeviceManagement/add', {
+                'siteName': siteName,
+                'siteAdress': siteplace,
+                'address': siteAddress,
+                'username': contactMan,
+                'phone': mobile
+            }, function(res) {
+                if (res == 1) {
+                    alert("保存成功");
+                    window.location.href = "__MODULE__/SiteManagement/index";
+                } else {
+                    alert("保存失败");
                 }
 
-            }
+                //
+                // $('#content-data').html(res);
+            });
         })
     </script>
 </body>

+ 91 - 0
add2.html

@@ -0,0 +1,91 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+    <meta name="viewport" content="width=750, initial-scale=1, maximum-scale=1, user-scalable=0" />
+    <meta name="keywords" content="" />
+    <meta name="description" content="" />
+    <title>新增</title>
+    <!-- FAVICON AND APPLE TOUCH -->
+    <link href="favicon.ico" rel="shortcut icon" />
+    <link rel="apple-touch-icon-precomposed" sizes="180x180" />
+    <meta name="msapplication-TileImage" content="mstile.png" />
+    <link rel="stylesheet" href="css/common.css" />
+    <meta name="viewport" content="width=375, user-scalable=no" />
+</head>
+
+<body>
+    <div class="page-wrapper">
+        <div class="fixed-section">
+            <div class="nav-tit">
+                <a class="goBack" onclick="history.back()"></a>
+                新增
+            </div>
+
+        </div>
+        <form action="" style="margin-top:40px">
+            <div>
+                <span><i>*</i>站点名称:</span>
+                <input type="text" name="siteName">
+            </div>
+            <div>
+                <span><i>*</i>站点位置:</span>
+                <input type="text" name="siteplace">
+            </div>
+            <div>
+                <span><i>*</i>站点地址:</span>
+                <input type="text" name="siteAddress">
+            </div>
+            <div>
+                <span><i>*</i>联系人:</span>
+                <input type="text" name="contactMan">
+            </div>
+            <div>
+                <span><i>*</i>手机号码:</span>
+                <input type="text" name="mobile">
+            </div>
+            <a class="submit-btn">提交</a>
+
+        </form>
+    </div>
+    <script src="js/layout.js"></script>
+    <script src="js/jquery-2.2.2.min.js"></script>
+    <script>
+        $('.submit-btn').click(function() {
+            if ($('input[name=siteName]').val().length == 0) {
+                alert('请输入站点名称')
+                return false;
+            }
+            if ($('input[name=siteplace]').val().length == 0) {
+                alert('请输入站点位置')
+                return false;
+            }
+            if ($('input[name=siteAddress]').val().length == 0) {
+                alert('请输入站点地址')
+                return false;
+            }
+            if ($('input[name=contactMan]').val().length == 0) {
+                alert('请输入联系人')
+                return false;
+            }
+
+            var mobile = $('input[name=mobile]').val();
+            if (mobile.length == 0) {
+
+                alert('请填写手机号码');
+                return false;
+            } else {
+                var telre = /^(13[0-9]|14[0-9]|15[0-9]|17[0-9]|18[0-9])\d{8}$/;
+                if (!telre.test(mobile)) {
+                    alert('请输入有效的手机号码');
+                    return false;
+                }
+
+            }
+        })
+    </script>
+</body>
+
+</html>

+ 108 - 0
auth-add.html

@@ -0,0 +1,108 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+    <meta name="viewport" content="width=750, initial-scale=1, maximum-scale=1, user-scalable=0" />
+    <meta name="keywords" content="" />
+    <meta name="description" content="" />
+    <title>权限新增</title>
+    <!-- FAVICON AND APPLE TOUCH -->
+    <link href="favicon.ico" rel="shortcut icon" />
+    <link rel="apple-touch-icon-precomposed" sizes="180x180" />
+    <meta name="msapplication-TileImage" content="mstile.png" />
+    <link rel="stylesheet" href="css/common.css" />
+    <meta name="viewport" content="width=375, user-scalable=no" />
+</head>
+
+<body>
+    <div class="page-wrapper">
+        <div class="fixed-section">
+            <div class="nav-tit">
+                <a class="goBack" onclick="history.back()"></a>
+                权限新增
+            </div>
+
+        </div>
+        <form action="__MODULE__/DeviceManagement/add" style="margin-top:40px">
+            <div>
+                <span><i>*</i>角色:</span>
+                <select name="push_param2" id="">
+                    <option value="">请选择</option>
+                    <option value="1">角色一</option>
+                    <option value="2">角色二</option>
+                </select>
+            </div>
+            <div style="vertical-align: top;">
+                <span style="vertical-align: top;"><i>*</i>站点:</span>
+                <div class="siteSelect">
+                    <div class="qwe">qwe</div>
+
+                </div>
+
+
+            </div>
+
+            <div class="alarming-type">
+                <span>告警类型:</span>
+                <input type="radio" name="alarming" value="1" checked/> 全部告警
+                <input type="radio" name="alarming" value="2" /> 维保告警
+
+            </div>
+            <a class="submit-btn">提交</a>
+
+        </form>
+    </div>
+    <script src="js/layout.js"></script>
+    <script src="js/jquery-2.2.2.min.js"></script>
+    <script src="js/select.js"></script>
+    <script>
+        $('.submit-btn').click(function() {
+            // if ($('input[name=owner_code]').val().length == 0) {
+            //     alert('请输入设备编号')
+            //     return false;
+            // }
+            // if ($('input[name=owner_name]').val().length == 0) {
+            //     alert('请输入设备名称')
+            //     return false;
+            // }
+            // if ($('input[name=unitinfo]').val().length == 0) {
+            //     alert('请输入安装位置')
+            //     return false;
+            // }
+            if (!$('select[name=push_param2]').val()) {
+                alert('请选择角色')
+                return false;
+            }
+            if (!$(".label").length) {
+                alert('请选择站点')
+                return false;
+            }
+
+            var siteName = $('input[name=siteName]').val();
+            var siteplace = $('input[name=siteplace]').val();
+            var siteAddress = $('input[name=siteAddress]').val();
+            var contactMan = $('input[name=contactMan]').val();
+            $.post('__MODULE__/DeviceManagement/add', {
+                'siteName': siteName,
+                'siteAdress': siteplace,
+                'address': siteAddress,
+                'username': contactMan,
+                'phone': mobile
+            }, function(res) {
+                if (res == 1) {
+                    alert("保存成功");
+                    window.location.href = "__MODULE__/SiteManagement/index";
+                } else {
+                    alert("保存失败");
+                }
+
+                //
+                // $('#content-data').html(res);
+            });
+        })
+    </script>
+</body>
+
+</html>

+ 164 - 0
auth-manage.html

@@ -0,0 +1,164 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+    <meta name="viewport" content="width=750, initial-scale=1, maximum-scale=1, user-scalable=0" />
+    <meta name="keywords" content="" />
+    <meta name="description" content="" />
+    <title>权限管理</title>
+    <!-- FAVICON AND APPLE TOUCH -->
+    <link href="favicon.ico" rel="shortcut icon" />
+    <link rel="apple-touch-icon-precomposed" sizes="180x180" />
+    <meta name="msapplication-TileImage" content="mstile.png" />
+    <link rel="stylesheet" href="css/common.css" />
+    <meta name="viewport" content="width=375, user-scalable=no" />
+</head>
+
+<body>
+    <div class="page-wrapper">
+
+        <div class="fixed-section">
+            <div class="nav-tit">
+                <a class="goBack" onclick="history.back()"></a>
+                权限管理
+            </div>
+            <div class="filterSection">
+                <input type="text" placeholder="请选择传输方式">
+                <span class="search">查询</span>
+            </div>
+        </div>
+        <div class="device-list">
+            <div class="noResult">
+                <p>暂无查询结果...</p>
+            </div>
+            <ul>
+
+                <li class="device-item">
+                    <div class="iconBox"><img src="image/auth-icon.jpg" alt=""></div>
+                    <div class="desBox">
+                        <p class="device-tit">13262908433</p>
+                    </div>
+                    <a href="detail.html" class="navRight"><img src="image/call.png" alt="" width="16"></a>
+                    <div class="operate-box">
+                        <ul>
+                            <li class="opera-edit" οnclick="javascrtpt:window.location.href='auth-add.html'">修改设备 </li>
+                            <li class="opera-delete">删除设备</li>
+                        </ul>
+                    </div>
+                </li>
+                <li class="device-item">
+                    <div class="iconBox"><img src="image/auth-icon.jpg" alt=""></div>
+                    <div class="desBox">
+                        <p class="device-tit">13262908433</p>
+                    </div>
+                    <a href="detail.html" class="navRight"><img src="image/call.png" alt="" width="16"></a>
+                    <div class="operate-box">
+                        <ul>
+                            <li class="opera-edit" οnclick="javascrtpt:window.location.href='auth-add.html'">修改设备 </li>
+                            <li class="opera-delete">删除设备</li>
+                        </ul>
+                    </div>
+                </li>
+                <li class="device-item">
+                    <div class="iconBox"><img src="image/auth-icon.jpg" alt=""></div>
+                    <div class="desBox">
+                        <p class="device-tit">13262908433</p>
+                    </div>
+                    <a href="detail.html" class="navRight"><img src="image/call.png" alt="" width="16"></a>
+                    <div class="operate-box">
+                        <ul>
+                            <li class="opera-edit" οnclick="javascrtpt:window.location.href='auth-add.html'">修改设备 </li>
+                            <li class="opera-delete">删除设备</li>
+                        </ul>
+                    </div>
+                </li>
+                <li class="device-item">
+                    <div class="iconBox"><img src="image/auth-icon.jpg" alt=""></div>
+                    <div class="desBox">
+                        <p class="device-tit">13262908433</p>
+                    </div>
+                    <a href="detail.html" class="navRight"><img src="image/call.png" alt="" width="16"></a>
+                    <div class="operate-box">
+                        <ul>
+                            <li class="opera-edit" οnclick="javascrtpt:window.location.href='auth-add.html'">修改设备 </li>
+                            <li class="opera-delete">删除设备</li>
+                        </ul>
+                    </div>
+                </li>
+                <li class="device-item">
+                    <div class="iconBox"><img src="image/auth-icon.jpg" alt=""></div>
+                    <div class="desBox">
+                        <p class="device-tit">13262908433</p>
+                    </div>
+                    <a href="detail.html" class="navRight"><img src="image/call.png" alt="" width="16"></a>
+                    <div class="operate-box">
+                        <ul>
+                            <li class="opera-edit" οnclick="javascrtpt:window.location.href='auth-add.html'">修改设备 </li>
+                            <li class="opera-delete">删除设备</li>
+                        </ul>
+                    </div>
+                </li>
+
+
+            </ul>
+            <a href="auth-add.html"><img class="plus" src="image/plus-icon.png" alt=""></a>
+        </div>
+
+    </div>
+
+    <script src="js/layout.js"></script>
+    <script src="js/jquery-2.2.2.min.js"></script>
+    <script>
+        // 手机长按事件
+        var timeOutEvent = 0;
+        var _this;
+        $(function() {
+            $(".desBox").on({
+                touchstart: function(e) {
+                    _this = $(this)
+                    timeOutEvent = setTimeout("longPress()", 500);
+                    // e.preventDefault();
+                },
+                touchmove: function() {
+                    clearTimeout(timeOutEvent);
+                    timeOutEvent = 0;
+                },
+                touchend: function() {
+                    clearTimeout(timeOutEvent);
+                    if (timeOutEvent != 0) {
+                        // alert("你这是点击,不是长按");
+                    }
+                    return false;
+                }
+            })
+        });
+
+        function longPress() {
+            timeOutEvent = 0;
+            // alert("长按事件触发发");
+            _this.parent().find('.operate-box').show().parent().siblings().find('.operate-box').hide()
+
+        }
+
+        //点击修改页面跳转
+        $(".device-item").on("touchend", ".opera-edit", function() {
+            // alert("子元素点击");
+            window.location.href = "auth-add.html";
+        })
+        $(".device-item").on("touchend", ".opera-delete", function() {
+            // alert("子元素点击");
+            $(this).parent().parent().parent().remove();
+        })
+
+        // 点击除按钮和弹框之外任意地方隐藏表情
+        $("body").click(function(e) {
+            if (!$(e.target).closest(".operate-box").length) {
+                $(".operate-box").hide();
+            }
+        });
+    </script>
+</body>
+
+</html>

+ 140 - 8
css/common.css

@@ -367,11 +367,11 @@ body {
     left: 0;
 }
 
-input {
+input[type="text"] {
     -webkit-appearance: none;
 }
 
-.filterSection input {
+.filterSection input[type="text"] {
     line-height: 35px;
     width: 70%;
     border-radius: 18px;
@@ -428,7 +428,7 @@ input {
 }
 
 .navRight img {
-    width: 14px
+    /* width: 14px */
 }
 
 
@@ -449,21 +449,39 @@ form span {
     display: inline-block;
     text-align: left;
     position: relative;
-    padding-left: 5px
+    padding-left: 10px
 }
 
 form span i {
     color: #FF0303;
-    position: relative;
+    position: absolute;
     left: -5px;
 }
 
-form input {
-    width: 66%;
+form input[type="text"],
+form select,
+form option {
+    width: 71%;
+    height: 35px;
     line-height: 35px;
     border: 1px solid #EDEDED;
     padding: 0 10px;
     color: #999;
+    box-sizing: border-box;
+    appearance: none;
+    -moz-appearance: none;
+    -webkit-appearance: none;
+}
+
+select {
+    background: url(../image/arrow.png) no-repeat scroll 98% center;
+    background-size: 6%;
+}
+
+select:focus,
+select:active,
+select:hover {
+    outline: none;
 }
 
 a.submit-btn {
@@ -475,4 +493,118 @@ a.submit-btn {
     line-height: 40px;
     text-align: center;
     margin: 20px 0
-}
+}
+
+.alarming-type input:last-child {
+    margin-left: 20px
+}
+
+.siteSelect select {
+    position: relative;
+}
+
+.siteSelect select input {
+    position: absolute;
+    left: 0
+}
+
+
+/* 站点多选下拉样式 start */
+
+.layui-btn {
+    background-color: #5fb878;
+}
+
+a {
+    text-decoration: none;
+}
+
+.label {
+    padding: 2px 0px;
+    background: #aaa;
+    border-radius: 2px;
+    color: #fff;
+    display: block;
+    line-height: 20px;
+    height: 20px;
+    margin: 2px 5px 2px 0;
+    float: left;
+}
+
+.label span {
+    padding: 0 5px;
+    color: #fff;
+}
+
+.close {
+    padding: 1px 5px !important;
+}
+
+.close:hover {
+    /* background-color: #009E94;
+    border-radius: 2px;
+    color: tomato; */
+}
+
+.selectId input {
+    width: 100%!important;
+}
+
+.selectId input {
+    height: 25px;
+    padding: 1px 5px;
+    border-radius: 3px;
+    width: calc(100% - 12px);
+    outline-color: #5fb878;
+    border: 1px solid #5fb878;
+}
+
+.selectId {
+    position: relative;
+}
+
+.selectId dl {
+    border: 1px solid #eee;
+    border-radius: 3px;
+    margin: 2px 0px;
+    max-height: 300px;
+    overflow-x: hidden;
+    white-space: nowrap;
+    position: absolute;
+    width: 100%;
+    top: 40px;
+    background: #fff;
+    z-index: 1000
+}
+
+.selectId dl dd {
+    margin: 0;
+    padding: 5px 10px;
+}
+
+.selectId dl dd:hover {
+    background-color: #5FB878;
+    color: white;
+}
+
+.AD {
+    /* width: 210px;
+        margin-left: 40px; */
+    overflow-y: auto;
+    max-height: 200px;
+    /* border: 2px solid #5fb878;
+        border-radius: 6px;
+        padding: 1px 2px; */
+}
+
+form .AD span {
+    width: auto;
+}
+
+.siteSelect {
+    width: 71%;
+    display: inline-block;
+}
+
+
+/* 站点多选下拉样式end */

BIN
image/arrow.png


BIN
image/auth-icon.jpg


BIN
image/call.png


+ 186 - 0
js/select.js

@@ -0,0 +1,186 @@
+var legp = function(ele) {
+    return ({
+        that: Array.prototype.slice.call(document.querySelectorAll(ele), 0),
+        stopPropagation: function(e) {
+            e = e || window.event;
+            if (e.stopPropagation) { //W3C阻止冒泡方法  
+                e.stopPropagation();
+            } else {
+                e.cancelBubble = true; //IE阻止冒泡方法  
+            }
+        },
+        hide: function() {
+            legp(ele).that.forEach(function(item) {
+                item.style.cssText += "display:none;";
+            });
+        },
+        show: function() {
+            legp(ele).that.forEach(function(item) {
+                item.style.cssText += "display:block;";
+            });
+        },
+        legp_searchList: function(name) {
+            let arr = [];
+            legp("input[name=" + name + "]").that.forEach(item => {
+                arr.push(item.value)
+            });
+            return arr;
+        },
+        legp_search: function(name, tagData) {
+            var domId = legp(ele).that[0];
+            var html = "\n<div>\n<div class=\"selectId\">\n<input type=\"text\" placeholder=\"\u8F93\u5165\u6216\u9009\u62E9\" autocomplete=\"off\">\n<dl style=\"display: none;\">\n</dl>\n</div>\n</div>\n<div>\n<label style=\"line-height:30px\">已选择:</label>\n<div class=\"AD\">\n</div>\n</div>";
+            domId.innerHTML = html;
+            // domId.appendChild(dom);
+            legp(".AD").that[0].parentNode.style.cssText += "display:none;";
+            //获取当前广告
+            function myClick() {
+                legp(".selectId dl dd").that.forEach(function(item) {
+                    item.onclick = function(e) {
+                        var id = this.attributes.value.value;
+                        if (id != '') {
+                            legp(".AD").that[0].innerHTML += "<a href=\"javascript:;\" class=\"label\"><span>" + this.innerHTML + "</span><input type=\"hidden\" name=\"" + name + "\" id=\"" + id + "\" value=\"" + id + "\"/><span class=\"close\">x</span></a>";
+                            legp(".AD").that[0].parentNode.style.cssText += "display:block;";
+                            for (var i = 0; i < tagData.length; i++) {
+                                if (tagData[i].id == id) {
+                                    tagData.splice(i, 1);
+                                    i = tagData.length;
+                                }
+                            }
+                            removeAdvertising();
+                        }
+                        legp(".selectId dl").hide();
+                        legp(".selectId input").that[0].value = '';
+                        e.stopPropagation();
+                    };
+                });
+            }
+            var ddRemove = function(dd) {
+                var temp = dd.nextElementSibling;
+                dd.remove();
+                if (temp != null && temp.nodeName == 'DD') {
+                    ddRemove(temp);
+                }
+            };
+            //筛选
+            legp(".selectId input").that[0].oninput = function() {
+                var val = this.value; //获取input值
+                var dd = legp(".selectId dl dd").that[0];
+                if (dd == "DD") {
+                    ddRemove(dd);
+                }
+                legp(".selectId dl").hide();
+                if (tagData.length > 0) {
+                    legp(".selectId dl").show();
+                    var sear_1 = new RegExp(val);
+                    var judge_1 = false;
+                    legp(".selectId dl").that[0].innerHTML = "";
+                    tagData.forEach(function(item) {
+                        if (sear_1.test(item.name)) {
+                            judge_1 = true;
+                            legp(".selectId dl").that[0].innerHTML += "<dd value=\"" + item.id + "\">" + item.name + "</dd>";
+                        }
+                    });
+                    if (!judge_1) {
+                        legp(".selectId dl").that[0].innerHTML = "<dd>\u6682\u65E0\u6570\u636E</dd>";
+                    }
+                    myClick();
+                }
+            };
+            //显示没被选择的
+            legp(".selectId input").that[0].onclick = function(e) {
+                var dd = legp(".selectId dl dd").that[0];
+                if (dd == "DD") {
+                    ddRemove(dd);
+                }
+                if (tagData.length == 0) {
+                    this.innerHTML = "暂无数据";
+                } else {
+                    legp(".selectId dl").show();
+                }
+                legp(".selectId dl").that[0].innerHTML = "";
+                tagData.sort(function(a, b) {
+                    return a.id - b.id;
+                });
+                tagData.forEach(function(item) {
+                    legp(".selectId dl").that[0].innerHTML += "<dd value=\"" + item.id + "\">" + item.name + "</dd>";
+                });
+                myClick();
+                e.stopPropagation();
+            };
+            var AD = /** @class */ (function() {
+                function AD(name, id) {
+                    this.name = name;
+                    this.id = id;
+                }
+                return AD;
+            }());
+            //删除当前广告
+            function removeAdvertising() {
+                legp(".close").that.forEach(function(item) {
+                    item.onclick = function() {
+                        ddRemove(this.parentNode);
+                        var id = this.parentNode.children[1].id;
+                        var text = this.parentNode.children[0].innerHTML;
+                        tagData.push(new AD(text, id));
+                        if (legp(".close").that.length == 0) {
+                            legp(".AD").that[0].parentNode.style.cssText += "display:none;";
+                        }
+                    };
+                });
+            }
+            // //封装
+            // function clickoutSide(nameClass, callback) {
+            // 	// 全局注册点击事件
+            // 	document.onclick = function (e) {
+            // 		//若点击元素为目标元素则返回
+            // 		if (e.target.className === nameClass) return
+            // 		//否则执行回调函数
+            // 		callback()
+            // 	}
+            // }
+            //隐藏
+            document.onclick = function(e) {
+                legp(".selectId dl").hide();
+                legp(".selectId input").that[0].value = "";
+            };
+        }
+    });
+};
+(function() {
+    var tagData = [{
+        "name": "站点1",
+        "id": 64
+    }, {
+        "name": "站点2",
+        "id": 65
+    }, {
+        "name": "站点3",
+        "id": 5
+    }, {
+        "name": "站点4",
+        "id": 6
+    }, {
+        "name": "站点5",
+        "id": 7
+    }, {
+        "name": "站点6",
+        "id": 8
+    }, {
+        "name": "站点7",
+        "id": 10
+    }, {
+        "name": "站点8",
+        "id": 111
+    }, {
+        "name": "站点9",
+        "id": 112
+    }, {
+        "name": "站点10",
+        "id": 113
+    }];
+
+
+    legp(".qwe").legp_search("fileId", tagData)
+
+
+})()