최동원

change routes

......@@ -14,16 +14,16 @@ router.get('/show', function(req, res, next) {
console.log('select error');
res.status(404).send();
} else {
folders.push(folder);
// folders.push(folder);
connection.query(checkfiles, [user_id], function(err, file, fields) {
if (err) {
console.log('select error');
res.status(404).send();
} else {
files.push(file);
// files.push(file);
res.status(200).send({
folders: folders,
files: files
folders: folder,
files: file
});
}
});
......
......@@ -18,7 +18,7 @@ function folder(curData) {
return axios.get('/api/folder/show', {
params: {
id: curData.id,
cur: curData.cur,
folder_id: curData.folder_id,
},
});
}
......@@ -39,7 +39,7 @@ function file(curData) {
return axios.get('/api/file', {
params: {
id: curData.id,
cur: curData.cur,
folder_id: curData.cur,
},
});
}
......@@ -109,6 +109,14 @@ function addFavoriteFile(fileData) {
return axios.post('api/favorites/addfile', fileData);
}
function getFavoriteList(userId) {
return axios.get('api/favorites/show', {
params: {
id: userId,
},
});
}
export {
registerUser,
loginUser,
......@@ -128,4 +136,5 @@ export {
accessedList,
detailFile,
modifyFile,
getFavoriteList,
};
......
This diff is collapsed. Click to expand it.
......@@ -19,11 +19,17 @@
>
<v-list-item
v-for="item in this.$store.getters.folderL"
:key="item.title"
:key="item.folder_id"
:search="search"
@click.right="show(item, $event)"
@click=""
@dblclick="moveF(item.folder_name)"
@dblclick="
$router.push({
name: 'Folder',
params: { id: item.folder_id },
props: { folderId: item.id },
})
"
>
<v-list-item-avatar>
<v-icon>mdi-folder</v-icon>
......@@ -341,7 +347,7 @@ export default {
try {
const curData = {
id: this.$store.state.id,
cur: '/',
folder_id: -1,
};
console.log(curData);
const response = await folder(curData);
......
This diff is collapsed. Click to expand it.
......@@ -67,9 +67,10 @@ export default new VueRouter({
component: () => import('../views/Feedback.vue'),
},
{
path: '/folder',
path: '/file/:id',
name: 'Folder',
component: () => import('../views/FolderPage.vue'),
props: true,
},
],
});
......
......@@ -11,6 +11,8 @@ export default new Vuex.Store({
cur: '/',
parent: '/',
recentList: [],
favFolderList: [],
favFileList: [],
},
mutations: {
setId(state, userid) {
......@@ -34,6 +36,12 @@ export default new Vuex.Store({
setRecentList(state, list) {
state.recentList = list;
},
setfavFolderList(state, fflist) {
state.favFolderList = fflist;
},
setfavFileList(state, fflist) {
state.favFileList = fflist;
},
},
getters: {
isLogin(state) {
......@@ -60,5 +68,11 @@ export default new Vuex.Store({
setFile(state, filelist) {
state.files = filelist;
},
favFolderL(state) {
return state.favFolderList;
},
favFileL(state) {
return state.favFileList;
},
},
});
......
<template>
<div>
<v-toolbar flat>
<v-toolbar-title>즐겨찾기</v-toolbar-title>
<v-spacer></v-spacer>
<v-text-field
v-model="search"
append-icon="mdi-magnify"
label="즐겨찾기 검색"
single-line
hide-details
></v-text-field>
</v-toolbar>
<v-list two-line subheader>
<v-list-item v-for="item in items" :key="item.title" @click="">
<v-list-item-avatar>
<v-icon>{{ item.iconClass }}</v-icon>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title v-text="item.title"></v-list-item-title>
<v-list-item-subtitle v-text="item.subtitle"></v-list-item-subtitle>
</v-list-item-content>
<v-list-item-action>
<v-btn icon>
<v-icon color="grey lighten-1">mdi-information</v-icon>
</v-btn>
</v-list-item-action>
</v-list-item>
<v-list-item v-for="item in items2" :key="item.title" @click="">
<v-list-item-avatar>
<v-icon> {{ item.iconClass }}</v-icon>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title v-text="item.title"></v-list-item-title>
<v-list-item-subtitle v-text="item.subtitle"></v-list-item-subtitle>
</v-list-item-content>
<v-list-item-action>
<v-btn icon>
<v-icon color="grey lighten-1">mdi-information</v-icon>
</v-btn>
</v-list-item-action>
</v-list-item>
</v-list>
<Fav_list></Fav_list>
</div>
</template>
<script>
import Fav_list from '../components/Fav_list';
export default {
data: () => ({
items: [
{
icon: 'folder',
iconClass: 'mdi-folder',
title: 'Photos',
subtitle: 'Jan 9, 2014',
},
{
icon: 'folder',
iconClass: 'mdi-folder',
title: 'Recipes',
subtitle: 'Jan 17, 2014',
},
{
icon: 'folder',
iconClass: 'mdi-folder',
title: 'Work',
subtitle: 'Jan 28, 2014',
components: {
Fav_list,
},
],
items2: [
{
icon: 'assignment',
iconClass: 'mdi-file',
title: 'Vacation itinerary',
subtitle: 'Jan 20, 2014',
},
{
icon: 'call_to_action',
iconClass: 'mdi-PdfBox',
title: 'Kitchen remodel',
subtitle: 'Jan 10, 2014',
},
],
}),
};
</script>
<style></style>
......
<template>
<div>
<folderc></folderc>
</div>
</template>
<script>
import folderc from '../components/folderc';
export default {
components: {
folderc,
},
};
</script>
<style></style>
......