Browse Source

모바일 메인 스크립트 수정

juney 2 years ago
parent
commit
8137eb2311
1 changed files with 2 additions and 186 deletions
  1. 2 186
      src/main/webapp/mobile/js/app/main.js

+ 2 - 186
src/main/webapp/mobile/js/app/main.js

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