Bläddra i källkod

모바일웹 기초작업

juney 2 år sedan
förälder
incheckning
8910e873a1

+ 4 - 4
src/main/webapp/mobile/app/login.html

@@ -26,23 +26,23 @@
26 26
         </div>
27 27
         <div class="num_area">
28 28
           <div class="input_area">
29
-            <input type="text" name="bsnsRegNo" id="ITP_FORM_LOGIN_BSNS_REG_NO" required>
29
+            <input type="text" name="bsnsRegNo" id="ITP_FORM_LOGIN_BSNS_REG_NO">
30 30
             <label for="ITP_FORM_LOGIN_BSNS_REG_NO">사업자번호</label>
31 31
             <button type="button" id="ITP_BTN_LOGIN_BSNS_REG_NO">연결</button>
32 32
           </div>
33 33
           <div class="brand_list">
34
-            <select name="brandId" id="ITP_FORM_LOGIN_BRAND_ID">
34
+            <select name="brandId" id="ITP_FORM_LOGIN_BRAND_ID" required>
35 35
               <option value="">선택</option>
36 36
             </select>
37 37
           </div>
38 38
         </div>
39 39
         <div class="login_page">
40 40
           <div class="input_area">
41
-            <input type="text" id="ITP_FORM_LOGIN_USER_ID"  required>
41
+            <input type="text" id="ITP_FORM_LOGIN_USER_ID" required>
42 42
             <label for="ITP_FORM_LOGIN_USER_ID">아이디</label>
43 43
           </div>
44 44
           <div class="input_area">
45
-            <input type="password" id="ITP_FORM_LOGIN_USER_PW"  required>
45
+            <input type="password" id="ITP_FORM_LOGIN_USER_PW" required>
46 46
             <label for="ITP_FORM_LOGIN_USER_PW">비밀번호</label>
47 47
           </div>
48 48
         </div>

+ 46 - 91
src/main/webapp/mobile/app/main.html

@@ -5,45 +5,31 @@
5 5
 	<meta http-equiv="X-UA-Compatible" content="IE=edge">
6 6
 	<meta name="viewport" content="width=device-width, initial-scale=1.0">
7 7
 	<title>모바일 수발주</title>
8
-	<link rel="stylesheet" href="../css/style.css">
9
-	<style>
8
+	<link rel="stylesheet" href="../css/style.css?2011221">
10 9
 
11
-		/* ITP_SIDEBAR */
12
-		#ITP_SIDEBAR {width:0px; float:left; margin-left:-2px; height:calc(100vh - 68px); background:#ddd; transition:all .25s ease; border-style:solid; border-color:#ddd; border-width:0 1px 1px 1px;}
13
-		#ITP_SIDEBAR.itp_open_nav {width:360px;}
14
-		#ITP_SIDEBAR .itp_nav {list-style:none; margin:0; padding:0; height:100%; overflow-y:scroll; overflow-x:hidden; visibility:hidden;}
15
-		#ITP_SIDEBAR.itp_open_nav .itp_nav {visibility:visible;}
16
-		#ITP_SIDEBAR .itp_nav.panel-group .panel+.panel {margin-top:0;}
17
-		#ITP_SIDEBAR .itp_nav .panel-heading {padding:0;}
18
-		#ITP_SIDEBAR .itp_nav .panel-title {line-height:1.1; border-bottom:1px solid #ddd;}
19
-		#ITP_SIDEBAR .itp_nav .panel-title a {font-size:14px; display:block; padding:13px 15px; color:#333;}
20
-		#ITP_SIDEBAR .itp_nav .panel-title a .glyphicon {font-size:12px;}
21
-		#ITP_SIDEBAR .itp_nav .panel-default {margin-bottom:0; border:none;}
22
-		#ITP_SIDEBAR .itp_nav * {border-radius:0; border-width:1px 0 1px 0;}
23
-		#ITP_SIDEBAR .itp_nav .itp_svgs_body {padding:0; border-top:0; border-bottom:1px solid #ddd;}
24
-		#ITP_SIDEBAR .itp_nav .itp_svgs {list-style:none; margin:0; padding:0;}
25
-		#ITP_SIDEBAR .itp_nav .itp_svgs .itp_svg_in {position:relative;}
26
-		#ITP_SIDEBAR .itp_nav .itp_svgs li a {display:block; width:100%; color:#333; padding:5px 10px 5px 17px;}
27
-		#ITP_SIDEBAR .itp_nav .itp_svgs li:first-child a {padding-top:10px;}
28
-		#ITP_SIDEBAR .itp_nav .itp_svgs li:last-child a {padding-bottom:10px;}
29
-		#ITP_SIDEBAR .itp_nav .itp_svgs li a:hover, #ITP_SIDEBAR .itp_nav .itp_svgs li a:active {color:#000; font-weight:bold;}
30
-		#ITP_SIDEBAR .itp_nav .itp_svgs li a .glyphicon {font-size:9px; float:left; margin:4px 6px 0 0;}
31
-		#ITP_SIDEBAR .itp_nav .itp_svgs li a .itp_icon {font-size:9px; float:left; margin:4px 6px 0 15px;}
32
-		#ITP_SIDEBAR .itp_nav .itp_svgs li a .itp_icon_5 {font-size:9px; float:left; margin:4px 6px 0 25px;}
33
-		#ITP_SIDEBAR .itp_nav .itp_svgs li a .itp_tt {float:left;}
10
+	<script>
11
+		const ITP_SYSTEM_ADMIN_YN = 'Y';
12
+		const VIEW_PAGE = 'MAIN'; //config.js 에서 로그인 페이지 인지 아닌지 확인하기 위한 변수
34 13
 
35
-	</style>
14
+		var CONN_KEY; //Jwt 토큰을 담기위한 변수
15
+		var CODE_LIST; //코드리스트를 담기위한 변수
16
+		var AUTH_MENU_LIST; //메뉴리스트를 담기위한 변수
17
+		var ACT_LIST; //액션리스트를 담기위한 변수
18
+	</script>
19
+
20
+	<script src="../js/properties.js"></script>
21
+	<script src="../../js/require.min.js" data-main="../js/config.js"></script>
36 22
 </head>
37 23
 	<body>
38 24
 		<div id="ITP_WRAPPER">
39 25
 			<header>
40 26
 				<div class="header_wrap">
41 27
 					<div class="menu_logo">
42
-						<button id="ITP_BTN_MENU"><img src="../img/menu.png" alt=""></button>
43
-						<button id="ITP_BTN_HOME"><img src="../img/home.png" alt=""></button>
28
+						<button id="ITP_MOBILE_BTN_MENU"><img src="../img/menu.png" alt=""></button>
29
+						<button id="ITP_MOBILE_BTN_HOME"><img src="../img/home.png" alt=""></button>
44 30
 					</div>
45 31
 					<div class="logout">
46
-						<button id="ITP_BTN_LOGOUT">로그<br>아웃</button>
32
+						<button id="ITP_MOBILE_BTN_LOGOUT">로그<br>아웃</button>
47 33
 					</div>
48 34
 					<div class="name_info">
49 35
 						<label>
@@ -59,59 +45,6 @@
59 45
 				</div>
60 46
 			</header>
61 47
 
62
-			<!--<nav id="ITP_SIDEBAR" class="itp_open_nav">
63
-
64
-				<ul class="panel-group itp_nav"></ul>
65
-
66
-				<textarea id="ITP_AJAX_MAIN_SIDE_LEVEL2_ROWCOPY" rows="0" cols="0" style="display:none;">
67
-				<li class="panel panel-default">
68
-					<div class="panel-heading">
69
-						<div class="panel-title">
70
-							<a class="accordion-toggle" data-toggle="collapse" href="">
71
-								<span class="fnMenuNm">메뉴명</span>
72
-								<i class="indicator glyphicon glyphicon-chevron-down pull-right"></i>
73
-							</a>
74
-						</div>
75
-					</div>
76
-					<div class="panel-collapse collapse" id="">
77
-						<div class="panel-body itp_svgs_body">
78
-							<ul class="itp_svgs fnLevelBottomList"></ul>
79
-						</div>
80
-					</div>
81
-				</li>
82
-				</textarea>
83
-				<textarea id="ITP_AJAX_MAIN_SIDE_LEVEL3_ROWCOPY" rows="0" cols="0" style="display:none;">
84
-				<li>
85
-					<div class="itp_svg_in">
86
-						<a href="javascript:void(0)" data-itp-nav-id="" data-conn-url="" id="" class="itp_nav_link fix">
87
-							<i class="glyphicon glyphicon-chevron-right"></i>
88
-							<span class="itp_tt fnMenuNm">메뉴명</span>
89
-						</a>
90
-					</div>
91
-				</li>
92
-				</textarea>
93
-				<textarea id="ITP_AJAX_MAIN_SIDE_LEVEL4_ROWCOPY" rows="0" cols="0" style="display:none;">
94
-				<li>
95
-					<div class="itp_svg_in">
96
-						<a href="javascript:void(0)" data-itp-nav-id="" data-conn-url="" id="" class="itp_nav_link fix">
97
-							<i class="itp_icon">└</i>
98
-							<span class="itp_tt fnMenuNm">메뉴명</span>
99
-						</a>
100
-					</div>
101
-				</li>
102
-				</textarea>
103
-				<textarea id="ITP_AJAX_MAIN_SIDE_LEVEL5_ROWCOPY" rows="0" cols="0" style="display:none;">
104
-				<li>
105
-					<div class="itp_svg_in">
106
-						<a href="javascript:void(0)" data-itp-nav-id="" data-conn-url="" id="" class="itp_nav_link fix">
107
-							<i class="itp_icon_5">*</i>
108
-							<span class="itp_tt fnMenuNm">메뉴명</span>
109
-						</a>
110
-					</div>
111
-				</li>
112
-				</textarea>
113
-			</nav>-->
114
-
115 48
 			<div id="ITP_MENU" style="display: none;">
116 49
 				<div class="menu_area">
117 50
 					<button class="ITP_BTN_CLOSE"><img src="../img/close2.png"></button>
@@ -127,16 +60,16 @@
127 60
 							<div id="ITP_LOGIN_USER_ID" class="id">asdf1234</div>
128 61
 						</div>
129 62
 						<div class="setting">
130
-							<button><img src="../img/gear.png"></button>
63
+							<button id="ITP_MOBILE_BTN_SETTING"><img src="../img/gear.png"></button>
131 64
 						</div>
132 65
 					</div>
133
-					<div class="menu_select">
66
+					<div id="ITP_SIDEBAR" class="menu_select" style="overflow:auto;">
134 67
 						<ul class="panel-group itp_nav"></ul>
135 68
 						<ul>
136 69
 							<textarea id="ITP_AJAX_MAIN_SLIDE_LEVEL2_ROWCOPY" rows="0" cols="0" style="display:none;">
137 70
 							<li class="panel_list">
138
-								<div class="panel_heading">
139
-									<span class="fnMenuNm"></span>
71
+								<div class="panel_heading accordion-toggle">
72
+									<span data-toggle="collapse" href="" class="fnMenuNm"></span>
140 73
 								</div>
141 74
 								<div class="panel_body">
142 75
 									<ul class="fnLevelBottomList"></ul>
@@ -145,13 +78,13 @@
145 78
 							</textarea>
146 79
 							<textarea id="ITP_AJAX_MAIN_SLIDE_LEVEL3_ROWCOPY" rows="0" cols="0" style="display:none;">
147 80
 								<li>
148
-									<div class="itp_svg_in">
81
+									<div data-itp-nav-id="" data-conn-url="" id="" class="itp_svg_in itp_nav_link fix">
149 82
 										<i><img src="../img/arrow_right.png"></i>
150 83
 										<span class="fnMenuNm"></span>
151 84
 									</div>
152 85
 								</li>
153 86
 							</textarea>
154
-							<li class="panel_list">
87
+							<!--<li class="panel_list">
155 88
 								<div class="panel_heading">
156 89
 									<span class="fnMenuNm">발주관리</span>
157 90
 								</div>
@@ -232,7 +165,7 @@
232 165
 								<div class="panel_heading">
233 166
 									<span class="fnMenuNm">재고관리</span>
234 167
 								</div>
235
-							</li>
168
+							</li>-->
236 169
 							<li class="panel_list">
237 170
 								<div class="panel_heading">
238 171
 									<span class="fnMenuNm">버전</span>
@@ -244,8 +177,30 @@
244 177
 					</div>
245 178
 				</div>
246 179
 			</div>
247
-			<div id="ITP_CONTAINER">
248
-
180
+			<div id="ITP_CONTAINER" class="fix">
181
+				<div class="detail_content">
182
+					dsfgdfgfgdgdfss</br>
183
+					fdsgsdf</br>
184
+					sdfg</br>
185
+					sdfgd</br>
186
+					sfg</br>
187
+					sdfg</br>
188
+					dsfg</br>
189
+					sdfg</br>
190
+					fdsg</br>
191
+					sfdg</br>
192
+					fdsgdsfg</br>
193
+					sdfg</br>
194
+					sfd</br>
195
+					gd</br>
196
+					sfg</br>
197
+					dsfg
198
+					dsfg
199
+					dsfg
200
+					sdfg
201
+					d
202
+					sf
203
+				</div>
249 204
 			</div>
250 205
 			<script src="../js/app/main.js?version=20210826"></script>
251 206
 		</div>

+ 1 - 1
src/main/webapp/mobile/css/style.css

@@ -1,7 +1,7 @@
1 1
 @font-face { font-family: 'NanumBarunGothic';src: url('../fonts/NanumBarunGothic.eot');src: url('../fonts/NanumBarunGothic.eot') format('embedded-opentype'),url('../fonts/NanumBarunGothic.woff') format('woff');}
2 2
 * {margin: 0; padding: 0; box-sizing: border-box; text-align: center; font-family: 'NanumBarunGothic', 'serif'; list-style: none;}
3 3
 section {}
4
-body{background: #fff; position: relative; width: 100%; height: 500px;}
4
+body{background: #fff; position: relative; width: 100%; height: auto;}
5 5
 /* 팝업 */
6 6
 section .popup { position: fixed; width: 100%; height: 100%; background: transparent; z-index: 11;}
7 7
 section .popup .pop { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 70%; height: 550px; padding-top: 80px; background: #fff; border: 2px solid #000; border-top-left-radius: 20px; border-top-right-radius: 20px;}

+ 0 - 19
src/main/webapp/mobile/js/app/login.js

@@ -23,14 +23,6 @@ require(['config'], function() {
23 23
 				itp_fn_login_proc();
24 24
 			}
25 25
 		});
26
-
27
-		// var callbackFn = function(result) {
28
-		// 	POP_LIST = result.popList;
29
-		// 	fn_proc_popup_view('L');
30
-		// };
31
-		// const key = {sViewTargetCd: 'L'};
32
-		// var param = $.param(key);
33
-		// fn_ajax_call('/api/pop/open-pop', param, callbackFn, 'GET');
34 26
 	});
35 27
 });
36 28
 
@@ -89,10 +81,7 @@ function itp_fn_login_proc() {
89 81
 		var hashed = fnHashed(result.hashed);
90 82
 		$('#userId').val(CryptoJS.AES.encrypt($('#ITP_FORM_LOGIN_USER_ID').val(), hashed));
91 83
 		$('#password').val(CryptoJS.AES.encrypt($('#ITP_FORM_LOGIN_USER_PW').val(), hashed));
92
-		// $('#brandId').val(CryptoJS.AES.encrypt($('#ITP_FORM_LOGIN_BRAND_ID').val(), hashed));
93
-		console.log('USER_ID ===> ' + CryptoJS.AES.encrypt($('#ITP_FORM_LOGIN_USER_ID').val(), hashed));
94 84
 	    var loginFn = function(result) {
95
-			alert('SIGN-IN RESULT : ' + JSON.stringify(result));
96 85
 			sessionStorage.setItem('itp_login_info', JSON.stringify({
97 86
 				timestamp: new Date(),
98 87
 		        connKey: result.connKey		// Jwt키를 가져와서 세션 스토리지에 저장
@@ -100,15 +89,7 @@ function itp_fn_login_proc() {
100 89
 	    	$(location).attr('href', MOBILE_CONTEXTPATH + '/app/main.html');
101 90
 		};
102 91
 		var params = $('#ITP_FORM_MOBILE_LOGIN').serializeObject();
103
-		console.log(JSON.stringify(params));
104 92
 		fn_ajax_call('/api/member/sign-in-app', JSON.stringify(params), loginFn, 'POST'); //암호화 해서 보내는 경우 먼저 해시키를 가져와서 암호화해서 보낸다
105 93
 	};
106 94
 	fn_ajax_call('/api/session/hashed', null, callbackFn, 'GET'); //Crypto 암호화를 위한 해쉬키.. 로그인 후에는 Jwt 포함인 /api/session/hashedKey 이걸로 호출해서 사용한다.
107
-	
108
-	// 공통코드 저장 테스트
109
-	// let map = new Map();
110
-	// map.set('useYn', JSON.stringify([{'codeDtlCd':'Y','codeDtlNm':'사용'},{'codeDtlCd':'N','codeDtlNm':'미사용'}]));
111
-	// sessionStorage.itp_common_code = JSON.stringify(Array.from(map.entries()));
112
-	
113
-	// $(location).attr('href', ITP_CONTEXTPATH + '/main.html');	
114 95
 }

+ 3 - 201
src/main/webapp/mobile/js/app/main.js

@@ -1,212 +1,14 @@
1
-
2
-const MAIN_NOTICE_GRID_ID = '#ITP_MAIN_NOTICE_jqGrid';
3
-const MAIN_NOTICE_GRID_LIST = '#ITP_MAIN_NOTICE_jqGrid_list';
4
-const MAIN_NOTICE_GRID_PAGER = '#ITP_MAIN_NOTICE_jqGridPager';
5
-const MAIN_NOTICE_GRID_EMPTY = '#ITP_MAIN_NOTICE_jqGridEmpty';
6
-
7
-let NTICE_DETAIL_GRID_LIST = '/api/ntice/detail-grid-list';
8
-
9 1
 require(['config'], function() {
10 2
 	require([
3
+		'jquery'
11 4
 	], function($) {
12
-		
13
-		setTimeout(function() {
14
-			// // 시간지정
15
-			// $('#ITP_FORM_MAIN_NOTICE_SEARCH_SCH_DT').val(itp_fn_date_format(new Date(), 2));
16
-			// $('#ITP_FORM_MAIN_NOTICE_SEARCH_USER_ID').val(USER_ID);
17
-			//
18
-			// // 그리드
19
-			// itp_fn_jqgrid_resize(MAIN_NOTICE_GRID_ID, MAIN_NOTICE_GRID_LIST, 'lg');
20
-			// itp_fn_MAIN_NOTICE_grid.init();
21
-	    	// itp_fn_fire_window_resize();
22
-			//
23
-			// // 조회
24
-	    	// itp_fn_MAIN_NOTICE_search();
25
-			//
26
-	    	// // Barcode
27
-			// itp_fn_barcode.init();
28 5
 
29
-			$('#ITP_BTN_MENU').on('click', function() {
30
-				console.log('aaaaaaaaaaaaaa');
31
-				// $('#ITP_MENU').toggle();
32
-				$('#ITP_MENU').toggleClass('itp_open_nav');
33
-				// $('#ITP_CONTAINER').toggleClass('itp_open_conts');
34
-				itp_fn_fire_window_resize();
35
-			});
6
+		setTimeout(function() {
36 7
 		}, 100);
37
-				
8
+
38 9
 	});
39 10
 });
40 11
 
41
-var itp_fn_mobile_MAIN_MENU = {
42
-	init: function() {
43
-		this.topMenuMake();
44
-		this.button();
45
-	},
46
-	button: function() {
47
-		var _this = this;
48
-		$(document).on('click', '.manage_btn_bar button', function() {
49
-			$('#ITP_CONTAINER').empty();
50
-			_this.subMenuMake($(this).data('top-menu'));
51
-		});
52
-		$(document).on('click', '#ITP_CONTAINER button', function() {
53
-			console.log('===> ' + $(this).data('sub-menu'));
54
-		});
55
-	},
56
-	topMenuMake: function() {
57
-		var _this = this;
58
-		var topMenuCnt = 0;
59
-		$.each(AUTH_MENU_LIST, function(key, value) {
60
-			if(value.topMenuNo === 200) {
61
-				topMenuCnt++;
62
-			}
63
-		});
64
-		console.log(topMenuCnt);
65
-		$.each(AUTH_MENU_LIST, function(key, value) {
66
-			if(value.topMenuNo === 200) {
67
-				var menuDIV = 	'<div class="manage col_' + topMenuCnt + '">' +
68
-								'	<button data-top-menu="' + value.menuNo + '">' + value.menuNm + '</button>' +
69
-								'</div>';
70
-				$('.manage_btn_bar').append(menuDIV);
71
-				if(key === 0) {
72
-					_this.subMenuMake(value.menuNo);
73
-				}
74
-			}
75
-		});
76
-	},
77
-	subMenuMake: function(topMenuNo) {
78
-		var seq = 0;
79
-		var pos = 'icon_left';
80
-		var menuDIV = '<div class="wicon">\n';
81
-		$.each(AUTH_MENU_LIST, function(key, value) {
82
-			if(value.topMenuNo === topMenuNo) {
83
-				if(seq > 0 && seq % 2 === 0) {
84
-					menuDIV += '</div>\n';
85
-					menuDIV += '<div class="wicon">\n';
86
-					pos = 'icon_left';
87
-				}
88
-				menuDIV += 	'	<div class="' + pos + '">\n' +
89
-							'		<button data-sub-menu="' + value.menuNo + '">\n' +
90
-							'			<label>ICON<br>' + value.menuNm + '</label>\n' +
91
-							'		</button>\n' +
92
-							'	</div>\n';
93
-				seq++;
94
-				pos = 'icon_right';
95
-			}
96
-		});
97
-		menuDIV += '</div>';
98
-		$('#ITP_CONTAINER').append(menuDIV);
99
-	}
100
-};
101
-
102
-var itp_fn_MAIN_NOTICE_grid = {
103
-	init: function() {
104
-		// 데이터 없을때
105
-		itp_fn_MAIN_NOTICE_empty.push();
106
-		$(MAIN_NOTICE_GRID_EMPTY).on('click', function() {
107
-			itp_fn_MAIN_NOTICE_empty.back();
108
-			itp_MAIN_NOTICE_param.gridSize = $.jgrid.defaults.rowNum;
109
-			$(MAIN_NOTICE_GRID_ID).setGridParam({'postData': JSON.stringify(itp_MAIN_NOTICE_param)}).trigger('reloadGrid');
110
-		});
111
-	},
112
-	callBack: function() {
113
-		let param = $('#ITP_FORM_MAIN_NOTICE_SEARCH').serializeObject();
114
-		param.gridSize = $.jgrid.defaults.rowNum;
115
-		$(MAIN_NOTICE_GRID_ID).jqGrid({
116
-			colModel: [
117
-				{
118
-					index: 'NTICE_NO', name: 'nticeNo',
119
-					label: ITP_MSG_LOCALE.label.notiNo, //공지번호
120
-					width: '10', fixed: false, align: 'center',
121
-					sortable: false, hidden: false
122
-				},
123
-				{
124
-					index: 'NTICE_TITL', name: 'nticeTitl',
125
-					label: '공지사항', //공지제목
126
-					width: '15', fixed: false, align: 'center',
127
-					sortable: false, hidden: false
128
-				},
129
-				{
130
-					index: 'ADD_DT', name: 'addDt',
131
-					label: ITP_MSG_LOCALE.label.regDt, //등록일
132
-					width: '10', fixed: false, align: 'center',
133
-					sortable: false, hidden: false
134
-				}
135
-			],
136
-			loadBeforeSend: function(jqXHR) {
137
-			    jqXHR.setRequestHeader('X-AUTH-TOKEN', CONN_KEY);
138
-			},
139
-			postData: JSON.stringify(param),
140
-			url: DOMAIN + NTICE_DETAIL_GRID_LIST,
141
-			pager: MAIN_NOTICE_GRID_PAGER,
142
-			multiselect: false,
143
-			rownumbers: true,
144
-			onCellSelect: function(rowId, cellIdx, cellValue) {
145
-				var cm = $(this).jqGrid('getGridParam', 'colModel');
146
-				var colNm = cm[cellIdx].name;
147
-				if (colNm == 'nticeTitl') {
148
-					const nticeNoVal = $(this).jqGrid('getCell', rowId, 'nticeNo');
149
-					const key = {nticeNo: nticeNoVal, viewCd: 'R'};
150
-					var param = $.param(key);
151
-					// itp_fn_MAIN_NOTICE_view(param);
152
-					
153
-					fn_call_popup('comm', 'NOTICE_INFO_POPUP', '#ITP_ASIDE', function() {
154
-												
155
-					}, param, 'S');
156
-					$('#ITP_NOTICE_INFO_POPUP > div.modal-dialog').width('500px');
157
-				}
158
-		   	},
159
-			loadComplete: function(data) {
160
-				//console.log(JSON.stringify(data));
161
-				itp_fn_grid_load_complete(data, MAIN_NOTICE_GRID_ID, true, 'number', 'MAIN_NOTICE', itp_MAIN_NOTICE_search, itp_fn_MAIN_NOTICE_empty, false, data.gridRecords, false);
162
-				var ids = $(MAIN_NOTICE_GRID_ID).getDataIDs();
163
-				$.each(ids, function(idx, rowId) {
164
-					$(MAIN_NOTICE_GRID_ID).jqGrid('setCell', rowId, 'nticeTitl', '', ITP_GRID_COL_STYLE.link);
165
-				});
166
-
167
-				if ($('#ITP_CONTAINER').data('openYn') == 'Y') {
168
-					$('#ITP_CONTAINER').data('openYn', 'N');
169
-					const keyNew = {nticeNo: $('#ITP_CONTAINER').data('nticeNo'), viewCd: 'R'};
170
-					var paramNew = $.param(keyNew);
171
-					itp_fn_MAIN_NOTICE_view(paramNew);
172
-				}
173
-		    },
174
-		    loadError: function(jqXHR, textStatus, errorThrown) {
175
-		    	itp_fn_grid_load_error(jqXHR, textStatus, errorThrown);
176
-		    },
177
-		    onPaging: function(action) {
178
-		    	itp_fn_grid_paging(MAIN_NOTICE_GRID_ID, action, param);
179
-		    }
180
-		}).navGrid(MAIN_NOTICE_GRID_PAGER, ITP_GRID_NAV_DEFAULTS.navGrid);
181
-	},
182
-	clearData : function() {
183
-		$(MAIN_NOTICE_GRID_ID).jqGrid('clearGridData', true);
184
-		$(MAIN_NOTICE_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
185
-		$(MAIN_NOTICE_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
186
-		$(MAIN_NOTICE_GRID_EMPTY).show();
187
-	},
188
-	unload : function() {
189
-		$.jgrid.gridUnload(MAIN_NOTICE_GRID_ID);
190
-	}
191
-};
192
-
193
-var itp_fn_MAIN_NOTICE_search = function() {
194
-	itp_fn_MAIN_NOTICE_grid.unload();
195
-	itp_fn_MAIN_NOTICE_grid.callBack();
196
-};
197
-
198
-let itp_MAIN_NOTICE_param = {};
199
-let itp_MAIN_NOTICE_search = false;
200
-var itp_fn_MAIN_NOTICE_empty = {
201
-	push: function() {		
202
-		let param = $('#ITP_FORM_MAIN_NOTICE_SEARCH').serializeObject();
203
-		itp_MAIN_NOTICE_param = param;
204
-	},
205
-	back: function() {
206
-		
207
-	}
208
-};
209
-
210 12
 var itp_fn_barcode = {
211 13
 	init: function () {
212 14
 		this.event();

+ 250 - 23
src/main/webapp/mobile/js/config.js

@@ -137,12 +137,40 @@ require([
137 137
 			// 왼쪽 메뉴 만들기
138 138
 			fn_make_slide_menu.init();
139 139
 		};
140
-		fn_ajax_call('/api/session/data', null, callbackFn, 'GET');
141
-		// fn_ajax_call('/api/session/data-app', null, callbackFn, 'GET');
140
+		fn_ajax_call('/api/session/data-app', null, callbackFn, 'GET');
142 141
 	}
143 142
 
144 143
 });
145 144
 
145
+var itp_fn_logined_check = function(user_nm_update, fn) {
146
+	var now, expiration, data = false;
147
+	data = sessionStorage.getItem('itp_login_info');
148
+	if(data) {
149
+		data = JSON.parse(data);
150
+		now = new Date();
151
+		expiration = new Date(data.timestamp);
152
+		expiration.setMinutes(expiration.getMinutes() + 60);
153
+
154
+		if (now.getTime() > expiration.getTime()) {
155
+			data = false;
156
+			fnSessionOut();
157
+		} else {
158
+			sessionStorage.setItem('itp_login_info', JSON.stringify({
159
+				timestamp: new Date(),
160
+				connKey: data.connKey		//Jwt키를 가져와서 세션 스토리지에 저장
161
+			}));
162
+			if(user_nm_update && user_nm_update == true) {
163
+				if (fn !== undefined || typeof fn !== 'undefined') {
164
+					fn();
165
+				}
166
+			}
167
+		}
168
+	} else {
169
+		// 로그인 페이지로 이동
170
+		$(location).attr('href', MOBILE_CONTEXTPATH + '/app/login.html');
171
+	}
172
+};
173
+
146 174
 var fn_make_user_info = {
147 175
 	init : function() {
148 176
 		this.set();
@@ -187,36 +215,80 @@ var fn_make_slide_menu = {
187 215
 		this.make();
188 216
 	},
189 217
 	make: function() {
218
+		var selector = '.menu_select .panel-group > .panel_list:last';
190 219
 		$.each(AUTH_MENU_LIST, function(key, value) {
191
-			var selector = '.menu_select .panel-group > .panel-list:last';
192
-			if(value.level == 2) { // LEVEL2
220
+			if(value.level === 2) { // LEVEL2
193 221
 				$('.menu_select .panel-group').append($('#ITP_AJAX_MAIN_SLIDE_LEVEL2_ROWCOPY').val());
194 222
 				$(selector).find('.fnMenuNm').text(value.menuNm);
195 223
 				$(selector).find('.accordion-toggle').attr('href', '#ITP_NAV_'+value.menuNo);
196 224
 				$(selector).find('.panel-collapse').attr('id', 'ITP_NAV_'+value.menuNo);
197
-				// $(selector).find('.fnLevelBottomList').empty();
198
-				// $('.menu_select .panel-group').append($('#ITP_AJAX_MAIN_SIDE_LEVEL2_ROWCOPY').val());
199
-				// $('.menu_select .panel-group > .panel-default:last').find('.fnMenuNm').text(value.menuNm);
200
-				// $('.menu_select .panel-group > .panel-default:last').find('.accordion-toggle').attr('href', '#ITP_NAV_'+value.menuNo);
201
-				// $('.menu_select .panel-group > .panel-default:last').find('.panel-collapse').attr('id', 'ITP_NAV_'+value.menuNo);
202
-				// $('.menu_select .panel-group > .panel-default:last').find('.fnLevelBottomList').empty();
203
-			} else if(value.level == 3) { // LEVEL3
204
-				// $(selector).find('.fnLevelBottomList').append($('#ITP_AJAX_MAIN_SLIDE_LEVEL3_ROWCOPY').val());
205
-				// $(selector + ' .fnLevelBottomList .itp_svg_in:last').find('.fnMenuNm').text(value.menuNm);
206
-
207
-
208
-
209
-				// $('.menu_select .panel-group > .panel-default:last').find('.fnLevelBottomList').append($('#ITP_AJAX_MAIN_SIDE_LEVEL3_ROWCOPY').val());
210
-				// $('.menu_select .panel-group > .panel-default:last .fnLevelBottomList .itp_svg_in:last').find('.fnMenuNm').text(value.menuNm);
211
-				// $('.menu_select .panel-group > .panel-default:last .fnLevelBottomList .itp_svg_in:last').find('.itp_nav_link').attr('data-itp-nav-id', value.menuId);
212
-				// $('.menu_select .panel-group > .panel-default:last .fnLevelBottomList .itp_svg_in:last').find('.itp_nav_link').attr('data-conn-url', value.connUrl);
213
-				// $('.menu_select .panel-group > .panel-default:last .fnLevelBottomList .itp_svg_in:last').find('.itp_nav_link').attr('data-open-cd', value.openCd);
214
-				// $('.menu_select .panel-group > .panel-default:last .fnLevelBottomList .itp_svg_in:last').find('.itp_nav_link').attr('id', value.menuId + '_PAGE_NO');
225
+				$(selector).find('.fnLevelBottomList').empty();
226
+			} else if(value.level === 3) { // LEVEL3
227
+				$(selector).find('.fnLevelBottomList').append($('#ITP_AJAX_MAIN_SLIDE_LEVEL3_ROWCOPY').val());
228
+				$(selector + ' .fnLevelBottomList .itp_svg_in:last').find('.fnMenuNm').text(value.menuNm);
229
+				$(selector + ' .fnLevelBottomList .itp_svg_in:last').attr('data-itp-nav-id', value.menuId);
230
+				$(selector + ' .fnLevelBottomList .itp_svg_in:last').attr('data-conn-url', value.connUrl);
231
+				$(selector + ' .fnLevelBottomList .itp_svg_in:last').attr('data-open-cd', value.openCd);
232
+				$(selector + ' .fnLevelBottomList .itp_svg_in:last').attr('id', value.menuId + '_PAGE_NO');
233
+				// $(selector + ' .fnLevelBottomList .itp_svg_in:last').find('.itp_nav_link').attr('data-itp-nav-id', value.menuId);
234
+				// $(selector + ' .fnLevelBottomList .itp_svg_in:last').find('.itp_nav_link').attr('data-conn-url', value.connUrl);
235
+				// $(selector + ' .fnLevelBottomList .itp_svg_in:last').find('.itp_nav_link').attr('data-open-cd', value.openCd);
236
+				// $(selector + ' .fnLevelBottomList .itp_svg_in:last').find('.itp_nav_link').attr('id', value.menuId + '_PAGE_NO');
215 237
 			}
216 238
 		});
239
+		this.action();
217 240
 	},
218 241
 	action: function() {
219
-
242
+		var _this = this;
243
+		$('#ITP_SIDEBAR .accordion-toggle').off('click').on('click', function() {
244
+			console.log('accordion-toggle');
245
+		});
246
+		$('#ITP_SIDEBAR .itp_nav_link').off('click').on('click', function() {
247
+			const id = $(this).attr('data-itp-nav-id');
248
+			const connUrl = $(this).attr('data-conn-url');
249
+			const openCd = $(this).attr('data-open-cd');
250
+			console.log('id ===> ' + id);
251
+			console.log('connUrl ===> ' + connUrl);
252
+			console.log('openCd ===> ' + openCd);
253
+
254
+			if(openCd === 'C') {
255
+				const href = MOBILE_CONTEXTPATH + connUrl;
256
+				_this.loadPage(id, href);
257
+			}
258
+		});
259
+	},
260
+	loadPage: function(id, href, param) {
261
+		//로그인체크
262
+		itp_fn_logined_check();
263
+
264
+		$.ajax({
265
+			contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
266
+			url: href,
267
+			data: param,
268
+			type: 'POST',
269
+			dataType: 'html',
270
+			async: false,
271
+			timeout: 10000,
272
+			beforeSend: function() {
273
+			},
274
+			complete: function() {
275
+			},
276
+			success: function(html) {
277
+				console.log(html);
278
+				$('#ITP_CONTAINER .contents').empty().append(html);
279
+				//JS파일적용
280
+				const js = "<script src=\"../js/app/"+id.substring(0, id.length - 5).toLowerCase()+"/ITP_"+id+".js?version="+js_version+"\"></script>";
281
+				$('#ITP_CONTAINER #ITP_TAB_'+id+' #ITP_TAP_JS').append(js);
282
+				$('#ITP_MENU').toggle();
283
+			},
284
+			error: function(xhr, status, error) {
285
+				if (xhr.status == 401) location.href = MOBILE_CONTEXTPATH + '/app/';
286
+				itp_fn_modal_alert_ajax(ITP_MSG_LOCALE.message.ajax.failPage);
287
+			},
288
+			fail: function() {
289
+				itp_fn_modal_alert_ajax(ITP_MSG_LOCALE.message.ajax.failPage);
290
+			}
291
+		});
220 292
 	}
221 293
 };
222 294
 
@@ -436,3 +508,158 @@ function itp_fn_date_format(date, type) {
436 508
 		return date.getFullYear() + month + day + hour + minute + second;
437 509
 	}
438 510
 }
511
+
512
+let itp_fn_form_validate = function(form, element, arry, msg, type) {
513
+	var error = function(txt) {
514
+		if (type != 'ONLYCHK') {
515
+			if (msg == undefined || typeof msg == 'undefined') {
516
+				msg = txt;
517
+			}
518
+
519
+			$(element).closest('.itp_ip').addClass('has-error');
520
+			var error_msg = $('<span class="help-block">' + msg + '</span>');
521
+			if($(element).parent('.input-group').length) {
522
+				error_msg.insertAfter($(element).parent());
523
+			} else {
524
+				error_msg.insertAfter($(element));
525
+			}
526
+		}
527
+	};
528
+
529
+	if ($.inArray('empty', arry) > -1) {
530
+		if ($(element).val() == '' || $(element).val() < 1) {
531
+			error(ITP_MSG_LOCALE.message.form.mandatory);
532
+			return false;
533
+		}
534
+	}
535
+
536
+	if ($.inArray('emptyNum', arry) > -1) {
537
+		if ($(element).val() == '' || $(element).val() < 0) {
538
+			error(ITP_MSG_LOCALE.message.form.mandatory);
539
+			return false;
540
+		}
541
+	}
542
+
543
+	if ($.inArray('number', arry) > -1) {
544
+		const regExp = /^[0-9]+$/;
545
+		if (!regExp.test($(element).val())) {
546
+			error(ITP_MSG_LOCALE.message.form.onlynumber);
547
+			return false;
548
+		}
549
+	}
550
+
551
+	if ($.inArray('float', arry) > -1) {
552
+		if($(element).val() == '') return true;
553
+		const regExp = /^\d+.?\d?\d?\d?$/;
554
+		if (!regExp.test($(element).val())) {
555
+			error(ITP_MSG_LOCALE.message.form.onlynumber);
556
+			return false;
557
+		}
558
+	}
559
+
560
+	if ($.inArray('tel', arry) > -1) {
561
+		const regExp = /^\d{2,3}-\d{3,4}-\d{4}$/;
562
+		if (!regExp.test($(element).val())) {
563
+			error(ITP_MSG_LOCALE.message.form.wrongtelnumber);
564
+			return false;
565
+		}
566
+	}
567
+
568
+	if ($.inArray('email', arry) > -1) {
569
+		const regExp = /^[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*\.[a-zA-Z]{2,3}$/i;
570
+		if (!regExp.test($(element).val())) {
571
+			error(ITP_MSG_LOCALE.message.form.wrongemail);
572
+			return false;
573
+		}
574
+	}
575
+
576
+	if ($.inArray('id', arry) > -1) {
577
+		const regExp = /^[a-z]+[a-z0-9]{4,11}$/g;
578
+		if (!regExp.test($(element).val())) {
579
+			error(ITP_MSG_LOCALE.message.form.wronguserid);
580
+			return false;
581
+		}
582
+	}
583
+
584
+	if ($.inArray('id2', arry) > -1) {
585
+		const regExp = /^[A-Za-z0-9+]*$/;
586
+		if (!regExp.test($(element).val())) {
587
+			error(ITP_MSG_LOCALE.message.form.wronguserid2);
588
+			return false;
589
+		}
590
+	}
591
+
592
+	if ($.inArray('password', arry) > -1) {
593
+		const regExp = /^(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9])(?=.*[0-9]).{8,16}$/;
594
+		if (!regExp.test($(element).val())) {
595
+			error(ITP_MSG_LOCALE.message.form.wrongpassword);
596
+			return false;
597
+		}
598
+	}
599
+
600
+	if ($.inArray('url', arry) > -1) {
601
+		const regExp = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
602
+		if (!regExp.test($(element).val())) {
603
+			error(ITP_MSG_LOCALE.message.form.wronglink);
604
+			return false;
605
+		}
606
+	}
607
+
608
+	return true;
609
+};
610
+
611
+let itp_fn_form_event = {
612
+	onKeyup: function(formId) {
613
+		$(formId).find('input[data-key-up]').on('keyup', function() {
614
+			let value = '';
615
+			let arry = $(this).data('key-up').split(',');
616
+			if ($.inArray('number', arry) > -1) {
617
+				value = $(this).val().replace(/[^0-9]/g, "");
618
+			}
619
+			if ($.inArray('comma', arry) > -1) {
620
+				value = $(this).val().replace(/[^0-9]/g, "")
621
+					.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
622
+			}
623
+			if ($.inArray('regNo', arry) > -1) {
624
+				value = $(this).val().replace(/[^0-9]/g, "")
625
+					.replace(/(^[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{5})$/,"$1-$2-$3")
626
+			}
627
+			if ($.inArray('corpNo', arry) > -1) {
628
+				if($(this).val().length > 13) return;
629
+				value = $(this).val().replace(/[^0-9]/g, "")
630
+					.replace(/(^[0-9]{6})([0-9]+)?([0-9]{7})$/,"######-#######")
631
+				// .replace(/(\d{6})(\d{7})/, '######-#######')
632
+			}
633
+			if ($.inArray('tel', arry) > -1) {
634
+				value = ($(this).val().startsWith('0')) ? $(this).val().replace(/[^0-9]/g, "")
635
+					.replace(/(^02|^0505|^1[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{4})$/,"$1-$2-$3")
636
+					.replace("--", "-") : '';
637
+			}
638
+			$(this).val(value);
639
+		});
640
+	},
641
+	removeChar: function(formId) {
642
+		$(formId).find('input[data-key-up]').each(function() {
643
+			$(this).val($(this).val().replace(/[^0-9]/g, ""));
644
+		});
645
+	},
646
+	isValid: function(formId, type) {
647
+		var isValid = false;
648
+		$(formId).find('input, select, checkbox, textarea').each(function(k) {
649
+			if($(this).data('check-required')) {
650
+				var arry = $(this).data('check-required').split(',');
651
+				var alertMsg = $(this).data('alert-required');
652
+				console.log(alertMsg);
653
+				isValid = itp_fn_form_validate(formId, '#' + $(this).attr('id'), arry, undefined, alertMsg);
654
+				if(!isValid) {
655
+					if(alertMsg && alertMsg.length > 0) {
656
+						// itp_fn_modal_alert($(this).data('alert-msg'));
657
+						alert($(this).data('alert-msg'));
658
+					}
659
+					return false;
660
+				}
661
+			}
662
+		});
663
+		return isValid;
664
+	}
665
+};