
+++ client/resources/api/asset.js
... | ... | @@ -0,0 +1,12 @@ |
1 | +import apiClient from "./index"; | |
2 | + | |
3 | +// 자산(프로젝트) 목록 조회 기능 | |
4 | +export const findAllProjectsProc = (data) => { | |
5 | + return apiClient.post('/project/findAllProjects.json', data); | |
6 | +} | |
7 | + | |
8 | +// 자산(프로젝트) 생성 기능 | |
9 | +export const saveProjectProc = (data) => { | |
10 | + return apiClient.post('/project/saveProject.json', data); | |
11 | +} | |
12 | + |
--- client/views/pages/subPage/Asset.vue
+++ client/views/pages/subPage/Asset.vue
... | ... | @@ -16,7 +16,7 @@ |
16 | 16 |
</div> |
17 | 17 |
<div class="bottom-zone"> |
18 | 18 |
<!-- 새 카드 --> |
19 |
- <div class="card new-card"> |
|
19 |
+ <div class="card new-card" @click="goToModeling()"> |
|
20 | 20 |
<div class="new-symbol"> |
21 | 21 |
<img src="../../../resources/img/content/ico_digital_asset.svg" alt=""> |
22 | 22 |
</div> |
... | ... | @@ -62,16 +62,18 @@ |
62 | 62 |
</template> |
63 | 63 |
|
64 | 64 |
<script> |
65 |
+import { findAllProjectsProc } from '../../../resources/api/asset'; |
|
66 |
+import { mapGetters } from 'vuex'; |
|
65 | 67 |
|
66 | 68 |
export default { |
67 | 69 |
data() { |
68 | 70 |
return { |
69 | 71 |
projects: [ |
70 |
- { name: '프로젝트A', date: '2025.05.12', img: require('../../../resources/img/content/sample1.png'),isFavorite: false }, |
|
71 |
- { name: '프로젝트B', date: '2025.05.12', img: require('../../../resources/img/content/sample1.png'),isFavorite: true }, |
|
72 |
- { name: '프로젝트C', date: '2025.05.12', img: require('../../../resources/img/content/sample1.png'),isFavorite: false }, |
|
73 |
- { name: '프로젝트D', date: '2025.05.12', img: require('../../../resources/img/content/sample1.png'),isFavorite: true }, |
|
74 |
- { name: '프로젝트E', date: '2025.05.12', img: require('../../../resources/img/content/sample1.png'),isFavorite: false }, |
|
72 |
+ // { name: '프로젝트A', date: '2025.05.12', img: require('../../../resources/img/content/sample1.png'),isFavorite: false }, |
|
73 |
+ // { name: '프로젝트B', date: '2025.05.12', img: require('../../../resources/img/content/sample1.png'),isFavorite: true }, |
|
74 |
+ // { name: '프로젝트C', date: '2025.05.12', img: require('../../../resources/img/content/sample1.png'),isFavorite: false }, |
|
75 |
+ // { name: '프로젝트D', date: '2025.05.12', img: require('../../../resources/img/content/sample1.png'),isFavorite: true }, |
|
76 |
+ // { name: '프로젝트E', date: '2025.05.12', img: require('../../../resources/img/content/sample1.png'),isFavorite: false }, |
|
75 | 77 |
], |
76 | 78 |
openMenuIndex: null, |
77 | 79 |
dropdownDirection: 'right' // 또는 'left' |
... | ... | @@ -99,13 +101,43 @@ |
99 | 101 |
this.dropdownDirection = (windowWidth - rect.right < 200) ? 'left' : 'right'; |
100 | 102 |
this.openMenuIndex = index; |
101 | 103 |
}); |
102 |
- } |
|
104 |
+ }, |
|
105 |
+ loadProjects() { |
|
106 |
+ findAllProjectsProc({ |
|
107 |
+ memberId: this.getMemId, |
|
108 |
+ isMain: "Y" // 대표 프로젝트만 화면 목록에 뜨게 함. |
|
109 |
+ }) |
|
110 |
+ .then(response => { |
|
111 |
+ const projectList = response.data.result.projects; |
|
112 |
+ |
|
113 |
+ this.projects = projectList.map(project => ({ |
|
114 |
+ name: project.projectName, |
|
115 |
+ date: project.createdAt, |
|
116 |
+ img: require('../../../resources/img/content/sample1.png'), // 백엔드 - 썸네일 기능 추가 후 수정 |
|
117 |
+ isFavorite: false // 백엔드 - 즐겨찾기 기능 추가 후 수정 |
|
118 |
+ })); |
|
119 |
+ }) |
|
120 |
+ .catch(error => {console.error('자산 목록 조회 실패: ', error);}) |
|
121 |
+ }, |
|
122 |
+ goToModeling() { |
|
123 |
+ console.log("모델링 페이지로 이동"); |
|
124 |
+ this.$router.push('/modeling.page'); |
|
125 |
+ }, |
|
103 | 126 |
}, |
104 | 127 |
watch: {}, |
105 |
- computed: {}, |
|
128 |
+ computed: { |
|
129 |
+ ...mapGetters([ |
|
130 |
+ 'getMemId', |
|
131 |
+ 'getMemNm', |
|
132 |
+ 'getMemLoginId' |
|
133 |
+ ]) |
|
134 |
+ }, |
|
106 | 135 |
components: {}, |
107 | 136 |
created() {}, |
108 |
- mounted() {}, |
|
137 |
+ mounted() { |
|
138 |
+ console.log("로그인한 사용자:", this.getMemId); |
|
139 |
+ this.loadProjects(); |
|
140 |
+ }, |
|
109 | 141 |
beforeUnmount() {}, |
110 | 142 |
}; |
111 | 143 |
|
--- client/views/pages/subPage/Modeling.vue
+++ client/views/pages/subPage/Modeling.vue
... | ... | @@ -65,7 +65,9 @@ |
65 | 65 |
v-for="tool in subTolls.slice(0, 3)" |
66 | 66 |
:key="tool.id" |
67 | 67 |
> |
68 |
- <button :title="tool.title" @click="toggleTool(tool)"> |
|
68 |
+ <button |
|
69 |
+ :title="tool.title" |
|
70 |
+ @click=" tool.title === '저장' ? saveProject() : toggleTool(tool)"> |
|
69 | 71 |
<img :src="tool.icon" :alt="tool.title + ' 아이콘'" style="vertical-align: middle;"/> |
70 | 72 |
</button> |
71 | 73 |
</li> |
... | ... | @@ -166,6 +168,8 @@ |
166 | 168 |
</template> |
167 | 169 |
|
168 | 170 |
<script> |
171 |
+import { saveProjectProc } from '../../../resources/api/asset'; |
|
172 |
+import { mapGetters } from 'vuex'; |
|
169 | 173 |
|
170 | 174 |
export default { |
171 | 175 |
data() { |
... | ... | @@ -393,6 +397,20 @@ |
393 | 397 |
closeModal() { |
394 | 398 |
this.activeModalTool = null; |
395 | 399 |
}, |
400 |
+ saveProject() { |
|
401 |
+ console.log('프로젝트(자산) 저장'); |
|
402 |
+ saveProjectProc({ |
|
403 |
+ memberId: this.getMemId, |
|
404 |
+ imageFileName: null, |
|
405 |
+ imageFileUrl : null, |
|
406 |
+ summary: "요약", |
|
407 |
+ comment: "주석"}) |
|
408 |
+ .then(response => { |
|
409 |
+ console.log('프로젝트(자산) 페이지로 이동'); |
|
410 |
+ this.$router.push('/asset.page'); |
|
411 |
+ }) |
|
412 |
+ .catch(error => {console.error('자산 생성 실패: ', error);}) |
|
413 |
+ } |
|
396 | 414 |
}, |
397 | 415 |
watch: {}, |
398 | 416 |
computed: { |
... | ... | @@ -404,7 +422,13 @@ |
404 | 422 |
} |
405 | 423 |
return tool.icon; |
406 | 424 |
}; |
407 |
- } |
|
425 |
+ }, |
|
426 |
+ ...mapGetters([ |
|
427 |
+ 'getMemId', |
|
428 |
+ 'getMemNm', |
|
429 |
+ 'getMemLoginId' |
|
430 |
+ ]) |
|
431 |
+ |
|
408 | 432 |
}, |
409 | 433 |
components: {}, |
410 | 434 |
created() {}, |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?