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:11:16 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e9d6846710181c6c8b1e71dec8a6188e0082668e
e9d68467
1 parent
be1917af
change_favorite
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
63 deletions
front-end/src/api/index.js
front-end/src/components/FileList.vue
front-end/src/store/index.js
front-end/src/api/index.js
View file @
e9d6846
...
...
@@ -80,6 +80,10 @@ function downloadFile(fileData) {
});
}
function
changeFavorite
()
{
return
axios
.
post
();
}
export
{
registerUser
,
loginUser
,
...
...
@@ -91,4 +95,5 @@ export {
uploadFile
,
deleteFile
,
downloadFile
,
changeFavorite
,
};
...
...
front-end/src/components/FileList.vue
View file @
e9d6846
...
...
@@ -18,7 +18,7 @@
v-for="item in this.$store.getters.folderL"
:key="item.title"
:search="search"
@click.right="show(item
.folder_name
, $event)"
@click.right="show(item, $event)"
@click.left="moveF(item.folder_name)"
>
<v-list-item-avatar>
...
...
@@ -27,6 +27,15 @@
<v-list-item-content>
<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-icon v-else color="yellow">
star
</v-icon>
</v-list-item-action>
</v-list-item>
<v-divider inset></v-divider>
...
...
@@ -60,7 +69,7 @@
v-for="item2 in folders"
:key="item2.folder_id"
@click.left="transferF(item2.folder_name)"
v-if="item2.folder_name !== curfName"
v-if="item2.folder_name !== curfName
.folder_name
"
>
<v-list-item-avatar>
<v-icon>mdi-folder</v-icon>
...
...
@@ -94,6 +103,16 @@
<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-title>즐겨 찾기 삭제</v-list-item-title>
</v-list-item>
</template>
<template v-if="curfName.favorite === 'false'" @click="change_favorite">
<v-list-item>
<v-list-item-title>즐겨 찾기 추가</v-list-item-title>
</v-list-item>
</template>
</v-list>
</v-menu>
...
...
@@ -151,7 +170,7 @@ export default {
return {
uploadedfile: null,
foldername: '',
curfName:
''
,
curfName:
{}
,
folders: [],
files: [],
search: '',
...
...
@@ -201,7 +220,7 @@ export default {
this.foldername = '';
},
cancelMove() {
this.curfName =
''
;
this.curfName =
{}
;
this.dialog2 = false;
},
async makeF() {
...
...
@@ -263,7 +282,7 @@ export default {
const cData = {
id: this.$store.state.id,
cur: this.$store.state.cur,
folder_name: this.curfName,
folder_name: this.curfName
.folder_name
,
};
const response = await deleteFolder(cData);
console.log(response);
...
...
@@ -281,7 +300,7 @@ export default {
const cData = {
id: this.$store.state.id,
cur: this.$store.state.cur,
folder_name: this.curfName,
folder_name: this.curfName
.folder_name
,
isfolder: true,
newPath: this.$store.state.cur + folderName + '/',
};
...
...
@@ -294,7 +313,7 @@ export default {
console.log(error.response.data);
} finally {
this.initFolderName();
this.curfName =
''
;
this.curfName =
{}
;
this.dialog2 = false;
}
},
...
...
@@ -369,9 +388,10 @@ export default {
console.log(error);
}
},
show(folderN, e) {
async change_favorite() {},
show(folderObj, e) {
e.preventDefault();
this.curfName = folder
N
;
this.curfName = folder
Obj
;
this.showMenu = false;
this.x = e.clientX;
this.y = e.clientY;
...
...
front-end/src/store/index.js
View file @
e9d6846
import
Vue
from
'vue'
import
Vuex
from
'vuex'
import
Vue
from
'vue'
;
import
Vuex
from
'vuex'
;
Vue
.
use
(
Vuex
)
Vue
.
use
(
Vuex
)
;
export
default
new
Vuex
.
Store
({
state
:
{
id
:
''
,
folders
:
[],
files
:
[],
cur
:
'/'
,
parent
:
'/'
},
mutations
:
{
setId
(
state
,
userid
)
{
state
.
id
=
userid
;
},
clearid
(
state
)
{
state
.
id
=
''
;
},
setFolder
(
state
,
folderlist
)
{
state
.
folders
=
folderlist
;
},
setFile
(
state
,
filelist
)
{
state
.
files
=
filelist
;
},
setCur
(
state
,
cur
)
{
state
.
cur
=
cur
;
},
setParent
(
state
,
parent
)
{
state
.
parent
=
parent
;
}
},
getters
:
{
isLogin
(
state
)
{
return
state
.
id
!==
''
;
},
userID
(
state
)
{
return
state
.
id
;
},
folderL
(
state
)
{
return
state
.
folders
;
},
fileL
(
state
)
{
return
state
.
files
;
},
cur
(
state
)
{
return
state
.
cur
;
},
setFolder
(
state
,
folderlist
){
state
.
folders
=
folderlist
;
},
setFile
(
state
,
filelist
){
state
.
files
=
filelist
;
},
},
})
\ No newline at end of file
state
:
{
id
:
''
,
folders
:
[],
files
:
[],
cur
:
'/'
,
parent
:
'/'
,
},
mutations
:
{
setId
(
state
,
userid
)
{
state
.
id
=
userid
;
},
clearid
(
state
)
{
state
.
id
=
''
;
},
setFolder
(
state
,
folderlist
)
{
state
.
folders
=
folderlist
;
},
setFile
(
state
,
filelist
)
{
state
.
files
=
filelist
;
},
setCur
(
state
,
cur
)
{
state
.
cur
=
cur
;
},
setParent
(
state
,
parent
)
{
state
.
parent
=
parent
;
},
},
getters
:
{
isLogin
(
state
)
{
return
state
.
id
!==
''
;
},
userID
(
state
)
{
return
state
.
id
;
},
folderL
(
state
)
{
return
state
.
folders
;
},
fileL
(
state
)
{
return
state
.
files
;
},
cur
(
state
)
{
return
state
.
cur
;
},
setFolder
(
state
,
folderlist
)
{
state
.
folders
=
folderlist
;
},
setFile
(
state
,
filelist
)
{
state
.
files
=
filelist
;
},
},
});
...
...
Please
register
or
login
to post a comment