

231030 류윤주 사용자 등록 커밋
@3bb27b4eacf654b94e13f067dd5080c9ed44bb62
--- client/resources/js/commonUtil.js
+++ client/resources/js/commonUtil.ts
... | ... | @@ -6,30 +6,244 @@ |
6 | 6 |
* 공통 자바스크립트 Util입니다. |
7 | 7 |
*/ |
8 | 8 |
|
9 |
- |
|
10 | 9 |
const COMMON_UTIL = (function () { |
11 | 10 |
|
12 | 11 |
var _utils = { |
13 | 12 |
|
13 |
+ |
|
14 |
+ engNum: function(value : any) { |
|
15 |
+ let engNum = /^[a-zA-Z0-9]*$/; |
|
16 |
+ if(engNum.test(value)) { |
|
17 |
+ return true |
|
18 |
+ } else { |
|
19 |
+ return false |
|
20 |
+ } |
|
21 |
+ }, |
|
22 |
+ |
|
23 |
+ /** |
|
24 |
+ * 오늘 년-월-일 구하기 |
|
25 |
+ */ |
|
26 |
+ today: function() { |
|
27 |
+ let date = new Date(); |
|
28 |
+ let today = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toISOString().substring(0, 10); |
|
29 |
+ return today; |
|
30 |
+ }, |
|
31 |
+ |
|
32 |
+ /** |
|
33 |
+ * 오늘 년-월-일 구하기 |
|
34 |
+ */ |
|
35 |
+ dateTime: function() { |
|
36 |
+ let date = new Date(); |
|
37 |
+ let today = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toISOString().substring(0, 16); |
|
38 |
+ return today; |
|
39 |
+ }, |
|
40 |
+ |
|
41 |
+ /** |
|
42 |
+ * 한달전 년-월-일 구하기 |
|
43 |
+ */ |
|
44 |
+ oneMonthAgo: function() { |
|
45 |
+ let date = new Date(); |
|
46 |
+ let oneMonthAgo = new Date(date.setMonth(date.getMonth() - 1) - (date.getTimezoneOffset() * 60000)).toISOString().substring(0, 10); |
|
47 |
+ return oneMonthAgo; |
|
48 |
+ }, |
|
49 |
+ |
|
50 |
+ /** |
|
51 |
+ * null값 '-' 으로 치환 |
|
52 |
+ */ |
|
53 |
+ nullHyphen: function(data : any) { |
|
54 |
+ if(data === null || data === "") { |
|
55 |
+ return "-"; |
|
56 |
+ } else { |
|
57 |
+ return data; |
|
58 |
+ } |
|
59 |
+ }, |
|
60 |
+ |
|
61 |
+ /** |
|
62 |
+ * 일자에 '-' 넣기 |
|
63 |
+ */ |
|
64 |
+ dateHyphen: function(data : any) { |
|
65 |
+ if(data === null || data === "") return "-"; |
|
66 |
+ let formatDate = ''; |
|
67 |
+ // 공백제거 |
|
68 |
+ data = data.replace(/\s/gi, ""); |
|
69 |
+ if(data.length == 8) { |
|
70 |
+ formatDate = data.replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3'); |
|
71 |
+ } else { |
|
72 |
+ formatDate = data; |
|
73 |
+ } |
|
74 |
+ |
|
75 |
+ return formatDate; |
|
76 |
+ }, |
|
77 |
+ |
|
78 |
+ /** |
|
79 |
+ * 일시에서 시,분,초 자르기 |
|
80 |
+ */ |
|
81 |
+ yyyymmdd: function(data : any) { |
|
82 |
+ if(data === null || data === "") { |
|
83 |
+ return "-"; |
|
84 |
+ } else { |
|
85 |
+ let date = data.substr(0,10); |
|
86 |
+ return date; |
|
87 |
+ } |
|
88 |
+ }, |
|
89 |
+ |
|
90 |
+ /** |
|
91 |
+ * 전화번호 출력 시 '-'을 추가하여 출력 |
|
92 |
+ */ |
|
93 |
+ HyphenMinus: function( phoneNumber : any ) { |
|
94 |
+ if(!phoneNumber) return phoneNumber |
|
95 |
+ |
|
96 |
+ phoneNumber = phoneNumber.replace(/[^0-9]/g, '') |
|
97 |
+ |
|
98 |
+ let tmp = '' |
|
99 |
+ if( phoneNumber.length < 4){ |
|
100 |
+ return phoneNumber; |
|
101 |
+ } |
|
102 |
+ else if(phoneNumber.length < 7) |
|
103 |
+ { |
|
104 |
+ tmp += phoneNumber.substr(0, 3); |
|
105 |
+ tmp += '-'; |
|
106 |
+ tmp += phoneNumber.substr(3); |
|
107 |
+ return tmp; |
|
108 |
+ } |
|
109 |
+ else if(phoneNumber.length == 8) |
|
110 |
+ { |
|
111 |
+ tmp += phoneNumber.substr(0, 4); |
|
112 |
+ tmp += '-'; |
|
113 |
+ tmp += phoneNumber.substr(4); |
|
114 |
+ return tmp; |
|
115 |
+ } |
|
116 |
+ else if(phoneNumber.length < 10) |
|
117 |
+ { |
|
118 |
+ if(phoneNumber.substr(0, 2) =='02') { //02-123-5678 |
|
119 |
+ tmp += phoneNumber.substr(0, 2); |
|
120 |
+ tmp += '-'; |
|
121 |
+ tmp += phoneNumber.substr(2, 3); |
|
122 |
+ tmp += '-'; |
|
123 |
+ tmp += phoneNumber.substr(5); |
|
124 |
+ return tmp; |
|
125 |
+ } |
|
126 |
+ } |
|
127 |
+ else if(phoneNumber.length < 11) |
|
128 |
+ { |
|
129 |
+ if(phoneNumber.substr(0, 2) =='02') { //02-1234-5678 |
|
130 |
+ tmp += phoneNumber.substr(0, 2); |
|
131 |
+ tmp += '-'; |
|
132 |
+ tmp += phoneNumber.substr(2, 4); |
|
133 |
+ tmp += '-'; |
|
134 |
+ tmp += phoneNumber.substr(6); |
|
135 |
+ return tmp; |
|
136 |
+ } else { //010-123-4567 |
|
137 |
+ tmp += phoneNumber.substr(0, 3); |
|
138 |
+ tmp += '-'; |
|
139 |
+ tmp += phoneNumber.substr(3, 3); |
|
140 |
+ tmp += '-'; |
|
141 |
+ tmp += phoneNumber.substr(6); |
|
142 |
+ return tmp; |
|
143 |
+ } |
|
144 |
+ } |
|
145 |
+ else { //010-1234-5678 |
|
146 |
+ tmp += phoneNumber.substr(0, 3); |
|
147 |
+ tmp += '-'; |
|
148 |
+ tmp += phoneNumber.substr(3, 4); |
|
149 |
+ tmp += '-'; |
|
150 |
+ tmp += phoneNumber.substr(7); |
|
151 |
+ return tmp; |
|
152 |
+ } |
|
153 |
+ }, |
|
154 |
+ |
|
155 |
+ /** |
|
156 |
+ * 전화번호 자동 '-' 삽입 |
|
157 |
+ */ |
|
158 |
+ //전화번호 입력 시 자동 '-' 삽입 |
|
159 |
+ getMask: function( phoneNumber : any ) { |
|
160 |
+ if(!phoneNumber) return phoneNumber |
|
161 |
+ phoneNumber = phoneNumber.replace(/[^0-9]/g, '') |
|
162 |
+ |
|
163 |
+ let res = '' |
|
164 |
+ if(phoneNumber.length < 3) { |
|
165 |
+ res = phoneNumber |
|
166 |
+ } |
|
167 |
+ else { |
|
168 |
+ if(phoneNumber.substr(0, 2) =='02') { |
|
169 |
+ if(phoneNumber.length <= 5) {//02-123-5678 |
|
170 |
+ res = phoneNumber.substr(0, 2) + '-' + phoneNumber.substr(2, 3) |
|
171 |
+ } |
|
172 |
+ else if(phoneNumber.length > 5 && phoneNumber.length <= 9) {//02-123-5678 |
|
173 |
+ res = phoneNumber.substr(0, 2) + '-' + phoneNumber.substr(2, 3) + '-' + phoneNumber.substr(5) |
|
174 |
+ } |
|
175 |
+ else if(phoneNumber.length > 9) {//02-1234-5678 |
|
176 |
+ res = phoneNumber.substr(0, 2) + '-' + phoneNumber.substr(2, 4) + '-' + phoneNumber.substr(6) |
|
177 |
+ } |
|
178 |
+ } else { |
|
179 |
+ if(phoneNumber.length < 8) { |
|
180 |
+ res = phoneNumber |
|
181 |
+ } |
|
182 |
+ else if(phoneNumber.length == 8) |
|
183 |
+ { |
|
184 |
+ res = phoneNumber.substr(0, 4) + '-' + phoneNumber.substr(4) |
|
185 |
+ } |
|
186 |
+ else if(phoneNumber.length == 9) |
|
187 |
+ { |
|
188 |
+ res = phoneNumber.substr(0, 3) + '-' + phoneNumber.substr(3, 3) + '-' + phoneNumber.substr(6) |
|
189 |
+ } |
|
190 |
+ else if(phoneNumber.length == 10) |
|
191 |
+ { |
|
192 |
+ res = phoneNumber.substr(0, 3) + '-' + phoneNumber.substr(3, 3) + '-' + phoneNumber.substr(6) |
|
193 |
+ } |
|
194 |
+ else if(phoneNumber.length > 10) { //010-1234-5678 |
|
195 |
+ res = phoneNumber.substr(0, 3) + '-' + phoneNumber.substr(3, 4) + '-' + phoneNumber.substr(7) |
|
196 |
+ } |
|
197 |
+ } |
|
198 |
+ } |
|
199 |
+ return res |
|
200 |
+ }, |
|
201 |
+ |
|
202 |
+ /** |
|
203 |
+ * 비밀번호 일치 체크 |
|
204 |
+ */ |
|
205 |
+ checkPassword: function(pw : any, pwC : any) { |
|
206 |
+ if (pw != pwC) return false; |
|
207 |
+ return true; |
|
208 |
+ }, |
|
209 |
+ /** |
|
210 |
+ * 휴대폰 번호 정규식 |
|
211 |
+ */ |
|
212 |
+ checkPhone: function(data : any) { |
|
213 |
+ let regExp = /^01([0|1|6|7|8|9]?)-?([0-9]{3,4})-?([0-9]{4})$/; |
|
214 |
+ if (regExp.test(data) === true) return true; |
|
215 |
+ return false; |
|
216 |
+ }, |
|
217 |
+ |
|
218 |
+ /** |
|
219 |
+ * 이메일 정규식 |
|
220 |
+ */ |
|
221 |
+ checkEmail: function (data : any) { |
|
222 |
+ // 이메일 형식 검사 |
|
223 |
+ let validateEmail = /^[A-Za-z0-9_\\.\\-]+@[A-Za-z0-9\\-]+\.[A-Za-z0-9\\-\\.]+$/; |
|
224 |
+ if (validateEmail.test(data) === true) return true; |
|
225 |
+ return false; |
|
226 |
+ }, |
|
227 |
+ |
|
14 | 228 |
/** |
15 | 229 |
* 빈 객체 여부 |
16 | 230 |
*/ |
17 |
- isEmpty: function (data) { |
|
18 |
- if (data === undefined || data === null || data === "" || data.length === 0 || (data.constructor == Object && Object.keys(data).length === 0)) { |
|
231 |
+ isEmpty: function (data : any) { |
|
232 |
+ if (data === undefined || data === null || data === "null" || data === "" || data.length === 0 || (data.constructor == Object && Object.keys(data).length === 0)) { |
|
19 | 233 |
if ((typeof data) === "number") { |
20 |
- return false |
|
234 |
+ return true |
|
21 | 235 |
} else { |
22 |
- return true; |
|
236 |
+ return false; |
|
23 | 237 |
} |
24 | 238 |
} else { |
25 |
- return false; |
|
239 |
+ return true; |
|
26 | 240 |
} |
27 | 241 |
}, |
28 | 242 |
|
29 | 243 |
/** |
30 | 244 |
* empty to null |
31 | 245 |
*/ |
32 |
- toNull: function (data) { |
|
246 |
+ toNull: function ( data : any) { |
|
33 | 247 |
if(data === undefined || data === "") { |
34 | 248 |
try { |
35 | 249 |
data = null; |
... | ... | @@ -46,23 +260,7 @@ |
46 | 260 |
/** |
47 | 261 |
* string to JSON |
48 | 262 |
*/ |
49 |
- toJson: function (data) { |
|
50 |
- if ("string" === (typeof data)) { |
|
51 |
- try { |
|
52 |
- return JSON.parse(data); |
|
53 |
- } catch (e) { |
|
54 |
- console.log("commonUtil.js - string to json convert error : ", e); |
|
55 |
- return data; |
|
56 |
- } |
|
57 |
- } else { |
|
58 |
- return data; |
|
59 |
- } |
|
60 |
- }, |
|
61 |
- |
|
62 |
- /** |
|
63 |
- * string to JSON |
|
64 |
- */ |
|
65 |
- toJson: function (data) { |
|
263 |
+ toJson: function (data : any) { |
|
66 | 264 |
if ("string" === (typeof data)) { |
67 | 265 |
try { |
68 | 266 |
return JSON.parse(data); |
... | ... | @@ -78,7 +276,7 @@ |
78 | 276 |
/** |
79 | 277 |
* JSON to string |
80 | 278 |
*/ |
81 |
- toString: function (data) { |
|
279 |
+ toString: function (data : any) { |
|
82 | 280 |
try { |
83 | 281 |
return JSON.parse(data); |
84 | 282 |
} catch (e) { |
... | ... | @@ -90,12 +288,12 @@ |
90 | 288 |
/** |
91 | 289 |
* 다중 separator split |
92 | 290 |
*/ |
93 |
- split: function (text, separator) { |
|
291 |
+ split: function (text : any, separator : any) { |
|
94 | 292 |
var words = []; |
95 | 293 |
if (this.isEmpty(text) == false && this.isEmpty(separator) == false && separator.length > 0) { |
96 | 294 |
words.push(text); |
97 | 295 |
for (var i = 0; i < separator.length; i++) { |
98 |
- var subWords = []; |
|
296 |
+ var subWords : any = []; |
|
99 | 297 |
for (var j = 0; j < words.length; j++) { |
100 | 298 |
if (this.isEmpty(words[j]) == false && this.isEmpty(separator[i]) == false) { |
101 | 299 |
subWords = subWords.concat(words[j].split(separator[i])); |
... | ... | @@ -121,7 +319,7 @@ |
121 | 319 |
/** |
122 | 320 |
* 객체 깊은 복사 |
123 | 321 |
*/ |
124 |
- copyObject: function (obj) { |
|
322 |
+ copyObject: function (obj : any) { |
|
125 | 323 |
if (obj === null || typeof(obj) !== 'object') return obj; |
126 | 324 |
|
127 | 325 |
try { |
... | ... | @@ -138,7 +336,7 @@ |
138 | 336 |
|
139 | 337 |
*/ |
140 | 338 |
getDateTime : function () { |
141 |
- return this.getDate()+ " " + this.getFullTime(); |
|
339 |
+ return this.getDate(null) as String + " " + this.getFullTime(null); |
|
142 | 340 |
}, |
143 | 341 |
|
144 | 342 |
/** |
... | ... | @@ -153,7 +351,7 @@ |
153 | 351 |
* separator(String) |
154 | 352 |
* } |
155 | 353 |
*/ |
156 |
- getDate: function (options) { |
|
354 |
+ getDate: function (options : any) { |
|
157 | 355 |
|
158 | 356 |
if (this.isEmpty(options) == true) { |
159 | 357 |
options = { |
... | ... | @@ -257,7 +455,7 @@ |
257 | 455 |
* separator(String) |
258 | 456 |
* } |
259 | 457 |
*/ |
260 |
- getFullTime: function (options) { |
|
458 |
+ getFullTime: function (options : any) { |
|
261 | 459 |
if (this.isEmpty(options) == true) { |
262 | 460 |
options = { |
263 | 461 |
addHour: 0, |
... | ... | @@ -295,7 +493,7 @@ |
295 | 493 |
* separator(String) |
296 | 494 |
* } |
297 | 495 |
*/ |
298 |
- getTime: function (options) { |
|
496 |
+ getTime: function (options : any) { |
|
299 | 497 |
if (this.isEmpty(options) == true) { |
300 | 498 |
options = { |
301 | 499 |
addHour: 0, |
... | ... | @@ -328,7 +526,7 @@ |
328 | 526 |
* ex) this.prefixZero(2, 5) => 00002, this.prefixZero(20, 5) => 00020 |
329 | 527 |
* |
330 | 528 |
*/ |
331 |
- prefixZero: function (text, length) { |
|
529 |
+ prefixZero: function (text : any, length : any) { |
|
332 | 530 |
var zero = ''; |
333 | 531 |
var suffix = text; |
334 | 532 |
|
... | ... | @@ -348,7 +546,7 @@ |
348 | 546 |
/** |
349 | 547 |
* Date => text |
350 | 548 |
*/ |
351 |
- dateToText: function (date) { |
|
549 |
+ dateToText: function (date : any) { |
|
352 | 550 |
var d = new Date(date); |
353 | 551 |
var yyyy = d.getFullYear(); |
354 | 552 |
var mm = d.getMonth() + 1; |
... | ... | @@ -366,7 +564,7 @@ |
366 | 564 |
* |
367 | 565 |
* ex) getRandomInt(2, 5) => 2~5사이의 정수 난수 값 리턴 |
368 | 566 |
*/ |
369 |
- getRandomInt: function (min, max) { |
|
567 |
+ getRandomInt: function (min : any, max : any) { |
|
370 | 568 |
min = Math.ceil(min); |
371 | 569 |
max = Math.floor(max); |
372 | 570 |
return Math.floor(Math.random() * (max - min)) + min; |
... | ... | @@ -398,7 +596,7 @@ |
398 | 596 |
* |
399 | 597 |
* ex) 10000 => 10,000 |
400 | 598 |
*/ |
401 |
- comma: function (text) { |
|
599 |
+ comma: function (text : any) { |
|
402 | 600 |
try { |
403 | 601 |
return text.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
404 | 602 |
} catch (e) { |
... | ... | @@ -415,7 +613,7 @@ |
415 | 613 |
* |
416 | 614 |
* ex) 10,000 => 10000 |
417 | 615 |
*/ |
418 |
- removeComma: function (text) { |
|
616 |
+ removeComma: function (text : any) { |
|
419 | 617 |
try { |
420 | 618 |
return text.toString().replace(/,/g, "");; |
421 | 619 |
} catch (e) { |
... | ... | @@ -430,7 +628,7 @@ |
430 | 628 |
/** |
431 | 629 |
* json 데이터 가지고 오기 (외부 JSON 파일 PATH or URL) (동기 요청) |
432 | 630 |
*/ |
433 |
- getJsonByPromise: function (url, isAsync) { |
|
631 |
+ getJsonByPromise: function (url : any, isAsync : any) { |
|
434 | 632 |
if (this.isEmpty(url) == true) { |
435 | 633 |
new Error('COMMON_UTIL - getJson(url, isAsync) Error : url(parameter) is empty') |
436 | 634 |
} |
... | ... | @@ -461,7 +659,7 @@ |
461 | 659 |
/** |
462 | 660 |
* json 데이터 가지고 오기 (동기 요청) (외부 JSON 파일 PATH or URL) |
463 | 661 |
*/ |
464 |
- getJsonBySync: function (url) { |
|
662 |
+ getJsonBySync: function (url : any) { |
|
465 | 663 |
var result = {}; |
466 | 664 |
if (this.isEmpty(url) == true) { |
467 | 665 |
new Error('COMMON_UTIL - getJson(url, isAsync) Error : url(parameter) is empty') |
... | ... | @@ -486,16 +684,6 @@ |
486 | 684 |
|
487 | 685 |
return result; |
488 | 686 |
}, |
489 |
- |
|
490 |
- /** |
|
491 |
- * 이메일 정규식 |
|
492 |
- */ |
|
493 |
- checkEmail: function (data) { |
|
494 |
- // 이메일 형식 검사 |
|
495 |
- let validateEmail = /^[A-Za-z0-9_\\.\\-]+@[A-Za-z0-9\\-]+\.[A-Za-z0-9\\-\\.]+$/; |
|
496 |
- if (validateEmail.test(data) === true) return true; |
|
497 |
- return false; |
|
498 |
- }, |
|
499 | 687 |
|
500 | 688 |
} |
501 | 689 |
|
+++ client/views/AppFilters.ts
... | ... | @@ -0,0 +1,157 @@ |
1 | +/*** | |
2 | + * | |
3 | + * @param 기존 CMS | |
4 | + * @returns | |
5 | + */ | |
6 | + | |
7 | + const AppFilters = (function () { | |
8 | + | |
9 | + var _filters = { | |
10 | + | |
11 | + /*전화번호*/ | |
12 | + phone: function (phone : any) { | |
13 | + return phone.replace(/[^0-9]/g, '') | |
14 | + .replace(/(\d{3})(\d{4})(\d{4})/, '($1) $2-$3'); | |
15 | + }, | |
16 | + | |
17 | + /* 반올림 */ | |
18 | + math: function (param : any) { | |
19 | + if(param == 0){ | |
20 | + return "-"; | |
21 | + } | |
22 | + return Math.round(param); | |
23 | + }, | |
24 | + | |
25 | + /* 특수문자 변형 */ | |
26 | + specialCharacter: function (arr : any) { | |
27 | + arr = arr.replace(/</g, '<'); | |
28 | + arr = arr.replace(/>/g, '>'); | |
29 | + arr = arr.replace(/"/g, '"'); | |
30 | + arr = arr.replace(/&/g, '&'); | |
31 | + arr = arr.replace(/ /g, '\n'); | |
32 | + arr = arr.replace(/	/g, '\t'); | |
33 | + return arr; | |
34 | + }, | |
35 | + | |
36 | + /* input text 제한 */ | |
37 | + comma: function (text : any) { | |
38 | + try { | |
39 | + return text.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); | |
40 | + } catch (e) { | |
41 | + if (text === undefined || text === null || text === "" || text.length === 0) { | |
42 | + return "-"; | |
43 | + } else { | |
44 | + return text; | |
45 | + } | |
46 | + } | |
47 | + }, | |
48 | + | |
49 | + /* html text 제한 */ | |
50 | + textLimit: function (text : any, limit : any) { | |
51 | + if (text === undefined || text === null || text === "" || text.length === 0) { | |
52 | + return text; | |
53 | + } else { | |
54 | + return text.substr(0, limit); | |
55 | + } | |
56 | + }, | |
57 | + | |
58 | + /* 파일 사이즈 */ | |
59 | + fileSize: function (size : any) { | |
60 | + var result = size + " bytes"; | |
61 | + // optional code for multiples approximation | |
62 | + var type = ["KB", "MB", "GB"]; | |
63 | + for (var i = 0, reSize = (size / 1024); reSize > 1 && i < type.length; reSize /= 1024, i++) { | |
64 | + result = reSize.toFixed(3) + " " + type[i]; | |
65 | + } | |
66 | + return result; | |
67 | + }, | |
68 | + | |
69 | + /* 숫자 한글 표현 */ | |
70 | + numberSize: function (number : any) { | |
71 | + var result = number; | |
72 | + // optional code for multiples approximation | |
73 | + var type = ["만", "억", "조", "경", "해"]; | |
74 | + for (var i = 0, reSize = (number / 10000); reSize > 1 && i < type.length; reSize /= 10000, i++) { | |
75 | + result = reSize.toFixed(1) + " " + type[i]; | |
76 | + } | |
77 | + if (result == null) { | |
78 | + return '0'; | |
79 | + } else { | |
80 | + return result.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); | |
81 | + } | |
82 | + //return result; | |
83 | + }, | |
84 | + | |
85 | + isEmpty: function (data : any) { | |
86 | + if (data === undefined || data === null || data === "" || data.length === 0 || (data.constructor == Object && Object.keys(data).length === 0)) { | |
87 | + if ((typeof data) === "number") { | |
88 | + return false | |
89 | + } else { | |
90 | + return true; | |
91 | + } | |
92 | + } else { | |
93 | + return false; | |
94 | + } | |
95 | + }, | |
96 | + | |
97 | + /* 빈 데이터 표현 => '-' */ | |
98 | + emptyText: function (text : any) { | |
99 | + if (text === undefined || text === null || text === "" || text.length === 0) { | |
100 | + return '-'; | |
101 | + } else { | |
102 | + return text; | |
103 | + } | |
104 | + }, | |
105 | + | |
106 | + //클라이언트의 현재 일짜와 비교해서 더 작은 지에 대한 여부 확인 | |
107 | + //param - dateText : yyyy-mm-dd (String) | |
108 | + isSmallerClientDate: function (dateText : any) { | |
109 | + const date = new Date(dateText); | |
110 | + let clientDate = new Date(); | |
111 | + | |
112 | + let yyyy = clientDate.getFullYear(); | |
113 | + let mm : any = clientDate.getMonth() + 1; | |
114 | + if (mm < 10) { | |
115 | + let MM : String; | |
116 | + MM = "0" + mm; | |
117 | + mm=String(mm); | |
118 | + } | |
119 | + | |
120 | + let dd : any = clientDate.getDate(); | |
121 | + if (dd < 10) { | |
122 | + dd = "0" + dd; | |
123 | + } | |
124 | + clientDate = new Date(`${yyyy}-${mm}-${dd}`); | |
125 | + | |
126 | + if (date <= clientDate) { | |
127 | + return true; | |
128 | + } else { | |
129 | + return false; | |
130 | + } | |
131 | + }, | |
132 | + | |
133 | + /* 인하 수치 5mm */ | |
134 | + DEFAULT_REPAIR_SIZE: -5, | |
135 | + | |
136 | + /* 인하 횟수 => 인하 수치 */ | |
137 | + repairMillimeter: function(repairCount : any) { | |
138 | + const newRepairCount = !repairCount ? 0 : Number(repairCount); | |
139 | + const repairSize = this.DEFAULT_REPAIR_SIZE * newRepairCount; | |
140 | + return repairSize; | |
141 | + } | |
142 | + | |
143 | + } | |
144 | + | |
145 | + | |
146 | + //초기화 | |
147 | + function init() { | |
148 | + return _filters; | |
149 | + } | |
150 | + | |
151 | + | |
152 | + return init(); | |
153 | + | |
154 | +})(); | |
155 | + | |
156 | +export default AppFilters; | |
157 | + |
--- client/views/index.js
+++ client/views/index.js
... | ... | @@ -1,17 +1,17 @@ |
1 |
-/** |
|
2 |
- * @author : 최정우 |
|
3 |
- * @since : 2022.10.19 |
|
4 |
- * @dscription : Vue를 활용한 Client단 구현의 시작점(Index) Component 입니다. |
|
5 |
- */ |
|
6 |
-import { createApp } from 'vue'; |
|
1 |
+// /** |
|
2 |
+// * @author : 최정우 |
|
3 |
+// * @since : 2022.10.19 |
|
4 |
+// * @dscription : Vue를 활용한 Client단 구현의 시작점(Index) Component 입니다. |
|
5 |
+// */ |
|
6 |
+// import { createApp } from 'vue'; |
|
7 | 7 |
|
8 |
-import AppRouter from './pages/AppRouter.js'; |
|
9 |
-import App from './pages/App.vue'; |
|
10 |
-import AppStore from './pages/AppStore.js'; |
|
8 |
+// import AppRouter from './pages/AppRouter.js'; |
|
9 |
+// import App from './pages/App.vue'; |
|
10 |
+// import AppStore from './pages/AppStore.js'; |
|
11 | 11 |
|
12 |
-const vue = createApp(App).use(AppRouter).use(AppStore).mount('#root'); |
|
12 |
+// const vue = createApp(App).use(AppRouter).use(AppStore).mount('#root'); |
|
13 | 13 |
|
14 |
-if (!APP_USER_HTTP_REQUEST_URL && APP_USER_HTTP_REQUEST_URL != '/') { |
|
15 |
- console.log('index.js APP_USER_HTTP_REQUEST_URL : ', APP_USER_HTTP_REQUEST_URL); |
|
16 |
- AppRouter.push({ path: APP_USER_HTTP_REQUEST_URL, query: {}}) |
|
17 |
-} |
|
14 |
+// if (!APP_USER_HTTP_REQUEST_URL && APP_USER_HTTP_REQUEST_URL != '/') { |
|
15 |
+// console.log('index.js APP_USER_HTTP_REQUEST_URL : ', APP_USER_HTTP_REQUEST_URL); |
|
16 |
+// AppRouter.push({ path: APP_USER_HTTP_REQUEST_URL, query: {}}) |
|
17 |
+// } |
+++ client/views/index.ts
... | ... | @@ -0,0 +1,22 @@ |
1 | +/** | |
2 | + * @author : 최정우 | |
3 | + * @since : 2022.10.19 | |
4 | + * @dscription : Vue를 활용한 Client단 구현의 시작점(Index) Component 입니다. | |
5 | + */ | |
6 | +import { createApp } from 'vue'; | |
7 | + | |
8 | +import AppRouter from './pages/AppRouter'; | |
9 | +import AppStore from './pages/AppStore'; | |
10 | +import AppFilters from './AppFilters'; | |
11 | +import App from './pages/App.vue'; | |
12 | + | |
13 | + | |
14 | +// const vue = createApp(App).use(AppRouter).mount('#root'); | |
15 | +const vue = createApp(App) | |
16 | +vue.use(AppStore); | |
17 | +vue.use(AppRouter); | |
18 | +vue.config.globalProperties.$filters = AppFilters | |
19 | + | |
20 | + | |
21 | +vue.mount('#root'); | |
22 | + |
--- client/views/pages/admin/login/Login.vue
+++ client/views/pages/admin/login/Login.vue
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 |
|
5 | 5 |
<script> |
6 | 6 |
import axios from 'axios'; |
7 |
-import common from '../../../../resources/js/commonUtil.js'; |
|
7 |
+ |
|
8 | 8 |
|
9 | 9 |
export default { |
10 | 10 |
data() { |
--- client/views/pages/admin/main/Main.vue
+++ client/views/pages/admin/main/Main.vue
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 |
|
5 | 5 |
<script> |
6 | 6 |
import axios from "axios"; |
7 |
-import common from '../../../../resources/js/commonUtil.js'; |
|
7 |
+ |
|
8 | 8 |
|
9 | 9 |
export default { |
10 | 10 |
data() { |
--- client/views/pages/admin/user/UserSelectList.vue
+++ client/views/pages/admin/user/UserSelectList.vue
... | ... | @@ -66,7 +66,7 @@ |
66 | 66 |
<tr v-for="(mngr, index) in mngrList" :key="index"> |
67 | 67 |
<td>{{ mngr.mngr_id }}</td> |
68 | 68 |
<td>{{ mngr.mngr_nm }}</td> |
69 |
- <td>{{ mngr.mngr_eml}}</td> |
|
69 |
+ <td>{{ mngr.mngr_eml }}</td> |
|
70 | 70 |
<td>{{ mngr.rgtr_id }}</td> |
71 | 71 |
<td>{{ mngr.reg_dt }}</td> |
72 | 72 |
</tr> |
... | ... | @@ -126,7 +126,7 @@ |
126 | 126 |
import { useStore } from "vuex"; |
127 | 127 |
import axios from "axios"; |
128 | 128 |
import crypto from "crypto-js"; |
129 |
-import COMMON_UTIL from '../../../../resources/js/commonUtil.js'; |
|
129 |
+import COMMON_UTIL from '../../../../resources/js/commonUtil.ts'; |
|
130 | 130 |
|
131 | 131 |
|
132 | 132 |
export default { |
... | ... | @@ -231,7 +231,7 @@ |
231 | 231 |
}, |
232 | 232 |
// 등록버튼 클릭 시 빈칸 검사 |
233 | 233 |
managerInsertCheck: function () { |
234 |
- if (COMMON_UTIL.isEmpty(this.mngr.mngr_id)) { |
|
234 |
+ if (COMMON_UTIL.isEmpty(this.mngr.mngr_id) === false) { |
|
235 | 235 |
alert('ID를 입력해주세요.'); |
236 | 236 |
return false; |
237 | 237 |
} |
... | ... | @@ -241,27 +241,28 @@ |
241 | 241 |
return false; |
242 | 242 |
} |
243 | 243 |
|
244 |
- if (COMMON_UTIL.isEmpty(this.mngr.mngr_pw)) { |
|
244 |
+ if (COMMON_UTIL.isEmpty(this.mngr.mngr_pw) === false) { |
|
245 | 245 |
alert('비밀번호를 입력해주세요.'); |
246 | 246 |
return false; |
247 | 247 |
} |
248 | 248 |
|
249 |
- if (COMMON_UTIL.isEmpty(this.mngr.mngr_nm)) { |
|
249 |
+ if (COMMON_UTIL.isEmpty(this.mngr.mngr_nm) === false) { |
|
250 | 250 |
alert('이름을 입력해주세요.'); |
251 | 251 |
return false; |
252 | 252 |
} |
253 | 253 |
|
254 | 254 |
|
255 |
- if (COMMON_UTIL.isEmpty(this.email_id)) { |
|
255 |
+ if (COMMON_UTIL.isEmpty(this.email_id) === false) { |
|
256 | 256 |
alert('이메일 ID를 입력해주세요.'); |
257 | 257 |
return false; |
258 | 258 |
} |
259 | 259 |
|
260 |
- if (COMMON_UTIL.isEmpty(this.email_domain)) { |
|
260 |
+ if (COMMON_UTIL.isEmpty(this.email_domain) === false) { |
|
261 | 261 |
alert('이메일을 선택 혹은 입력해주세요.'); |
262 | 262 |
return false; |
263 | 263 |
} |
264 |
- return true; |
|
264 |
+ |
|
265 |
+ return true |
|
265 | 266 |
}, |
266 | 267 |
|
267 | 268 |
//사용자 등록 |
+++ client/views/vue-shim.d.ts
... | ... | @@ -0,0 +1,5 @@ |
1 | +declare module '*.vue' { | |
2 | + import type { DefineComponent } from 'vue' | |
3 | + const component: DefineComponent<{}, {}, any> | |
4 | + export default component | |
5 | +}(No newline at end of file) |
--- package-lock.json
+++ package-lock.json
... | ... | @@ -1,5 +1,5 @@ |
1 | 1 |
{ |
2 |
- "name": "KERIS", |
|
2 |
+ "name": "KERIS-1", |
|
3 | 3 |
"lockfileVersion": 3, |
4 | 4 |
"requires": true, |
5 | 5 |
"packages": { |
... | ... | @@ -41,7 +41,10 @@ |
41 | 41 |
}, |
42 | 42 |
"devDependencies": { |
43 | 43 |
"less": "^4.2.0", |
44 |
- "less-loader": "^11.1.3" |
|
44 |
+ "less-loader": "^11.1.3", |
|
45 |
+ "ts-loader": "^9.5.0", |
|
46 |
+ "ts-node": "^10.9.1", |
|
47 |
+ "typescript": "^5.2.2" |
|
45 | 48 |
} |
46 | 49 |
}, |
47 | 50 |
"node_modules/@ampproject/remapping": { |
... | ... | @@ -351,6 +354,28 @@ |
351 | 354 |
"node": ">=6.9.0" |
352 | 355 |
} |
353 | 356 |
}, |
357 |
+ "node_modules/@cspotcode/source-map-support": { |
|
358 |
+ "version": "0.8.1", |
|
359 |
+ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", |
|
360 |
+ "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", |
|
361 |
+ "dev": true, |
|
362 |
+ "dependencies": { |
|
363 |
+ "@jridgewell/trace-mapping": "0.3.9" |
|
364 |
+ }, |
|
365 |
+ "engines": { |
|
366 |
+ "node": ">=12" |
|
367 |
+ } |
|
368 |
+ }, |
|
369 |
+ "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { |
|
370 |
+ "version": "0.3.9", |
|
371 |
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", |
|
372 |
+ "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", |
|
373 |
+ "dev": true, |
|
374 |
+ "dependencies": { |
|
375 |
+ "@jridgewell/resolve-uri": "^3.0.3", |
|
376 |
+ "@jridgewell/sourcemap-codec": "^1.4.10" |
|
377 |
+ } |
|
378 |
+ }, |
|
354 | 379 |
"node_modules/@discoveryjs/json-ext": { |
355 | 380 |
"version": "0.5.7", |
356 | 381 |
"resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", |
... | ... | @@ -482,6 +507,30 @@ |
482 | 507 |
"resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz", |
483 | 508 |
"integrity": "sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==", |
484 | 509 |
"optional": true |
510 |
+ }, |
|
511 |
+ "node_modules/@tsconfig/node10": { |
|
512 |
+ "version": "1.0.9", |
|
513 |
+ "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", |
|
514 |
+ "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", |
|
515 |
+ "dev": true |
|
516 |
+ }, |
|
517 |
+ "node_modules/@tsconfig/node12": { |
|
518 |
+ "version": "1.0.11", |
|
519 |
+ "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", |
|
520 |
+ "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", |
|
521 |
+ "dev": true |
|
522 |
+ }, |
|
523 |
+ "node_modules/@tsconfig/node14": { |
|
524 |
+ "version": "1.0.3", |
|
525 |
+ "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", |
|
526 |
+ "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", |
|
527 |
+ "dev": true |
|
528 |
+ }, |
|
529 |
+ "node_modules/@tsconfig/node16": { |
|
530 |
+ "version": "1.0.4", |
|
531 |
+ "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", |
|
532 |
+ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", |
|
533 |
+ "dev": true |
|
485 | 534 |
}, |
486 | 535 |
"node_modules/@types/eslint": { |
487 | 536 |
"version": "8.44.4", |
... | ... | @@ -831,6 +880,15 @@ |
831 | 880 |
"acorn": "^8" |
832 | 881 |
} |
833 | 882 |
}, |
883 |
+ "node_modules/acorn-walk": { |
|
884 |
+ "version": "8.3.0", |
|
885 |
+ "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.0.tgz", |
|
886 |
+ "integrity": "sha512-FS7hV565M5l1R08MXqo8odwMTB02C2UqzB17RVgu9EyuYFBqJZ3/ZY97sQD5FewVu1UyDFc1yztUDrAwT0EypA==", |
|
887 |
+ "dev": true, |
|
888 |
+ "engines": { |
|
889 |
+ "node": ">=0.4.0" |
|
890 |
+ } |
|
891 |
+ }, |
|
834 | 892 |
"node_modules/ajv": { |
835 | 893 |
"version": "6.12.6", |
836 | 894 |
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", |
... | ... | @@ -877,6 +935,12 @@ |
877 | 935 |
"engines": { |
878 | 936 |
"node": ">= 8" |
879 | 937 |
} |
938 |
+ }, |
|
939 |
+ "node_modules/arg": { |
|
940 |
+ "version": "4.1.3", |
|
941 |
+ "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", |
|
942 |
+ "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", |
|
943 |
+ "dev": true |
|
880 | 944 |
}, |
881 | 945 |
"node_modules/array-flatten": { |
882 | 946 |
"version": "1.1.1", |
... | ... | @@ -1001,7 +1065,7 @@ |
1001 | 1065 |
"version": "3.0.2", |
1002 | 1066 |
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", |
1003 | 1067 |
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", |
1004 |
- "optional": true, |
|
1068 |
+ "devOptional": true, |
|
1005 | 1069 |
"dependencies": { |
1006 | 1070 |
"fill-range": "^7.0.1" |
1007 | 1071 |
}, |
... | ... | @@ -1249,6 +1313,12 @@ |
1249 | 1313 |
"url": "https://github.com/sponsors/mesqueeb" |
1250 | 1314 |
} |
1251 | 1315 |
}, |
1316 |
+ "node_modules/create-require": { |
|
1317 |
+ "version": "1.1.1", |
|
1318 |
+ "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", |
|
1319 |
+ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", |
|
1320 |
+ "dev": true |
|
1321 |
+ }, |
|
1252 | 1322 |
"node_modules/cross-spawn": { |
1253 | 1323 |
"version": "7.0.3", |
1254 | 1324 |
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", |
... | ... | @@ -1391,6 +1461,15 @@ |
1391 | 1461 |
"engines": { |
1392 | 1462 |
"node": ">= 0.8", |
1393 | 1463 |
"npm": "1.2.8000 || >= 1.4.16" |
1464 |
+ } |
|
1465 |
+ }, |
|
1466 |
+ "node_modules/diff": { |
|
1467 |
+ "version": "4.0.2", |
|
1468 |
+ "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", |
|
1469 |
+ "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", |
|
1470 |
+ "dev": true, |
|
1471 |
+ "engines": { |
|
1472 |
+ "node": ">=0.3.1" |
|
1394 | 1473 |
} |
1395 | 1474 |
}, |
1396 | 1475 |
"node_modules/dom-walk": { |
... | ... | @@ -1684,7 +1763,7 @@ |
1684 | 1763 |
"version": "7.0.1", |
1685 | 1764 |
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", |
1686 | 1765 |
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", |
1687 |
- "optional": true, |
|
1766 |
+ "devOptional": true, |
|
1688 | 1767 |
"dependencies": { |
1689 | 1768 |
"to-regex-range": "^5.0.1" |
1690 | 1769 |
}, |
... | ... | @@ -2141,7 +2220,7 @@ |
2141 | 2220 |
"version": "7.0.0", |
2142 | 2221 |
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", |
2143 | 2222 |
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", |
2144 |
- "optional": true, |
|
2223 |
+ "devOptional": true, |
|
2145 | 2224 |
"engines": { |
2146 | 2225 |
"node": ">=0.12.0" |
2147 | 2226 |
} |
... | ... | @@ -2373,6 +2452,12 @@ |
2373 | 2452 |
"semver": "bin/semver" |
2374 | 2453 |
} |
2375 | 2454 |
}, |
2455 |
+ "node_modules/make-error": { |
|
2456 |
+ "version": "1.3.6", |
|
2457 |
+ "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", |
|
2458 |
+ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", |
|
2459 |
+ "dev": true |
|
2460 |
+ }, |
|
2376 | 2461 |
"node_modules/media-typer": { |
2377 | 2462 |
"version": "0.3.0", |
2378 | 2463 |
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", |
... | ... | @@ -2397,6 +2482,19 @@ |
2397 | 2482 |
"integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", |
2398 | 2483 |
"engines": { |
2399 | 2484 |
"node": ">= 0.6" |
2485 |
+ } |
|
2486 |
+ }, |
|
2487 |
+ "node_modules/micromatch": { |
|
2488 |
+ "version": "4.0.5", |
|
2489 |
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", |
|
2490 |
+ "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", |
|
2491 |
+ "dev": true, |
|
2492 |
+ "dependencies": { |
|
2493 |
+ "braces": "^3.0.2", |
|
2494 |
+ "picomatch": "^2.3.1" |
|
2495 |
+ }, |
|
2496 |
+ "engines": { |
|
2497 |
+ "node": ">=8.6" |
|
2400 | 2498 |
} |
2401 | 2499 |
}, |
2402 | 2500 |
"node_modules/mime": { |
... | ... | @@ -2750,7 +2848,7 @@ |
2750 | 2848 |
"version": "2.3.1", |
2751 | 2849 |
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", |
2752 | 2850 |
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", |
2753 |
- "optional": true, |
|
2851 |
+ "devOptional": true, |
|
2754 | 2852 |
"engines": { |
2755 | 2853 |
"node": ">=8.6" |
2756 | 2854 |
}, |
... | ... | @@ -3420,7 +3518,7 @@ |
3420 | 3518 |
"version": "5.0.1", |
3421 | 3519 |
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", |
3422 | 3520 |
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", |
3423 |
- "optional": true, |
|
3521 |
+ "devOptional": true, |
|
3424 | 3522 |
"dependencies": { |
3425 | 3523 |
"is-number": "^7.0.0" |
3426 | 3524 |
}, |
... | ... | @@ -3434,6 +3532,181 @@ |
3434 | 3532 |
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", |
3435 | 3533 |
"engines": { |
3436 | 3534 |
"node": ">=0.6" |
3535 |
+ } |
|
3536 |
+ }, |
|
3537 |
+ "node_modules/ts-loader": { |
|
3538 |
+ "version": "9.5.0", |
|
3539 |
+ "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.5.0.tgz", |
|
3540 |
+ "integrity": "sha512-LLlB/pkB4q9mW2yLdFMnK3dEHbrBjeZTYguaaIfusyojBgAGf5kF+O6KcWqiGzWqHk0LBsoolrp4VftEURhybg==", |
|
3541 |
+ "dev": true, |
|
3542 |
+ "dependencies": { |
|
3543 |
+ "chalk": "^4.1.0", |
|
3544 |
+ "enhanced-resolve": "^5.0.0", |
|
3545 |
+ "micromatch": "^4.0.0", |
|
3546 |
+ "semver": "^7.3.4", |
|
3547 |
+ "source-map": "^0.7.4" |
|
3548 |
+ }, |
|
3549 |
+ "engines": { |
|
3550 |
+ "node": ">=12.0.0" |
|
3551 |
+ }, |
|
3552 |
+ "peerDependencies": { |
|
3553 |
+ "typescript": "*", |
|
3554 |
+ "webpack": "^5.0.0" |
|
3555 |
+ } |
|
3556 |
+ }, |
|
3557 |
+ "node_modules/ts-loader/node_modules/ansi-styles": { |
|
3558 |
+ "version": "4.3.0", |
|
3559 |
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", |
|
3560 |
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", |
|
3561 |
+ "dev": true, |
|
3562 |
+ "dependencies": { |
|
3563 |
+ "color-convert": "^2.0.1" |
|
3564 |
+ }, |
|
3565 |
+ "engines": { |
|
3566 |
+ "node": ">=8" |
|
3567 |
+ }, |
|
3568 |
+ "funding": { |
|
3569 |
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1" |
|
3570 |
+ } |
|
3571 |
+ }, |
|
3572 |
+ "node_modules/ts-loader/node_modules/chalk": { |
|
3573 |
+ "version": "4.1.2", |
|
3574 |
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", |
|
3575 |
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", |
|
3576 |
+ "dev": true, |
|
3577 |
+ "dependencies": { |
|
3578 |
+ "ansi-styles": "^4.1.0", |
|
3579 |
+ "supports-color": "^7.1.0" |
|
3580 |
+ }, |
|
3581 |
+ "engines": { |
|
3582 |
+ "node": ">=10" |
|
3583 |
+ }, |
|
3584 |
+ "funding": { |
|
3585 |
+ "url": "https://github.com/chalk/chalk?sponsor=1" |
|
3586 |
+ } |
|
3587 |
+ }, |
|
3588 |
+ "node_modules/ts-loader/node_modules/color-convert": { |
|
3589 |
+ "version": "2.0.1", |
|
3590 |
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", |
|
3591 |
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", |
|
3592 |
+ "dev": true, |
|
3593 |
+ "dependencies": { |
|
3594 |
+ "color-name": "~1.1.4" |
|
3595 |
+ }, |
|
3596 |
+ "engines": { |
|
3597 |
+ "node": ">=7.0.0" |
|
3598 |
+ } |
|
3599 |
+ }, |
|
3600 |
+ "node_modules/ts-loader/node_modules/color-name": { |
|
3601 |
+ "version": "1.1.4", |
|
3602 |
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", |
|
3603 |
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", |
|
3604 |
+ "dev": true |
|
3605 |
+ }, |
|
3606 |
+ "node_modules/ts-loader/node_modules/has-flag": { |
|
3607 |
+ "version": "4.0.0", |
|
3608 |
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", |
|
3609 |
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", |
|
3610 |
+ "dev": true, |
|
3611 |
+ "engines": { |
|
3612 |
+ "node": ">=8" |
|
3613 |
+ } |
|
3614 |
+ }, |
|
3615 |
+ "node_modules/ts-loader/node_modules/lru-cache": { |
|
3616 |
+ "version": "6.0.0", |
|
3617 |
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", |
|
3618 |
+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", |
|
3619 |
+ "dev": true, |
|
3620 |
+ "dependencies": { |
|
3621 |
+ "yallist": "^4.0.0" |
|
3622 |
+ }, |
|
3623 |
+ "engines": { |
|
3624 |
+ "node": ">=10" |
|
3625 |
+ } |
|
3626 |
+ }, |
|
3627 |
+ "node_modules/ts-loader/node_modules/semver": { |
|
3628 |
+ "version": "7.5.4", |
|
3629 |
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", |
|
3630 |
+ "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", |
|
3631 |
+ "dev": true, |
|
3632 |
+ "dependencies": { |
|
3633 |
+ "lru-cache": "^6.0.0" |
|
3634 |
+ }, |
|
3635 |
+ "bin": { |
|
3636 |
+ "semver": "bin/semver.js" |
|
3637 |
+ }, |
|
3638 |
+ "engines": { |
|
3639 |
+ "node": ">=10" |
|
3640 |
+ } |
|
3641 |
+ }, |
|
3642 |
+ "node_modules/ts-loader/node_modules/source-map": { |
|
3643 |
+ "version": "0.7.4", |
|
3644 |
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", |
|
3645 |
+ "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", |
|
3646 |
+ "dev": true, |
|
3647 |
+ "engines": { |
|
3648 |
+ "node": ">= 8" |
|
3649 |
+ } |
|
3650 |
+ }, |
|
3651 |
+ "node_modules/ts-loader/node_modules/supports-color": { |
|
3652 |
+ "version": "7.2.0", |
|
3653 |
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", |
|
3654 |
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", |
|
3655 |
+ "dev": true, |
|
3656 |
+ "dependencies": { |
|
3657 |
+ "has-flag": "^4.0.0" |
|
3658 |
+ }, |
|
3659 |
+ "engines": { |
|
3660 |
+ "node": ">=8" |
|
3661 |
+ } |
|
3662 |
+ }, |
|
3663 |
+ "node_modules/ts-loader/node_modules/yallist": { |
|
3664 |
+ "version": "4.0.0", |
|
3665 |
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", |
|
3666 |
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", |
|
3667 |
+ "dev": true |
|
3668 |
+ }, |
|
3669 |
+ "node_modules/ts-node": { |
|
3670 |
+ "version": "10.9.1", |
|
3671 |
+ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", |
|
3672 |
+ "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", |
|
3673 |
+ "dev": true, |
|
3674 |
+ "dependencies": { |
|
3675 |
+ "@cspotcode/source-map-support": "^0.8.0", |
|
3676 |
+ "@tsconfig/node10": "^1.0.7", |
|
3677 |
+ "@tsconfig/node12": "^1.0.7", |
|
3678 |
+ "@tsconfig/node14": "^1.0.0", |
|
3679 |
+ "@tsconfig/node16": "^1.0.2", |
|
3680 |
+ "acorn": "^8.4.1", |
|
3681 |
+ "acorn-walk": "^8.1.1", |
|
3682 |
+ "arg": "^4.1.0", |
|
3683 |
+ "create-require": "^1.1.0", |
|
3684 |
+ "diff": "^4.0.1", |
|
3685 |
+ "make-error": "^1.1.1", |
|
3686 |
+ "v8-compile-cache-lib": "^3.0.1", |
|
3687 |
+ "yn": "3.1.1" |
|
3688 |
+ }, |
|
3689 |
+ "bin": { |
|
3690 |
+ "ts-node": "dist/bin.js", |
|
3691 |
+ "ts-node-cwd": "dist/bin-cwd.js", |
|
3692 |
+ "ts-node-esm": "dist/bin-esm.js", |
|
3693 |
+ "ts-node-script": "dist/bin-script.js", |
|
3694 |
+ "ts-node-transpile-only": "dist/bin-transpile.js", |
|
3695 |
+ "ts-script": "dist/bin-script-deprecated.js" |
|
3696 |
+ }, |
|
3697 |
+ "peerDependencies": { |
|
3698 |
+ "@swc/core": ">=1.2.50", |
|
3699 |
+ "@swc/wasm": ">=1.2.50", |
|
3700 |
+ "@types/node": "*", |
|
3701 |
+ "typescript": ">=2.7" |
|
3702 |
+ }, |
|
3703 |
+ "peerDependenciesMeta": { |
|
3704 |
+ "@swc/core": { |
|
3705 |
+ "optional": true |
|
3706 |
+ }, |
|
3707 |
+ "@swc/wasm": { |
|
3708 |
+ "optional": true |
|
3709 |
+ } |
|
3437 | 3710 |
} |
3438 | 3711 |
}, |
3439 | 3712 |
"node_modules/tslib": { |
... | ... | @@ -3463,6 +3736,19 @@ |
3463 | 3736 |
}, |
3464 | 3737 |
"engines": { |
3465 | 3738 |
"node": ">= 0.6" |
3739 |
+ } |
|
3740 |
+ }, |
|
3741 |
+ "node_modules/typescript": { |
|
3742 |
+ "version": "5.2.2", |
|
3743 |
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", |
|
3744 |
+ "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", |
|
3745 |
+ "dev": true, |
|
3746 |
+ "bin": { |
|
3747 |
+ "tsc": "bin/tsc", |
|
3748 |
+ "tsserver": "bin/tsserver" |
|
3749 |
+ }, |
|
3750 |
+ "engines": { |
|
3751 |
+ "node": ">=14.17" |
|
3466 | 3752 |
} |
3467 | 3753 |
}, |
3468 | 3754 |
"node_modules/undici-types": { |
... | ... | @@ -3570,6 +3856,12 @@ |
3570 | 3856 |
"engines": { |
3571 | 3857 |
"node": ">= 0.4.0" |
3572 | 3858 |
} |
3859 |
+ }, |
|
3860 |
+ "node_modules/v8-compile-cache-lib": { |
|
3861 |
+ "version": "3.0.1", |
|
3862 |
+ "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", |
|
3863 |
+ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", |
|
3864 |
+ "dev": true |
|
3573 | 3865 |
}, |
3574 | 3866 |
"node_modules/vary": { |
3575 | 3867 |
"version": "1.1.2", |
... | ... | @@ -3997,6 +4289,15 @@ |
3997 | 4289 |
"version": "3.1.1", |
3998 | 4290 |
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", |
3999 | 4291 |
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" |
4292 |
+ }, |
|
4293 |
+ "node_modules/yn": { |
|
4294 |
+ "version": "3.1.1", |
|
4295 |
+ "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", |
|
4296 |
+ "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", |
|
4297 |
+ "dev": true, |
|
4298 |
+ "engines": { |
|
4299 |
+ "node": ">=6" |
|
4300 |
+ } |
|
4000 | 4301 |
} |
4001 | 4302 |
} |
4002 | 4303 |
} |
--- package.json
+++ package.json
... | ... | @@ -46,6 +46,9 @@ |
46 | 46 |
}, |
47 | 47 |
"devDependencies": { |
48 | 48 |
"less": "^4.2.0", |
49 |
- "less-loader": "^11.1.3" |
|
49 |
+ "less-loader": "^11.1.3", |
|
50 |
+ "ts-loader": "^9.5.0", |
|
51 |
+ "ts-node": "^10.9.1", |
|
52 |
+ "typescript": "^5.2.2" |
|
50 | 53 |
} |
51 | 54 |
} |
+++ tsconfig.json
... | ... | @@ -0,0 +1,22 @@ |
1 | +{ | |
2 | + "compilerOptions": { | |
3 | + /* "composite": true, | |
4 | + "target": "esnext", | |
5 | + "module": "esnext", | |
6 | + "strict": true, | |
7 | + "jsx": "preserve", | |
8 | + "moduleResolution": "node", | |
9 | + "allowImportingTsExtensions": true, | |
10 | + "emitDeclarationOnly": true */ | |
11 | + /* "outDir": "./client/build/", */ | |
12 | + "outDir": "./built/", | |
13 | + "strict": true, | |
14 | + "noImplicitAny": true, | |
15 | + "module": "es6", | |
16 | + "target": "es5", | |
17 | + "jsx": "preserve", | |
18 | + "allowJs": true, | |
19 | + "moduleResolution": "node", | |
20 | + | |
21 | + } | |
22 | +}(No newline at end of file) |
--- webpack.config.js
+++ webpack.config.js
... | ... | @@ -1,6 +1,6 @@ |
1 | 1 |
const { VueLoaderPlugin } = require("vue-loader"); |
2 | 2 |
|
3 |
-const {PROJECT_NAME, BASE_DIR, SERVICE_STATUS} = require('./Global'); |
|
3 |
+const {PROJECT_NAME, BASE_DIR, SERVICE_STATUS} = require('./Global.js'); |
|
4 | 4 |
|
5 | 5 |
module.exports = { |
6 | 6 |
name: PROJECT_NAME, |
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 |
devtool: 'eval', |
9 | 9 |
|
10 | 10 |
entry: { |
11 |
- app: [`${BASE_DIR}/client/views/index.js`] |
|
11 |
+ app: [`${BASE_DIR}/client/views/index.ts`] |
|
12 | 12 |
}, |
13 | 13 |
|
14 | 14 |
module: { |
... | ... | @@ -18,6 +18,9 @@ |
18 | 18 |
}, { |
19 | 19 |
test: /\.(js|jsx)?$/, |
20 | 20 |
loader: 'babel-loader', |
21 |
+ options: { |
|
22 |
+ compact: true, |
|
23 |
+ }, |
|
21 | 24 |
}, { |
22 | 25 |
test: /\.css$/, |
23 | 26 |
use: ['vue-style-loader', 'css-loader'] |
... | ... | @@ -30,11 +33,22 @@ |
30 | 33 |
fallback:require.resolve('file-loader') |
31 | 34 |
} |
32 | 35 |
}] |
36 |
+ },{ |
|
37 |
+ test: /\.(ts|tsx)$/, |
|
38 |
+ exclude: /node_modules/, |
|
39 |
+ loader: 'ts-loader', |
|
40 |
+ options: { appendTsSuffixTo: [/\.vue$/] } |
|
33 | 41 |
}], |
34 | 42 |
}, |
35 | 43 |
|
36 | 44 |
plugins: [new VueLoaderPlugin()], |
37 | 45 |
|
46 |
+ resolve: { |
|
47 |
+ //확장자를 순서대로 해석, 여러 파일에서 이름이 동일하지만 다른 확장자를 가진 경우, webpack은 배열의 앞에서부터 파일을 해석하고 남은 것은 해석하지 않음 |
|
48 |
+ //import 시, 확장자 생략 가능 |
|
49 |
+ extensions: [ '.tsx', '.ts', '.jsx', '.js', '.vue', 'json' ], |
|
50 |
+ }, |
|
51 |
+ |
|
38 | 52 |
output: { |
39 | 53 |
path: `${BASE_DIR}/client/build`, // __dirname: webpack.config.js 파일이 위치한 경로 |
40 | 54 |
filename: 'bundle.js' |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?