
--- client/views/pages/bbsDcry/photo/PicHistoryInsert.vue
+++ client/views/pages/bbsDcry/photo/PicHistoryInsert.vue
... | ... | @@ -274,7 +274,8 @@ |
274 | 274 |
alert("제목을 입력해 주세요."); |
275 | 275 |
return; |
276 | 276 |
} |
277 |
- if (this.$isEmpty(this.pageId) && this.multipartFiles.length == 0) { |
|
277 |
+ |
|
278 |
+ if ((this.multipartFiles.length + this.requestDTO.files.length) == 0) { |
|
278 | 279 |
alert("파일을 1개 이상 첨부해 주세요."); |
279 | 280 |
return; |
280 | 281 |
} |
--- client/views/pages/bbsDcry/video/VideoHistoryInsert.vue
+++ client/views/pages/bbsDcry/video/VideoHistoryInsert.vue
... | ... | @@ -16,23 +16,23 @@ |
16 | 16 |
<dl> |
17 | 17 |
<dd> |
18 | 18 |
<label for="sj" class="require">제목</label> |
19 |
- <div class="wfull"><input type="text" id="sj" placeholder="제목을 입력하세요." v-model="reqDTO.sj"></div> |
|
19 |
+ <div class="wfull"><input type="text" id="sj" placeholder="제목을 입력하세요." v-model="requestDTO.sj"></div> |
|
20 | 20 |
</dd> |
21 | 21 |
<div class="hr"></div> |
22 | 22 |
<dd> |
23 | 23 |
<label for="prdctnYear">생산연도</label> |
24 |
- <input type="text" id="prdctnYear" placeholder="생산연도를 입력하세요" v-model="reqDTO.prdctnYear"> |
|
24 |
+ <input type="text" id="prdctnYear" placeholder="생산연도를 입력하세요" v-model="requestDTO.prdctnYear"> |
|
25 | 25 |
</dd> |
26 | 26 |
<div class="hr"></div> |
27 | 27 |
<dd> |
28 | 28 |
<label for="adres">주소</label> |
29 |
- <div class="wfull"><input type="text" id="adres" placeholder="주소를 입력하세요" v-model="reqDTO.adres"></div> |
|
29 |
+ <div class="wfull"><input type="text" id="adres" placeholder="주소를 입력하세요" v-model="requestDTO.adres"></div> |
|
30 | 30 |
</dd> |
31 | 31 |
<div class="hr"></div> |
32 | 32 |
<dd> |
33 | 33 |
<label for="text">내용</label> |
34 | 34 |
<div class="wfull"> |
35 |
- <EditorComponent v-model:contents="reqDTO.cn" /> |
|
35 |
+ <EditorComponent v-model:contents="requestDTO.cn" /> |
|
36 | 36 |
</div> |
37 | 37 |
</dd> |
38 | 38 |
<div class="hr"></div> |
... | ... | @@ -63,7 +63,7 @@ |
63 | 63 |
</label> |
64 | 64 |
<p class="mb-10">파일목록</p> |
65 | 65 |
<div id="fileNames" class="file-names"> |
66 |
- <div v-if="reqDTO.files.length === 0 && multipartFiles.length === 0">선택된 파일이 없습니다.</div> |
|
66 |
+ <div v-if="requestDTO.files.length === 0 && multipartFiles.length === 0">선택된 파일이 없습니다.</div> |
|
67 | 67 |
<!-- 새로 추가된 파일 목록 --> |
68 | 68 |
<div v-for="(file, idx) of multipartFiles" :key="idx" class="flex-sp-bw mb-5 file-wrap"> |
69 | 69 |
<div class="file-name"> |
... | ... | @@ -73,7 +73,7 @@ |
73 | 73 |
<button type="button" class="cancel" @click="fnDelFile('new', idx)"><b>✕</b></button> |
74 | 74 |
</div> |
75 | 75 |
<!-- 기존 등록된 파일 목록 --> |
76 |
- <div v-for="(file, idx) of reqDTO.files" :key="idx" class="flex-sp-bw mb-5 file-wrap"> |
|
76 |
+ <div v-for="(file, idx) of requestDTO.files" :key="idx" class="flex-sp-bw mb-5 file-wrap"> |
|
77 | 77 |
<div class="file-name"> |
78 | 78 |
<img src="/client/resources/images/icon/imgicon.png" alt="fileicon"> |
79 | 79 |
<p>{{ file.fileNm }}</p> |
... | ... | @@ -131,7 +131,7 @@ |
131 | 131 |
fileNames: [], |
132 | 132 |
|
133 | 133 |
// 등록/수정 요청 객체 |
134 |
- reqDTO: { |
|
134 |
+ requestDTO: { |
|
135 | 135 |
dcryId: null, |
136 | 136 |
sj: null, |
137 | 137 |
cn: null, |
... | ... | @@ -178,20 +178,20 @@ |
178 | 178 |
} |
179 | 179 |
}, |
180 | 180 |
|
181 |
- // dcry > reqDTO |
|
181 |
+ // dcry > requestDTO |
|
182 | 182 |
copyToDcryReqDTO(dcry) { |
183 |
- const copyFields = Object.keys(this.reqDTO).filter(key => key !== 'dcryId' && key !== 'ty' && key !== 'files'); |
|
183 |
+ const copyFields = Object.keys(this.requestDTO).filter(key => key !== 'dcryId' && key !== 'ty' && key !== 'files'); |
|
184 | 184 |
copyFields.forEach(field => { |
185 |
- this.reqDTO[field] = this.$isEmpty(dcry[field]) ? null : dcry[field]; |
|
185 |
+ this.requestDTO[field] = this.$isEmpty(dcry[field]) ? null : dcry[field]; |
|
186 | 186 |
}); |
187 | 187 |
|
188 |
- this.reqDTO.ty = 'V'; // 영상기록물 |
|
189 |
- this.reqDTO.files = dcry.files.length > 0 ? dcry.files : []; // 기존 첨부파일 |
|
188 |
+ this.requestDTO.ty = 'V'; // 영상기록물 |
|
189 |
+ this.requestDTO.files = dcry.files.length > 0 ? dcry.files : []; // 기존 첨부파일 |
|
190 | 190 |
|
191 | 191 |
this.multipartFiles = []; |
192 | 192 |
this.selectedCtgries = dcry.ctgrys.length > 0 ? dcry.ctgrys : []; |
193 | 193 |
|
194 |
- console.log(this.reqDTO); |
|
194 |
+ console.log(this.requestDTO); |
|
195 | 195 |
}, |
196 | 196 |
|
197 | 197 |
// 카테고리 모달 열기/닫기 |
... | ... | @@ -239,7 +239,7 @@ |
239 | 239 |
const maxSize = 10 * 1024 * 1024 * 1024; // 10GB |
240 | 240 |
|
241 | 241 |
// 유효성 검사 |
242 |
- if (files.length > 1 + this.multipartFiles.length + this.reqDTO.files.length > 0) { |
|
242 |
+ if ((files.length + this.multipartFiles.length + this.requestDTO.files.length) > 1) { |
|
243 | 243 |
alert("영상 파일은 한 개만 등록 가능합니다."); |
244 | 244 |
return; |
245 | 245 |
} |
... | ... | @@ -249,7 +249,7 @@ |
249 | 249 |
|
250 | 250 |
// 파일 타입 검증 |
251 | 251 |
if (!allowedTypes.includes(fileType)) { |
252 |
- alert(`${file.name} 파일은 허용되지 않는 형식입니다. 이미지 파일(jpg, jpeg, png, gif)만 업로드 가능합니다.`); |
|
252 |
+ alert(`${file.name} 파일은 허용되지 않는 형식입니다. 영상 파일(mp4, mov, avi, wmv, mkv, webm)만 업로드 가능합니다.`); |
|
253 | 253 |
return; |
254 | 254 |
} |
255 | 255 |
|
... | ... | @@ -268,18 +268,19 @@ |
268 | 268 |
if (type === 'new') { |
269 | 269 |
this.multipartFiles.splice(separator, 1); |
270 | 270 |
} else if (type === 'old') { |
271 |
- this.reqDTO.files = this.reqDTO.files.filter(item => item.fileId !== separator); |
|
271 |
+ this.requestDTO.files = this.requestDTO.files.filter(item => item.fileId !== separator); |
|
272 | 272 |
} |
273 | 273 |
}, |
274 | 274 |
|
275 | 275 |
// 등록 |
276 | 276 |
async submitForm() { |
277 | 277 |
// 유효성 검사 |
278 |
- if (!this.reqDTO.sj) { |
|
278 |
+ if (!this.requestDTO.sj) { |
|
279 | 279 |
alert("제목을 입력해 주세요."); |
280 | 280 |
return; |
281 | 281 |
} |
282 |
- if (this.$isEmpty(this.pageId) && this.multipartFiles.length == 0) { |
|
282 |
+ |
|
283 |
+ if ((this.multipartFiles.length + this.requestDTO.files.length) == 0) { |
|
283 | 284 |
alert("파일을 1개 이상 첨부해 주세요."); |
284 | 285 |
return; |
285 | 286 |
} |
... | ... | @@ -288,11 +289,11 @@ |
288 | 289 |
const formData = new FormData(); |
289 | 290 |
|
290 | 291 |
// 텍스트 데이터 추가 |
291 |
- formData.append('sj', this.reqDTO.sj); |
|
292 |
- formData.append('cn', this.reqDTO.cn); |
|
293 |
- formData.append('adres', this.reqDTO.adres); |
|
294 |
- formData.append('prdctnYear', this.reqDTO.prdctnYear); |
|
295 |
- formData.append('ty', this.reqDTO.ty); |
|
292 |
+ formData.append('sj', this.requestDTO.sj); |
|
293 |
+ formData.append('cn', this.requestDTO.cn); |
|
294 |
+ formData.append('adres', this.requestDTO.adres); |
|
295 |
+ formData.append('prdctnYear', this.requestDTO.prdctnYear); |
|
296 |
+ formData.append('ty', this.requestDTO.ty); |
|
296 | 297 |
|
297 | 298 |
// 게시물 아이디 |
298 | 299 |
if (!this.$isEmpty(this.pageId)) { |
... | ... | @@ -300,8 +301,8 @@ |
300 | 301 |
} |
301 | 302 |
|
302 | 303 |
// 파일 아이디 |
303 |
- if (!this.$isEmpty(this.reqDTO.fileId)) { |
|
304 |
- formData.append('fileId', this.reqDTO.fileId); |
|
304 |
+ if (!this.$isEmpty(this.requestDTO.fileId)) { |
|
305 |
+ formData.append('fileId', this.requestDTO.fileId); |
|
305 | 306 |
} |
306 | 307 |
|
307 | 308 |
// 카테고리 Ids 추가 |
... | ... | @@ -317,8 +318,8 @@ |
317 | 318 |
} |
318 | 319 |
|
319 | 320 |
// 기존파일 수정 |
320 |
- if (!this.$isEmpty(this.pageId) && this.reqDTO.files.length > 0) { |
|
321 |
- for (let file of this.reqDTO.files) { |
|
321 |
+ if (!this.$isEmpty(this.pageId) && this.requestDTO.files.length > 0) { |
|
322 |
+ for (let file of this.requestDTO.files) { |
|
322 | 323 |
formData.append("files", file.fileId); |
323 | 324 |
} |
324 | 325 |
} |
--- client/views/pages/bbsNesDta/NewsReleaseInsert.vue
+++ client/views/pages/bbsNesDta/NewsReleaseInsert.vue
... | ... | @@ -231,6 +231,12 @@ |
231 | 231 |
const allowedTypes = ['jpg', 'jpeg', 'png', 'gif']; // 이미지 파일만 허용 |
232 | 232 |
const maxSize = 10 * 1024 * 1024 * 1024; // 10GB |
233 | 233 |
|
234 |
+ // 유효성 검사 |
|
235 |
+ if ((files.length + this.multipartFiles.length + this.requestDTO.files.length) > 1) { |
|
236 |
+ alert("썸네일은 한 개만 등록 가능합니다."); |
|
237 |
+ return; |
|
238 |
+ } |
|
239 |
+ |
|
234 | 240 |
for (let file of files) { |
235 | 241 |
const fileType = file.name.split('.').pop().toLowerCase(); |
236 | 242 |
|
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?