Jelajahi Sumber

Merge branch 'master' of http://39.104.94.153:3000/yf_zd/second

yf_ymm 5 tahun lalu
induk
melakukan
2401b771d9

+ 2 - 1
apps/Equipment/urls.py

@@ -9,7 +9,7 @@ from apps.Equipment.views import (
     Farm_Mark, Garden_Check, Garden_Check_List, Garden_Detail,Garden_Intro, Garden_List,Tourist,Tourist_List,
     Garden_Manage_New, Garden_Manage_View, Garden_Pub, 
     Garden_User_New, Garden_User_View, Garden_View, Industry_Data, Info_Manage,
-    Info_Pub, JKlist, JKManage_View, Limit, Map_Test, News_Check,
+    Info_Pub, JKlist, JKManage_View, Limit, Map_Test,SetMap_View, News_Check,
     News_Check_List, News_Photo, News_Pub, News_View, Newslist_View,
     Person_Farm, Person_Farm_Edit, Pick, Pick_Photo, Policy_List,
     Policy_List_View, Policy_Pub, Product_Photo, Production_Set, QXZ_Mqtt,
@@ -43,6 +43,7 @@ urlpatterns = [
     url(r'^person_area_pub$', Person_Area_Pub.as_view(), name='person_area_pub'),
     # 地图
     url(r'^map$', Map_Test.as_view(), name='map'),
+    url(r'^setMap$', SetMap_View.as_view(), name='setMap'),
 
     url(r'^equip_test$', Equip_Test.as_view(), name='equip_test'),
     # 监控接口

+ 42 - 2
apps/Equipment/views.py

@@ -387,9 +387,11 @@ class Video_Detail(ListView):
 class Back_Manage(ListView):
     def get(self,request):
         if request.user.is_authenticated():
-            return render(request, 'backstageNet/home.html', context={})
+            current_user = request.user.username
+            current_user = MyUser.objects.get(username=current_user)
+            return render(request, 'backstageNet/home.html', context={"current_user":current_user})
         else:
-            return render(request, 'outerNet/index.html')
+            return render(request, 'outerNet/index2.html')
     def post(self,request):
         current_user = request.user.username
         print("current_user:", current_user)
@@ -2999,6 +3001,44 @@ class Person_View(ListView):
     def post(self, request):
         pass
 
+# 地图设置
+class SetMap_View(ListView):
+    def get(self,request):
+        # 接收当前用户
+        # current_user = request.session.get('username')
+        current_user = MyUser.objects.get(username="admin")
+        # print("current_user:", current_user)
+        # current_user = MyUser.objects.get(username=current_user)
+        page = request.GET.get("page")
+        uname = request.GET.get("uname")
+        user_list = MyUser.objects.all()
+        nums = user_list.count()
+        return render(request, 'backstageNet/systemSet/mapManage.html', context={"nums": nums,"page":page,"uname":uname})
+
+    def post(self, request):
+        map_photo = request.FILES.get('upicture')
+        if map_photo:
+            print("地图图片:", map_photo)
+            map_photo_dir = 'map_photo/'
+            end_name = map_photo.name.split('.')[-1]
+            # 判断如果路径不存在,即创建路径
+            if os.path.exists(map_photo_dir) == False:
+                os.makedirs(map_photo_dir)
+            img = Image.open(map_photo)
+            # img = img.convert('RGB')
+            now_time = time.strftime('%Y%m%d%H%M%S', time.localtime(time.time()))
+            pic_name = now_time + '.' + end_name
+            print("pic_name:", pic_name)
+            img.save(map_photo_dir + pic_name)
+            news_photo = map_photo_dir + pic_name
+            print("new_photo:",news_photo)
+            data = {"code": 0,"msg": "","data": {"src": news_photo}}
+        else:
+            new_photo = "0"
+            data = {"code": 404,"msg": "","data": {"src": news_photo}}
+        data = json.dumps(data)
+        return HttpResponse(data)
+
 
 class Person_List(ListView):
     def get(self,request):

+ 2 - 2
templates/backstageNet/home.html

@@ -280,8 +280,8 @@
                 </li>
                 <li class="layui-nav-item" lay-unselect="">
                     <a href="javascript:;">
-                        <img src="{% static 'imgs/productImg.jpg'%}" class="layui-nav-img">
-                        <span class="currUser" id=""></span>
+                        <img src="{{current_user.user_picture}}" class="layui-nav-img">
+                        <span class="currUser" id="">{{current_user.username}}</span>
                     </a>
                     <dl class="layui-nav-child">
                         <dd>

+ 19 - 21
templates/backstageNet/infoList/myPub.html

@@ -153,12 +153,12 @@
                             <div class="layui-input-inline">
                                 <select name="type" id="selectType" lay-verify="required" lay-filter="type">
                                     <option value="">全部</option>
-                                    <option value="">新闻资讯</option>
-                                    <option value="">视频资讯</option>
-                                    <option value="">产品展厅</option>
-                                    <option value="">四季采摘</option>
-                                    <option value="">民宿导览</option>
-                                    <option value="">旅游景点</option>
+                                    <option value="5">新闻资讯</option>
+                                    <option value="6">视频资讯</option>
+                                    <option value="7">产品展厅</option>
+                                    <option value="8">四季采摘</option>
+                                    <option value="9">民宿导览</option>
+                                    <option value="10">旅游景点</option>
                                 </select> 
                             </div>
                             
@@ -172,10 +172,8 @@
                     <table class="layui-table" id="dataTable">
                         <thead>
                             <tr>
-                                <th>文章标题</th>
-                                <th>文章简介</th>
-                                <!-- <th>内容</th> -->
-                                <th>作者</th>
+                                <th>标题</th>
+                                <th>类型</th>
                                 <th>发布日期</th>
                                 <th>操作</th>
                             </tr>
@@ -212,11 +210,12 @@
             });
 
             //第一个实例
-            getData('art_list', 1, 0) //url,page,信息类型
+            getData('my_pub_list', 1,0, '') //url,page,信息类型
 
             form.on('select(type)', function(data){
+                console.log(data)
                 var hidden = $('.permission button.active').data('type');
-                getData('art_list', 1, hidden) //url,page,信息类型
+                getData('my_pub_list', 1, hidden,data.value) //url,page,信息类型
 
             }); 
             //监听提交
@@ -228,13 +227,14 @@
 
         });
 
-        function getData(url, page, hidden) {
+        function getData(url, page, hidden,curtype) {
             $.ajax({
                 url: url,
                 type: 'get',
                 data: {
                     page: page,
-                    hidden: hidden
+                    hidden: hidden,
+                    type:curtype
                 },
                 dataType: 'html',
                 success: function (data) {
@@ -248,14 +248,12 @@
                         , jump: function (obj, first) {
                             if (!first) {
                                 $.ajax({
-                                    url: 'news_check_list',
+                                    url: 'my_pub_list',
                                     type: 'get',
-                                    data: { page: obj.curr ,hidden: hidden},
+                                    data: { page: obj.curr ,hidden: hidden,type:curtype},
                                     dataType: 'html',
                                     success: function (data) {
-                                        console.log(data);
                                         $('#dataTable').children('tbody').html(data);
-                                        console.log($('#totalPage').val());
                                     },
                                     error: function (type) {
                                         console.log(type)
@@ -274,7 +272,7 @@
         // 编辑
         function editFun(id) {
             $.ajax({
-                url: 'news_check_list',
+                url: 'my_pub_list',
                 type: 'post',
                 data: {
                     id: id,
@@ -312,7 +310,7 @@
         function passFun(id) {
             layer.confirm('是否通过此信息',{title:'通过'}, function (index) {
                 $.ajax({
-                    url: 'news_check_list',
+                    url: 'my_pub_list',
                     type: 'post',
                     data: {
                         req: 'check',
@@ -422,7 +420,7 @@
                 $(this).addClass('active');
                 $('#selectType').val('');
                 form.render('select');
-                getData('art_list', 1, type)
+                getData('my_pub_list', 1, type)
             }
         })
 

+ 33 - 12
templates/backstageNet/infoList/myPubList.html

@@ -1,25 +1,46 @@
-{% if art|length %} {% for msg in art %}
+{% if art_list|length %} {% for msg in art_list %}
 <tr>
     <td>{{ msg.title }}</td>
-    <td>{{ msg.intro }}</td>
-    <!-- <td>{{ msg.content|safe }}</td> -->
-    <td>{{ msg.writer }}</td>
+    {% if msg.art_type == '5' %}
+        <td>新闻资讯</td>
+    {% elif msg.art_type == '6' %}
+        <td>视频资讯</td>
+    {% elif msg.art_type == '7' %}
+        <td>产品展厅</td>
+    {% elif msg.art_type == '8' %}
+        <td>四季采摘</td>
+    {% elif msg.art_type == '9' %}
+        <td>民宿导览</td>
+    {% elif msg.art_type == '10' %}
+        <td>旅游景点</td>
+    {% else %}
+        <td>{{msg.art_type}}</td>
+    {% endif %} 
     <td>{{ msg.upl_time }}</td>
     <td>
-        {% if msg.hidden == 0%}
-        <a href="JavaScript:;" class="editBtn" onclick="editFun('{{msg.id}}')">编辑</a>
-        |
-        <a href="JavaScript:;" class="passBtn"  onclick="passFun('{{msg.id}}')">通过</a>
-        |
-        {% endif %} 
         <a href="JavaScript:;" class="delBtn" onclick="delFun('{{msg.id}}')">删除</a>
         |
-        <a href="JavaScript:;" class="lokBtn" onclick="lokFun('{{msg.id}}')">查看</a>
+        <!-- <a href="JavaScript:;" class="lokBtn" onclick="lokFun('{{msg.id}}')">查看</a> -->
+    {% if msg.art_type == '5' %}
+        <a href="news_view?id={{msg.id}}" target="_blank" class="lokBtn">查看</a>
+    {% elif msg.art_type == '6' %}
+        <a href="video_detail?id={{msg.id}}" target="_blank" class="lokBtn">查看</a>
+    {% elif msg.art_type == '7' %}
+        <a href="equip_show_detail?id={{msg.id}}" target="_blank" class="lokBtn">查看</a>
+    {% elif msg.art_type == '8' %}
+        <a href="garden_intro?id={{msg.id}}" target="_blank" class="lokBtn">查看</a>
+    {% elif msg.art_type == '9' %}
+        <a href="dorm_detail?id={{msg.id}}" target="_blank" class="lokBtn">查看</a>
+    {% elif msg.art_type == '10' %}
+        <a href="tourist?id={{msg.id}}" target="_blank" class="lokBtn">查看</a>
+    {% else %}
+        <td> </td>
+    {% endif %} 
     </td>
 </tr>
 {% endfor %} {% else %}
 <tr>
-    <td colspan="5" style="text-align:center;">暂无数据</td>
+    <td colspan="4" style="text-align:center;">暂无数据</td>
 </tr>
 {% endif %}
 <input type="hidden" value="{{nums}}" id="totalPage">

+ 241 - 131
templates/backstageNet/jk/equipmanage_jk.html

@@ -133,6 +133,9 @@
         .nullData p:first-child {
             padding-top: 10%;
         }
+        .flashShowDiv{
+            background: #323d48;
+        }
 
         .flashShowDiv,
         .flashDownDiv,
@@ -148,11 +151,6 @@
             width: 100%;
         }
 
-        .equipName {
-            color: #438eb9;
-            font-size: 16px;
-            line-height: 30px;
-        }
 
         #downpath {
             width: 100%;
@@ -169,17 +167,18 @@
 
         #divMain .aSelected {
             z-index: 9;
-            border: 3px solid #61615e;
+            border: 3px solid #49dfb4;
         }
 
         #divMain a,
         a:visited {
             float: left;
-            border: 1px solid #000;
+            /* border: 1px solid #000; */
             margin: 0 -1px -1px 0;
             position: relative;
             text-decoration: none;
             box-sizing: border-box;
+            border: 3px solid #000;
         }
 
         #divMain .a1 {
@@ -234,17 +233,6 @@
             color: #37CAB9;
         }
 
-
-        .equipname {
-            position: absolute;
-            right: 0px;
-            top: 0;
-            font-size: 22px;
-            color: #fff;
-            background: #000;
-            padding: 3px;
-        }
-
         /* 控制按钮 */
 
         .searchInp {
@@ -256,8 +244,21 @@
             line-height: 30px;
             font-size: 14px;
             border: 1px solid #000;
-            width: 90%;
-            padding-left: 5px;
+            padding: 0 10px;
+            padding: 0 10px;
+            border-right: none;
+        }
+        .searchInp>button {
+            line-height: 30px;
+            vertical-align: middle;
+            padding: 0 5px;
+            background: #c2c3c5;
+            color: #fff;
+        }
+        .jkListDiv{
+            overflow-x: hidden;
+            line-height: 40px;
+            height: 100%;
         }
 
         .jkListUl>li {
@@ -265,33 +266,17 @@
             font-size: 14px;
             line-height: 30px;
             cursor: pointer;
-            padding-left: 20px;
             white-space: nowrap;
             overflow: hidden;
             text-overflow: ellipsis;
-            width: 200px;
-        }
-
-        .ctrlBox {
-            /* display: none; */
-            position: absolute;
-            /* background: #685f5f; */
-            z-index: 99999;
-            /* padding: 0 20px; */
-            width: 240px;
-            height: 260px;
-            left: 0;
-            bottom: 30px;
-            /* border: 1px solid #000; */
-            border-radius: 30px 30px 50px 50px;
+            text-indent: 15px;
         }
 
-
         .cutCtrl,
         .directionCtrl>div {
             position: absolute;
-            width: 50px;
-            height: 50px;
+            width: 40px;
+            height: 40px;
             cursor: pointer;
         }
 
@@ -306,35 +291,35 @@
 
         .directionCtrl {
             position: relative;
-            width: 180px;
+            /* width: 180px; */
             height: 180px;
             bottom: 0;
             background: url(../static/imgs/ptz_bg.png) no-repeat center;
-            background-size: 100% 100%;
-            margin-left: 30px;
+            background-size: 150px 150px;
+            /* margin-left: 13px; */
         }
 
         .upCtrl {
-            top: 7px;
-            left: 50%;
+            top: 18px;
+            left: 53%;
             margin-left: -25px;
         }
 
         .leftCtrl {
-            left: 10px;
-            top: 50%;
+            left: 24px;
+            top: 53%;
             margin-top: -25px;
         }
 
         .bottomCtrl {
-            bottom: 8px;
-            left: 50%;
+            bottom: 17px;
+            left: 53%;
             margin-left: -25px;
         }
 
         .rightCtrl {
-            right: 7px;
-            top: 50%;
+            right: 26px;
+            top: 53%;
             margin-top: -25px;
         }
 
@@ -345,8 +330,8 @@
             width: 120px;
             height: 30px;
             margin: auto;
-            margin-top: 15px;
-            margin-bottom: 15px;
+            /* margin-top: 15px; */
+            /* margin-bottom: 15px; */
         }
 
         .Zoom span {
@@ -367,6 +352,15 @@
             background-color: #36404D;
             color: rgb(255, 255, 0);
         }
+        .gardenListBtn button.layui-btn-primary{
+            color: #49dfb4;
+            border: #000;
+            background-image: linear-gradient(#525b6d, #3e4654);
+            border: 1px solid #3c4452;
+        }
+        .gardenListBtn button.layui-btn-primary:hover{
+            box-shadow: 0 0 2px 0px #039c6b;
+        }
     </style>
 </head>
 <script>
@@ -396,18 +390,12 @@
             </div>
             <div class="flashShowDiv">
                 <div style="display: table; width: 100%;" id="jk_main">
-
-                    <!-- <div id="div_ControlPanel" style="display: table-cell; width: 160px; height: 911.875px; overflow: hidden; background: rgb(0, 0, 0); vertical-align: top;"></div> -->
-                    <!-- <div id="div_ControlPanel" style="display: table-cell; width: 160px; height: 911.875px; overflow: hidden; background: rgb(0, 0, 0); vertical-align: top;"></div> -->
-                    <!-- 隐藏 -->
-                    <!-- <div id="div_vControl" style="display: table-cell; width: 22px; vertical-align: middle;"></div> -->
-
                     <!-- 视频框 -->
                     <div style="display: table-cell;">
-                        <div id="divMain" style="width: 100%; height:750px; background: #313a47; margin: auto; padding: 5px; position: relative; z-index: 9999;">
+                        <div id="divMain" style="height:750px; background: #313a47; margin: auto; padding: 5px; position: relative; z-index: 9999;">
 
                         </div>
-                        <div style="clear: both; width: 100%; height: 45px; line-height: 45px; background: #323d48; padding: 5px; position: relative; z-index: 9999;">
+                        <div style="clear: both; height: 45px; line-height: 45px; background: #323d48; padding: 5px; position: relative; z-index: 9999;">
                             &ensp;
                             <span class="v1" id="span_V1" onclick="CreateVidewDiv(1);">
                                 <i class="iconfont" style="font-size: 24px;">&#xe600;</i>
@@ -423,62 +411,72 @@
                         </div>
                     </div>
                     <!-- 控制 -->
-                    <div id="div_ControlPanel" style="position:relative;display: table-cell; width: 220px; background: #464e60; overflow: hidden; vertical-align: top; padding: 10px;">
-                        <div class="jkListDiv">
-                            <div class="searchInp">
-                                <input type="text" placeholder="请输入设备ID搜索">
-                            </div>
-                            <ul class="jkListUl" id="dataFillDiv">
-                                <!-- <li onclick='StartPlay("363","1","2","rtmp://rtmp01open.ys7.com/openlive/18319fb1a08249d3a498c5cba3e8bdee.hd","http://hls01open.ys7.com/openlive/18319fb1a08249d3a498c5cba3e8bdee.hd.m3u8","719458092","1","阳台",this)'>监控一</li>
-                                <li onclick='StartPlay("417","1","2","rtmp://rtmp.open.ys7.com/openlive/8702368f321341deb9fb5edb9d72faec", "http://hls.open.ys7.com/openlive/8702368f321341deb9fb5edb9d72faec.m3u8","C25308553","1","阳台",this)'>监控二</li>
-                                <li>监控三</li>
-                                <li>监控四</li>
-                                <li>监控五</li> -->
-
-                                
-                            </ul>
-                            <div class="gardenListBtn">
-                                <span class="firstPage">
-                                    <button type="button" onclick="switchPage('home')" class="layui-btn layui-btn-sm layui-btn-primary">
-                                        <i class="layui-icon">&#xe68e;</i>
-                                    </button>
-                                </span>
-                                <span class="prevPageBtn">
-                                    <button type="button" onclick="switchPage('jian')" class="layui-btn layui-btn-sm layui-btn-primary">
-                                        <i class="layui-icon">&#xe65a;</i>
-                                    </button>
-                                </span>
-                                <span class="menuCurr">1</span>
-                                <span class="">/</span>
-                                <span class="menuTotalPage">6</span>
-                                <span class="">页</span>
-                                <span class="nextPageBtn">
-                                    <button type="button" onclick="switchPage('jia')" class="layui-btn layui-btn-sm layui-btn-primary">
-                                        <i class="layui-icon">&#xe65b;</i>
-                                    </button>
-                                </span>
-                            </div>
-                        </div>
-                        <div class="ctrlBox">
-                            <!-- <div class="cutCtrl" onclick="configCamera(this,'takephoto','')"></div> -->
-                            <div class="directionCtrl">
-                                <div class="upCtrl" onmousedown="configCamera(this,'move',0)" onmouseup="configCamera(this,'stop')"></div>
-                                <div class="leftCtrl" onmousedown="configCamera(this,'move',2)" onmouseup="configCamera(this,'stop')"></div>
-                                <div class="bottomCtrl" onmousedown="configCamera(this,'move',1)" onmouseup="configCamera(this,'stop')"></div>
-                                <div class="rightCtrl" onmousedown="configCamera(this,'move',3)" onmouseup="configCamera(this,'stop')"></div>
-                            </div>
-                            <div class="Zoom">
-                                <span onmousedown="configCamera(this,'move',8)" onmouseup="configCamera(this,'stop')"></span>
-                                <span onmousedown="configCamera(this,'move',9)" onmouseup="configCamera(this,'stop')"></span>
-                            </div>
-                        </div>
+                    <div id="div_ControlPanel" style="position:relative;display: table-cell; width: 220px; background: #464e60; overflow: hidden; vertical-align: top;">
+                        
+                        <table style="width: 100%; height: 100%">
+                            <tr style="height: 30px;">
+                                <td>
+                                    <div class="searchInp">
+                                        <input type="text" placeholder="请输入设备ID搜索" onkeyup="if (event.keyCode == 13) searchFun();"><button onclick="searchFun()"><i class="fa fa-search" aria-hidden="true"></i></button>
+                                    </div>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td style="vertical-align: top;">
+                                    <div class="jkListDiv">                                       
+                                        <ul class="jkListUl" id="dataFillDiv"></ul>
+                                    </div> 
+                                </td>
+                            </tr>
+                            <tr style="height: 50px;">
+                                <td>
+                                    <div class="gardenListBtn">
+                                        <span class="firstPage">
+                                            <button type="button" onclick="switchPage('home')" class="layui-btn layui-btn-sm layui-btn-primary">
+                                                <i class="layui-icon">&#xe68e;</i>
+                                            </button>
+                                        </span>
+                                        <span class="prevPageBtn">
+                                            <button type="button" onclick="switchPage('jian')" class="layui-btn layui-btn-sm layui-btn-primary">
+                                                <i class="layui-icon">&#xe65a;</i>
+                                            </button>
+                                        </span>
+                                        <span class="menuCurr">1</span>
+                                        <span class="">/</span>
+                                        <span class="menuTotalPage">6</span>
+                                        <span class="">页</span>
+                                        <span class="nextPageBtn">
+                                            <button type="button" onclick="switchPage('jia')" class="layui-btn layui-btn-sm layui-btn-primary">
+                                                <i class="layui-icon">&#xe65b;</i>
+                                            </button>
+                                        </span>
+                                    </div>
+                                </td>
+                            </tr>
+                            <tr id="tr_ptz">
+                                <td style="height: 190px; padding: 15px;">
+                                    <div class="ctrlBox">
+                                        <!-- <div class="cutCtrl" onclick="configCamera(this,'takephoto','')"></div>  -->
+                                        <div class="directionCtrl">
+                                            <div class="upCtrl" onmousedown="configCamera(this,'move',0)" onmouseup="configCamera(this,'stop')"></div>
+                                            <div class="leftCtrl" onmousedown="configCamera(this,'move',2)" onmouseup="configCamera(this,'stop')"></div>
+                                            <div class="bottomCtrl" onmousedown="configCamera(this,'move',1)" onmouseup="configCamera(this,'stop')"></div>
+                                            <div class="rightCtrl" onmousedown="configCamera(this,'move',3)" onmouseup="configCamera(this,'stop')"></div>
+                                        </div>
+                                        <div class="Zoom">
+                                            <span onmousedown="configCamera(this,'move',8)" onmouseup="configCamera(this,'stop')"></span>
+                                            <span onmousedown="configCamera(this,'move',9)" onmouseup="configCamera(this,'stop')"></span>
+                                        </div>
+                                    </div>
+                                </td>
+                            </tr>
+
+                        </table>
+                        
+                        
                     </div>
 
                 </div>
-                <!-- <div class="fenpei-bottom">
-                    <input type="hidden" id="totalPage" value={{ nums }}>
-                    <div id="page" style="text-align: center;"></div>
-                </div> -->
             </div>
         </div>
     </div>
@@ -510,8 +508,11 @@
                 else
                     html += "<a id=\"a_" + i + "\" class=\"a" + n + "\">";
 
-                html += "<span id='span_deviceSerial_" + i + "' class='equipname' style=''></span>";
+                html += "<span id='span_ConnectionType_" + i + "' style='display:none'></span>";
+                html += "<span id='span_deviceSerial_" + i + "' class='equipname' style='display:none'></span>";
                 html += "<span id='span_cameraNo_" + i + "' style='display:none'></span>";
+                html += "<span id='span_playTime_" + i + "' style='display:none'></span>";
+
 
                 html += "<table id=\"table_" + i + "\" style=\"width: " + width + "; height: " + height + "; text-align:center;vertical-align:middle;\">";
                 html += "<tr style='display:none;'>";
@@ -552,7 +553,6 @@
                 $("#a_" + curIndex).removeClass("aSelected");
 
             curIndex = idx;
-            console.log($("#a_" + idx).find('.equipname').html());
 
             if ($("#a_" + idx).length > 0)
                 $("#a_" + idx).addClass("aSelected");
@@ -584,17 +584,37 @@
 
         var spanIdx = "";
 
+        function StartPlayTime() {
+            setInterval(function () {
+
+                for (var i = 0; i <= 16; i++) {
+                    var obj = $("#span_playTime_" + i);
+
+                    if (obj.length > 0) {
+
+                        if (obj.html() != "") {
+                            if ($("#span_ConnectionType_" + i).html() != "1")
+                                continue;
+
+                            var t = parseInt((new Date().getTime() - parseInt(obj.html())) / 1000);//播放时间,秒
+
+                            if (t >= 5 * 60) {//5分钟
+                                $("#video_" + i).html("<div style='font-size:14px;color:yellow;padding:10px;text-align:center;'>抱歉,由于长时间没有操作,4G摄像头进入自动休眠模式。</div>");
+                                $("#a_" + i).removeClass("noborder");
+                            }
+                        }
+                    }
+                }
+
+            }, 1000);
+        }
+        //监听播放时间
+        StartPlayTime();
+
+        var isIE = (!!window.ActiveXObject || "ActiveXObject" in window);
 
         //预览函数
         function StartPlay(id, connectionType, liveStatus, rtmp, hls, deviceSerial, cameraNo, title, obj) {
-            // if (obj == null) {
-
-            //     $("#dataFillDiv >li").eq(0).addClass("select-c");
-            // }
-            // else {
-            //     $("#dataFillDiv >li").removeClass("select-c");
-            //     $(obj).addClass("select-c");
-            // }
 
             $("#span_ConnectionType_" + curIndex).html(connectionType);
             $("#span_deviceSerial_" + curIndex).html(deviceSerial);
@@ -616,14 +636,31 @@
 
             $("#title_" + curIndex).html(title);
 
-            var playHtml = "<video id='myPlayer" + curIndex + "' style='width: 100%; height: 100%' class='videoNum" + divNum + "' poster='' controls playsinline webkit-playsinline autoplay>";
+            var playHtml;
+            var script;
+             
+
+            if (isIE) {
+                playHtml = "<video id='myPlayer" + curIndex + "' style='width: 100%; height: 100%' class='videoNum" + divNum + "' poster='' controls playsinline webkit-playsinline autoplay>";
+
+                //playHtml += " <source src='" + rtmp + "' type='rtmp/flv' />";
+                playHtml += "<source src='" + hls + "' type='application/x-mpegURL' />";
+                playHtml += "</video>";
+
+                script = document.createElement("script");
+                script.type = "text/javascript";
+                script.appendChild(document.createTextNode(" new EZUIPlayer('myPlayer" + curIndex + "');")); 
+            }
+            else {
+
+                playHtml = "<iframe   id='playFrame" + curIndex + "'  src='https://open.ys7.com/ezopen/h5/iframe_se?url=ezopen://open.ys7.com/" + deviceSerial + "/" + cameraNo + ".hd.live&autoplay=1&accessToken=at.d2trwvdod5bxxlr4dug8le6wb0ugbi2h-173pi8ymy3-1882umg-zrib7cj3f&templete=2'  width='100%' height='100%' allowfullscreen frameborder='0' allowtransparency=true></iframe>"
+
+                script = document.createElement("script");
+                script.type = "text/javascript";
+                script.appendChild(document.createTextNode(" IframeOnClick.track(document.getElementById('playFrame" + curIndex + "'), function() { setCurIndex(" + curIndex + " ); }); "));
 
-            playHtml += "<source src='" + hls + "' type='' />";
-            playHtml += "</video>";
+            }
 
-            var script = document.createElement("script");
-            script.type = "text/javascript";
-            script.appendChild(document.createTextNode(" new EZUIPlayer('myPlayer" + curIndex + "');"));
 
             $("#video_" + curIndex).html(playHtml);
             $("#video_" + curIndex).append(script);
@@ -632,10 +669,43 @@
             if ($("#a_" + (curIndex + 1)).length > 0)
                 SetAutoNext(curIndex + 1);
 
-            //SetPtzControl();
-
             windowResize();
         }
+        //iframe点击事件
+        var IframeOnClick = {
+            resolution: 200,
+            iframes: [],
+            interval: null,
+            Iframe: function () {
+                this.element = arguments[0];
+                this.cb = arguments[1];
+                this.hasTracked = false;
+            },
+            track: function (element, cb) {
+                this.iframes.push(new this.Iframe(element, cb));
+                if (!this.interval) {
+                    var _this = this;
+                    this.interval = setInterval(function () { _this.checkClick(); }, this.resolution);
+                }
+            },
+            checkClick: function () {
+                if (document.activeElement) {
+                    var activeElement = document.activeElement;
+                    for (var i in this.iframes) {
+                        if (activeElement === this.iframes[i].element) { // user is in this Iframe
+                            if (this.iframes[i].hasTracked == false) {
+                                this.iframes[i].cb.apply(window, []);
+                                this.iframes[i].hasTracked = true;
+                            }
+                        } else {
+                            this.iframes[i].hasTracked = false;
+                        }
+                    }
+                }
+            }
+        };
+
+
 
         function SetAutoNext(idx) {
             if (AutoNext) {
@@ -712,6 +782,7 @@
         // 控制
         function configCamera(deviceSerial, ctrl, movenum) {
             var id = $("#a_" + curIndex).find('.equipname').html();
+            console.log($("#a_" + curIndex))
             if (!id) {
                 layui.use(['layer'], function () {
                     var layer = layui.layer;
@@ -821,6 +892,45 @@
             $('.flashDownDiv').show();
         }
 
+        // 搜索
+        function searchFun(){
+            var id = $('.searchInp>input').val();
+            searchPare(id)
+        }
+        function searchPare(para){
+            $.ajax({
+                url: 'jklist',
+                type: 'get',
+                data: {
+                    f_id:para,
+                    page: 1
+                },
+                dataType: 'json',
+                beforeSend: function () {
+                    // loadFlage = layer.load();
+                },
+                success: function (data) {
+                    // layer.close(loadFlage);
+                    if (data.nums) {
+                        // StartPlay(data);
+                        setHtml(data.ids);
+                        $("#dataFillDiv >li").removeClass("select-c");
+                        $("#dataFillDiv >li").eq(0).addClass("select-c");
+                        // getVideoResource(data.ids[0].equip_id,data.ids[0].equip_name);
+                        menuTotalPage = Math.ceil(data.nums / 10);
+                        if (menuTotalPage > 1) {
+                            $('.gardenListBtn').show();
+                        } else {
+                            $('.gardenListBtn').hide();
+                        }
+                        $('.menuTotalPage').html(menuTotalPage);
+                    } else {
+                        $('.flashShowDiv').hide();
+                        $('.nullData').show();
+                    }
+                }
+            })
+        }
         var menuCurrNum = 1; //当前页
         var menuTotalPage;  //总页
         // 分页切换

+ 177 - 2
templates/backstageNet/limit/expert.html

@@ -10,6 +10,9 @@
     <link rel="stylesheet" href="{% static '/lib/layui/css/layui.css' %}">
     <link rel="stylesheet" href="{% static '/lib/css/reset.css' %}">
     <style>
+        body{
+            background-color: #f5f5f5;
+        }
         .breadcrumbs {
             padding: 12px 0 12px 30px;
             border-bottom: 1px solid #dbdbdb;
@@ -30,7 +33,75 @@
             box-shadow: 0px 3px 5px 0px #ececec;*/
             background: #fff; 
         }
-
+        /* 专家模块 */
+        .expertGather{
+            display: flex;
+            flex-wrap: wrap;
+        }
+        .expertGatherItem{
+            width: 31%;
+            margin: 1%;
+            box-sizing: border-box;
+            background: #fff;
+            border-radius: 5px;
+            position: relative;
+            padding: 40px 20px 40px 45px;
+        }
+        .expertGatherItem>img{
+            position: absolute;
+            top: -7px;
+            left: -8px;
+        }
+        .expertInner{
+            display: flex;
+        }
+        .expertImg{
+            width: 135px;
+            height: 135px;
+            border: 1px solid #d3d3d3;
+        }
+        .expertImg>img{
+            width: 100%;
+            height: 100%;
+        }
+        .expertTxt{
+            flex: 1;
+            margin-left: 25px;
+        }
+        .expertTxt h1{
+            font-size: 16px;
+            font-weight: 700;
+            display: inline-block;
+            border-bottom: 2px solid #f7304d;
+            line-height: 25px;
+        }
+        .expertTxt p{
+            font-size: 14px;
+            line-height: 35px;
+        }
+        .expertTxt .desc{
+            font-size: 12px;
+            line-height: 26px;
+            text-overflow: -o-ellipsis-lastline;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            display: -webkit-box;
+            -webkit-line-clamp: 2;
+            line-clamp: 2;
+            -webkit-box-orient: vertical;
+            margin-bottom: 10px;
+            color:#585858;
+        }
+        .expertTxt .ctrlBtn{
+            text-align: right;
+        }
+        .expertTxt .ctrlBtn a{
+            background: #3f9df4;
+            color: #fff;
+            padding: 4px 9px;
+            border-radius: 5px;
+            font-size: 12px;
+        }
     </style>
 </head>
 
@@ -49,8 +120,112 @@
         </div>
 
         <!-- 内容 -->
+        <div class="expertGather">
+            <div class="expertGatherItem">
+                <img src="{% static '/imgs/cornerIcon.png' %}" alt="">
+                <div class="expertInner">
+                    <div class="expertImg">
+                        <img src="{% static '/imgs/Customer.png'%}" alt="">
+                    </div>
+                    <div class="expertTxt">
+                        <h1>吴玉金教授</h1>
+                        <p>简介:</p>
+                        <div class="desc">吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授</div>
+                        <div class="ctrlBtn">
+                            <a href="tencent://message/?uin=405204799&Site=sc.chinaz.com&Menu=yes">视频电话</a>  
+                            <a href="tencent://message/?uin=405204799&Site=sc.chinaz.com&Menu=yes">发信息</a>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="expertGatherItem">
+                <img src="{% static '/imgs/cornerIcon.png' %}" alt="">
+                <div class="expertInner">
+                    <div class="expertImg">
+                        <img src="{% static '/imgs/Customer.png'%}" alt="">
+                    </div>
+                    <div class="expertTxt">
+                        <h1>吴玉金教授</h1>
+                        <p>简介:</p>
+                        <div class="desc">吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授</div>
+                        <div class="ctrlBtn">
+                            <a href="tencent://message/?uin=405204799&Site=sc.chinaz.com&Menu=yes">视频电话</a>  
+                            <a href="tencent://message/?uin=405204799&Site=sc.chinaz.com&Menu=yes">发信息</a>  
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="expertGatherItem">
+                <img src="{% static '/imgs/cornerIcon.png' %}" alt="">
+                <div class="expertInner">
+                    <div class="expertImg">
+                        <img src="{% static '/imgs/Customer.png'%}" alt="">
+                    </div>
+                    <div class="expertTxt">
+                        <h1>吴玉金教授</h1>
+                        <p>简介:</p>
+                        <div class="desc">吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授</div>
+                        <div class="ctrlBtn">
+                            <a href="tencent://message/?uin=405204799&Site=sc.chinaz.com&Menu=yes">视频电话</a>  
+                            <a href="tencent://message/?uin=405204799&Site=sc.chinaz.com&Menu=yes">发信息</a>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="expertGatherItem">
+                <img src="{% static '/imgs/cornerIcon.png' %}" alt="">
+                <div class="expertInner">
+                    <div class="expertImg">
+                        <img src="{% static '/imgs/Customer.png'%}" alt="">
+                    </div>
+                    <div class="expertTxt">
+                        <h1>吴玉金教授</h1>
+                        <p>简介:</p>
+                        <div class="desc">吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授</div>
+                        <div class="ctrlBtn">
+                            <a href="tencent://message/?uin=405204799&Site=sc.chinaz.com&Menu=yes">视频电话</a>  
+                            <a href="tencent://message/?uin=405204799&Site=sc.chinaz.com&Menu=yes">发信息</a>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="expertGatherItem">
+                <img src="{% static '/imgs/cornerIcon.png' %}" alt="">
+                <div class="expertInner">
+                    <div class="expertImg">
+                        <img src="{% static '/imgs/Customer.png'%}" alt="">
+                    </div>
+                    <div class="expertTxt">
+                        <h1>吴玉金教授</h1>
+                        <p>简介:</p>
+                        <div class="desc">吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授</div>
+                        <div class="ctrlBtn">
+                            <a href="tencent://message/?uin=405204799&Site=sc.chinaz.com&Menu=yes">视频电话</a>  
+                            <a href="tencent://message/?uin=405204799&Site=sc.chinaz.com&Menu=yes">发信息</a>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="expertGatherItem">
+                <img src="{% static '/imgs/cornerIcon.png' %}" alt="">
+                <div class="expertInner">
+                    <div class="expertImg">
+                        <img src="{% static '/imgs/Customer.png'%}" alt="">
+                    </div>
+                    <div class="expertTxt">
+                        <h1>吴玉金教授</h1>
+                        <p>简介:</p>
+                        <div class="desc">吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授吴玉金教授</div>
+                        <div class="ctrlBtn">
+                            <a href="tencent://message/?uin=405204799&Site=sc.chinaz.com&Menu=yes">视频电话</a>  
+                            <a href="tencent://message/?uin=405204799&Site=sc.chinaz.com&Menu=yes">发信息</a>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
         <div>
-           <img src="{% static 'imgs/specialist/intr03.jpg'%}" alt="">
+           <!-- <img src="{% static 'imgs/specialist/intr03.jpg'%}" alt=""> -->
         </div>
     </div>
 

+ 25 - 2
templates/backstageNet/limit/limitUserManage.html

@@ -30,6 +30,20 @@
 			padding-left: 5px;
 			width: 200px;
 		}
+		.layui-form-checked[lay-skin=primary] i{
+			border-color: #008bf3!important;
+			background-color: #1e9fff;
+			color: #fff;
+		}
+		.layui-form-checkbox[lay-skin=primary]:hover i{
+			border-color: #008bf3;
+		}
+		.layui-tree-line .layui-tree-entry:hover .layui-tree-txt{
+			color: #008bf3;
+		}
+		#limitPop{
+			display: none;
+		}
 	</style>
 
 	<body>
@@ -79,8 +93,16 @@
 					</div>
 				</div>
 			</div>
-			<input type="hidden" id="gobackuname" value="{{uname|default:''}}">
-			<input type="hidden" id="gobackpage" value="{{page|default:''}}">
+		</div>
+
+		<!-- 权限弹框 -->
+		<div id="limitPop">
+			<input type="hidden" value="" id="hiduname">
+			<div class="qx">
+				<div id="test1">
+					
+				</div>
+			</div>
 		</div>
 
 		<script src="{% static '/lib/js/jquery-2.1.4.min.js' %}"></script>
@@ -90,6 +112,7 @@
 				data: { csrfmiddlewaretoken: '{{ csrf_token }}' },
 			});
 		</script>
+		<script src="{% static '/js/limit/limit.js' %}?versions=0.2.3" type="text/javascript"></script>
 		<script src="{% static '/js/limit/limitUserManage.js' %}?versions=0.2.3" type="text/javascript"></script>
 	</body>
 

+ 307 - 0
templates/backstageNet/limit/limit_user_list copy.html

@@ -0,0 +1,307 @@
+<script>
+	var navList = [
+            {
+                "id": 1,
+                "title": "首页",
+                "icon": "&#xe626;",
+                "url": "map",
+                "children": []
+            },
+            {
+                "id": 2,
+                "title": "设备分配",
+                "icon": "&#xe609;",
+                "url": "equipallot",
+                "disabled": "true",
+                "children": []
+            },
+            {
+                "id": 3,
+                "title": "信息发布",
+                "icon": "&#xe765;",
+                "url": "",
+                "children": [
+                    {
+                        "id": 3.1,
+                        "title": "新闻资讯",
+                        "url": "news_pub",
+                    },
+                    {
+                        "id": 3.2,
+                        "title": "视频资讯",
+                        "url": "video_pub",
+                    },
+                    {
+                        "id": 3.2,
+                        "title": "产品展厅",
+                        "url": "equip_pub",
+                    },
+                    {
+                        "id": 3.3,
+                        "title": "四季采摘",
+                        "url": "garden_pub",
+                    },
+                    {
+                        "id": 3.4,
+                        "title": "民宿导览",
+                        "url": "dorm_pub",
+                    },
+                    {
+                        "id": 3.5,
+                        "title": "旅游景点",
+                        "url": "sightsee_pub",
+                    },
+                ]
+            },
+            {
+                "id": 4,
+                "title": "我的发布",
+                "icon": "&#xe609;",
+                "url": "my_pub",
+                "disabled": "true",
+                "children": []
+            },
+            {
+                "id": 5,
+                "title": "视频监控",
+                "icon": "&#xe610;",
+                "url": "jkview",
+                "children": []
+            },
+            {
+                "id": 6,
+                "title": "传感及控制",
+                "icon": "&#xe654;",
+                "url": "",
+                "children": [
+                    {
+                        "id": 6.1,
+                        "title": "控制模块",
+                        "url": "qxzcontrol",
+                    },
+                    {
+                        "id": 6.2,
+                        "title": "趋势分析",
+                        "url": "qxzchart",
+                    },
+                    {
+                        "id": 6.3,
+                        "title": "数据统计",
+                        "url": "qxz_status",
+                    }
+                ]
+            },
+            {
+                "id": 7,
+                "title": "预警中心",
+                "icon": "&#xe634;",
+                "url": "",
+                "children": [
+                    {
+                        "id": 7.1,
+                        "title": "阈值设置",
+                        "url": "qxz_warning_view",
+                    },
+                    {
+                        "id": 7.2,
+                        "title": "生产方式设置",
+                        "url": "productionset",
+                    },
+                    {
+                        "id": 7.3,
+                        "title": "预警记录",
+                        "url": "qxz_warning_list",
+                    },
+                ]
+            },
+            {
+                "id": 8,
+                "title": "开心农场",
+                "icon": "&#xe603;",
+                "url": "",
+                "children": [
+                    {
+                        "id": 8.1,
+                        "title": "我的农场",
+                        "url": "person_farm_edit",
+                    },
+                    {
+                        "id": 8.2,
+                        "title": "农场管理",
+                        "url": "garden_manage_view",
+                    },
+                    {
+                        "id": 8.3,
+                        "title": "人员管理",
+                        "url": "garden_user_view",
+                    },
+                    {
+                        "id": 8.4,
+                        "title": "库存管理",
+                        "url": "repertory_view",  //物料管理    
+                    },
+                    {
+                        "id": 8.5,
+                        "title": "种植管理",
+                        "url": "cropcount",
+                    },
+                    {
+                        "id": 8.6,
+                        "title": "入库管理",
+                        "url": "pick",
+                    },
+                    {
+                        "id": 8.7,
+                        "title": "销售管理",
+                        "url": "sell_view",
+                    }
+                ]
+            },
+            {
+                "id": 9,
+                "title": "数据中心",
+                "icon": "&#xe603;",
+                "url": "",
+                "children": [
+                    {
+                        "id": 9.1,
+                        "title": "产业数据",
+                        "url": "industrydata",
+                    },
+                    {
+                        "id": 9.2,
+                        "title": "类型分析",
+                        "url": "type",
+                    },
+                    {
+                        "id": 9.3,
+                        "title": "对比分析",
+                        "url": "contrast",
+                    },
+                ]
+            },
+            {
+                "id": 10,
+                "title": "通知公告",
+                "icon": "&#xe765;",
+                "url": "",
+                "disabled": "true",
+                "children": [
+                    {
+                        "id": 10.1,
+                        "title": "发布公告",
+                        "url": "policy_pub",
+                        "disabled": "true",
+                    },
+                    {
+                        "id": 10.2,
+                        "title": "查看公告",
+                        "url": "policy_list_view",
+                        "disabled": "true",
+                    },
+                ]
+            },
+            {
+                "id": 11,
+                "title": "信息审核",
+                "icon": "&#xe765;",
+                "url": "",
+                "disabled": "true",
+                "children": [
+                    {
+                        "id": 11.1,
+                        "title": "新闻资讯",
+                        "url": "news_check",
+                        "disabled": "true",
+                    },
+
+                    {
+                        "id": 11.2,
+                        "title": "视频资讯",
+                        "url": "video_check",
+                        "disabled": "true",
+                    },
+                    {
+                        "id": 11.3,
+                        "title": "产品展厅",
+                        "url": "equip_check",
+                        "disabled": "true",
+                    },
+                    {
+                        "id": 11.4,
+                        "title": "四季采摘",
+                        "url": "garden_check",
+                        "disabled": "true",
+                    },
+                    {
+                        "id": 11.5,
+                        "title": "民宿导览",
+                        "url": "dorm_check",
+                        "disabled": "true",
+                    },
+                    {
+                        "id": 11.6,
+                        "title": "旅游景点",
+                        "url": "sightsee_check",
+                        "disabled": "true",
+                    },
+                    {
+                        "id": 11.7,
+                        "title": "个人农场",
+                        "url": "farm_check",
+                        "disabled": "true",
+                    },
+                ]
+            },
+            {
+                "id": 12,
+                "title": "权限",
+                "icon": "&#xe765;",
+                "url": "limit_view",
+                "disabled": "true",
+                "children": []
+            },
+            {
+                "id": 13,
+                "title": "系统设置",
+                "icon": "&#xe765;",
+                "url": "",
+                "disabled": "true",
+                "children": [
+                    {
+                        "id": 13.1,
+                        "title": "用户管理",
+                        "url": "person_view",
+                        "disabled": "true",
+                    },
+                    {
+                        "id": 13.2,
+                        "title": "修改密码",
+                        "url": "policy_list_view",
+                        "disabled": "true",
+                    }
+                ]
+            },
+			{
+                "id": 14,
+                "title": "专家诊断",
+                "icon": "&#xe765;",
+                "url": "",
+                "disabled": "true",
+                "children": [
+                    {
+                        "id": 14.1,
+                        "title": "在线专家",
+                        "url": "expert",
+                        "disabled": "true",
+                    },
+                    {
+                        "id": 14.2,
+                        "title": "知识库",
+                        "url": "learning_depot",
+                        "disabled": "true",
+                    }
+                ]
+            },
+        ]
+</script>

+ 27 - 307
templates/backstageNet/limit/limit_user_list.html

@@ -1,307 +1,27 @@
-<script>
-	var navList = [
-            {
-                "id": 1,
-                "title": "首页",
-                "icon": "&#xe626;",
-                "url": "map",
-                "children": []
-            },
-            {
-                "id": 2,
-                "title": "设备分配",
-                "icon": "&#xe609;",
-                "url": "equipallot",
-                "disabled": "true",
-                "children": []
-            },
-            {
-                "id": 3,
-                "title": "信息发布",
-                "icon": "&#xe765;",
-                "url": "",
-                "children": [
-                    {
-                        "id": 3.1,
-                        "title": "新闻资讯",
-                        "url": "news_pub",
-                    },
-                    {
-                        "id": 3.2,
-                        "title": "视频资讯",
-                        "url": "video_pub",
-                    },
-                    {
-                        "id": 3.2,
-                        "title": "产品展厅",
-                        "url": "equip_pub",
-                    },
-                    {
-                        "id": 3.3,
-                        "title": "四季采摘",
-                        "url": "garden_pub",
-                    },
-                    {
-                        "id": 3.4,
-                        "title": "民宿导览",
-                        "url": "dorm_pub",
-                    },
-                    {
-                        "id": 3.5,
-                        "title": "旅游景点",
-                        "url": "sightsee_pub",
-                    },
-                ]
-            },
-            {
-                "id": 4,
-                "title": "我的发布",
-                "icon": "&#xe609;",
-                "url": "my_pub",
-                "disabled": "true",
-                "children": []
-            },
-            {
-                "id": 5,
-                "title": "视频监控",
-                "icon": "&#xe610;",
-                "url": "jkview",
-                "children": []
-            },
-            {
-                "id": 6,
-                "title": "传感及控制",
-                "icon": "&#xe654;",
-                "url": "",
-                "children": [
-                    {
-                        "id": 6.1,
-                        "title": "控制模块",
-                        "url": "qxzcontrol",
-                    },
-                    {
-                        "id": 6.2,
-                        "title": "趋势分析",
-                        "url": "qxzchart",
-                    },
-                    {
-                        "id": 6.3,
-                        "title": "数据统计",
-                        "url": "qxz_status",
-                    }
-                ]
-            },
-            {
-                "id": 7,
-                "title": "预警中心",
-                "icon": "&#xe634;",
-                "url": "",
-                "children": [
-                    {
-                        "id": 7.1,
-                        "title": "阈值设置",
-                        "url": "qxz_warning_view",
-                    },
-                    {
-                        "id": 7.2,
-                        "title": "生产方式设置",
-                        "url": "productionset",
-                    },
-                    {
-                        "id": 7.3,
-                        "title": "预警记录",
-                        "url": "qxz_warning_list",
-                    },
-                ]
-            },
-            {
-                "id": 8,
-                "title": "开心农场",
-                "icon": "&#xe603;",
-                "url": "",
-                "children": [
-                    {
-                        "id": 8.1,
-                        "title": "我的农场",
-                        "url": "person_farm_edit",
-                    },
-                    {
-                        "id": 8.2,
-                        "title": "农场管理",
-                        "url": "garden_manage_view",
-                    },
-                    {
-                        "id": 8.3,
-                        "title": "人员管理",
-                        "url": "garden_user_view",
-                    },
-                    {
-                        "id": 8.4,
-                        "title": "库存管理",
-                        "url": "repertory_view",  //物料管理    
-                    },
-                    {
-                        "id": 8.5,
-                        "title": "种植管理",
-                        "url": "cropcount",
-                    },
-                    {
-                        "id": 8.6,
-                        "title": "入库管理",
-                        "url": "pick",
-                    },
-                    {
-                        "id": 8.7,
-                        "title": "销售管理",
-                        "url": "sell_view",
-                    }
-                ]
-            },
-            {
-                "id": 9,
-                "title": "数据中心",
-                "icon": "&#xe603;",
-                "url": "",
-                "children": [
-                    {
-                        "id": 9.1,
-                        "title": "产业数据",
-                        "url": "industrydata",
-                    },
-                    {
-                        "id": 9.2,
-                        "title": "类型分析",
-                        "url": "type",
-                    },
-                    {
-                        "id": 9.3,
-                        "title": "对比分析",
-                        "url": "contrast",
-                    },
-                ]
-            },
-            {
-                "id": 10,
-                "title": "通知公告",
-                "icon": "&#xe765;",
-                "url": "",
-                "disabled": "true",
-                "children": [
-                    {
-                        "id": 10.1,
-                        "title": "发布公告",
-                        "url": "policy_pub",
-                        "disabled": "true",
-                    },
-                    {
-                        "id": 10.2,
-                        "title": "查看公告",
-                        "url": "policy_list_view",
-                        "disabled": "true",
-                    },
-                ]
-            },
-            {
-                "id": 11,
-                "title": "信息审核",
-                "icon": "&#xe765;",
-                "url": "",
-                "disabled": "true",
-                "children": [
-                    {
-                        "id": 11.1,
-                        "title": "新闻资讯",
-                        "url": "news_check",
-                        "disabled": "true",
-                    },
-
-                    {
-                        "id": 11.2,
-                        "title": "视频资讯",
-                        "url": "video_check",
-                        "disabled": "true",
-                    },
-                    {
-                        "id": 11.3,
-                        "title": "产品展厅",
-                        "url": "equip_check",
-                        "disabled": "true",
-                    },
-                    {
-                        "id": 11.4,
-                        "title": "四季采摘",
-                        "url": "garden_check",
-                        "disabled": "true",
-                    },
-                    {
-                        "id": 11.5,
-                        "title": "民宿导览",
-                        "url": "dorm_check",
-                        "disabled": "true",
-                    },
-                    {
-                        "id": 11.6,
-                        "title": "旅游景点",
-                        "url": "sightsee_check",
-                        "disabled": "true",
-                    },
-                    {
-                        "id": 11.7,
-                        "title": "个人农场",
-                        "url": "farm_check",
-                        "disabled": "true",
-                    },
-                ]
-            },
-            {
-                "id": 12,
-                "title": "权限",
-                "icon": "&#xe765;",
-                "url": "limit_view",
-                "disabled": "true",
-                "children": []
-            },
-            {
-                "id": 13,
-                "title": "系统设置",
-                "icon": "&#xe765;",
-                "url": "",
-                "disabled": "true",
-                "children": [
-                    {
-                        "id": 13.1,
-                        "title": "用户管理",
-                        "url": "person_view",
-                        "disabled": "true",
-                    },
-                    {
-                        "id": 13.2,
-                        "title": "修改密码",
-                        "url": "policy_list_view",
-                        "disabled": "true",
-                    }
-                ]
-            },
-			{
-                "id": 14,
-                "title": "专家诊断",
-                "icon": "&#xe765;",
-                "url": "",
-                "disabled": "true",
-                "children": [
-                    {
-                        "id": 14.1,
-                        "title": "在线专家",
-                        "url": "expert",
-                        "disabled": "true",
-                    },
-                    {
-                        "id": 14.2,
-                        "title": "知识库",
-                        "url": "learning_depot",
-                        "disabled": "true",
-                    }
-                ]
-            },
-        ]
-</script>
+{% if user_list|length %} {% for user in user_list %}
+<tr>
+   <td>{{ user.username }}</td>
+   <td>{{ user.email }}</td>
+   <td>{% if user.user_phone == "" %} 无 {% else %} {{user.user_phone}} {% endif %}</td>
+   <td>
+   	{% if user.is_superuser == 1 %} 超级管理员 {% elif user.is_staff == 1 %} 管理员 {% else %} 用户 {% endif %}
+   </td>
+   <!-- <td>{% if user.user_remark == "" %} 无 {% else %} {{user.user_remark}} {% endif %}</td> -->
+   <td>{% if user.is_active == True %} 可用 {% else %} 不可用 {% endif %}</td>
+   <td>{{ user.date_joined }}</td>
+   <td>
+   	<!-- <a class="fpsb-link" href="allot?uname={{ user.username }}" style="display: inline-block;"> -->
+   		{% if user.username == 'admin' %} 
+   			暂无权限
+   		{% else %} 
+   			<button class="layui-btn layui-btn-sm layui-btn-normal btn-shaixuan" onclick="allotEquipPage('{{ user.username }}')">权限分配</button>
+   		{% endif %}
+   	<!-- </a> -->
+   </td>
+</tr>
+{% endfor %} {% else %}
+<tr>
+    <td colspan="7" style="text-align:center;">暂无数据</td>
+</tr>
+{% endif %}
+<input type="hidden" value="{{nums}}" id="totalPage">

File diff ditekan karena terlalu besar
+ 45 - 611
templates/backstageNet/map/map.1.html


File diff ditekan karena terlalu besar
+ 132 - 883
templates/backstageNet/map/map.html


+ 4 - 2
templates/backstageNet/production/workerManage.html

@@ -244,14 +244,16 @@
                         }
                         
                         
-                //页面数据渲染
-                gedata('garden_user_new', 1)
+                    //页面数据渲染
+                    gedata('garden_user_new', 1)
                     function gedata(url, page) {
+                        sessionStorage.setItem('seelectID', $('#farmSelect option:eq(0)').val())
                         $.ajax({
                             url: 'garden_user_new',
                             type: 'get',
                             data: {
                                 page: page,
+                                ids: $('#farmSelect option:eq(0)').val(),
                             },
                             dataType: 'html',
                             success: function (data) {

+ 551 - 0
templates/backstageNet/systemSet/mapManage.html

@@ -0,0 +1,551 @@
+{% load staticfiles %}
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
+    <title>新闻发布</title>
+	<link rel="stylesheet" href="{% static '/lib/layui/css/layui.css' %}">
+    <link rel="stylesheet" href="{% static '/lib/css/reset.css' %}">
+	<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=EpbgpqakDpXGN9E3ejg6e93ffsi83b0t"></script>
+	<!--加载鼠标绘制工具-->
+	<script type="text/javascript" src="//api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js"></script>
+	<link rel="stylesheet" href="//api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.css" />
+	<!--加载检索信息窗口-->
+	<script type="text/javascript" src="//api.map.baidu.com/library/SearchInfoWindow/1.4/src/SearchInfoWindow_min.js"></script>
+	<link rel="stylesheet" href="//api.map.baidu.com/library/SearchInfoWindow/1.4/src/SearchInfoWindow_min.css" />
+    <style>
+        .breadcrumbs {
+            padding: 12px 0 12px 30px;
+            border-bottom: 1px solid #dbdbdb;
+        }
+
+        .layui-breadcrumb>* {
+            font-size: 16px;
+        }
+
+        .fixedDiv {
+            position: fixed;
+            width: 100%;
+            z-index: 999;
+            box-shadow: 0px 3px 5px 0px #ececec;
+            background: #fff;
+        }
+
+        /* 发布类型 */
+
+        .widget-title {
+            position: relative;
+            padding-left: 10px;
+            font-size: 16px;
+            padding: 5px 0 5px 10px;
+        }
+
+        .widget-title::after {
+            position: absolute;
+            content: '';
+            left: 0;
+            top: 9px;
+            height: 15px;
+            border-left: 5px solid #23a3ee;
+            padding-left: 10px;
+            font-size: 16px;
+            padding: 5px 0 5px 10px;
+        }
+
+        .widget-title h2 {
+            font-weight: 700;
+            line-height: 33px;
+        }
+
+        .widget-title h2 span {
+            font-size: 13px;
+            font-weight: 100;
+            margin-left: 20px;
+            color: #333;
+        }
+
+
+
+        /* 上传详情 */
+
+        .layui-form-item .layui-input-inline {
+            width: 50%;
+        }
+
+        .uploadContent {
+            /* border-top: 7px solid #f0f0f0; */
+            padding: 25px;
+        }
+
+        .uploadUl>li {
+            display: none;
+        }
+
+        .uploadUl>li:first-child {
+            display: block;
+        }
+
+        .innerDiv {
+            max-width: 500px;
+        }
+
+        /* 图片预览 */
+
+        .layui-upload-img {
+            width: 92px;
+            height: 92px;
+            margin: 0 10px 10px 0;
+        }
+
+        #progressBar {
+            display: none;
+        }
+
+        /* 产品展厅上传多图 */
+
+        .uploadParent {
+            position: absolute;
+            margin: 10px 0;
+        }
+
+        .uploadParent>div {
+            display: inline-block;
+            width: 92px;
+            height: 92px;
+            /* border: 1px solid #b8b8b8; */
+            background: url(../../static/imgs/addicon.png) no-repeat center;
+            background-size: 80% 80%;
+            cursor: pointer;
+            margin-right: 8px;
+        }
+
+        .uploadShowParent .layui-upload-list {
+            display: inline-block;
+        }
+
+        /* 表单样式 */
+
+        .layui-form-item .layui-input-inline {
+            width: 50%;
+        }
+
+        .layui-form-item .layui-input-textarea {
+            width: 50%;
+        }
+
+        .uploadImg {
+            position: absolute;
+            margin: 10px 0;
+            width: 92px;
+            height: 92px;
+            background: none;
+            border: 1px solid #b8b8b8;
+            cursor: pointer;
+        }
+
+        .uploadImgIcon {
+            background: url(../../static/imgs/uploadImgIcon.png) no-repeat center;
+            background-size: 80% 80%;
+        }
+		/* 地图 */
+		.layui-form-label{
+			width: 102px;
+		}
+		.mapBox{
+			display: flex;
+		}
+		.map{
+			width: 55%;
+			height: 400px;
+			border: 1px solid #878787;
+		}
+		.locatPoint button{
+			padding: 5px 10px;
+    		border-radius: 4px;
+    		margin: 10px 20px 5px;
+			color: #fff;
+		}
+		.locatPoint button.sw{
+			background-color: #ed9c22;
+		}
+		.locatPoint button.ne{
+			background-color: #22a3ed;
+
+		}
+		.locatPoint button.center{
+			background-color: #ed2289;
+
+		}
+
+    </style>
+</head>
+
+<body>
+    <div class="content">
+        <div class="floatNav">
+            <!-- 导航 -->
+            <div class="breadcrumbs">
+                <span class="layui-breadcrumb">
+                    <a target="BoardRight">首页</a>
+                    <a>
+                        <cite>信息发布</cite>
+                    </a>
+                </span>
+            </div>
+        </div>
+
+        <!-- 内容 -->
+        <div>
+            <!-- 发布详情 -->
+            <div class="uploadContent" id="uploadContent">
+                <div class="widget-title">
+                    <h2>我的定位
+                        <span id="Uptime"></span>
+                    </h2>
+                </div>
+
+                <div>
+                    <form class="layui-form" action="" id="formDiv" lay-filter="newsFormDiv">
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">地图图片:</label>
+                            <div class="layui-input-inline">
+                                <button type="button" class="uploadImg uploadImgIcon" id="newsUpImg"></button>
+                                <!-- 隐藏的input -->
+                                <input type="hidden" id="img_url" name="upload" value="" />
+                                <div class="layui-upload-list">
+                                    <img class="layui-upload-img" id="demo1" :src=head_img>
+                                    <p id="demoText"></p>
+                                </div>
+                            </div>
+						</div>
+						<div class="layui-form-item">
+                            <label class="layui-form-label">图片定位:</label>
+                            <div class="layui-input-block">
+                                <div class="mapBox">
+									<div id="imgmap" class="map"></div>
+									<div class="locatPoint">
+                                        圈出当前图片展示位置
+									</div>
+								</div>
+                            </div>
+						</div>
+						<div class="layui-form-item">
+                            <label class="layui-form-label">地图中心点:</label>
+                            <div class="layui-input-block">
+                                <div class="mapBox">
+									<div id="centermap" class="map"></div>
+									<div class="locatPoint">
+										拖动标注,定位中心点
+									</div>
+								</div>
+                            </div>
+                        </div>
+                        
+                        <div class="layui-form-item">
+                            <div class="layui-input-block">
+                                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
+                                <!-- <button type="reset" class="layui-btn layui-btn-primary">重置</button> -->
+                                <button class="layui-btn layui-btn-primary clearForm" type="button" >取消</button>
+                            </div>
+                        </div>
+                    </form>
+                </div>
+            </div>
+        </div>
+    </div>
+
+
+    <script src="{% static '/lib/js/jquery-2.1.4.min.js'%}"></script>
+    <script src="{% static '/lib/layui/layui.js'%}"></script>
+    <script src="{% static 'lib/ckeditor/ckeditor.js'%}"></script>
+    <script src="{% static 'lib/ckeditor/lang/zh-cn.js'%}"></script>
+    <script src="{% static '/js/backstageNet/common.js'%}"></script>
+    <script>
+        var element, form, upload;
+        layui.use(['element', 'form', 'upload','layer'], function () {
+            element = layui.element;
+            form = layui.form;
+            upload = layui.upload;
+            layer = layui.layer;
+            //一些事件监听
+            element.on('tab(demo)', function (data) {
+                console.log(data);
+            });
+
+            //新闻图片上传
+            var uploadInst = upload.render({
+                elem: '#newsUpImg'
+                , url: 'news_photo'
+                , field: 'upicture'
+                , accept: 'images' //只允许上传图片
+                // , acceptMime: 'image/*' //只筛选图片
+                // ,exts: 'jpg|jpeg' 
+                , size: 1024 * 2 //限定大小
+                , xhr: function () { } //上传视频进度条
+                , before: function (obj) {
+                    $('.uploadImg').removeClass('uploadImgIcon')
+                    //预读本地文件示例,不支持ie8
+                    obj.preview(function (index, file, result) {
+                        $('#demo1').attr('src', result); //图片链接(base64)
+                    });
+                }
+                , done: function (res) {
+                    //如果上传失败
+                    if (res.code == 0) {
+                        //上传成功
+                        document.getElementById("img_url").value = res.data.src;
+                    } else {
+                        return layer.msg('上传失败');
+                    }
+
+
+                }
+                , error: function () {
+                    //演示失败状态,并实现重传
+                    var demoText = $('#demoText');
+                    demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
+                    demoText.find('.demo-reload').on('click', function () {
+                        uploadInst.upload();
+                    });
+                }
+            });
+			
+			// 百度地图API功能
+			var map = new BMap.Map("imgmap", { mapType: BMAP_NORMAL_MAP, minZoom: 4 });//BMAP_HYBRID_MAP  卫星地图
+			map.centerAndZoom(new BMap.Point(119.604114, 26.09877), 13);
+			// 添加带有定位的导航控件
+            var navigationControl = new BMap.NavigationControl({
+                // 靠左上角位置
+                anchor: BMAP_ANCHOR_TOP_LEFT,
+                // LARGE类型
+                type: BMAP_NAVIGATION_CONTROL_LARGE,
+                // 启用显示定位
+                enableGeolocation: true
+            });
+            map.addControl(navigationControl);
+
+            map.enableScrollWheelZoom(); //启用鼠标滚动对地图放大缩小
+			var styleOptions = {
+				strokeColor: "red",    //边线颜色。
+				fillColor: "red",      //填充颜色。当参数为空时,圆形将没有填充效果。
+				strokeWeight: 3,       //边线的宽度,以像素为单位。
+				strokeOpacity: 0.5,       //边线透明度,取值范围0 - 1。
+				fillOpacity: 0.1,      //填充的透明度,取值范围0 - 1。
+				strokeStyle: 'solid' //边线的样式,solid或dashed。
+			}
+			//实例化鼠标绘制工具
+			var drawingManager = new BMapLib.DrawingManager(map, {
+				isOpen: false, //是否开启绘制模式
+				drawingControl:false,
+				draggable:false,
+				enableDrawingTool: true, //是否显示工具栏
+				drawingToolOptions: {
+					anchor: BMAP_ANCHOR_TOP_RIGHT, //位置
+					offset: new BMap.Size(5, 40), //偏离值
+					drawingModes: [
+						BMAP_DRAWING_RECTANGLE 
+					]
+				},
+				polygonOptions: styleOptions //多边形的样式
+			});
+			
+			document.getElementsByClassName('BMapLib_rectangle')[0].addEventListener('click', e => {
+				// 这里是你的执行操作
+				clearAll()
+			})
+
+			//鼠标绘制完成回调方法   获取各个点的经纬度
+			var overlays = [];
+			var swneLatLng = [];
+			var overlaycomplete = function (e) {
+				drawingManager.close();
+			    swneLatLng = [];
+        		overlays.push(e.overlay);
+			
+                swneLatLng.push(e.overlay.zo[1])
+                swneLatLng.push(e.overlay.zo[3])
+				
+				e.overlay.enableEditing();
+			};
+
+			//添加鼠标绘制工具监听事件,用于获取绘制结果
+			drawingManager.addEventListener('overlaycomplete', overlaycomplete);
+			function clearAll() {
+
+				for (var i = 0; i < overlays.length; i++) {
+					map.removeOverlay(overlays[i]);
+				}
+				overlays.length = 0
+
+			}
+
+			// var point = new BMap.Point(119.578243,26.074887);
+			// var swIcon = new BMap.Icon("../static/imgs/homeIcon2.png", new BMap.Size(21,25),{imageSize: new BMap.Size(21,25)});
+			// var marker = new BMap.Marker(point,{icon:swIcon});// 西南
+			// imgmap.addOverlay(marker); 
+			// var point = new BMap.Point(119.633435,26.109152);
+			// var marker = new BMap.Marker(point);// 东北
+			// imgmap.addOverlay(marker); 
+			// imgmap.addEventListener("click",function(e){
+			// 	alert(e.point.lng + "," + e.point.lat);
+			// });
+
+
+			var centermap = new BMap.Map("centermap", { mapType: BMAP_NORMAL_MAP, minZoom: 4 });  
+			centermap.centerAndZoom(new BMap.Point(119.604114, 26.09877), 13);
+			 // 添加带有定位的导航控件
+             var navigationControl = new BMap.NavigationControl({
+                // 靠左上角位置
+                anchor: BMAP_ANCHOR_TOP_LEFT,
+                // LARGE类型
+                type: BMAP_NAVIGATION_CONTROL_LARGE,
+                // 启用显示定位
+                enableGeolocation: true
+            });
+            centermap.addControl(navigationControl);
+
+            centermap.enableScrollWheelZoom(); //启用鼠标滚动对地图放大缩小
+            var point = new BMap.Point(119.604114, 26.09877);
+			var swIcon = new BMap.Icon("../static/imgs/homeIcon1.png", new BMap.Size(21,25),{imageSize: new BMap.Size(21,25)});
+			var centermapMarker = new BMap.Marker(point,{icon:swIcon});// 东北
+			centermap.addOverlay(centermapMarker); 
+            centermapMarker.enableDragging();
+
+            //监听提交
+            form.on('submit(formDemo)', function (data) {
+				console.log(swneLatLng)
+                var contentLngLat = [];
+                var allOverlay = centermap.getOverlays();
+				for(var i= 0;i<allOverlay.length;i++){
+                    if(allOverlay[i].Pa){
+                        contentLngLat.push(allOverlay[i].point.lng)
+                        contentLngLat.push(allOverlay[i].point.lat)
+                    }
+                }
+                var img_url = $('#img_url').val();
+				console.log(contentLngLat)
+				console.log(img_url)
+                var data = {
+                    swne:swneLatLng,
+                    contentPoint:contentLngLat,
+                    img_url:img_url
+                }
+                
+                // window.id = data.field.id
+                if (!img_url) {
+                    layer.msg("请上传地图底图", { icon: 5 });
+                    return false;
+                }
+                // var content = editor1.getData();
+                // // alert(content)
+                if (!swneLatLng.length) {
+                    layer.msg("请绘制图片展示区域", { icon: 5 });
+                    return false;
+                }
+                // var fields = data.field;
+                // CKupdate()
+
+                $.ajax({
+                    url: 'news_pub',
+                    data: JSON.stringify(data),
+                    type: 'post',
+                    success: function (data) {
+                        if (data) {
+                            if (window.id !== '') {
+                                layer.msg("发布成功,等待审核", { icon: 1 });
+                            } else {
+                                layer.msg("发布成功,等待审核", { icon: 1 });
+                            }
+                            msgTitleSaveFun(fields.title,5)
+                            clearForm()
+                        } else {
+                            if (window.id !== '') {
+                                parent.layer.msg("发布失败", { icon: 2 });
+                            } else {
+                                layer.msg("发布失败", { icon: 2 });
+                            }
+                        }
+                    },
+                    error: function (type) {
+
+                    }
+                })
+                return false;
+
+            });
+            
+            $('.clearForm').on('click',function(){
+                clearForm()
+            })
+            
+            function clearForm() {
+                form.val('newsFormDiv', {
+                    "title": "",
+                    "writer": "",
+                    "intro": ""
+                });
+                $('#img_url').val('');
+                $('.uploadImg').addClass('uploadImgIcon');
+                $('#demo1').removeAttr('src'); //图片链接(base64)
+                clearAll()
+                swneLatLng=''
+            }
+        });
+
+        
+
+       
+       
+
+ 
+
+        windowAddMouseWheel();
+        function windowAddMouseWheel() {
+            var scrollFunc = function (e) {
+                e = e || window.event;
+                var top = $(window).scrollTop();
+                if (e.wheelDelta) {  //判断浏览器IE,谷歌滑轮事件
+                    if (e.wheelDelta > 0) { //当滑轮向上滚动时
+                        if (top < 60) {
+                            if ($(".floatNav").hasClass("fixedDiv")) {
+                                $(".floatNav").removeClass("fixedDiv");
+                                $(window).scrollTop(0)
+                            }
+                        }
+                    }
+                    if (e.wheelDelta < 0) { //当滑轮向下滚动时
+                        if (top >= 60) {
+                            $(".floatNav").addClass("fixedDiv");
+                        }
+                    }
+                } else if (e.detail) {  //Firefox滑轮事件
+                    if (e.detail > 0) { //当滑轮向上滚动时
+                        if (top < 60) {
+                            if ($(".floatNav").hasClass("fixedDiv")) {
+                                $(".floatNav").removeClass("fixedDiv");
+                                $(window).scrollTop(0)
+                            }
+                        }
+                    }
+                    if (e.detail < 0) { //当滑轮向下滚动时
+                        if (top >= 60) {
+                            $(".floatNav").addClass("fixedDiv");
+                        }
+                    }
+                }
+            };
+            //给页面绑定滑轮滚动事件
+            if (document.addEventListener) {
+                document.addEventListener('DOMMouseScroll', scrollFunc, false);
+            }
+            //滚动滑轮触发scrollFunc方法
+            window.onmousewheel = document.onmousewheel = scrollFunc;
+        }
+
+    </script>
+</body>
+
+</html>

+ 7 - 4
templates/outerNet/index2.html

@@ -141,20 +141,22 @@
                     <button>搜索</button>
                 </div>
             </div>
-            <!-- <div class="not_loginCover">
+            {% if not curr_user.username %}
+            <div class="not_loginCover">
                 <a href="login2" target="_blank">登录</a>
                 <a href="" target="_blank">注册</a>
-            </div> -->
+            </div>
+            {% else %}
             <div class="yet_loginCover">
                 <div class="person">
                     <div class="userHeadImg">
-                        <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
+                        <img src="{{curr_user.user_picture}}" alt="">
                     </div>
                     <div class="userCtrl">
                         <div class="userCtrlTop">
                             <div class="userInfo">
                                 <div>
-                                    <span>admin</span>
+                                    <span>{{curr_user.username}}</span>
                                 </div>
                             </div>
                         </div>
@@ -167,6 +169,7 @@
                      </div>
                 </div>
              </div>
+            {% endif %}
         </div>
         <!-- 轮播 -->
         <div class="sliderBox advImg">

+ 3 - 0
templates/outerNet/tourist.html

@@ -29,6 +29,9 @@
             margin: 10px 0;
             font-weight: 700;
         }
+        .advImg{
+            background: url(../static/imgs/scenicAdv.jpg) no-repeat center;
+        }
     </style>
 </head>
 

TEMPAT SAMPAH
templates/static/imgs/cartoonFarmImg.jpg


TEMPAT SAMPAH
templates/static/imgs/cornerIcon.png


templates/static/imgs/微信图片_20200815092454.jpg → templates/static/imgs/farmAdv.jpg


TEMPAT SAMPAH
templates/static/imgs/homeIcon1.png


templates/static/imgs/微信图片_20200815092512.jpg → templates/static/imgs/scenicAdv.jpg


+ 304 - 0
templates/static/js/limit/limit.js

@@ -0,0 +1,304 @@
+var navList = [
+    {
+        "id": 1,
+        "title": "首页",
+        "icon": "&#xe626;",
+        "url": "map",
+        "children": []
+    },
+    {
+        "id": 2,
+        "title": "设备分配",
+        "icon": "&#xe609;",
+        "url": "equipallot",
+        "disabled": "true",
+        "children": []
+    },
+    {
+        "id": 3,
+        "title": "信息发布",
+        "icon": "&#xe765;",
+        "url": "",
+        "children": [
+            {
+                "id": 3.1,
+                "title": "新闻资讯",
+                "url": "news_pub",
+            },
+            {
+                "id": 3.2,
+                "title": "视频资讯",
+                "url": "video_pub",
+            },
+            {
+                "id": 3.2,
+                "title": "产品展厅",
+                "url": "equip_pub",
+            },
+            {
+                "id": 3.3,
+                "title": "四季采摘",
+                "url": "garden_pub",
+            },
+            {
+                "id": 3.4,
+                "title": "民宿导览",
+                "url": "dorm_pub",
+            },
+            {
+                "id": 3.5,
+                "title": "旅游景点",
+                "url": "sightsee_pub",
+            },
+        ]
+    },
+    {
+        "id": 4,
+        "title": "我的发布",
+        "icon": "&#xe609;",
+        "url": "my_pub",
+        "children": []
+    },
+    {
+        "id": 5,
+        "title": "视频监控",
+        "icon": "&#xe610;",
+        "url": "jkview",
+        "children": []
+    },
+    {
+        "id": 6,
+        "title": "传感及控制",
+        "icon": "&#xe654;",
+        "url": "",
+        "children": [
+            {
+                "id": 6.1,
+                "title": "控制模块",
+                "url": "qxzcontrol",
+            },
+            {
+                "id": 6.2,
+                "title": "趋势分析",
+                "url": "qxzchart",
+            },
+            {
+                "id": 6.3,
+                "title": "数据统计",
+                "url": "qxz_status",
+            }
+        ]
+    },
+    {
+        "id": 7,
+        "title": "预警中心",
+        "icon": "&#xe634;",
+        "url": "",
+        "children": [
+            {
+                "id": 7.1,
+                "title": "阈值设置",
+                "url": "qxz_warning_view",
+            },
+            {
+                "id": 7.2,
+                "title": "生产方式设置",
+                "url": "productionset",
+            },
+            {
+                "id": 7.3,
+                "title": "预警记录",
+                "url": "qxz_warning_list",
+            },
+        ]
+    },
+    {
+        "id": 8,
+        "title": "开心农场",
+        "icon": "&#xe603;",
+        "url": "",
+        "children": [
+            {
+                "id": 8.1,
+                "title": "我的农场",
+                "url": "person_farm_edit",
+            },
+            {
+                "id": 8.2,
+                "title": "农场管理",
+                "url": "garden_manage_view",
+            },
+            {
+                "id": 8.3,
+                "title": "人员管理",
+                "url": "garden_user_view",
+            },
+            {
+                "id": 8.4,
+                "title": "库存管理",
+                "url": "repertory_view",  //物料管理    
+            },
+            {
+                "id": 8.5,
+                "title": "种植管理",
+                "url": "cropcount",
+            },
+            {
+                "id": 8.6,
+                "title": "入库管理",
+                "url": "pick",
+            },
+            {
+                "id": 8.7,
+                "title": "销售管理",
+                "url": "sell_view",
+            }
+        ]
+    },
+    {
+        "id": 9,
+        "title": "数据中心",
+        "icon": "&#xe603;",
+        "url": "",
+        "children": [
+            {
+                "id": 9.1,
+                "title": "产业数据",
+                "url": "industrydata",
+            },
+            {
+                "id": 9.2,
+                "title": "类型分析",
+                "url": "type",
+            },
+            {
+                "id": 9.3,
+                "title": "对比分析",
+                "url": "contrast",
+            },
+        ]
+    },
+    {
+        "id": 10,
+        "title": "通知公告",
+        "icon": "&#xe765;",
+        "url": "",
+        "disabled": "true",
+        "children": [
+            {
+                "id": 10.1,
+                "title": "发布公告",
+                "url": "policy_pub",
+                "disabled": "true",
+            },
+            {
+                "id": 10.2,
+                "title": "查看公告",
+                "url": "policy_list_view",
+                "disabled": "true",
+            },
+        ]
+    },
+    {
+        "id": 11,
+        "title": "信息审核",
+        "icon": "&#xe765;",
+        "url": "",
+        "disabled": "true",
+        "children": [
+            {
+                "id": 11.1,
+                "title": "新闻资讯",
+                "url": "news_check",
+                "disabled": "true",
+            },
+
+            {
+                "id": 11.2,
+                "title": "视频资讯",
+                "url": "video_check",
+                "disabled": "true",
+            },
+            {
+                "id": 11.3,
+                "title": "产品展厅",
+                "url": "equip_check",
+                "disabled": "true",
+            },
+            {
+                "id": 11.4,
+                "title": "四季采摘",
+                "url": "garden_check",
+                "disabled": "true",
+            },
+            {
+                "id": 11.5,
+                "title": "民宿导览",
+                "url": "dorm_check",
+                "disabled": "true",
+            },
+            {
+                "id": 11.6,
+                "title": "旅游景点",
+                "url": "sightsee_check",
+                "disabled": "true",
+            },
+            {
+                "id": 11.7,
+                "title": "个人农场",
+                "url": "farm_check",
+                "disabled": "true",
+            },
+        ]
+    },
+    {
+        "id": 12,
+        "title": "权限",
+        "icon": "&#xe765;",
+        "url": "limit_view",
+        "disabled": "true",
+        "children": []
+    },
+    {
+        "id": 13,
+        "title": "系统设置",
+        "icon": "&#xe765;",
+        "url": "",
+        "disabled": "true",
+        "children": [
+            {
+                "id": 13.1,
+                "title": "用户管理",
+                "url": "person_view",
+                "disabled": "true",
+            },
+            {
+                "id": 13.2,
+                "title": "地图设置",
+                "url": "setMap",
+                "disabled": "true",
+            }
+        ]
+    },
+    {
+        "id": 14,
+        "title": "专家诊断",
+        "icon": "&#xe765;",
+        "url": "",
+        "disabled": "true",
+        "children": [
+            {
+                "id": 14.1,
+                "title": "在线专家",
+                "url": "expert",
+                "disabled": "true",
+            },
+            {
+                "id": 14.2,
+                "title": "知识库",
+                "url": "learn_depot",
+                "disabled": "true",
+            }
+        ]
+    },
+]

+ 135 - 13
templates/static/js/limit/limitUserManage.js

@@ -1,16 +1,11 @@
-if ($('#gobackpage').val()) {
-    var gobackpage = $('#gobackpage').val();
-} else {
-    var gobackpage = 1;
-}
-var uname = $('#gobackuname').val();
+
 
 $.ajax({
     url: 'person_limit',
     type: 'post',
     data: {
-        uname: uname,
-        page: gobackpage
+        uname: "",
+        page: 1
     },
     success: function (data) {
         $('#datatable tbody').html('');
@@ -32,7 +27,7 @@ $.ajax({
             var laypage = layui.laypage;
             laypage.render({
                 elem: 'page' //注意,这里的 test1 是 ID,不用加 # 号
-                , curr: gobackpage
+                , curr: 1
                 , count: $('#total_nums').val()
                 , theme: '#2ca9f9'
                 , layout: ['prev', 'page', 'next', 'skip']
@@ -43,7 +38,7 @@ $.ajax({
                             url: 'person_limit',
                             type: 'post',
                             data: {
-                                uname: uname,
+                                uname: "",
                                 page: obj.curr,
                             },
                             success: function (data) {
@@ -144,7 +139,134 @@ function initSearchPage(page, url, datas) {
 }
 
 function allotEquipPage(uname) {
-    var currPage = $('#page .layui-laypage-curr em').eq(1).html();
-    var f_name = $('#uname').val();
-    window.location.href = 'limit?uname=' + uname + '&currpage=' + currPage + '&f_name=' + f_name;
+    $('#hiduname').val(uname);
+    $.ajax({
+        url: 'limit',
+        type: 'post',
+        data: {
+            uname: uname
+        },
+        // dataType: "json",
+        success: function (data) {
+            if (data) {
+                var newNavList = eval('(' + data + ')');
+                layui.use(['tree'], function () {
+                    var tree = layui.tree;
+
+                    var topicId = []
+                    for (var i = 0; i < newNavList.length; i++) {
+                        if (newNavList[i].children.length) {
+                            var currChildren = newNavList[i].children;
+                            for (var j = 0; j < currChildren.length; j++) {
+                                topicId.push(currChildren[j].id);
+                                // topicId.push(parseInt(currChildren[j].id));
+                            }
+                        } else {
+                            topicId.push(newNavList[i].id);
+                            // topicId.push(parseInt(newNavList[i].id));
+                        }
+                        if (i == newNavList.length - 1) {
+                            //基本演示
+                            tree.render({
+                                elem: '#test1'
+                                , data: navList
+                                , showCheckbox: true  //是否显示复选框
+                                , id: 'demoId1'
+                                , isJump: true //是否允许点击节点时弹出新窗口跳转
+                                , click: function (obj) {
+                                    var data = obj.data;  //获取当前点击的节点数据
+                                    // layer.msg('状态:' + obj.state + '<br>节点数据:' + JSON.stringify(data));
+                                }
+                            });
+                            tree.setChecked('demoId1', topicId); //勾选指定节点
+                            console.log(topicId)
+
+                        }
+                    }
+
+
+                })
+            } else {
+                layui.use(['tree'], function () {
+                    var tree = layui.tree;
+                    tree.render({
+                        elem: '#test1'
+                        , data: navList
+                        , showCheckbox: true  //是否显示复选框
+                        , id: 'demoId1'
+                        , isJump: true //是否允许点击节点时弹出新窗口跳转
+                        , click: function (obj) {
+                            var data = obj.data;  //获取当前点击的节点数据
+                            // layer.msg('状态:' + obj.state + '<br>节点数据:' + JSON.stringify(data));
+                        }
+                    });
+                })
+            }
+        },
+        error: function (type) {
+            console.log(type)
+        }
+    })
+    // var currPage = $('#page .layui-laypage-curr em').eq(1).html();
+    // var f_name = $('#uname').val();
+    // window.location.href = 'limit?uname=' + uname + '&currpage=' + currPage + '&f_name=' + f_name;
+    layer.open({
+        type: 1,
+        id:"limitPopLayer",
+        title:"用户"+uname+" 权限分配",
+        area: ['60%', '80%'],
+        btn: ['确定', '取消'],
+        yes: function(index, layero){
+            getLimit()
+        },
+        btn2: function(index, layero){
+        //按钮【按钮二】的回调
+        
+        //return false 开启该代码可禁止点击该按钮关闭
+        },
+        scrollbar: false,
+        // skin: 'layui-layer-rim', //加上边框
+        content: $('#limitPop')
+    });
+}
+function getLimit() {
+    layui.use(['tree'], function () {
+        var tree = layui.tree;
+        var checkData = tree.getChecked('demoId1');
+        console.log(checkData)
+        if (checkData.length) {
+            $.ajax({
+                url: 'limit_view',
+                type: 'post',
+                data: {
+                    uname: $('#uname').val(),
+                    limit: JSON.stringify(checkData)
+                },
+                success: function (data) {
+                    if (data) {
+                        layui.use(['layer'], function () {
+                            var layer = layui.layer;
+                            layer.msg('设置成功!', { icon: 1, time: 500 }, function () {
+                                layer.close(layer.index);
+                            })
+                        })
+                    } else {
+                        layui.use(['layer'], function () {
+                            var layer = layui.layer;
+                            layer.msg('设置失败!', { icon: 2 })
+                        })
+                    }
+                },
+                error: function (type) {
+                    console.log(type)
+                }
+            })
+        } else {
+            layui.use(['layer'], function () {
+                var layer = layui.layer;
+                layer.msg('必须选择一项', { icon: 2 })
+            })
+        }
+
+    })
 }

TEMPAT SAMPAH
user_photo/20200817170355.jpg