{% 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/font/fontIcon/iconfont.css' %}">
    <link rel="stylesheet" href="{% static '/lib/css/reset.css' %}">
    <style>
        /* 面包屑导航 */

        .breadcrumbs {
            /* line-height: 38px; */
            padding: 12px 0 12px 30px;
            border-bottom: 1px solid #dbdbdb;
        }

        .layui-breadcrumb>* {
            font-size: 16px;
        }

        /* 内容 */

        .mainContent {
            padding: 30px;
        }

        .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;
        }

        .mainContent>div:nth-child(2) {
            margin-top: 30px;
        }

        /*  */

        .navUl {
            line-height: 33px;
        }

        ul.childUl {
            padding-left: 30px;
        }

        ul.childUl>li {
            display: inline-block;
            margin-right: 10px;
        }

        /*  */
        span.layui-tree-icon{
            width: 16px;
            height: 16px;
        }
    </style>
</head>

<body>
    <div class="content">
        <!-- 导航 -->
        <div class="breadcrumbs">
            <span class="layui-breadcrumb">
                <a target="BoardRight">首页</a>
                <a>
                    <cite>菜单权限</cite>
                </a>
            </span>
        </div>
        <!-- 内容 -->
        <div class="mainContent">
            <div class="widget-title">
                <!-- <button type="button" class="layui-btn  layui-btn-normal layui-btn-sm fr" onclick="selectModelFun()">园区筛选</button> -->
                <!-- <a href="" target="BoardRight"  class="layui-btn  layui-btn-normal layui-btn-sm fr">新增</a> -->
                <!-- <button type="button" class="layui-btn  layui-btn-normal layui-btn-sm fr" onclick="selectModelFun()">新增</button> -->
                <h2>菜单权限
                    <!-- <span id="Uptime">草莓园商情站-设备：20126555</span> -->
                </h2>
            </div>
            <div class="qx">
                <div id="test1"></div>
            </div>
            <div>
                <button type="button" class="layui-btn  layui-btn-normal layui-btn-sm fr" onclick="saveQx()">提交</button>
            </div>
        </div>

    </div>


    <script src="{% static '/lib/js/jquery-2.1.4.min.js'%}"></script>
    <script src="{% static '/lib/layui/layui.js'%}"></script>
    <script>
        layui.use('tree', function () {
            var tree = layui.tree;

            var navList = [
                {
                    "id": '1',
                    "title": "首页",
                    "icon": "&#xe626;",
                    "url": "map",
                    "children": []
                },
                {
                    "id": '2',
                    "title": "设备分配",
                    "icon": "&#xe609;",
                    "url": "allot",
                    "children": []
                },
                {
                    "id": '3',
                    "title": "信息发布",
                    "icon": "&#xe765;",
                    "url": "",
                    "children": [
                        // {
                        //     "id": '3-1',
                        //     "title": "信息发布",
                        //     "url": "info_pub",
                        // },
                        {
                            "id": '3-2',
                            "title": "新闻资讯",
                            "url": "news_pub",
                        },
                        {
                            "id": '3-2',
                            "title": "视频资讯",
                            "url": "video_pub",
                        },
                        {
                            "id": '3-2',
                            "title": "产品展厅",
                            "url": "equip_pub",
                        },
                        {
                            "id": '3-2',
                            "title": "四季采摘",
                            "url": "garden_pub",
                        },
                        {
                            "id": '3-2',
                            "title": "民宿导览",
                            "url": "dorm_pub",
                        },
                    ]
                },
                {
                    "id": '4',
                    "title": "视频监控",
                    "icon": "&#xe610;",
                    "url": "equipmanage_jk",
                    "children": []
                },
                {
                    "id": '5',
                    "title": "传感及控制",
                    "icon": "&#xe654;",
                    "url": "",
                    "children": [
                        {
                            "id": '5-1',
                            "title": "控制模块",
                            "url": "qxzcontrol",
                        },
                        {
                            "id": '5-2',
                            "title": "趋势分析",
                            "url": "qxzchart",
                        },
                        {
                            "id": '5-3',
                            "title": "数据统计",
                            "url": "qxz_status",
                        }
                    ]
                },
                {
                    "id": '6',
                    "title": "预警中心",
                    "icon": "&#xe634;",
                    "url": "",
                    "children": [
                        {
                            "id": '6-1',
                            "title": "阈值设置",
                            "url": "qxz_warning_view",
                        },
                        {
                            "id": '6-3',
                            "title": "生产方式设置",
                            "url": "productionset",
                        },
                        {
                            "id": '6-4',
                            "title": "预警记录",
                            "url": "qxz_warning_list",
                        },
                    ]
                },
                {
                    "id": '7',
                    "title": "开心农场",
                    "icon": "&#xe603;",
                    "url": "",
                    "children": [
                        {
                            "id": '7-1',
                            "title": "我的农场",
                            "url": "person_farm_edit",
                        },
                        {
                            "id": '7-2',
                            "title": "农场管理",
                            "url": "garden_manage_view",
                        },
                        {
                            "id": '7-3',
                            "title": "人员管理",
                            "url": "garden_user_view",
                        },
                        {
                            "id": '7-4',
                            "title": "库存管理",
                            "url": "repertory_view",  //物料管理    
                        },
                        {
                            "id": '7-5',
                            "title": "种植管理",
                            "url": "cropcount",
                        },
                        {
                            "id": '7-6',
                            "title": "入库管理",
                            "url": "pick",
                        },
                        {
                            "id": '7-7',
                            "title": "销售管理",
                            "url": "sell_view",
                        }
                    ]
                },
                {
                    "id": '8',
                    "title": "数据中心",
                    "icon": "&#xe603;",
                    "url": "",
                    "children": [
                        {
                            "id": '8-1',
                            "title": "产业数据",
                            "url": "industrydata",
                        },
                        {
                            "id": '8-2',
                            "title": "类型分析",
                            "url": "type",
                        },
                        {
                            "id": '8-3',
                            "title": "对比分析",
                            "url": "contrast",
                        },
                    ]
                },
                {
                    "id": '9',
                    "title": "基础设置",
                    "icon": "&#xe603;",
                    "url": "",
                    "children": [
                        {
                            "id": '9-1',
                            "title": "农场划分",
                            "url": "farm_mark",
                        },
                        {
                            "id": '9-2',
                            "title": "农场列表",
                            "url": "farm_list",
                        },
                        // {
                        //     "id": '8-3',
                        //     "title": "对比分析", 
                        //     "url": "contrast ",
                        // },
                    ]
                },
                {
                    "id": '10',
                    "title": "通知公告",
                    "icon": "&#xe765;",
                    "url": "",
                    "children": [
                        {
                            "id": '10-1',
                            "title": "发布公告",
                            "url": "policy_pub",
                        },
                        {
                            "id": '10-2',
                            "title": "查看公告",
                            "url": "policy_list_view",
                        },
                        // {
                        //     "id": '10-2',
                        //     "title": "农业技术",
                        //     "url": "info_manage",
                        // }
                    ]
                },
                {
                    "id": '11',
                    "title": "信息审核",
                    "icon": "&#xe765;",
                    "url": "",
                    "children": [
                        {
                            "id": '11-2',
                            "title": "信息维护",
                            "url": "info_manage",
                        },
                        {
                            "id": '11-1',
                            "title": "新闻资讯",
                            "url": "news_check",
                        },

                        {
                            "id": '3-2',
                            "title": "视频资讯",
                            "url": "video_check",
                        },
                        {
                            "id": '3-2',
                            "title": "产品展厅",
                            "url": "equip_check",
                        },
                        {
                            "id": '3-2',
                            "title": "四季采摘",
                            "url": "garden_check",
                        },
                        {
                            "id": '3-2',
                            "title": "民宿导览",
                            "url": "dorm_check",
                        },
                    ]
                },
                {
                    "id": '11',
                    "title": "权限",
                    "icon": "&#xe765;",
                    "url": "limit",
                    "children": []
                },
            ]

            //基本演示
            tree.render({
                elem: '#test1'
                , data: navList
                , showCheckbox: true  //是否显示复选框
                , spread: true
                , id: 'demoId1'
                , isJump: true //是否允许点击节点时弹出新窗口跳转
                , click: function (obj) {
                    var data = obj.data;  //获取当前点击的节点数据
                    layer.msg('状态：' + obj.state + '<br>节点数据：' + JSON.stringify(data));
                }
            });

        })
    </script>
</body>

</html>