Showing
4 changed files
with
88 additions
and
15 deletions
... | @@ -11,7 +11,7 @@ | ... | @@ -11,7 +11,7 @@ |
11 | hide-details | 11 | hide-details |
12 | ></v-text-field> | 12 | ></v-text-field> |
13 | </v-toolbar> | 13 | </v-toolbar> |
14 | - <v-list two-line subheader> | 14 | + <v-list> |
15 | <!-- <v-subheader inset>Folders</v-subheader> --> | 15 | <!-- <v-subheader inset>Folders</v-subheader> --> |
16 | <!-- Folder view --> | 16 | <!-- Folder view --> |
17 | <v-list-item | 17 | <v-list-item |
... | @@ -21,7 +21,7 @@ | ... | @@ -21,7 +21,7 @@ |
21 | >...</v-list-item | 21 | >...</v-list-item |
22 | > | 22 | > |
23 | <v-list-item | 23 | <v-list-item |
24 | - v-for="item in this.$store.getters.favFolderL" | 24 | + v-for="item in calData" |
25 | :key="item.folder_id" | 25 | :key="item.folder_id" |
26 | :search="search" | 26 | :search="search" |
27 | @click.right="show(item, $event)" | 27 | @click.right="show(item, $event)" |
... | @@ -50,7 +50,7 @@ | ... | @@ -50,7 +50,7 @@ |
50 | </v-list-item> | 50 | </v-list-item> |
51 | <!-- File view --> | 51 | <!-- File view --> |
52 | <v-list-item | 52 | <v-list-item |
53 | - v-for="item in this.$store.getters.favFileL" | 53 | + v-for="item in calData2" |
54 | :key="item.title" | 54 | :key="item.title" |
55 | @click.right="showF(item, $event)" | 55 | @click.right="showF(item, $event)" |
56 | @dblclick=" | 56 | @dblclick=" |
... | @@ -319,6 +319,26 @@ export default { | ... | @@ -319,6 +319,26 @@ export default { |
319 | created() { | 319 | created() { |
320 | this.fetchData(); | 320 | this.fetchData(); |
321 | }, | 321 | }, |
322 | + computed: { | ||
323 | + calData() { | ||
324 | + return this.folders | ||
325 | + .filter(data => { | ||
326 | + return data.folder_name | ||
327 | + .toLowerCase() | ||
328 | + .includes(this.search.toLowerCase()); | ||
329 | + }) | ||
330 | + .slice(0); | ||
331 | + }, | ||
332 | + calData2() { | ||
333 | + return this.files | ||
334 | + .filter(data => { | ||
335 | + return data.file_name | ||
336 | + .toLowerCase() | ||
337 | + .includes(this.search.toLowerCase()); | ||
338 | + }) | ||
339 | + .slice(0); | ||
340 | + }, | ||
341 | + }, | ||
322 | watch: { | 342 | watch: { |
323 | $route: 'fetchData', | 343 | $route: 'fetchData', |
324 | }, | 344 | }, |
... | @@ -329,6 +349,8 @@ export default { | ... | @@ -329,6 +349,8 @@ export default { |
329 | console.log(response.data); | 349 | console.log(response.data); |
330 | this.$store.commit('setfavFolderList', response.data.folders); | 350 | this.$store.commit('setfavFolderList', response.data.folders); |
331 | this.$store.commit('setfavFileList', response.data.files); | 351 | this.$store.commit('setfavFileList', response.data.files); |
352 | + this.folders = response.data.folders; | ||
353 | + this.files = response.data.files; | ||
332 | } catch (error) { | 354 | } catch (error) { |
333 | console.log('에러'); | 355 | console.log('에러'); |
334 | console.log(error); | 356 | console.log(error); |
... | @@ -521,6 +543,7 @@ export default { | ... | @@ -521,6 +543,7 @@ export default { |
521 | const del = await delFavorite(cData); | 543 | const del = await delFavorite(cData); |
522 | const response = await getFavoriteList(this.$store.state.id); | 544 | const response = await getFavoriteList(this.$store.state.id); |
523 | this.$store.commit('setfavFolderList', response.data.folders); | 545 | this.$store.commit('setfavFolderList', response.data.folders); |
546 | + this.folders = response.data.folders; | ||
524 | } catch (error) { | 547 | } catch (error) { |
525 | console.log('에러'); | 548 | console.log('에러'); |
526 | } | 549 | } |
... | @@ -550,6 +573,7 @@ export default { | ... | @@ -550,6 +573,7 @@ export default { |
550 | const del = await delFavoriteFile(fData); | 573 | const del = await delFavoriteFile(fData); |
551 | const response = await getFavoriteList(this.$store.state.id); | 574 | const response = await getFavoriteList(this.$store.state.id); |
552 | this.$store.commit('setfavFileList', response.data.files); | 575 | this.$store.commit('setfavFileList', response.data.files); |
576 | + this.files = response.data.files; | ||
553 | } catch (error) { | 577 | } catch (error) { |
554 | console.log('에러'); | 578 | console.log('에러'); |
555 | } | 579 | } | ... | ... |
... | @@ -11,11 +11,11 @@ | ... | @@ -11,11 +11,11 @@ |
11 | hide-details | 11 | hide-details |
12 | ></v-text-field> | 12 | ></v-text-field> |
13 | </v-toolbar> | 13 | </v-toolbar> |
14 | - <v-list two-line subheader> | 14 | + <v-list> |
15 | <!-- <v-subheader inset>Folders</v-subheader> --> | 15 | <!-- <v-subheader inset>Folders</v-subheader> --> |
16 | <!-- Folder view --> | 16 | <!-- Folder view --> |
17 | <v-list-item | 17 | <v-list-item |
18 | - v-for="item in this.$store.getters.folderL" | 18 | + v-for="item in calData" |
19 | :key="item.folder_id" | 19 | :key="item.folder_id" |
20 | :search="search" | 20 | :search="search" |
21 | @click.right="show(item, $event)" | 21 | @click.right="show(item, $event)" |
... | @@ -44,8 +44,8 @@ | ... | @@ -44,8 +44,8 @@ |
44 | </v-list-item> | 44 | </v-list-item> |
45 | <!-- File view --> | 45 | <!-- File view --> |
46 | <v-list-item | 46 | <v-list-item |
47 | - v-for="item in this.$store.getters.fileL" | 47 | + v-for="item in calData2" |
48 | - :key="item.title" | 48 | + :key="item.file_id" |
49 | @click.right="showF(item, $event)" | 49 | @click.right="showF(item, $event)" |
50 | @dblclick=" | 50 | @dblclick=" |
51 | detailF(item, $event); | 51 | detailF(item, $event); |
... | @@ -124,8 +124,8 @@ | ... | @@ -124,8 +124,8 @@ |
124 | <v-container> | 124 | <v-container> |
125 | <v-list> | 125 | <v-list> |
126 | <v-list-item | 126 | <v-list-item |
127 | - v-for="item2 in folders" | 127 | + v-for="(item2, index) in folders" |
128 | - :key="item2.folder_id" | 128 | + :key="index" |
129 | @click.left="transferF(item2.folder_name)" | 129 | @click.left="transferF(item2.folder_name)" |
130 | v-if="item2.folder_name !== curfName.folder_name" | 130 | v-if="item2.folder_name !== curfName.folder_name" |
131 | > | 131 | > |
... | @@ -199,8 +199,8 @@ | ... | @@ -199,8 +199,8 @@ |
199 | <v-container> | 199 | <v-container> |
200 | <v-list> | 200 | <v-list> |
201 | <v-list-item | 201 | <v-list-item |
202 | - v-for="item2 in folders" | 202 | + v-for="(item2, index) in folders" |
203 | - :key="item2.folder_id" | 203 | + :key="index" |
204 | @click.left="transferFile(item2.folder_name)" | 204 | @click.left="transferFile(item2.folder_name)" |
205 | > | 205 | > |
206 | <v-list-item-avatar> | 206 | <v-list-item-avatar> |
... | @@ -353,6 +353,7 @@ export default { | ... | @@ -353,6 +353,7 @@ export default { |
353 | files: [], | 353 | files: [], |
354 | search: '', | 354 | search: '', |
355 | id: '', | 355 | id: '', |
356 | + searchD: '', | ||
356 | share_file_name: '', | 357 | share_file_name: '', |
357 | showShareF: false, | 358 | showShareF: false, |
358 | targetUid: '', | 359 | targetUid: '', |
... | @@ -379,6 +380,26 @@ export default { | ... | @@ -379,6 +380,26 @@ export default { |
379 | created() { | 380 | created() { |
380 | this.fetchData(); | 381 | this.fetchData(); |
381 | }, | 382 | }, |
383 | + computed: { | ||
384 | + calData() { | ||
385 | + return this.folders | ||
386 | + .filter(data => { | ||
387 | + return data.folder_name | ||
388 | + .toLowerCase() | ||
389 | + .includes(this.search.toLowerCase()); | ||
390 | + }) | ||
391 | + .slice(0); | ||
392 | + }, | ||
393 | + calData2() { | ||
394 | + return this.files | ||
395 | + .filter(data => { | ||
396 | + return data.file_name | ||
397 | + .toLowerCase() | ||
398 | + .includes(this.search.toLowerCase()); | ||
399 | + }) | ||
400 | + .slice(0); | ||
401 | + }, | ||
402 | + }, | ||
382 | watch: { | 403 | watch: { |
383 | $route: 'fetchData', | 404 | $route: 'fetchData', |
384 | }, | 405 | }, |
... | @@ -569,6 +590,7 @@ export default { | ... | @@ -569,6 +590,7 @@ export default { |
569 | console.log(cData); | 590 | console.log(cData); |
570 | const response = await delFavorite(cData); | 591 | const response = await delFavorite(cData); |
571 | this.$store.commit('setFolder', response.data.folders); | 592 | this.$store.commit('setFolder', response.data.folders); |
593 | + this.folders = response.data.folders; | ||
572 | } catch (error) { | 594 | } catch (error) { |
573 | console.log('에러'); | 595 | console.log('에러'); |
574 | } | 596 | } |
... | @@ -583,6 +605,7 @@ export default { | ... | @@ -583,6 +605,7 @@ export default { |
583 | console.log(cData); | 605 | console.log(cData); |
584 | const response = await addFavorite(cData); | 606 | const response = await addFavorite(cData); |
585 | this.$store.commit('setFolder', response.data.folders); | 607 | this.$store.commit('setFolder', response.data.folders); |
608 | + this.folders = response.data.folders; | ||
586 | } catch (error) { | 609 | } catch (error) { |
587 | console.log('에러'); | 610 | console.log('에러'); |
588 | } | 611 | } |
... | @@ -597,6 +620,7 @@ export default { | ... | @@ -597,6 +620,7 @@ export default { |
597 | console.log(fData); | 620 | console.log(fData); |
598 | const response = await delFavoriteFile(fData); | 621 | const response = await delFavoriteFile(fData); |
599 | this.$store.commit('setFile', response.data.files); | 622 | this.$store.commit('setFile', response.data.files); |
623 | + this.files = response.data.files; | ||
600 | } catch (error) { | 624 | } catch (error) { |
601 | console.log('에러'); | 625 | console.log('에러'); |
602 | } | 626 | } |
... | @@ -611,6 +635,7 @@ export default { | ... | @@ -611,6 +635,7 @@ export default { |
611 | console.log(fData); | 635 | console.log(fData); |
612 | const response = await addFavoriteFile(fData); | 636 | const response = await addFavoriteFile(fData); |
613 | this.$store.commit('setFile', response.data.files); | 637 | this.$store.commit('setFile', response.data.files); |
638 | + this.files = response.data.files; | ||
614 | } catch (error) { | 639 | } catch (error) { |
615 | console.log('에러'); | 640 | console.log('에러'); |
616 | } | 641 | } | ... | ... |
... | @@ -5,7 +5,7 @@ | ... | @@ -5,7 +5,7 @@ |
5 | <v-spacer></v-spacer> | 5 | <v-spacer></v-spacer> |
6 | <v-btn @click="delAll">비우기</v-btn> | 6 | <v-btn @click="delAll">비우기</v-btn> |
7 | </v-toolbar> | 7 | </v-toolbar> |
8 | - <v-list two-line subheader> | 8 | + <v-list> |
9 | <!-- <v-subheader inset>Folders</v-subheader> --> | 9 | <!-- <v-subheader inset>Folders</v-subheader> --> |
10 | <!-- Folder view --> | 10 | <!-- Folder view --> |
11 | <v-list-item | 11 | <v-list-item | ... | ... |
... | @@ -11,12 +11,12 @@ | ... | @@ -11,12 +11,12 @@ |
11 | hide-details | 11 | hide-details |
12 | ></v-text-field> | 12 | ></v-text-field> |
13 | </v-toolbar> | 13 | </v-toolbar> |
14 | - <v-list two-line subheader> | 14 | + <v-list> |
15 | <!-- <v-subheader inset>Folders</v-subheader> --> | 15 | <!-- <v-subheader inset>Folders</v-subheader> --> |
16 | <!-- Folder view --> | 16 | <!-- Folder view --> |
17 | <v-list-item @click="" @dblclick="$router.go(-1)">...</v-list-item> | 17 | <v-list-item @click="" @dblclick="$router.go(-1)">...</v-list-item> |
18 | <v-list-item | 18 | <v-list-item |
19 | - v-for="item in this.$store.getters.folderL" | 19 | + v-for="item in calData" |
20 | :key="item.folder_id" | 20 | :key="item.folder_id" |
21 | :search="search" | 21 | :search="search" |
22 | @click.right="show(item, $event)" | 22 | @click.right="show(item, $event)" |
... | @@ -45,7 +45,7 @@ | ... | @@ -45,7 +45,7 @@ |
45 | </v-list-item> | 45 | </v-list-item> |
46 | <!-- File view --> | 46 | <!-- File view --> |
47 | <v-list-item | 47 | <v-list-item |
48 | - v-for="item in this.$store.getters.fileL" | 48 | + v-for="item in calData2" |
49 | :key="item.title" | 49 | :key="item.title" |
50 | @click.right="showF(item, $event)" | 50 | @click.right="showF(item, $event)" |
51 | @dblclick=" | 51 | @dblclick=" |
... | @@ -382,6 +382,26 @@ export default { | ... | @@ -382,6 +382,26 @@ export default { |
382 | created() { | 382 | created() { |
383 | this.fetchData(); | 383 | this.fetchData(); |
384 | }, | 384 | }, |
385 | + computed: { | ||
386 | + calData() { | ||
387 | + return this.folders | ||
388 | + .filter(data => { | ||
389 | + return data.folder_name | ||
390 | + .toLowerCase() | ||
391 | + .includes(this.search.toLowerCase()); | ||
392 | + }) | ||
393 | + .slice(0); | ||
394 | + }, | ||
395 | + calData2() { | ||
396 | + return this.files | ||
397 | + .filter(data => { | ||
398 | + return data.file_name | ||
399 | + .toLowerCase() | ||
400 | + .includes(this.search.toLowerCase()); | ||
401 | + }) | ||
402 | + .slice(0); | ||
403 | + }, | ||
404 | + }, | ||
385 | watch: { | 405 | watch: { |
386 | $route: 'fetchData', | 406 | $route: 'fetchData', |
387 | }, | 407 | }, |
... | @@ -574,6 +594,7 @@ export default { | ... | @@ -574,6 +594,7 @@ export default { |
574 | console.log(cData); | 594 | console.log(cData); |
575 | const response = await delFavorite(cData); | 595 | const response = await delFavorite(cData); |
576 | this.$store.commit('setFolder', response.data.folders); | 596 | this.$store.commit('setFolder', response.data.folders); |
597 | + this.folders = response.data.folders; | ||
577 | } catch (error) { | 598 | } catch (error) { |
578 | console.log('에러'); | 599 | console.log('에러'); |
579 | } | 600 | } |
... | @@ -588,6 +609,7 @@ export default { | ... | @@ -588,6 +609,7 @@ export default { |
588 | console.log(cData); | 609 | console.log(cData); |
589 | const response = await addFavorite(cData); | 610 | const response = await addFavorite(cData); |
590 | this.$store.commit('setFolder', response.data.folders); | 611 | this.$store.commit('setFolder', response.data.folders); |
612 | + this.folders = response.data.folders; | ||
591 | } catch (error) { | 613 | } catch (error) { |
592 | console.log('에러'); | 614 | console.log('에러'); |
593 | } | 615 | } |
... | @@ -602,6 +624,7 @@ export default { | ... | @@ -602,6 +624,7 @@ export default { |
602 | console.log(fData); | 624 | console.log(fData); |
603 | const response = await delFavoriteFile(fData); | 625 | const response = await delFavoriteFile(fData); |
604 | this.$store.commit('setFile', response.data.files); | 626 | this.$store.commit('setFile', response.data.files); |
627 | + this.files = response.data.files; | ||
605 | } catch (error) { | 628 | } catch (error) { |
606 | console.log('에러'); | 629 | console.log('에러'); |
607 | } | 630 | } |
... | @@ -616,6 +639,7 @@ export default { | ... | @@ -616,6 +639,7 @@ export default { |
616 | console.log(fData); | 639 | console.log(fData); |
617 | const response = await addFavoriteFile(fData); | 640 | const response = await addFavoriteFile(fData); |
618 | this.$store.commit('setFile', response.data.files); | 641 | this.$store.commit('setFile', response.data.files); |
642 | + this.files = response.data.files; | ||
619 | } catch (error) { | 643 | } catch (error) { |
620 | console.log('에러'); | 644 | console.log('에러'); |
621 | } | 645 | } | ... | ... |
-
Please register or login to post a comment