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
Hong
2020-05-29 03:39:13 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2747f20c691fd18fafcf45a6060c59934190e72f
2747f20c
1 parent
e69b45cc
파일이동v2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
48 deletions
front-end/src/components/FileList.vue
front-end/src/components/FileList.vue
View file @
2747f20
...
...
@@ -19,7 +19,7 @@
v-for="item in this.$store.getters.folderL"
:key="item.title"
:search="search"
@click.right="show"
@click.right="show
(item.folder_name,$event)
"
@click.left="moveF(item.folder_name)"
>
<v-list-item-avatar >
...
...
@@ -29,7 +29,26 @@
<v-list-item-title v-text="item.folder_name"></v-list-item-title>
</v-list-item-content>
<v-dialog
<v-menu
v-model="showMenu"
:position-x="x"
:position-y="y"
absolute
offset-y
>
<v-list dense>
<v-list-item @click.prevent="dialog2 = !dialog2">
<v-list-item-title>이동</v-list-item-title>
</v-list-item>
<v-list-item @click.prevent="deleteF">
<v-list-item-title>삭제</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-list-item>
<v-dialog
v-model="dialog2"
width="500px"
>
...
...
@@ -38,48 +57,33 @@
Move Folder
</v-card-title>
<v-container>
<v-list-item
v-for="item2 in fMove"
:key="item2.title"
@click.prevent="transferF(item.folder_name, item2.folder_name)"
<v-list-item-group
v-for="item2 in folders"
:key="item2.folder_id"
>
<template v-if="!(item2.folder_name === curfName)">
<v-hover @click.left="transferF(item2.folder_name)">
<v-list-item-avatar>
<v-icon>mdi-folder</v-icon>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title v-text="item2.folder_name"></v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-hover>
</template>
<!-- <template v-else></template> -->
</v-list-item-group>
</v-container>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
text
color="primary"
@click="
initf
Move"
@click="
cancel
Move"
>Cancel</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-menu
v-model="showMenu"
:position-x="x"
:position-y="y"
absolute
offset-y
>
<v-list dense>
<v-list-item @click.prevent="moveW(item.folder_name)">
<v-list-item-title>이동</v-list-item-title>
</v-list-item>
<v-list-item @click.prevent="deleteF(item.folder_name)">
<v-list-item-title>삭제</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-list-item>
<v-divider inset></v-divider>
<v-subheader inset>Files</v-subheader>
<v-list-item
...
...
@@ -143,7 +147,6 @@
>
<v-icon>mdi-plus</v-icon>
</v-btn>
<v-dialog
v-model="dialog"
width="500px"
...
...
@@ -181,9 +184,9 @@ import Axios from 'axios';
data() {
return {
foldername:'',
curfName:'',
folders: [],
files: [],
fMove:[],
search:'',
id: '',
dialog:false,
...
...
@@ -216,6 +219,10 @@ import Axios from 'axios';
initFolderName(){
this.foldername = '';
},
cancelMove(){
this.curfName = '';
this.dialog2 = false;
},
async makeF(){
try {
const folderData = {
...
...
@@ -270,12 +277,12 @@ import Axios from 'axios';
console.log(error.response.data);
}
},
async deleteF(
folderName
){
async deleteF(){
try {
const cData = {
id: this.$store.state.id,
cur : this.$store.state.cur,
folder_name:
folder
Name
folder_name:
this.curf
Name
}
const response = await deleteFolder(cData);
console.log(response);
...
...
@@ -284,16 +291,18 @@ import Axios from 'axios';
} catch (error) {
console.log("에러");
console.log(error.response.data);
} finally{
this.curfName = '';
}
},
async transferF(folderName
1, folderName2
){
async transferF(folderName){
try {
const cData = {
id: this.$store.state.id,
cur : this.$store.state.cur,
folder_name:
folderName1
,
folder_name:
this.curfName
,
isfolder: true,
newPath: this.$store.state.cur + folderName
2
newPath: this.$store.state.cur + folderName
+ '/'
}
const response = await moveFolder(cData);
console.log(response);
...
...
@@ -304,30 +313,19 @@ import Axios from 'axios';
console.log(error.response.data);
} finally{
this.initFolderName();
this.curfName = '';
this.dialog2 = false;
}
},
show (e) {
show (
folderN,
e) {
e.preventDefault()
this.curfName = folderN;
this.showMenu = false
this.x = e.clientX
this.y = e.clientY
this.$nextTick(() => {
this.showMenu = true
})
},
moveW(fName){
for(let i of this.folders){
if(i.folder_name !==fName){
this.fMove.push(i);
}
}
this.dialog2 = !this.dialog2;
console.log(fName);
},
initfMove(){
this.fMove = [];
this.dialog2 = !this.dialog2;
}
}
}
...
...
Please
register
or
login
to post a comment