최동원

search folder,file

......@@ -11,7 +11,7 @@
hide-details
></v-text-field>
</v-toolbar>
<v-list two-line subheader>
<v-list>
<!-- <v-subheader inset>Folders</v-subheader> -->
<!-- Folder view -->
<v-list-item
......@@ -21,7 +21,7 @@
>...</v-list-item
>
<v-list-item
v-for="item in this.$store.getters.favFolderL"
v-for="item in calData"
:key="item.folder_id"
:search="search"
@click.right="show(item, $event)"
......@@ -50,7 +50,7 @@
</v-list-item>
<!-- File view -->
<v-list-item
v-for="item in this.$store.getters.favFileL"
v-for="item in calData2"
:key="item.title"
@click.right="showF(item, $event)"
@dblclick="
......@@ -319,6 +319,26 @@ export default {
created() {
this.fetchData();
},
computed: {
calData() {
return this.folders
.filter(data => {
return data.folder_name
.toLowerCase()
.includes(this.search.toLowerCase());
})
.slice(0);
},
calData2() {
return this.files
.filter(data => {
return data.file_name
.toLowerCase()
.includes(this.search.toLowerCase());
})
.slice(0);
},
},
watch: {
$route: 'fetchData',
},
......@@ -329,6 +349,8 @@ export default {
console.log(response.data);
this.$store.commit('setfavFolderList', response.data.folders);
this.$store.commit('setfavFileList', response.data.files);
this.folders = response.data.folders;
this.files = response.data.files;
} catch (error) {
console.log('에러');
console.log(error);
......@@ -521,6 +543,7 @@ export default {
const del = await delFavorite(cData);
const response = await getFavoriteList(this.$store.state.id);
this.$store.commit('setfavFolderList', response.data.folders);
this.folders = response.data.folders;
} catch (error) {
console.log('에러');
}
......@@ -550,6 +573,7 @@ export default {
const del = await delFavoriteFile(fData);
const response = await getFavoriteList(this.$store.state.id);
this.$store.commit('setfavFileList', response.data.files);
this.files = response.data.files;
} catch (error) {
console.log('에러');
}
......
......@@ -11,11 +11,11 @@
hide-details
></v-text-field>
</v-toolbar>
<v-list two-line subheader>
<v-list>
<!-- <v-subheader inset>Folders</v-subheader> -->
<!-- Folder view -->
<v-list-item
v-for="item in this.$store.getters.folderL"
v-for="item in calData"
:key="item.folder_id"
:search="search"
@click.right="show(item, $event)"
......@@ -44,8 +44,8 @@
</v-list-item>
<!-- File view -->
<v-list-item
v-for="item in this.$store.getters.fileL"
:key="item.title"
v-for="item in calData2"
:key="item.file_id"
@click.right="showF(item, $event)"
@dblclick="
detailF(item, $event);
......@@ -124,8 +124,8 @@
<v-container>
<v-list>
<v-list-item
v-for="item2 in folders"
:key="item2.folder_id"
v-for="(item2, index) in folders"
:key="index"
@click.left="transferF(item2.folder_name)"
v-if="item2.folder_name !== curfName.folder_name"
>
......@@ -199,8 +199,8 @@
<v-container>
<v-list>
<v-list-item
v-for="item2 in folders"
:key="item2.folder_id"
v-for="(item2, index) in folders"
:key="index"
@click.left="transferFile(item2.folder_name)"
>
<v-list-item-avatar>
......@@ -353,6 +353,7 @@ export default {
files: [],
search: '',
id: '',
searchD: '',
share_file_name: '',
showShareF: false,
targetUid: '',
......@@ -379,6 +380,26 @@ export default {
created() {
this.fetchData();
},
computed: {
calData() {
return this.folders
.filter(data => {
return data.folder_name
.toLowerCase()
.includes(this.search.toLowerCase());
})
.slice(0);
},
calData2() {
return this.files
.filter(data => {
return data.file_name
.toLowerCase()
.includes(this.search.toLowerCase());
})
.slice(0);
},
},
watch: {
$route: 'fetchData',
},
......@@ -569,6 +590,7 @@ export default {
console.log(cData);
const response = await delFavorite(cData);
this.$store.commit('setFolder', response.data.folders);
this.folders = response.data.folders;
} catch (error) {
console.log('에러');
}
......@@ -583,6 +605,7 @@ export default {
console.log(cData);
const response = await addFavorite(cData);
this.$store.commit('setFolder', response.data.folders);
this.folders = response.data.folders;
} catch (error) {
console.log('에러');
}
......@@ -597,6 +620,7 @@ export default {
console.log(fData);
const response = await delFavoriteFile(fData);
this.$store.commit('setFile', response.data.files);
this.files = response.data.files;
} catch (error) {
console.log('에러');
}
......@@ -611,6 +635,7 @@ export default {
console.log(fData);
const response = await addFavoriteFile(fData);
this.$store.commit('setFile', response.data.files);
this.files = response.data.files;
} catch (error) {
console.log('에러');
}
......
......@@ -5,7 +5,7 @@
<v-spacer></v-spacer>
<v-btn @click="delAll">비우기</v-btn>
</v-toolbar>
<v-list two-line subheader>
<v-list>
<!-- <v-subheader inset>Folders</v-subheader> -->
<!-- Folder view -->
<v-list-item
......
......@@ -11,12 +11,12 @@
hide-details
></v-text-field>
</v-toolbar>
<v-list two-line subheader>
<v-list>
<!-- <v-subheader inset>Folders</v-subheader> -->
<!-- Folder view -->
<v-list-item @click="" @dblclick="$router.go(-1)">...</v-list-item>
<v-list-item
v-for="item in this.$store.getters.folderL"
v-for="item in calData"
:key="item.folder_id"
:search="search"
@click.right="show(item, $event)"
......@@ -45,7 +45,7 @@
</v-list-item>
<!-- File view -->
<v-list-item
v-for="item in this.$store.getters.fileL"
v-for="item in calData2"
:key="item.title"
@click.right="showF(item, $event)"
@dblclick="
......@@ -382,6 +382,26 @@ export default {
created() {
this.fetchData();
},
computed: {
calData() {
return this.folders
.filter(data => {
return data.folder_name
.toLowerCase()
.includes(this.search.toLowerCase());
})
.slice(0);
},
calData2() {
return this.files
.filter(data => {
return data.file_name
.toLowerCase()
.includes(this.search.toLowerCase());
})
.slice(0);
},
},
watch: {
$route: 'fetchData',
},
......@@ -574,6 +594,7 @@ export default {
console.log(cData);
const response = await delFavorite(cData);
this.$store.commit('setFolder', response.data.folders);
this.folders = response.data.folders;
} catch (error) {
console.log('에러');
}
......@@ -588,6 +609,7 @@ export default {
console.log(cData);
const response = await addFavorite(cData);
this.$store.commit('setFolder', response.data.folders);
this.folders = response.data.folders;
} catch (error) {
console.log('에러');
}
......@@ -602,6 +624,7 @@ export default {
console.log(fData);
const response = await delFavoriteFile(fData);
this.$store.commit('setFile', response.data.files);
this.files = response.data.files;
} catch (error) {
console.log('에러');
}
......@@ -616,6 +639,7 @@ export default {
console.log(fData);
const response = await addFavoriteFile(fData);
this.$store.commit('setFile', response.data.files);
this.files = response.data.files;
} catch (error) {
console.log('에러');
}
......