
--- client/views/pages/admin/technology/TechInsert.vue
+++ client/views/pages/admin/technology/TechInsert.vue
... | ... | @@ -283,6 +283,12 @@ |
283 | 283 |
document.getElementById("link_url").focus(); |
284 | 284 |
return false; |
285 | 285 |
} |
286 |
+ |
|
287 |
+ if (!this.post.link_url.startsWith('http://') && !this.post.link_url.startsWith('https://')) { |
|
288 |
+ alert("링크는 http:// 또는 https://로 시작해야합니다."); |
|
289 |
+ document.getElementById("link_url").focus(); |
|
290 |
+ return false; |
|
291 |
+ } |
|
286 | 292 |
} |
287 | 293 |
|
288 | 294 |
this.postInsert(); |
--- client/views/pages/admin/technology/TechSelectOne.vue
+++ client/views/pages/admin/technology/TechSelectOne.vue
... | ... | @@ -45,7 +45,7 @@ |
45 | 45 |
<th> |
46 | 46 |
<p>링크</p> |
47 | 47 |
</th> |
48 |
- <td>{{ post.tech_doc_main_content }}</td> |
|
48 |
+ <td>{{ post.link_url }}</td> |
|
49 | 49 |
</tr> |
50 | 50 |
</table> |
51 | 51 |
</div> |
--- client/views/pages/admin/technology/TechUpdate.vue
+++ client/views/pages/admin/technology/TechUpdate.vue
... | ... | @@ -33,10 +33,25 @@ |
33 | 33 |
v-model="post.ctgry_nm"> |
34 | 34 |
<label for="issue" class="category">기술규격문서</label> |
35 | 35 |
</div> |
36 |
+ <div> |
|
37 |
+ <input type="radio" name="category" id="service" value="service" |
|
38 |
+ style="display:none" v-model="post.ctgry_nm"> |
|
39 |
+ <label for="service" class="category">서비스</label> |
|
40 |
+ </div> |
|
36 | 41 |
</div> |
37 | 42 |
</td> |
38 | 43 |
</tr> |
39 |
- <tr> |
|
44 |
+ <tr v-if="post.ctgry_nm == 'service'"> |
|
45 |
+ <th style="width:15%">기술문서 필수내용</th> |
|
46 |
+ <td> |
|
47 |
+ <div class="atech-grid"> |
|
48 |
+ <input type="date" name="" id="date" data-placeholder="배포날짜 (ex : 2023-11-17)" required |
|
49 |
+ aria-required="true" v-model="post.tech_doc_dt"> |
|
50 |
+ <input type="Text" name="" id="link_url" placeholder="링크를 입력해주세요" v-model="post.link_url"> |
|
51 |
+ </div> |
|
52 |
+ </td> |
|
53 |
+ </tr> |
|
54 |
+ <tr v-if="post.ctgry_nm != 'service'"> |
|
40 | 55 |
<th>기술문서 필수내용</th> |
41 | 56 |
<td> |
42 | 57 |
<div class="atech-grid"> |
... | ... | @@ -52,11 +67,11 @@ |
52 | 67 |
</div> |
53 | 68 |
</td> |
54 | 69 |
</tr> |
55 |
- <tr> |
|
70 |
+ <tr v-if="post.ctgry_nm != 'service'"> |
|
56 | 71 |
<th>내용</th> |
57 | 72 |
<td><textarea name="smart" id="smart"></textarea></td> |
58 | 73 |
</tr> |
59 |
- <tr class="file-zone"> |
|
74 |
+ <tr class="file-zone" v-if="post.ctgry_nm != 'service'"> |
|
60 | 75 |
<th>등록된 썸네일파일</th> |
61 | 76 |
<td> |
62 | 77 |
<div class="join-sub-input join-imgbox" |
... | ... | @@ -68,7 +83,7 @@ |
68 | 83 |
</div> |
69 | 84 |
</td> |
70 | 85 |
</tr> |
71 |
- <tr class="file-zone"> |
|
86 |
+ <tr class="file-zone" v-if="post.ctgry_nm != 'service'"> |
|
72 | 87 |
<th>등록된 첨부파일</th> |
73 | 88 |
<td colspan="6"> |
74 | 89 |
<div v-if="attachFileList.length == 0"> |
... | ... | @@ -82,7 +97,7 @@ |
82 | 97 |
</ul> |
83 | 98 |
</td> |
84 | 99 |
</tr> |
85 |
- <tr class="file-zone"> |
|
100 |
+ <tr class="file-zone" v-if="post.ctgry_nm != 'service'"> |
|
86 | 101 |
<th>추가 첨부파일</th> |
87 | 102 |
<td colspan="6"> |
88 | 103 |
<div class="btn-upload" @click="openFileInput('attach', 'attachInput')">파일 업로드</div> |
... | ... | @@ -278,59 +293,90 @@ |
278 | 293 |
|
279 | 294 |
//등록 유효성 검사 |
280 | 295 |
postUpdateCheck: function () { |
281 |
- const oEditors = this.oEditors; |
|
282 |
- oEditors.getById["smart"].exec("UPDATE_CONTENTS_FIELD", []); |
|
283 |
- // 스마트에디터의 iframe에 있는 내용을 textarea로. |
|
284 |
- this.post.post_content = document.getElementById("smart").value; |
|
296 |
+ if(this.post.ctgry_nm !== 'service'){ |
|
297 |
+ const oEditors = this.oEditors; |
|
298 |
+ oEditors.getById["smart"].exec("UPDATE_CONTENTS_FIELD", []); |
|
299 |
+ // 스마트에디터의 iframe에 있는 내용을 textarea로. |
|
300 |
+ this.post.post_content = document.getElementById("smart").value; |
|
285 | 301 |
|
286 |
- if (COMMON_UTIL.isEmpty(this.post.post_title) === false) { |
|
287 |
- alert("제목을 입력해주세요."); |
|
288 |
- document.getElementById("techTitle").focus(); |
|
289 |
- return false; |
|
302 |
+ if (COMMON_UTIL.isEmpty(this.post.post_title) === false) { |
|
303 |
+ alert("제목을 입력해주세요."); |
|
304 |
+ document.getElementById("techTitle").focus(); |
|
305 |
+ return false; |
|
306 |
+ } |
|
307 |
+ |
|
308 |
+ if (COMMON_UTIL.isEmpty(this.post.ctgry_nm) === false) { |
|
309 |
+ alert("카테고리를 선택해주세요."); |
|
310 |
+ document.getElementById("api").focus(); |
|
311 |
+ return false; |
|
312 |
+ } |
|
313 |
+ |
|
314 |
+ if (COMMON_UTIL.isEmpty(this.post.tech_doc_nm) === false) { |
|
315 |
+ alert("기술문서명을 입력해주세요"); |
|
316 |
+ document.getElementById("techName").focus(); |
|
317 |
+ return false; |
|
318 |
+ } |
|
319 |
+ |
|
320 |
+ if (COMMON_UTIL.isEmpty(this.post.tech_doc_version) === false) { |
|
321 |
+ alert("버전을 입력해주세요"); |
|
322 |
+ document.getElementById("version").focus(); |
|
323 |
+ return false; |
|
324 |
+ } |
|
325 |
+ |
|
326 |
+ if (COMMON_UTIL.isEmpty(this.post.tech_doc_dt) === false) { |
|
327 |
+ alert("배포날짜를 입력해주세요"); |
|
328 |
+ document.getElementById("date").focus(); |
|
329 |
+ return false; |
|
330 |
+ } |
|
331 |
+ |
|
332 |
+ if (COMMON_UTIL.isEmpty(this.post.tech_doc_keyword) === false) { |
|
333 |
+ alert("키워드를 입력해주세요"); |
|
334 |
+ document.getElementById("keyword").focus(); |
|
335 |
+ return false; |
|
336 |
+ } |
|
337 |
+ |
|
338 |
+ if (COMMON_UTIL.isEmpty(this.post.tech_doc_main_content) === false) { |
|
339 |
+ alert("주요내용을 입력해주세요"); |
|
340 |
+ document.getElementById("techContent").focus(); |
|
341 |
+ return false; |
|
342 |
+ } |
|
343 |
+ |
|
344 |
+ if (COMMON_UTIL.isEmpty(this.post.post_content) === false || this.post.post_content === "<p><br></p>") { |
|
345 |
+ alert("내용을 입력해주세요."); |
|
346 |
+ document.getElementById("smart").focus(); |
|
347 |
+ return false; |
|
348 |
+ } |
|
349 |
+ } else { |
|
350 |
+ if (COMMON_UTIL.isEmpty(this.post.post_title) === false) { |
|
351 |
+ alert("제목을 입력해주세요."); |
|
352 |
+ document.getElementById("techTitle").focus(); |
|
353 |
+ return false; |
|
354 |
+ } |
|
355 |
+ |
|
356 |
+ if (COMMON_UTIL.isEmpty(this.post.ctgry_nm) === false) { |
|
357 |
+ alert("카테고리를 선택해주세요."); |
|
358 |
+ document.getElementById("api").focus(); |
|
359 |
+ return false; |
|
360 |
+ } |
|
361 |
+ |
|
362 |
+ if (COMMON_UTIL.isEmpty(this.post.tech_doc_dt) === false) { |
|
363 |
+ alert("배포날짜를 입력해주세요"); |
|
364 |
+ document.getElementById("date").focus(); |
|
365 |
+ return false; |
|
366 |
+ } |
|
367 |
+ |
|
368 |
+ if (COMMON_UTIL.isEmpty(this.post.link_url) === false) { |
|
369 |
+ alert("링크를 입력해주세요"); |
|
370 |
+ document.getElementById("link_url").focus(); |
|
371 |
+ return false; |
|
372 |
+ } |
|
373 |
+ |
|
374 |
+ if (!this.post.link_url.startsWith('http://') && !this.post.link_url.startsWith('https://')) { |
|
375 |
+ alert("링크는 http:// 또는 https://로 시작해야합니다."); |
|
376 |
+ document.getElementById("link_url").focus(); |
|
377 |
+ return false; |
|
378 |
+ } |
|
290 | 379 |
} |
291 |
- |
|
292 |
- if (COMMON_UTIL.isEmpty(this.post.ctgry_nm) === false) { |
|
293 |
- alert("카테고리를 선택해주세요."); |
|
294 |
- document.getElementById("api").focus(); |
|
295 |
- return false; |
|
296 |
- } |
|
297 |
- |
|
298 |
- if (COMMON_UTIL.isEmpty(this.post.tech_doc_nm) === false) { |
|
299 |
- alert("기술문서명을 입력해주세요"); |
|
300 |
- document.getElementById("techName").focus(); |
|
301 |
- return false; |
|
302 |
- } |
|
303 |
- |
|
304 |
- if (COMMON_UTIL.isEmpty(this.post.tech_doc_version) === false) { |
|
305 |
- alert("버전을 입력해주세요"); |
|
306 |
- document.getElementById("version").focus(); |
|
307 |
- return false; |
|
308 |
- } |
|
309 |
- |
|
310 |
- if (COMMON_UTIL.isEmpty(this.post.tech_doc_dt) === false) { |
|
311 |
- alert("배포날짜를 입력해주세요"); |
|
312 |
- document.getElementById("date").focus(); |
|
313 |
- return false; |
|
314 |
- } |
|
315 |
- |
|
316 |
- if (COMMON_UTIL.isEmpty(this.post.tech_doc_keyword) === false) { |
|
317 |
- alert("키워드를 입력해주세요"); |
|
318 |
- document.getElementById("keyword").focus(); |
|
319 |
- return false; |
|
320 |
- } |
|
321 |
- |
|
322 |
- if (COMMON_UTIL.isEmpty(this.post.tech_doc_main_content) === false) { |
|
323 |
- alert("주요내용을 입력해주세요"); |
|
324 |
- document.getElementById("techContent").focus(); |
|
325 |
- return false; |
|
326 |
- } |
|
327 |
- |
|
328 |
- if (COMMON_UTIL.isEmpty(this.post.post_content) === false || this.post.post_content === "<p><br></p>") { |
|
329 |
- alert("내용을 입력해주세요."); |
|
330 |
- document.getElementById("smart").focus(); |
|
331 |
- return false; |
|
332 |
- } |
|
333 |
- |
|
334 | 380 |
this.postUpdate(); |
335 | 381 |
}, |
336 | 382 |
|
--- client/views/pages/user/Data/Technology.vue
+++ client/views/pages/user/Data/Technology.vue
... | ... | @@ -202,7 +202,19 @@ |
202 | 202 |
}, |
203 | 203 |
|
204 | 204 |
serviceEvent(item) { |
205 |
- window.location.href = item.link_url; |
|
205 |
+ const vm = this; |
|
206 |
+ axios({ |
|
207 |
+ url: '/post/postViewCount.json', |
|
208 |
+ method: 'post', |
|
209 |
+ hearder: { |
|
210 |
+ 'Content-Type': "application/json; charset=UTF-8", |
|
211 |
+ }, |
|
212 |
+ data: { 'post_id': item.post_id, 'bbs_id': item.bbs_id } |
|
213 |
+ }).then(function (response) { |
|
214 |
+ window.location.href = item.link_url; |
|
215 |
+ }).catch(function (error) { |
|
216 |
+ alert("기술문서 상세보기 오류, 관리자에게 문의바랍니다."); |
|
217 |
+ }) |
|
206 | 218 |
}, |
207 | 219 |
}, |
208 | 220 |
watch: { |
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?