박현정 박현정 07-22
250722 박현정 프로젝트 생성 시 이미지 주석 입력 기능 추가
@4198252b9361eb1e948580f22da27b56cfc82710
client/views/pages/subPage/Modeling.vue
--- client/views/pages/subPage/Modeling.vue
+++ client/views/pages/subPage/Modeling.vue
@@ -15,7 +15,7 @@
                 <div class="tab-content">
                     <div class="layout center justify-center h_100" style="background-color: #ffffff; border-radius: 2rem;"  v-if="activeTab === 'Image Prompt'">
                         <div class="layout center center" style="flex-direction: column;">
-                            <input type="file" name="" id="file" class="sr-only">
+                            <input type="file" ref="fileInput" name="" id="file" class="sr-only">
                             <span class="file-icon" id="file"><img src="../../../resources/img/content/ico_file.svg" alt=""></span>
                             <label for="file" style="text-align: center;">파일을 업로드하세요.</label>
                         </div>
@@ -96,20 +96,20 @@
                                         <div v-else-if="activeModalTool.title === '코멘트'" class="mb10">
                                             <div class="input-group mb10">
                                                 <label for="">writer</label>
-                                                <input type="text" class="form-control sm" disabled>
+                                                <input type="text" class="form-control sm" :value="getMemNm" disabled>
                                             </div>
                                             <div class="input-group mb10">
                                                 <label for="">summary</label>
-                                                <input type="text" class="form-control sm">
+                                                <input type="text" class="form-control sm" v-model="localCommentData.summary">
                                             </div>
                                             <div class="input-group">
                                                 <label for="">comment</label>
-                                                <textarea  class="form-control sm"></textarea>
+                                                <textarea  class="form-control sm" v-model="localCommentData.comment"></textarea>
                                             </div>
                                         </div>
                                         <div class="btn-group layout center justify-center gap10">
                                             <button class="btn sm black" v-if="activeModalTool.title === '참여자'" @click="closeModal">닫기</button>
-                                            <button class="btn sm purple" v-if="activeModalTool.title === '코멘트'">저장</button>
+                                            <button class="btn sm purple" v-if="activeModalTool.title === '코멘트'" @click="saveComment">저장</button>
                                             <button class="btn sm black" v-if="activeModalTool.title === '코멘트'" @click="closeModal">취소</button>
                                         </div>
                                     </div>
@@ -345,7 +345,15 @@
             activeSubToolId: null,
             openedToolId: null,
             selectedColor: '#000000',
-            activeModalTool : false
+            activeModalTool : false,
+            commentData: { // 주석 입력 데이터
+                summary: '',
+                comment: ''
+            },
+            localCommentData: { // 복사본
+                summary: '',
+                comment: ''
+            }
         };
     },
     methods: {
@@ -399,17 +407,30 @@
         },
         saveProject() {
             console.log('프로젝트(자산) 저장');
-            saveProjectProc({ 
-                memberId: this.getMemId, 
-                imageFileName: null,
-                imageFileUrl : null,
-                summary: "요약",
-                comment: "주석"})
+
+            const formData = new FormData();
+            const fileInput = this.$refs.fileInput; // 업로드 파일 가져오기
+            if (!fileInput || !fileInput.files.length) {
+                alert("파일을 선택해주세요.");
+                return;
+            }
+
+            formData.append("imageFile", fileInput.files[0]);
+            formData.append("memberId", this.getMemId);
+            formData.append("summary", this.commentData.summary);
+            formData.append("comment", this.commentData.comment);
+            saveProjectProc(formData)
             .then(response => {
                 console.log('프로젝트(자산) 페이지로 이동');
                 this.$router.push('/asset.page');
             })
             .catch(error => {console.error('자산 생성 실패: ', error);})
+        },
+        saveComment() {
+            this.commentData = {...this.localCommentData}; // 저장 시 반영
+            console.log('요약: ', this.commentData.summary);
+            console.log('주석: ', this.commentData.comment);
+            this.closeModal();
         }
     },
     watch: {},
Add a comment
List