박현정 박현정 6 days ago
250804 박현정 피드백 요약 기능 추가
@d2efb693ae92b977605131263f69d8f86ffc7f7f
client/resources/api/feedback.js
--- client/resources/api/feedback.js
+++ client/resources/api/feedback.js
@@ -13,4 +13,14 @@
 // 피드백 채팅 조회 기능
 export const findAllChatMsgsProc = (chatRoomId, data) => {
     return apiClient.post(`/chat/${chatRoomId}/findAllChatMsgs.json`, data);
-}
(파일 끝에 줄바꿈 문자 없음)
+}
+
+// 미확인 피드백 개수 조회 기능
+export const findUncheckedFeedbacks = (data) => {
+    return apiClient.post('/feedback/findUncheckedFeedbacks.json', data);
+}
+
+// 피드백 요약 조회 기능
+export const findFeedbackSummary = (data) => {
+    return apiClient.post('/feedback/findFeedbackSummary.json', data);
+}
client/views/pages/main/Main.vue
--- client/views/pages/main/Main.vue
+++ client/views/pages/main/Main.vue
@@ -15,12 +15,12 @@
                     <p>최신 디지털 자산</p>
                 </div>
                 <ul class="layout center gap30">
-                    <li v-for="item in assets" :key="item.id" class="box-item">
+                    <li v-for="project in projects" :key="project.id" class="box-item" @click="goToModelingUpdate(project)">
                         <div class="layout center space-between mb10">
-                            <div class="box-title" >{{ item.name }}</div>
-                            <div class="date" >{{ item.date }}</div>
+                            <div class="box-title" >{{ project.name }}</div>
+                            <div class="date" >{{ project.date }}</div>
                         </div>
-                        <img :src="item.img" alt="자산 이미지" >
+                        <img :src="project.img" alt="자산 이미지" >
                     </li>
                 </ul>
             </div>
@@ -30,10 +30,10 @@
                             <p>피드백 알림</p>
                         </div>
                         <ul class="box-item">
-                            <li class="alram-item" v-for="item in alarms" :key="item.id">
+                            <li class="alram-item" v-for="project in alarms" :key="project.groupId" @click="goToFeedback">
                                 <div  class="layout center gap10">
                                     <img src="../../../resources/img/content/ico_alram.svg" alt="">
-                                    <p><span>프로젝트{{ item.project }}</span>에 피드백 <span>{{ item.count }}건</span>이 입력되었습니다.</p>
+                                    <p><span>{{ project.name }}</span>에 피드백 <span>{{ project.count }}건</span>이 입력되었습니다.</p>
                                 </div>
                             </li>
                         </ul>
@@ -63,21 +63,22 @@
 import 'dayjs/locale/ko'; // 한국어 locale 불러오기
 import { findAllLogsProc } from '../../../resources/api/main';
 import { findAllProjectsProc } from '../../../resources/api/asset';
+import { findUncheckedFeedbacks } from '../../../resources/api/feedback';
 
 export default {
     data() {
         return {
-             assets: [
+             projects: [
                 // { id: 1, name: '디지털 자산 A', date: '2024-06-01', img: require('../../../resources/img/content/sample1.png') },
                 // { id: 2, name: '디지털 자산 B', date: '2024-06-10', img: require('../../../resources/img/content/sample2.png') },
                 // { id: 3, name: '디지털 자산 C', date: '2024-06-15', img: require('../../../resources/img/content/sample3.png') }
             ],
             alarms: [
-                { id: 1, project: 'A', count: 2 },
-                { id: 2, project: 'B', count: 1 },
-                { id: 3, project: 'C', count: 5 },
-                { id: 4, project: 'D', count: 3 },
-                { id: 5, project: 'F', count: 7 }
+                // { id: 1, project: 'A', count: 2 },
+                // { id: 2, project: 'B', count: 1 },
+                // { id: 3, project: 'C', count: 5 },
+                // { id: 4, project: 'D', count: 3 },
+                // { id: 5, project: 'F', count: 7 }
             ],
             activityLogs: [
                 // { id: 1, project: '프로젝트A', time: '어제 14:30' },
@@ -116,7 +117,7 @@
             .then(response => {
               const projectList = response.data.result.projects;
 
-              this.assets = projectList.map(project => ({
+              this.projects = projectList.map(project => ({
                 id: project.projectId,
                 groupId: project.projectGroupId,
                 isMain: project.isMain,
@@ -130,6 +131,27 @@
         },
         goToModelingCreate() {
           this.$router.push('/modeling.page');
+        },
+        goToModelingUpdate(project) {
+          this.$router.push({ name: 'Modeling', query: {projectId: project.id}});
+        },
+        goToFeedback() {
+          this.$router.push('/feedback.page');
+        },
+        loadFeedbackAlarms() {
+            findUncheckedFeedbacks({
+                memberId: this.getMemId
+            })
+            .then(response => {
+                const alarms = response.data.result;
+
+                this.alarms = alarms.map(alarm => ({
+                    groupId: alarm.projectGroupId,
+                    name: alarm.projectName,
+                    count: alarm.unCheckedFeedbackCnt
+                }));
+            })
+            .catch(error => {console.error('미확인 피드백 조회 실패: ', error);})
         },
     },
     watch: {},
@@ -146,6 +168,7 @@
         console.log("사용자 아이디: " + this.getMemId + " 사용자 이름: " + this.getMemNm + " 사용자 로그인 아이디: " + this.getMemLoginId);
         this.loadLogs();
         this.loadMainProjects();
+        this.loadFeedbackAlarms();
     },
     beforeUnmount() {},
 };
client/views/pages/subPage/FeedBack.vue
--- client/views/pages/subPage/FeedBack.vue
+++ client/views/pages/subPage/FeedBack.vue
@@ -75,7 +75,7 @@
 
 <script>
 import { mapGetters } from 'vuex';
-import { checkFeedbackProc, findAllChatMsgsProc, findAllFeedbacksProc } from '../../../resources/api/feedback';
+import { checkFeedbackProc, findAllChatMsgsProc, findAllFeedbacksProc, findFeedbackSummary } from '../../../resources/api/feedback';
 import dayjs from 'dayjs';
 import relativeTime from 'dayjs/plugin/relativeTime';
 import 'dayjs/locale/ko'; // 한국어 locale 불러오기
@@ -115,9 +115,9 @@
                 // }
             ],
             feedbackSummary: {
-                total: 3,
-                unread: 2,
-                read: 1
+                // total: 3,
+                // unread: 2,
+                // read: 1
             },
             selectedFeedback: null,     // 회신용
             replyingFeedbackId: null,   // 회신 폼 표시용
@@ -241,7 +241,7 @@
             checkFeedbackProc(feedbackId, data)
                 .then(response => {
                     this.loadFeedbacks();
-                    console.log('피드백 확인 완료');
+                    this.loadFeedbackSummary();
                 })
                 .catch(error => {
                     console.error('피드백 확인 실패: ', error);
@@ -296,6 +296,19 @@
 
             client.activate();
         },
+        loadFeedbackSummary(){
+            findFeedbackSummary({
+                memberId: this.getMemId
+            })
+            .then(response => {
+                const summary = response.data.result;
+
+                this.feedbackSummary.total = summary.totalCount;
+                this.feedbackSummary.unread = summary.uncheckedCount;
+                this.feedbackSummary.read = summary.checkedCount;
+            })
+            .catch(error => {console.error('피드백 요약 조회 실패: ', error);})
+        },
     },
     watch: {},
     computed: {
@@ -309,6 +322,7 @@
     created() {},
     mounted() {
         this.loadFeedbacks();
+        this.loadFeedbackSummary();
     },
     beforeUnmount() {},
 };
client/views/pages/subPage/Modeling.vue
--- client/views/pages/subPage/Modeling.vue
+++ client/views/pages/subPage/Modeling.vue
@@ -550,6 +550,7 @@
     mounted() {
         const projectId = this.$route.query.projectId;
         if(projectId) {
+            console.log("모델링 페이지 - 프로젝트 아이디: " + projectId);
             this.loadProjectData(projectId);
         }
     },
Add a comment
List