Browse Source

메인 엑셀 스크립트 수정

isna 2 years ago
parent
commit
289671bde6
2 changed files with 19 additions and 6 deletions
  1. 18 2
      src/main/webapp/js/app/main.js
  2. 1 4
      src/main/webapp/main.html

+ 18 - 2
src/main/webapp/js/app/main.js

@@ -14,13 +14,20 @@ let MAIN_CHART_SFT_STCK_CHART = '/api/main/chart/sft-stck-chart';
14 14
 let MAIN_CHART_DELI_CHART = '/api/main/chart/deli-chart';
15 15
 
16 16
 var chartCnt=0;
17
+function loadJS(url, implementationCode ) {
18
+	var scriptTag = document.createElement('script');
19
+	scriptTag.src = url;
20
+	scriptTag.onload = implementationCode;
21
+	scriptTag.onreadystatechange = implementationCode;
22
+	document.head.appendChild(scriptTag);
23
+};
17 24
 
18 25
 require(['config'], function() {
19 26
 	require([
20 27
 		'jquery', 
21 28
 		'jquery.bootstrap.fileUpload' //파일 업로드가 있는 페이지에서 로딩
22 29
 	], function($) {
23
-		
30
+		 
24 31
 		setTimeout(function() {
25 32
 			// 시간지정
26 33
 			// $('#ITP_FORM_MAIN_NOTICE_SEARCH_SCH_DT').val(itp_fn_date_format(new Date(), 2));
@@ -134,7 +141,16 @@ require(['config'], function() {
134 141
 				$('#ITP_MAIN_GRAPH_AREA').css('grid-template-columns','1fr 1fr 1fr');
135 142
 			}	
136 143
 
137
-		}, 300);		
144
+		}, 300);
145
+		
146
+		loadJS('./js/cpexcel.js', function() {
147
+			loadJS('./js/xlsx.js', function() {
148
+				if(XLSX.version!=='0.18.5') {
149
+					make_xlsx_lib(XLSX);
150
+				}
151
+				console.log("xxxxxx xlsx xxxxxx", XLSX);
152
+			});
153
+		});
138 154
 	});
139 155
 });
140 156
 

+ 1 - 4
src/main/webapp/main.html

@@ -39,7 +39,6 @@
39 39
 	</script>
40 40
 
41 41
 	<script src="./js/app/properties.js"></script>
42
-	<script src="./js/cpexcel.js"></script>
43 42
 	<script src="./js/require.min.js" data-main="./js/app/config.js"></script>
44 43
 
45 44
 	<style>
@@ -844,8 +843,6 @@
844 843
 		</footer>
845 844
 		
846 845
 		<aside id="ITP_ASIDE"></aside>	 
847
-	</div> 
848
-	
849
-	<script src="./js/xlsx.js"></script>
846
+	</div>  
850 847
 </body>
851 848
 </html>