Showing
1 changed file
with
41 additions
and
35 deletions
... | @@ -28,55 +28,40 @@ | ... | @@ -28,55 +28,40 @@ |
28 | <v-list-item-content > | 28 | <v-list-item-content > |
29 | <v-list-item-title v-text="item.folder_name"></v-list-item-title> | 29 | <v-list-item-title v-text="item.folder_name"></v-list-item-title> |
30 | </v-list-item-content> | 30 | </v-list-item-content> |
31 | - <v-menu | ||
32 | - v-model="showMenu" | ||
33 | - :position-x="x" | ||
34 | - :position-y="y" | ||
35 | - absolute | ||
36 | - offset-y | ||
37 | - > | ||
38 | - <v-list dense> | ||
39 | - <v-list-item @click.prevent="dialog2 = !dialog2"> | ||
40 | - <v-icon>mdi-folder</v-icon> | ||
41 | - <v-list-item-title>이동</v-list-item-title> | ||
42 | - </v-list-item> | ||
43 | - <v-list-item @click.prevent="deleteF(item.folder_name)"> | ||
44 | - <v-list-item-title>삭제</v-list-item-title> | ||
45 | - </v-list-item> | ||
46 | - </v-list> | ||
47 | - </v-menu> | ||
48 | - </v-list-item> | ||
49 | 31 | ||
50 | - | 32 | + <v-dialog |
51 | - | ||
52 | - <v-dialog | ||
53 | v-model="dialog2" | 33 | v-model="dialog2" |
54 | width="500px" | 34 | width="500px" |
55 | - > | 35 | + > |
56 | <v-card> | 36 | <v-card> |
57 | <v-card-title class="grey darken-2"> | 37 | <v-card-title class="grey darken-2"> |
58 | Move Folder | 38 | Move Folder |
59 | </v-card-title> | 39 | </v-card-title> |
60 | <v-container> | 40 | <v-container> |
61 | - <div> | 41 | + <v-list-item |
62 | - <v-icon>mdi-folder</v-icon> | 42 | + v-for="item2 in fMove" |
63 | - <v-text-field placeholder="name" id="foldername" type="text" v-model="foldername"></v-text-field> | 43 | + :key="item2.title" |
64 | - </div> | 44 | + @click.prevent="transferF(item.folder_name, item2.folder_name)" |
45 | + > | ||
46 | + <v-list-item-avatar> | ||
47 | + <v-icon>mdi-folder</v-icon> | ||
48 | + </v-list-item-avatar> | ||
49 | + <v-list-item-content> | ||
50 | + <v-list-item-title v-text="item2.folder_name"></v-list-item-title> | ||
51 | + </v-list-item-content> | ||
52 | + </v-list-item> | ||
65 | </v-container> | 53 | </v-container> |
66 | <v-card-actions> | 54 | <v-card-actions> |
67 | <v-spacer></v-spacer> | 55 | <v-spacer></v-spacer> |
68 | <v-btn | 56 | <v-btn |
69 | text | 57 | text |
70 | color="primary" | 58 | color="primary" |
71 | - @click="dialog2 = false" | 59 | + @click="initfMove" |
72 | >Cancel</v-btn> | 60 | >Cancel</v-btn> |
73 | - <v-btn | ||
74 | - text | ||
75 | - @click="transferF(item.folder_name)" | ||
76 | - >Move</v-btn> | ||
77 | </v-card-actions> | 61 | </v-card-actions> |
78 | </v-card> | 62 | </v-card> |
79 | </v-dialog> | 63 | </v-dialog> |
64 | + | ||
80 | <v-menu | 65 | <v-menu |
81 | v-model="showMenu" | 66 | v-model="showMenu" |
82 | :position-x="x" | 67 | :position-x="x" |
... | @@ -85,7 +70,7 @@ | ... | @@ -85,7 +70,7 @@ |
85 | offset-y | 70 | offset-y |
86 | > | 71 | > |
87 | <v-list dense> | 72 | <v-list dense> |
88 | - <v-list-item @click.prevent="dialog2 = !dialog2"> | 73 | + <v-list-item @click.prevent="moveW(item.folder_name)"> |
89 | <v-list-item-title>이동</v-list-item-title> | 74 | <v-list-item-title>이동</v-list-item-title> |
90 | </v-list-item> | 75 | </v-list-item> |
91 | <v-list-item @click.prevent="deleteF(item.folder_name)"> | 76 | <v-list-item @click.prevent="deleteF(item.folder_name)"> |
... | @@ -158,6 +143,7 @@ | ... | @@ -158,6 +143,7 @@ |
158 | > | 143 | > |
159 | <v-icon>mdi-plus</v-icon> | 144 | <v-icon>mdi-plus</v-icon> |
160 | </v-btn> | 145 | </v-btn> |
146 | + | ||
161 | <v-dialog | 147 | <v-dialog |
162 | v-model="dialog" | 148 | v-model="dialog" |
163 | width="500px" | 149 | width="500px" |
... | @@ -197,6 +183,7 @@ import Axios from 'axios'; | ... | @@ -197,6 +183,7 @@ import Axios from 'axios'; |
197 | foldername:'', | 183 | foldername:'', |
198 | folders: [], | 184 | folders: [], |
199 | files: [], | 185 | files: [], |
186 | + fMove:[], | ||
200 | search:'', | 187 | search:'', |
201 | id: '', | 188 | id: '', |
202 | dialog:false, | 189 | dialog:false, |
... | @@ -219,6 +206,7 @@ import Axios from 'axios'; | ... | @@ -219,6 +206,7 @@ import Axios from 'axios'; |
219 | this.$store.commit('setFolder', response.data.folders); | 206 | this.$store.commit('setFolder', response.data.folders); |
220 | this.$store.commit('setCur', response.data.cur); | 207 | this.$store.commit('setCur', response.data.cur); |
221 | this.$store.commit('setParent', response.data.parentPath); | 208 | this.$store.commit('setParent', response.data.parentPath); |
209 | + this.folders = this.$store.getters.folderL; | ||
222 | } catch (error) { | 210 | } catch (error) { |
223 | console.log("에러"); | 211 | console.log("에러"); |
224 | console.log(error.response.data); | 212 | console.log(error.response.data); |
... | @@ -239,6 +227,7 @@ import Axios from 'axios'; | ... | @@ -239,6 +227,7 @@ import Axios from 'axios'; |
239 | console.log(response.data) | 227 | console.log(response.data) |
240 | console.log("폴더 생성 완료"); | 228 | console.log("폴더 생성 완료"); |
241 | this.$store.commit('setFolder', response.data.folders); | 229 | this.$store.commit('setFolder', response.data.folders); |
230 | + this.folders = respons.data.folders; | ||
242 | } catch (error) { | 231 | } catch (error) { |
243 | console.log("에러"); | 232 | console.log("에러"); |
244 | console.log(error.response.data); | 233 | console.log(error.response.data); |
... | @@ -258,6 +247,7 @@ import Axios from 'axios'; | ... | @@ -258,6 +247,7 @@ import Axios from 'axios'; |
258 | this.$store.commit('setFolder', response.data.folders); | 247 | this.$store.commit('setFolder', response.data.folders); |
259 | this.$store.commit('setCur', response.data.cur); | 248 | this.$store.commit('setCur', response.data.cur); |
260 | this.$store.commit('setParent', response.data.parentPath); | 249 | this.$store.commit('setParent', response.data.parentPath); |
250 | + this.folders = this.$store.getters.folderL; | ||
261 | } catch (error) { | 251 | } catch (error) { |
262 | console.log("에러"); | 252 | console.log("에러"); |
263 | console.log(error.response.data); | 253 | console.log(error.response.data); |
... | @@ -274,6 +264,7 @@ import Axios from 'axios'; | ... | @@ -274,6 +264,7 @@ import Axios from 'axios'; |
274 | this.$store.commit('setFolder', response.data.folders); | 264 | this.$store.commit('setFolder', response.data.folders); |
275 | this.$store.commit('setCur', response.data.cur); | 265 | this.$store.commit('setCur', response.data.cur); |
276 | this.$store.commit('setParent', response.data.parentPath); | 266 | this.$store.commit('setParent', response.data.parentPath); |
267 | + this.folders = this.$store.getters.folderL; | ||
277 | } catch (error) { | 268 | } catch (error) { |
278 | console.log("에러"); | 269 | console.log("에러"); |
279 | console.log(error.response.data); | 270 | console.log(error.response.data); |
... | @@ -289,23 +280,25 @@ import Axios from 'axios'; | ... | @@ -289,23 +280,25 @@ import Axios from 'axios'; |
289 | const response = await deleteFolder(cData); | 280 | const response = await deleteFolder(cData); |
290 | console.log(response); | 281 | console.log(response); |
291 | this.$store.commit('setFolder', response.data.folders); | 282 | this.$store.commit('setFolder', response.data.folders); |
283 | + this.folders = this.$store.getters.folderL; | ||
292 | } catch (error) { | 284 | } catch (error) { |
293 | console.log("에러"); | 285 | console.log("에러"); |
294 | console.log(error.response.data); | 286 | console.log(error.response.data); |
295 | } | 287 | } |
296 | }, | 288 | }, |
297 | - async transferF(folderName){ | 289 | + async transferF(folderName1, folderName2){ |
298 | try { | 290 | try { |
299 | const cData = { | 291 | const cData = { |
300 | id: this.$store.state.id, | 292 | id: this.$store.state.id, |
301 | cur : this.$store.state.cur, | 293 | cur : this.$store.state.cur, |
302 | - folder_name: folderName, | 294 | + folder_name: folderName1, |
303 | isfolder: true, | 295 | isfolder: true, |
304 | - newPath: this.foldername | 296 | + newPath: this.$store.state.cur + folderName2 |
305 | } | 297 | } |
306 | const response = await moveFolder(cData); | 298 | const response = await moveFolder(cData); |
307 | console.log(response); | 299 | console.log(response); |
308 | this.$store.commit('setFolder', response.data.folders); | 300 | this.$store.commit('setFolder', response.data.folders); |
301 | + this.folders = this.$store.getters.folderL; | ||
309 | } catch (error) { | 302 | } catch (error) { |
310 | console.log("에러"); | 303 | console.log("에러"); |
311 | console.log(error.response.data); | 304 | console.log(error.response.data); |
... | @@ -322,6 +315,19 @@ import Axios from 'axios'; | ... | @@ -322,6 +315,19 @@ import Axios from 'axios'; |
322 | this.$nextTick(() => { | 315 | this.$nextTick(() => { |
323 | this.showMenu = true | 316 | this.showMenu = true |
324 | }) | 317 | }) |
318 | + }, | ||
319 | + moveW(fName){ | ||
320 | + for(let i of this.folders){ | ||
321 | + if(i.folder_name !==fName){ | ||
322 | + this.fMove.push(i); | ||
323 | + } | ||
324 | + } | ||
325 | + this.dialog2 = !this.dialog2; | ||
326 | + console.log(fName); | ||
327 | + }, | ||
328 | + initfMove(){ | ||
329 | + this.fMove = []; | ||
330 | + this.dialog2 = !this.dialog2; | ||
325 | } | 331 | } |
326 | } | 332 | } |
327 | } | 333 | } | ... | ... |
-
Please register or login to post a comment