Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-CloudComputing
/
D_Team_Khuloud
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
최동원
2020-06-08 01:55:40 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5044da91f75b159052ffa46c2ee29bd394fa041e
5044da91
1 parent
8515f027
.
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
13 deletions
front-end/src/api/index.js
front-end/src/components/FileList.vue
front-end/src/api/index.js
View file @
5044da9
...
...
@@ -80,8 +80,12 @@ function downloadFile(fileData) {
});
}
function
changeFavorite
()
{
return
axios
.
post
();
function
delFavorite
(
folderData
)
{
return
axios
.
post
(
'api/favorites/delfolder'
,
folderData
);
}
function
addFavorite
(
folderData
)
{
return
axios
.
post
(
'api/favorites/addfolder'
,
folderData
);
}
export
{
...
...
@@ -95,5 +99,6 @@ export {
uploadFile
,
deleteFile
,
downloadFile
,
changeFavorite
,
delFavorite
,
addFavorite
,
};
...
...
front-end/src/components/FileList.vue
View file @
5044da9
...
...
@@ -28,12 +28,12 @@
<v-list-item-title v-text="item.folder_name"></v-list-item-title>
</v-list-item-content>
<v-list-item-action>
<v-icon v-if="item.favorite ===
'false'
" color="grey lighten-1">
star_
border
<v-icon v-if="item.favorite ===
0
" color="grey lighten-1">
mdi-star-
border
</v-icon>
<v-icon v-else color="yellow">
star
mdi-
star
</v-icon>
</v-list-item-action>
</v-list-item>
...
...
@@ -103,16 +103,12 @@
<v-list-item @click.prevent="deleteF">
<v-list-item-title>삭제</v-list-item-title>
</v-list-item>
<template v-if="curfName.favorite === 'true'" @click="change_favorite">
<v-list-item>
<v-list-item v-if="curfName.favorite === 1" @click="delete_favorite">
<v-list-item-title>즐겨 찾기 삭제</v-list-item-title>
</v-list-item>
</template>
<template v-if="curfName.favorite === 'false'" @click="change_favorite">
<v-list-item>
<v-list-item v-if="curfName.favorite === 0" @click="add_favorite">
<v-list-item-title>즐겨 찾기 추가</v-list-item-title>
</v-list-item>
</template>
</v-list>
</v-menu>
...
...
@@ -162,6 +158,8 @@ import {
uploadFile,
deleteFile,
downloadFile,
delFavorite,
addFavorite,
} from '../api/index';
import Axios from 'axios';
...
...
@@ -388,7 +386,34 @@ export default {
console.log(error);
}
},
async change_favorite() {},
async delete_favorite() {
try {
const cData = {
id: this.$store.state.id,
cur: this.$store.state.cur,
name: this.curfName.folder_name,
};
console.log(cData);
const response = await delFavorite(cData);
this.$store.commit('setFolder', response.data.folders);
} catch (error) {
console.log('에러');
}
},
async add_favorite() {
try {
const cData = {
id: this.$store.state.id,
cur: this.$store.state.cur,
name: this.curfName.folder_name,
};
console.log(cData);
const response = await addFavorite(cData);
this.$store.commit('setFolder', response.data.folders);
} catch (error) {
console.log('에러');
}
},
show(folderObj, e) {
e.preventDefault();
this.curfName = folderObj;
...
...
Please
register
or
login
to post a comment