<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>그룹별권한</title>
    <%@ include file="/WEB-INF/jsp/adm/include/topLinkTag.jsp" %>
</head>

<script>

    $(document).ready(function () {
            getOpr();
            getServiceGroupQueryString();
            $("#Content").on("keyup", function (key) {
                if (key.keyCode == 13) {
                    fnCustSearchBtn();
                }
            });


        }
    );

    function getServiceGroupQueryString() {
        var param = new URLSearchParams(location.search).get("serviceGroup");
        return param;
    }


    function getOpr() {
        $.ajax({
            type: "GET",
            contentType: "application/json; charset=utf-8",
            datatype: "JSON",
            url: "<c:url value='/adm/menu/oprmng'/>",
            success: function (data) {
                // console.log(JSON.stringify(data));
                data.forEach(function (e, f) {
                    $('#serviceGroup').append("<option value=" + e.serviceGroup + ">" + e.serviceGroupName + "</option>");
                    $('#serviceGroup').niceSelect('update');
                });
            }
        })
    };

</script>


<body>

<h1>ICOMSYS ADMIN</h1>
<h1>대시보드</h1>
<div class="skip_navigation">
    <ul>
        <li>
            <a href="#Content" class="go_content">본문 바로가기</a>
        </li>
        <li>
            <a href="#Gnb">메뉴 바로가기</a>
        </li>
    </ul>
</div>

<header id="header">
    <%@ include file="/WEB-INF/jsp/adm/include/header.jsp" %>
</header>
<c:import url="/adm/menu/getLnbMenu.do"/>
<section id="Content" class="system_management">
    <div class="location">
        <ul>
            <li class="home"><a href="#">HOME</a></li>
            <li><a href="#">시스템관리</a></li>
            <li><a href="#">그룹별권한 관리</a></li>
        </ul>
    </div>

    <!-- TODO: 래부터 신규 컨텐츠 마크업 입니다. -->
    <div class="sub_cont">
        <div class="cont_box">
            <div class="box_title">
                <div class="fl">
                    <h2 class="mt12">권한그룹편집</h2>
                </div>
            </div>
            <div class="tbl">
                <table class="edit hght">
                    <colgroup>
                        <col width="150px">
                        <col width="auto">
                    </colgroup>
                    <tbody>
                    <tr>
                        <th class="tl">그룹명</th>
                        <td>
                            <div class="ipt_box">
                                <input type="text" value="인텐트 조회권한" name="" class="">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th class="tl">그룹설명</th>
                        <td>
                            <div class="ipt_box">
                                <input type="text" value="인텐트를 조회만 할 수 있는 권한" name="" class="">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th class="tl">소속사용자 <em class="red">*</em></th>
                        <td>
                            <div class="ipt_box type-flex">
                                <div class="select2-lib-ipt">
                                    <select class="select-search" multiple="multiple"></select>
                                </div>
                                <a href="#" class="btn">사용자 추가</a>
                                <script src="assets/js/lib/select2.js"></script>
                                <script>
                                    const data = [
                                        {id: 1, text: '홍길동'},
                                        {id: 2, text: '남길동'},
                                        {id: 3, text: '재길동'},
                                        {id: 4, text: '개길동'},
                                        {id: 5, text: '김길동'},
                                        {id: 6, text: '이길동'},
                                        {id: 7, text: '임길동'}
                                    ];
                                    $(".select-search").select2({
                                        placeholder: "사용자를 검색",
                                        data: data,
                                        tags: true
                                        // allowClear: true
                                    });
                                </script>
                            </div>
                            <div class="list-user-group-box">
                                <div class="list-user-group-item">
                                    <div class="group-item-title">소속타이틀(필요시 사용)</div>
                                    <ul class="list-user-group-box-ul">
                                        <li>
                                            <div class="chk_box">
                                                <input type="checkbox" name="checkbox" id="chk01" checked>
                                                <label for="chk01">홍길동</label>
                                            </div>
                                        </li>

                                        <li>
                                            <div class="chk_box">
                                                <input type="checkbox" name="checkbox" id="chk02" checked>
                                                <label for="chk02">김길동</label>
                                            </div>
                                        </li>

                                        <li>
                                            <div class="chk_box">
                                                <input type="checkbox" name="checkbox" id="chk01" checked>
                                                <label for="chk01">홍길동</label>
                                            </div>
                                        </li>

                                        <li>
                                            <div class="chk_box">
                                                <input type="checkbox" name="checkbox" id="chk02" checked>
                                                <label for="chk02">김길동</label>
                                            </div>
                                        </li>

                                        <li>
                                            <div class="chk_box">
                                                <input type="checkbox" name="checkbox" id="chk01" checked>
                                                <label for="chk01">홍길동</label>
                                            </div>
                                        </li>

                                        <li>
                                            <div class="chk_box">
                                                <input type="checkbox" name="checkbox" id="chk02" checked>
                                                <label for="chk02">김길동</label>
                                            </div>
                                        </li>

                                        <li>
                                            <div class="chk_box">
                                                <input type="checkbox" name="checkbox" id="chk01" checked>
                                                <label for="chk01">홍길동</label>
                                            </div>
                                        </li>

                                        <li>
                                            <div class="chk_box">
                                                <input type="checkbox" name="checkbox" id="chk02" checked>
                                                <label for="chk02">김길동</label>
                                            </div>
                                        </li>

                                        <li>
                                            <div class="chk_box">
                                                <input type="checkbox" name="checkbox" id="chk01" checked>
                                                <label for="chk01">홍길동</label>
                                            </div>
                                        </li>

                                        <li>
                                            <div class="chk_box">
                                                <input type="checkbox" name="checkbox" id="chk02" checked>
                                                <label for="chk02">김길동</label>
                                            </div>
                                        </li>

                                        <li>
                                            <div class="chk_box">
                                                <input type="checkbox" name="checkbox" id="chk01" checked>
                                                <label for="chk01">홍길동</label>
                                            </div>
                                        </li>

                                        <li>
                                            <div class="chk_box">
                                                <input type="checkbox" name="checkbox" id="chk02" checked>
                                                <label for="chk02">김길동</label>
                                            </div>
                                        </li>
                                    </ul>
                                </div>
                                <!-- 2단레이아웃 필요시 list-user-group-item부터 추가-->
                                <!-- <div class="list-user-group-item">
                                    <div class="group-item-title">소속타이틀(필요시 사용)</div>
                                    <ul class="list-user-group-box-ul">
                                        <li>
                                            <div class="chk_box">
                                                <input type="checkbox" name="checkbox" id="chk03" checked>
                                                <label for="chk03">홍길동</label>
                                            </div>
                                        </li>

                                        <li>
                                            <div class="chk_box">
                                                <input type="checkbox" name="checkbox" id="chk04" checked>
                                                <label for="chk04">김길동</label>
                                            </div>
                                        </li>
                                    </ul>
                                </div> -->
                            </div>
                        </td>
                    </tr>

                    <tr>
                        <th class="tl">권한</th>
                        <td class="tl">
                            <script>
                                $(document).ready(function () {
                                    $('.tree_wrap').jstree({
                                        "checkbox": {
                                            "keep_selected_style": false
                                        },
                                        "plugins": ["checkbox"]
                                    });
                                });
                            </script>
                            <div class="content tree tree-maxHeight type-chk">
                                <div class="tree_wrap">
                                    <ul>
                                        <li data-jstree='{ "opened" : true }'>root
                                            <ul>
                                                <li data-jstree='{ "opened" : true }'>주소BOT
                                                    <ul>
                                                        <li>지명 유사어 관리</li>
                                                        <li>빌딩 유사어 관리</li>
                                                        <li>유의어 전처리 관리</li>
                                                        <li>주소봇 멘트 관리</li>
                                                        <li>발화 건물유형 관리</li>
                                                        <li>주소 월별 업데이트</li>
                                                        <li>주소처리내역(녹취)</li>
                                                    </ul>
                                                </li>
                                                <li data-jstree='{ "opened" : true }'>BOT 공통 관리
                                                    <ul>
                                                        <li data-jstree='{ "opened" : true }'>서비스별관리
                                                            <ul>
                                                                <li>요일/시간대별 멘트 관리</li>
                                                                <li>휴무일 관리</li>
                                                                <li>자연어 전처리 관리</li>
                                                            </ul>
                                                        </li>
                                                        <li>공통 코드 관리</li>
                                                    </ul>
                                                </li>
                                                <li data-jstree='{ "opened" : true }'>무인접수BOT
                                                    <ul>
                                                        <li>무인 접수 리스트</li>
                                                        <li>제품군 유의어 관리</li>
                                                    </ul>
                                                </li>
                                                <li data-jstree='{ "opened" : true }'>영상상담
                                                    <ul>
                                                        <li>컨텐츠등록 관리</li>
                                                        <li>영상상담</li>
                                                        <li>상담이력 조회</li>
                                                    </ul>
                                                </li>
                                            </ul>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </td>
                    </tr>

                    </tbody>
                </table>
            </div>
        </div>

        <div class="cont_box">
            <div class="btn_wrap center">
                <a href="#" class="btn basic grey">취소</a>
                <a href="#" class="btn basic">저장</a>
            </div>
        </div>
    </div>

</section>


</body>
</html>