yjryu / KERIS star
Stormen123 2023-11-17
231117 김성훈 조회수 증가 추가
@87673a7e4fd6ad033c0bb514c8ebc4d7b0c94e5f
client/views/pages/admin/technology/TechUpdate.vue
--- client/views/pages/admin/technology/TechUpdate.vue
+++ client/views/pages/admin/technology/TechUpdate.vue
@@ -168,7 +168,7 @@
                         if (vm.fileList[i].file_ty === 'thumbnail') {
                             vm.oldThumbnailFileList.push(vm.fileList[i])
                             vm.thumbnailPreview = 'http://localhost:8080' + vm.fileList[i].file_path.replace('C:', '') +
-                                '\\thumbnail_' + vm.fileList[i].file_nm + '.' + vm.fileList[i].file_extn_nm;
+                                '/thumbnail_' + vm.fileList[i].file_nm + '.' + vm.fileList[i].file_extn_nm;
                         } else {
                             vm.attachFileList.push(vm.fileList[i]);
                         }
client/views/pages/user/Data/Data.vue
--- client/views/pages/user/Data/Data.vue
+++ client/views/pages/user/Data/Data.vue
@@ -192,8 +192,8 @@
             return COMMON_UTIL.yyyymmdd(date);
         },
 
-        //게시글 상세조회 페이지로 이동
-        postSelectOnePage: function (item) {
+         //게시글 상세조회 페이지로 이동
+         postSelectOnePage: function (item) {
             const vm = this;
 
             axios({
@@ -202,11 +202,16 @@
                 hearder: {
                     'Content-Type': "application/json; charset=UTF-8",
                 },
-                data: { 'post_id': item.post_id }
+                data: { 'post_id': item.post_id, 'bbs_id': item.bbs_id }
             }).then(function (response) {
-                vm.$router.push({ path: '/DataDtali.page', query: { 'post_id': item.post_id, 'file_id': item.file_id, 'bbs_id': item.bbs_id } });
+                if(response.data > 0 ) {
+                    vm.$router.push({ path: '/DataDtali.page', query: { 'post_id': item.post_id, 'file_id': item.file_id, 'bbs_id': item.bbs_id } });
+                } else {
+                    alert("자료집 상세보기 오류")
+                }
+                
             }).catch(function (error) {
-                console.log("서버오류");
+                alert("자료집 상세보기 오류, 관리자에게 문의바랍니다.");
             })
         },
     },
client/views/pages/user/Data/Technology.vue
--- client/views/pages/user/Data/Technology.vue
+++ client/views/pages/user/Data/Technology.vue
@@ -7,7 +7,7 @@
                     <h1>기술문서</h1>
                 </div>
                 <ul class="tech-bos">
-                    <li class="tech-box-sec" v-for="(item, idx) in postList" :key="idx" @click="openModal(item)">
+                    <li class="tech-box-sec" v-for="(item, idx) in postList" :key="idx">
                         <div class="tech-box-sec-h3">
                             <h3>{{ item.post_title }}</h3>
                         </div>
@@ -28,7 +28,7 @@
                             </div>
                         </div>
                         <div>
-                            <button class="blue-btn" @click="goToPage3(item)">바로가기</button>
+                            <button class="blue-btn" @click="postSelectOnePage(item)">바로가기</button>
                         </div>
                     </li>
                     <li class="tech-box-sec ">
@@ -254,8 +254,27 @@
         }
     },
     methods: {
-        goToPage3(item) {
-            this.$router.push({ path: '/TechnologyOne.page', query: { 'post_id': item.post_id, 'file_id': item.file_id, 'bbs_id': item.bbs_id } });
+        postSelectOnePage(item) {
+            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) {
+                if(response.data > 0 ) {
+                    vm.$router.push({ path: '/TechnologyOne.page', query: { 'post_id': item.post_id, 'file_id': item.file_id, 'bbs_id': item.bbs_id } });
+                } else {
+                    alert("기술문서 상세보기 오류")
+                }
+                
+            }).catch(function (error) {
+                alert("기술문서 상세보기 오류, 관리자에게 문의바랍니다.");
+            })
+            
         },
 
         postSelectList: function () {
client/views/pages/user/community/News.vue
--- client/views/pages/user/community/News.vue
+++ client/views/pages/user/community/News.vue
@@ -80,12 +80,30 @@
     },
     methods: {
         openModal: function (item) {
-            this.findFiles(item)
-            this.isModalOpen = true;
-            this.videoUrl = item.post_content;
-            this.urlHTML(this.videoUrl)
-            this.modalItem = item;
-            this.realContent = item.real_content;
+            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) {
+                if(response.data > 0 ) {
+                    vm.findFiles(item)
+                    vm.isModalOpen = true;
+                    vm.videoUrl = item.post_content;
+                    vm.urlHTML(vm.videoUrl)
+                    vm.modalItem = item;
+                    vm.realContent = item.real_content;
+                } else {
+                    alert("홍보/뉴스 상세보기 오류")
+                }
+                
+            }).catch(function (error) {
+                alert("홍보/뉴스 상세보기 오류, 관리자에게 문의바랍니다.");
+            })
         },
 
         urlHTML: function (content) {
@@ -97,6 +115,7 @@
             this.videoUrl = "";
             this.urlHTML(this.videoUrl);
             this.isModalOpen = false;
+            this.postSelectList();
         },
 
         postSelectList: function () {
client/views/pages/user/community/Notice.vue
--- client/views/pages/user/community/Notice.vue
+++ client/views/pages/user/community/Notice.vue
@@ -96,7 +96,26 @@
 
         //게시글 상세조회 페이지로 이동
         postSelectOnePage: function (item) {
-            this.$router.push({ path: 'NoticeOne.page', query: { 'post_id': item.post_id, 'file_id': item.file_id, 'bbs_id': item.bbs_id } });
+            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) {
+                if(response.data > 0 ) {
+                    vm.$router.push({ path: '/NoticeOne.page', query: { 'post_id': item.post_id, 'file_id': item.file_id, 'bbs_id': item.bbs_id } });
+                } else {
+                    alert("공지사항 상세보기 오류")
+                }
+                
+            }).catch(function (error) {
+                alert("공지사항 상세보기 오류, 관리자에게 문의바랍니다.");
+            })
+            
         },
     },
     watch: {
client/views/pages/user/community/Wgcommunity.vue
--- client/views/pages/user/community/Wgcommunity.vue
+++ client/views/pages/user/community/Wgcommunity.vue
@@ -155,7 +155,7 @@
                 vm.postListCount = response.data.postSelectListCount;
                 vm.postIdx = vm.postListCount - (vm.postListSearch.currentPage - 1) * vm.postListSearch.perPage;
             }).catch(function (error) {
-                alert('자료집 목록 조회 오류, 관리자에게 문의하세요.');
+                alert('전문가 협의체 목록 조회 오류, 관리자에게 문의하세요.');
             })
         },
 
@@ -166,7 +166,26 @@
 
         //게시글 상세조회 페이지로 이동
         postSelectOnePage: function (item) {
-            this.$router.push({ path: '/WgcommunityOne.page', query: { 'post_id': item.post_id, 'file_id': item.file_id, 'bbs_id': item.bbs_id } });
+            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) {
+                if(response.data > 0 ){
+                    vm.$router.push({ path: '/WgcommunityOne.page', query: { 'post_id': item.post_id, 'file_id': item.file_id, 'bbs_id': item.bbs_id } });
+                } else {
+                    alert("전문가 협의체 상세보기 오류")
+                }
+                
+            }).catch(function (error) {
+                alert("전문가 협의체 상세보기 오류, 관리자에게 문의바랍니다.");
+            })
+            
         },
     },
     components: {
Add a comment
List