<!DOCTYPE html>
<html lagn="ko" xmlns:th="http://www.thymeleaf.org">

<th:block th:fragment="layout_leftMenu2">
<!-- 왼쪽 -->
<div class="left_box">
	<a href="javascript:;" onclick="fn_back();" class="back" style="display:none;"><img src="/image/web/right_arrow_B.svg">뒤로가기</a>
	<ul id="sub_menu_list" class="sub_menu_list">
		<!-- 
		<li class="title_menu first">원무</li>
		<li><a href="hospital.html" class="on">근태·연차</a></li>
		<li><a href="hospital_employee.html" class="on">직원 목록</a></li>

		<li class="title_menu">병원 설정</li>
		<li><a href="hospital_info.html" class="on">병원 기본정보</a></li>
		<li><a href="hospital_work.html" class="on">근뮤·연차 설정</a></li>
		<li><a href="hospital_group.html" class="on">조직·권한 설정</a></li>
		<li><a href="hospital_diagnosis.html" class="on">진료·시술 설정</a></li>
		<li><a href="hospital_payment.html" class="on">결제 설정</a></li>
		<li><a href="hospital_notice.html" class="on">공지사항</a></li>
		-->
	</ul>
</div>
<script>
/****************************************************************************
* 메뉴 조회
****************************************************************************/
function fn_selectListSubMenu(param){
	let formData = new FormData();
	formData.append("type", "B");
	formData.append("groupCode", param);
	
	$.ajax({
		url: encodeURI('/webmenu/selectListMenu.do'),
		data: formData,
		dataType: "json",
		processData: false,
		contentType: false,
		type: 'POST',
		async: true,
		success: function(data){
			if('0'==data.msgCode){
				let listHTML = '';
				
				if(data.rows.length>1){
					for(let i = 0; i < data.rows.length; i++){
						let menuCode = data.rows[i].menuCode;
						let menuCodeLength = menuCode.length;
						
						let menuName = data.rows[i].menuName;
						let action   = data.rows[i].action;

						if(menuCodeLength == 4){
							if(i==0){
								listHTML += '<li class="title_menu first">'+menuName+'</li>';
							}
							else{
								listHTML += '<li class="title_menu">'+menuName+'</li>';
							}
						}
						else{
							listHTML += '<li>';
							listHTML += '	<a id="menu'+menuCode+'" href="javascript:;" onClick="javascript:fn_leftFormAction2(\''+menuCode+'\',\''+action+'\');">';
							listHTML += menuName;
							listHTML += '	</a>';
							listHTML += '</li>';
						}
					}
				}
				$("#sub_menu_list").empty().html(listHTML).trigger("create");
				
				// 선택 처리
				if(!fn_emptyYn(menuClass)){
					$("#sub_menu_list #menu"+menuClass).addClass("on");
				}
			}
			else if(data.msgCode=='-1'){
				modalEvent.warning("조회 오류", data.msgDesc);
			}
			else{
				modalEvent.danger("조회 오류", "조회 중 오류가 발생하였습니다. 잠시후 다시시도하십시오.");
			}
		},
		error : function(xhr, status, error) {
			modalEvent.danger("조회 오류", "조회 중 오류가 발생하였습니다. 잠시후 다시시도하십시오.");
		},
		beforeSend:function(){
			
		},
		complete:function(){
			
		}
	});
}

$(function(){
	
});

</script>
</th:block>
</html>