
--- client/views/pages/bbsDcry/photo/PicHistoryInsert.vue
+++ client/views/pages/bbsDcry/photo/PicHistoryInsert.vue
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 |
<div class="hr"></div> |
23 | 23 |
<dd> |
24 | 24 |
<label for="prdctnYear">생산연도</label> |
25 |
- <input type="text" id="prdctnYear" placeholder="생산연도를 입력하세요" v-model="requestDTO.prdctnYear"> |
|
25 |
+ <input type="text" id="prdctnYear" placeholder="생산연도를 입력하세요" v-model="requestDTO.prdctnYear" pattern="[0-9]{4}" maxlength="4" @input="onlyNumberInput"> |
|
26 | 26 |
</dd> |
27 | 27 |
<div class="hr"></div> |
28 | 28 |
<dd> |
... | ... | @@ -327,6 +327,16 @@ |
327 | 327 |
alert("제목을 입력해 주세요."); |
328 | 328 |
return; |
329 | 329 |
} |
330 |
+ if (!this.$isEmpty(this.requestDTO.prdctnYear)) { |
|
331 |
+ if (!/^\d+$/.test(this.requestDTO.prdctnYear)) { |
|
332 |
+ alert("생산연도는 숫자만 입력 가능합니다."); |
|
333 |
+ return; |
|
334 |
+ } |
|
335 |
+ if (this.requestDTO.prdctnYear.length !== 4) { |
|
336 |
+ alert("생산연도는 4자리로 입력해주세요."); |
|
337 |
+ return; |
|
338 |
+ } |
|
339 |
+ } |
|
330 | 340 |
|
331 | 341 |
let count = this.multipartFiles.length |
332 | 342 |
if (!this.$isEmpty(this.pageId)) { |
... | ... | @@ -424,6 +434,11 @@ |
424 | 434 |
this.$router.push(routes['list']); |
425 | 435 |
} |
426 | 436 |
}, |
437 |
+ |
|
438 |
+ // 생산연도 입력 제한 |
|
439 |
+ onlyNumberInput() { |
|
440 |
+ this.requestDTO.prdctnYear = this.requestDTO.prdctnYear.replace(/[^0-9]/g, ''); |
|
441 |
+ } |
|
427 | 442 |
} |
428 | 443 |
}; |
429 | 444 |
</script> |
--- client/views/pages/bbsDcry/video/VideoHistoryInsert.vue
+++ client/views/pages/bbsDcry/video/VideoHistoryInsert.vue
... | ... | @@ -21,7 +21,7 @@ |
21 | 21 |
<div class="hr"></div> |
22 | 22 |
<dd> |
23 | 23 |
<label for="prdctnYear">생산연도</label> |
24 |
- <input type="text" id="prdctnYear" placeholder="생산연도를 입력하세요" v-model="requestDTO.prdctnYear"> |
|
24 |
+ <input type="text" id="prdctnYear" placeholder="생산연도를 입력하세요" v-model="requestDTO.prdctnYear" pattern="[0-9]{4}" maxlength="4" @input="onlyNumberInput"> |
|
25 | 25 |
</dd> |
26 | 26 |
<div class="hr"></div> |
27 | 27 |
<dd> |
... | ... | @@ -274,9 +274,19 @@ |
274 | 274 |
// 등록 |
275 | 275 |
async submitForm() { |
276 | 276 |
// 유효성 검사 |
277 |
- if (!this.requestDTO.sj) { |
|
277 |
+ if (!this.$isEmpty(this.requestDTO.sj)) { |
|
278 | 278 |
alert("제목을 입력해 주세요."); |
279 | 279 |
return; |
280 |
+ } |
|
281 |
+ if (!this.$isEmpty(this.requestDTO.prdctnYear)) { |
|
282 |
+ if (!/^\d+$/.test(this.requestDTO.prdctnYear)) { |
|
283 |
+ alert("생산연도는 숫자만 입력 가능합니다."); |
|
284 |
+ return; |
|
285 |
+ } |
|
286 |
+ if (this.requestDTO.prdctnYear.length !== 4) { |
|
287 |
+ alert("생산연도는 4자리로 입력해주세요."); |
|
288 |
+ return; |
|
289 |
+ } |
|
280 | 290 |
} |
281 | 291 |
|
282 | 292 |
let count = this.multipartFiles.length |
... | ... | @@ -370,6 +380,11 @@ |
370 | 380 |
this.$router.push(routes['list']); |
371 | 381 |
} |
372 | 382 |
}, |
383 |
+ |
|
384 |
+ // 생산연도 입력 제한 |
|
385 |
+ onlyNumberInput() { |
|
386 |
+ this.requestDTO.prdctnYear = this.requestDTO.prdctnYear.replace(/[^0-9]/g, ''); |
|
387 |
+ } |
|
373 | 388 |
} |
374 | 389 |
}; |
375 | 390 |
</script> |
--- client/views/pages/bbsMediaVido/MediaVideoInsert.vue
+++ client/views/pages/bbsMediaVido/MediaVideoInsert.vue
... | ... | @@ -21,7 +21,7 @@ |
21 | 21 |
<div class="hr"></div> |
22 | 22 |
<dd> |
23 | 23 |
<label for="prdctnYear">생산연도</label> |
24 |
- <input type="text" id="prdctnYear" placeholder="생산연도를 입력하세요" v-model="requestDTO.prdctnYear"> |
|
24 |
+ <input type="text" id="prdctnYear" placeholder="생산연도를 입력하세요" v-model="requestDTO.prdctnYear" pattern="[0-9]{4}" maxlength="4" @input="onlyNumberInput"> |
|
25 | 25 |
</dd> |
26 | 26 |
<div class="hr"></div> |
27 | 27 |
<dd> |
... | ... | @@ -158,6 +158,16 @@ |
158 | 158 |
alert("제목을 입력해 주세요."); |
159 | 159 |
return; |
160 | 160 |
} |
161 |
+ if (!this.$isEmpty(this.requestDTO.prdctnYear)) { |
|
162 |
+ if (!/^\d+$/.test(this.requestDTO.prdctnYear)) { |
|
163 |
+ alert("생산연도는 숫자만 입력 가능합니다."); |
|
164 |
+ return; |
|
165 |
+ } |
|
166 |
+ if (this.requestDTO.prdctnYear.length !== 4) { |
|
167 |
+ alert("생산연도는 4자리로 입력해주세요."); |
|
168 |
+ return; |
|
169 |
+ } |
|
170 |
+ } |
|
161 | 171 |
|
162 | 172 |
try { |
163 | 173 |
if (this.$isEmpty(this.pageId)) { |
... | ... | @@ -198,6 +208,11 @@ |
198 | 208 |
this.$router.push(routes['list']); |
199 | 209 |
} |
200 | 210 |
}, |
211 |
+ |
|
212 |
+ // 생산연도 입력 제한 |
|
213 |
+ onlyNumberInput() { |
|
214 |
+ this.requestDTO.prdctnYear = this.requestDTO.prdctnYear.replace(/[^0-9]/g, ''); |
|
215 |
+ } |
|
201 | 216 |
} |
202 | 217 |
}; |
203 | 218 |
</script>(파일 끝에 줄바꿈 문자 없음) |
--- client/views/pages/bbsNesDta/NewsReleaseInsert.vue
+++ client/views/pages/bbsNesDta/NewsReleaseInsert.vue
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 |
<div class="hr"></div> |
23 | 23 |
<dd> |
24 | 24 |
<label for="prdctnYear">생산연도</label> |
25 |
- <input type="text" id="prdctnYear" placeholder="생산연도를 입력하세요" v-model="requestDTO.prdctnYear"> |
|
25 |
+ <input type="text" id="prdctnYear" placeholder="생산연도를 입력하세요" v-model="requestDTO.prdctnYear" pattern="[0-9]{4}" maxlength="4" @input="onlyNumberInput"> |
|
26 | 26 |
</dd> |
27 | 27 |
<div class="hr"></div> |
28 | 28 |
<dd> |
... | ... | @@ -276,6 +276,16 @@ |
276 | 276 |
alert("제목을 입력해 주세요."); |
277 | 277 |
return; |
278 | 278 |
} |
279 |
+ if (!this.$isEmpty(this.requestDTO.prdctnYear)) { |
|
280 |
+ if (!/^\d+$/.test(this.requestDTO.prdctnYear)) { |
|
281 |
+ alert("생산연도는 숫자만 입력 가능합니다."); |
|
282 |
+ return; |
|
283 |
+ } |
|
284 |
+ if (this.requestDTO.prdctnYear.length !== 4) { |
|
285 |
+ alert("생산연도는 4자리로 입력해주세요."); |
|
286 |
+ return; |
|
287 |
+ } |
|
288 |
+ } |
|
279 | 289 |
|
280 | 290 |
try { |
281 | 291 |
const formData = new FormData(); |
... | ... | @@ -358,6 +368,11 @@ |
358 | 368 |
alert("올바르지 않은 경로를 요청하여 목록으로 이동합니다."); |
359 | 369 |
this.$router.push(routes['list']); |
360 | 370 |
} |
371 |
+ }, |
|
372 |
+ |
|
373 |
+ // 생산연도 입력 제한 |
|
374 |
+ onlyNumberInput() { |
|
375 |
+ this.requestDTO.prdctnYear = this.requestDTO.prdctnYear.replace(/[^0-9]/g, ''); |
|
361 | 376 |
} |
362 | 377 |
} |
363 | 378 |
}; |
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?