yjryu / KERIS star
류윤주 류윤주 2023-12-01
231201 이세현 기술문서
@d626703827aef915d0f1f6c14ae47f70a3ed894a
client/views/pages/admin/technology/TechInsert.vue
--- client/views/pages/admin/technology/TechInsert.vue
+++ client/views/pages/admin/technology/TechInsert.vue
@@ -283,6 +283,12 @@
                     document.getElementById("link_url").focus();
                     return false;
                 }
+
+                if (!this.post.link_url.startsWith('http://') && !this.post.link_url.startsWith('https://')) {
+                    alert("링크는 http:// 또는 https://로 시작해야합니다.");
+                    document.getElementById("link_url").focus();
+                    return false;
+                }
             }
 
             this.postInsert();
client/views/pages/admin/technology/TechSelectOne.vue
--- client/views/pages/admin/technology/TechSelectOne.vue
+++ client/views/pages/admin/technology/TechSelectOne.vue
@@ -45,7 +45,7 @@
                                                 <th>
                                                     <p>링크</p>
                                                 </th>
-                                                <td>{{ post.tech_doc_main_content }}</td>
+                                                <td>{{ post.link_url }}</td>
                                             </tr>
                                         </table>
                                 </div>
client/views/pages/admin/technology/TechUpdate.vue
--- client/views/pages/admin/technology/TechUpdate.vue
+++ client/views/pages/admin/technology/TechUpdate.vue
@@ -33,10 +33,25 @@
                                             v-model="post.ctgry_nm">
                                         <label for="issue" class="category">기술규격문서</label>
                                     </div>
+                                    <div>
+                                        <input type="radio" name="category" id="service" value="service"
+                                            style="display:none" v-model="post.ctgry_nm">
+                                        <label for="service" class="category">서비스</label>
+                                    </div>
                                 </div>
                             </td>
                         </tr>
-                        <tr>
+                        <tr v-if="post.ctgry_nm == 'service'">
+                            <th style="width:15%">기술문서 필수내용</th>
+                            <td>
+                                <div class="atech-grid">
+                                    <input type="date" name="" id="date" data-placeholder="배포날짜 (ex : 2023-11-17)" required
+                                        aria-required="true" v-model="post.tech_doc_dt">
+                                    <input type="Text" name="" id="link_url" placeholder="링크를 입력해주세요" v-model="post.link_url">
+                                </div>
+                            </td>
+                        </tr>
+                        <tr v-if="post.ctgry_nm != 'service'">
                             <th>기술문서 필수내용</th>
                             <td>
                                 <div class="atech-grid">
@@ -52,11 +67,11 @@
                                 </div>
                             </td>
                         </tr>
-                        <tr>
+                        <tr v-if="post.ctgry_nm != 'service'">
                             <th>내용</th>
                             <td><textarea name="smart" id="smart"></textarea></td>
                         </tr>
-                        <tr class="file-zone">
+                        <tr class="file-zone" v-if="post.ctgry_nm != 'service'">
                             <th>등록된 썸네일파일</th>
                             <td>
                                 <div class="join-sub-input join-imgbox"
@@ -68,7 +83,7 @@
                                 </div>
                             </td>
                         </tr>
-                        <tr class="file-zone">
+                        <tr class="file-zone" v-if="post.ctgry_nm != 'service'">
                             <th>등록된 첨부파일</th>
                             <td colspan="6">
                                 <div v-if="attachFileList.length == 0">
@@ -82,7 +97,7 @@
                                 </ul>
                             </td>
                         </tr>
-                        <tr class="file-zone">
+                        <tr class="file-zone" v-if="post.ctgry_nm != 'service'">
                             <th>추가 첨부파일</th>
                             <td colspan="6">
                                 <div class="btn-upload" @click="openFileInput('attach', 'attachInput')">파일 업로드</div>
@@ -278,59 +293,90 @@
 
         //등록 유효성 검사
         postUpdateCheck: function () {
-            const oEditors = this.oEditors;
-            oEditors.getById["smart"].exec("UPDATE_CONTENTS_FIELD", []);
-            // 스마트에디터의 iframe에 있는 내용을 textarea로. 
-            this.post.post_content = document.getElementById("smart").value;
+            if(this.post.ctgry_nm !== 'service'){
+                const oEditors = this.oEditors;
+                oEditors.getById["smart"].exec("UPDATE_CONTENTS_FIELD", []);
+                // 스마트에디터의 iframe에 있는 내용을 textarea로. 
+                this.post.post_content = document.getElementById("smart").value;
 
-            if (COMMON_UTIL.isEmpty(this.post.post_title) === false) {
-                alert("제목을 입력해주세요.");
-                document.getElementById("techTitle").focus();
-                return false;
+                if (COMMON_UTIL.isEmpty(this.post.post_title) === false) {
+                    alert("제목을 입력해주세요.");
+                    document.getElementById("techTitle").focus();
+                    return false;
+                }
+
+                if (COMMON_UTIL.isEmpty(this.post.ctgry_nm) === false) {
+                    alert("카테고리를 선택해주세요.");
+                    document.getElementById("api").focus();
+                    return false;
+                }
+
+                if (COMMON_UTIL.isEmpty(this.post.tech_doc_nm) === false) {
+                    alert("기술문서명을 입력해주세요");
+                    document.getElementById("techName").focus();
+                    return false;
+                }
+
+                if (COMMON_UTIL.isEmpty(this.post.tech_doc_version) === false) {
+                    alert("버전을 입력해주세요");
+                    document.getElementById("version").focus();
+                    return false;
+                }
+
+                if (COMMON_UTIL.isEmpty(this.post.tech_doc_dt) === false) {
+                    alert("배포날짜를 입력해주세요");
+                    document.getElementById("date").focus();
+                    return false;
+                }
+
+                if (COMMON_UTIL.isEmpty(this.post.tech_doc_keyword) === false) {
+                    alert("키워드를 입력해주세요");
+                    document.getElementById("keyword").focus();
+                    return false;
+                }
+
+                if (COMMON_UTIL.isEmpty(this.post.tech_doc_main_content) === false) {
+                    alert("주요내용을 입력해주세요");
+                    document.getElementById("techContent").focus();
+                    return false;
+                }
+
+                if (COMMON_UTIL.isEmpty(this.post.post_content) === false || this.post.post_content === "<p><br></p>") {
+                    alert("내용을 입력해주세요.");
+                    document.getElementById("smart").focus();
+                    return false;
+                }
+            } else {
+                if (COMMON_UTIL.isEmpty(this.post.post_title) === false) {
+                    alert("제목을 입력해주세요.");
+                    document.getElementById("techTitle").focus();
+                    return false;
+                }
+
+                if (COMMON_UTIL.isEmpty(this.post.ctgry_nm) === false) {
+                    alert("카테고리를 선택해주세요.");
+                    document.getElementById("api").focus();
+                    return false;
+                }
+
+                if (COMMON_UTIL.isEmpty(this.post.tech_doc_dt) === false) {
+                    alert("배포날짜를 입력해주세요");
+                    document.getElementById("date").focus();
+                    return false;
+                }
+
+                if (COMMON_UTIL.isEmpty(this.post.link_url) === false) {
+                    alert("링크를 입력해주세요");
+                    document.getElementById("link_url").focus();
+                    return false;
+                }
+
+                if (!this.post.link_url.startsWith('http://') && !this.post.link_url.startsWith('https://')) {
+                    alert("링크는 http:// 또는 https://로 시작해야합니다.");
+                    document.getElementById("link_url").focus();
+                    return false;
+                }
             }
-
-            if (COMMON_UTIL.isEmpty(this.post.ctgry_nm) === false) {
-                alert("카테고리를 선택해주세요.");
-                document.getElementById("api").focus();
-                return false;
-            }
-
-            if (COMMON_UTIL.isEmpty(this.post.tech_doc_nm) === false) {
-                alert("기술문서명을 입력해주세요");
-                document.getElementById("techName").focus();
-                return false;
-            }
-
-            if (COMMON_UTIL.isEmpty(this.post.tech_doc_version) === false) {
-                alert("버전을 입력해주세요");
-                document.getElementById("version").focus();
-                return false;
-            }
-
-            if (COMMON_UTIL.isEmpty(this.post.tech_doc_dt) === false) {
-                alert("배포날짜를 입력해주세요");
-                document.getElementById("date").focus();
-                return false;
-            }
-
-            if (COMMON_UTIL.isEmpty(this.post.tech_doc_keyword) === false) {
-                alert("키워드를 입력해주세요");
-                document.getElementById("keyword").focus();
-                return false;
-            }
-
-            if (COMMON_UTIL.isEmpty(this.post.tech_doc_main_content) === false) {
-                alert("주요내용을 입력해주세요");
-                document.getElementById("techContent").focus();
-                return false;
-            }
-
-            if (COMMON_UTIL.isEmpty(this.post.post_content) === false || this.post.post_content === "<p><br></p>") {
-                alert("내용을 입력해주세요.");
-                document.getElementById("smart").focus();
-                return false;
-            }
-
             this.postUpdate();
         },
 
client/views/pages/user/Data/Technology.vue
--- client/views/pages/user/Data/Technology.vue
+++ client/views/pages/user/Data/Technology.vue
@@ -202,7 +202,19 @@
         },
 
         serviceEvent(item) {
-            window.location.href = item.link_url;
+            const vm = this;
+            axios({
+                url: '/post/postViewCount.json',
+                method: 'post',
+                hearder: {
+                    'Content-Type': "application/json; charset=UTF-8",
+                },
+                data: { 'post_id': item.post_id, 'bbs_id': item.bbs_id }
+            }).then(function (response) {
+                window.location.href = item.link_url;
+            }).catch(function (error) {
+                alert("기술문서 상세보기 오류, 관리자에게 문의바랍니다.");
+            })
         },
     },
     watch: {
Add a comment
List