yjryu / KERIS star
kimgkdud898 2023-11-20
231120김하영 최신순 조회순 버튼 수정
@65f54c3ae79adb5d08ce2d7454ab4d606196f43d
client/resources/css/Main.css
--- client/resources/css/Main.css
+++ client/resources/css/Main.css
@@ -2956,9 +2956,3 @@
   overflow: hidden;
   text-align: left;
 }
-
-/* 게시글 상단고정 css */
-
-.first-row {
-  background-color: #e8f4ff; /* 원하는 색상으로 변경하세요 */
-}
client/resources/css/common.css
--- client/resources/css/common.css
+++ client/resources/css/common.css
@@ -120,11 +120,11 @@
   border-bottom: 1px solid #007aff;
 }
 
-.title-zone > p{
+.title-zone > p {
   margin-bottom: 10px;
 }
 
-.title-zone > div > p{
+.title-zone > div > p {
   margin-left: 10px;
 }
 
@@ -408,6 +408,24 @@
   width: 100%;
 }
 
-.viewer iframe{
+.viewer iframe {
   width: 100%;
-}
(No newline at end of file)
+}
+
+/* 게시글 상단고정 css */
+
+.first-row {
+  background-color: #e8f4ff;
+}
+
+.sort-wrap li {
+  font-weight: 600;
+  font-family: "Pretendard-Regular";
+
+  color: #000000;
+}
+.sort-wrap li.active {
+  color: #333;
+  font-weight: 600;
+  font-family: "Pretendard-Regular";
+}
client/views/pages/user/Data/Data.vue
--- client/views/pages/user/Data/Data.vue
+++ client/views/pages/user/Data/Data.vue
@@ -61,8 +61,10 @@
                             </div>
                             <div class="sort-wrap" style="grid-column: 1 / span 2;">
                                 <ul class="flex-end">
-                                    <li>최신순</li>
-                                    <li>조회수순</li>
+                                    <li v-for="(item, index) in sorts" :key="index"
+                                        :class="{ active: activeIndex === index }" @click="changeColor(index)">
+                                        {{ item }}
+                                    </li>
                                 </ul>
                             </div>
                         </div>
@@ -128,6 +130,9 @@
             postIdx: 0,
             categoryName: '전체',
             route: useRoute(),
+            // 최신순 조회순
+            sorts: ['최신순', '조회수순'],
+            activeIndex: 0,
 
             // 자료실 버튼
             buttons: Array(3).fill(),
@@ -148,7 +153,10 @@
         }
     },
     methods: {
-
+        //  최신순 조회순
+        changeColor(index) {
+            this.activeIndex = index;
+        },
         clickButton(index) {
             this.buttons.forEach((button, idx) => {
                 if (idx === index) {
client/views/pages/user/Data/Technology.vue
--- client/views/pages/user/Data/Technology.vue
+++ client/views/pages/user/Data/Technology.vue
@@ -6,10 +6,13 @@
                     <img src="../../../../resources/jpg/tech-logo.png" alt="">
                     <h1>기술문서</h1>
                 </div>
+                <!-- 최신순 조회순 -->
                 <div class="sort-wrap" style="grid-column: 1 / span 2;">
                     <ul class="flex-end">
-                        <li>최신순</li>
-                        <li>조회수순</li>
+                        <li v-for="(item, index) in sorts" :key="index" :class="{ active: activeIndex === index }"
+                            @click="changeColor(index)">
+                            {{ item }}
+                        </li>
                     </ul>
                 </div>
                 <ul class="tech-bos">
@@ -261,9 +264,16 @@
             postList: [],
             postListCount: 0,
             postIdx: 0,
+            // 최신순 조회순
+            sorts: ['최신순', '조회수순'],
+            activeIndex: 0,
         }
     },
     methods: {
+        //  최신순 조회순
+        changeColor(index) {
+            this.activeIndex = index;
+        },
         postSelectOnePage(item) {
             const vm = this;
 
client/views/pages/user/community/News.vue
--- client/views/pages/user/community/News.vue
+++ client/views/pages/user/community/News.vue
@@ -6,10 +6,13 @@
                     <img src="../../../../resources/jpg/info-logo.png" alt="홍보뉴스 아이콘">
                     <h1>홍보/뉴스</h1>
                 </div>
+                <!-- 최신순 조회순 -->
                 <div class="sort-wrap" style="grid-column: 1 / span 2;">
                     <ul class="flex-end">
-                        <li>최신순</li>
-                        <li>조회수순</li>
+                        <li v-for="(item, index) in sorts" :key="index" :class="{ active: activeIndex === index }"
+                            @click="changeColor(index)">
+                            {{ item }}
+                        </li>
                     </ul>
                 </div>
                 <ul class="news-bos">
@@ -82,9 +85,16 @@
             realContent: null,
             fileList: [],
             realFileList: [],
+            // 최신순 조회순
+            sorts: ['최신순', '조회수순'],
+            activeIndex: 0,
         }
     },
     methods: {
+        //  최신순 조회순
+        changeColor(index) {
+            this.activeIndex = index;
+        },
         openModal: function (item) {
             const vm = this;
 
@@ -96,12 +106,12 @@
                 },
                 data: { 'post_id': item.post_id, 'bbs_id': item.bbs_id }
             }).then(function (response) {
-                    vm.findFiles(item)
-                    vm.isModalOpen = true;
-                    vm.videoUrl = item.post_content;
-                    vm.urlHTML(vm.videoUrl)
-                    vm.modalItem = item;
-                    vm.realContent = item.real_content;
+                vm.findFiles(item)
+                vm.isModalOpen = true;
+                vm.videoUrl = item.post_content;
+                vm.urlHTML(vm.videoUrl)
+                vm.modalItem = item;
+                vm.realContent = item.real_content;
             }).catch(function (error) {
                 alert("홍보/뉴스 상세보기 오류, 관리자에게 문의바랍니다.");
             })
client/views/pages/user/community/Notice.vue
--- client/views/pages/user/community/Notice.vue
+++ client/views/pages/user/community/Notice.vue
@@ -20,10 +20,13 @@
                         <input class="button--submit" value="검색" type="submit" @click="postSelectList()">
                     </div>
                 </div>
+                <!-- 최신순 조회순 -->
                 <div class="sort-wrap" style="grid-column: 1 / span 2;">
                     <ul class="flex-end">
-                        <li>최신순</li>
-                        <li>조회수순</li>
+                        <li v-for="(item, index) in sorts" :key="index" :class="{ active: activeIndex === index }"
+                            @click="changeColor(index)">
+                            {{ item }}
+                        </li>
                     </ul>
                 </div>
                 <div class="noti-sec">
@@ -76,10 +79,17 @@
             },
             postList: [],
             postListCount: 0,
-            postIdx: 0
+            postIdx: 0,
+            // 최신순 조회순
+            sorts: ['최신순', '조회수순'],
+            activeIndex: 0,
         }
     },
     methods: {
+        //  최신순 조회순
+        changeColor(index) {
+            this.activeIndex = index;
+        },
         postSelectList: function () {
             const vm = this;
 
Add a comment
List