Hong

Merge branch 'share,favorite' of http://khuhub.khu.ac.kr/2020-1-CloudComputing/D…

…_Team_Khuloud into share,favorite
...@@ -18,7 +18,7 @@ function folder(curData) { ...@@ -18,7 +18,7 @@ function folder(curData) {
18 return axios.get('/api/folder/show', { 18 return axios.get('/api/folder/show', {
19 params: { 19 params: {
20 id: curData.id, 20 id: curData.id,
21 - cur: curData.cur, 21 + folder_id: curData.folder_id,
22 }, 22 },
23 }); 23 });
24 } 24 }
...@@ -39,7 +39,7 @@ function file(curData) { ...@@ -39,7 +39,7 @@ function file(curData) {
39 return axios.get('/api/file', { 39 return axios.get('/api/file', {
40 params: { 40 params: {
41 id: curData.id, 41 id: curData.id,
42 - cur: curData.cur, 42 + folder_id: curData.cur,
43 }, 43 },
44 }); 44 });
45 } 45 }
...@@ -109,6 +109,14 @@ function addFavoriteFile(fileData) { ...@@ -109,6 +109,14 @@ function addFavoriteFile(fileData) {
109 return axios.post('api/favorites/addfile', fileData); 109 return axios.post('api/favorites/addfile', fileData);
110 } 110 }
111 111
112 +function getFavoriteList(userId) {
113 + return axios.get('api/favorites/show', {
114 + params: {
115 + id: userId,
116 + },
117 + });
118 +}
119 +
112 export { 120 export {
113 registerUser, 121 registerUser,
114 loginUser, 122 loginUser,
...@@ -128,4 +136,5 @@ export { ...@@ -128,4 +136,5 @@ export {
128 accessedList, 136 accessedList,
129 detailFile, 137 detailFile,
130 modifyFile, 138 modifyFile,
139 + getFavoriteList,
131 }; 140 };
......
This diff is collapsed. Click to expand it.
...@@ -19,11 +19,17 @@ ...@@ -19,11 +19,17 @@
19 > 19 >
20 <v-list-item 20 <v-list-item
21 v-for="item in this.$store.getters.folderL" 21 v-for="item in this.$store.getters.folderL"
22 - :key="item.title" 22 + :key="item.folder_id"
23 :search="search" 23 :search="search"
24 @click.right="show(item, $event)" 24 @click.right="show(item, $event)"
25 @click="" 25 @click=""
26 - @dblclick="moveF(item.folder_name)" 26 + @dblclick="
27 + $router.push({
28 + name: 'Folder',
29 + params: { id: item.folder_id },
30 + props: { folderId: item.id },
31 + })
32 + "
27 > 33 >
28 <v-list-item-avatar> 34 <v-list-item-avatar>
29 <v-icon>mdi-folder</v-icon> 35 <v-icon>mdi-folder</v-icon>
...@@ -341,7 +347,7 @@ export default { ...@@ -341,7 +347,7 @@ export default {
341 try { 347 try {
342 const curData = { 348 const curData = {
343 id: this.$store.state.id, 349 id: this.$store.state.id,
344 - cur: '/', 350 + folder_id: -1,
345 }; 351 };
346 console.log(curData); 352 console.log(curData);
347 const response = await folder(curData); 353 const response = await folder(curData);
......
This diff is collapsed. Click to expand it.
...@@ -67,9 +67,10 @@ export default new VueRouter({ ...@@ -67,9 +67,10 @@ export default new VueRouter({
67 component: () => import('../views/Feedback.vue'), 67 component: () => import('../views/Feedback.vue'),
68 }, 68 },
69 { 69 {
70 - path: '/folder', 70 + path: '/file/:id',
71 name: 'Folder', 71 name: 'Folder',
72 component: () => import('../views/FolderPage.vue'), 72 component: () => import('../views/FolderPage.vue'),
73 + props: true,
73 }, 74 },
74 ], 75 ],
75 }); 76 });
......
...@@ -11,6 +11,8 @@ export default new Vuex.Store({ ...@@ -11,6 +11,8 @@ export default new Vuex.Store({
11 cur: '/', 11 cur: '/',
12 parent: '/', 12 parent: '/',
13 recentList: [], 13 recentList: [],
14 + favFolderList: [],
15 + favFileList: [],
14 }, 16 },
15 mutations: { 17 mutations: {
16 setId(state, userid) { 18 setId(state, userid) {
...@@ -34,6 +36,12 @@ export default new Vuex.Store({ ...@@ -34,6 +36,12 @@ export default new Vuex.Store({
34 setRecentList(state, list) { 36 setRecentList(state, list) {
35 state.recentList = list; 37 state.recentList = list;
36 }, 38 },
39 + setfavFolderList(state, fflist) {
40 + state.favFolderList = fflist;
41 + },
42 + setfavFileList(state, fflist) {
43 + state.favFileList = fflist;
44 + },
37 }, 45 },
38 getters: { 46 getters: {
39 isLogin(state) { 47 isLogin(state) {
...@@ -60,5 +68,11 @@ export default new Vuex.Store({ ...@@ -60,5 +68,11 @@ export default new Vuex.Store({
60 setFile(state, filelist) { 68 setFile(state, filelist) {
61 state.files = filelist; 69 state.files = filelist;
62 }, 70 },
71 + favFolderL(state) {
72 + return state.favFolderList;
73 + },
74 + favFileL(state) {
75 + return state.favFileList;
76 + },
63 }, 77 },
64 }); 78 });
......
1 <template> 1 <template>
2 <div> 2 <div>
3 - <v-toolbar flat> 3 + <Fav_list></Fav_list>
4 - <v-toolbar-title>즐겨찾기</v-toolbar-title>
5 -
6 - <v-spacer></v-spacer>
7 - <v-text-field
8 - v-model="search"
9 - append-icon="mdi-magnify"
10 - label="즐겨찾기 검색"
11 - single-line
12 - hide-details
13 - ></v-text-field>
14 - </v-toolbar>
15 -
16 - <v-list two-line subheader>
17 - <v-list-item v-for="item in items" :key="item.title" @click="">
18 - <v-list-item-avatar>
19 - <v-icon>{{ item.iconClass }}</v-icon>
20 - </v-list-item-avatar>
21 -
22 - <v-list-item-content>
23 - <v-list-item-title v-text="item.title"></v-list-item-title>
24 - <v-list-item-subtitle v-text="item.subtitle"></v-list-item-subtitle>
25 - </v-list-item-content>
26 -
27 - <v-list-item-action>
28 - <v-btn icon>
29 - <v-icon color="grey lighten-1">mdi-information</v-icon>
30 - </v-btn>
31 - </v-list-item-action>
32 - </v-list-item>
33 -
34 - <v-list-item v-for="item in items2" :key="item.title" @click="">
35 - <v-list-item-avatar>
36 - <v-icon> {{ item.iconClass }}</v-icon>
37 - </v-list-item-avatar>
38 -
39 - <v-list-item-content>
40 - <v-list-item-title v-text="item.title"></v-list-item-title>
41 - <v-list-item-subtitle v-text="item.subtitle"></v-list-item-subtitle>
42 - </v-list-item-content>
43 -
44 - <v-list-item-action>
45 - <v-btn icon>
46 - <v-icon color="grey lighten-1">mdi-information</v-icon>
47 - </v-btn>
48 - </v-list-item-action>
49 - </v-list-item>
50 - </v-list>
51 </div> 4 </div>
52 </template> 5 </template>
53 6
54 <script> 7 <script>
8 +import Fav_list from '../components/Fav_list';
55 export default { 9 export default {
56 - data: () => ({ 10 + components: {
57 - items: [ 11 + Fav_list,
58 - {
59 - icon: 'folder',
60 - iconClass: 'mdi-folder',
61 - title: 'Photos',
62 - subtitle: 'Jan 9, 2014',
63 - },
64 - {
65 - icon: 'folder',
66 - iconClass: 'mdi-folder',
67 - title: 'Recipes',
68 - subtitle: 'Jan 17, 2014',
69 - },
70 - {
71 - icon: 'folder',
72 - iconClass: 'mdi-folder',
73 - title: 'Work',
74 - subtitle: 'Jan 28, 2014',
75 }, 12 },
76 - ],
77 - items2: [
78 - {
79 - icon: 'assignment',
80 - iconClass: 'mdi-file',
81 - title: 'Vacation itinerary',
82 - subtitle: 'Jan 20, 2014',
83 - },
84 - {
85 - icon: 'call_to_action',
86 - iconClass: 'mdi-PdfBox',
87 - title: 'Kitchen remodel',
88 - subtitle: 'Jan 10, 2014',
89 - },
90 - ],
91 - }),
92 }; 13 };
93 </script> 14 </script>
15 +
16 +<style></style>
......
1 +<template>
2 + <div>
3 + <folderc></folderc>
4 + </div>
5 +</template>
6 +
7 +<script>
8 +import folderc from '../components/folderc';
9 +export default {
10 + components: {
11 + folderc,
12 + },
13 +};
14 +</script>
15 +
16 +<style></style>
......