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-09 01:27:16 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a927247109b4fcba5e167dc8f354c7a29b723122
a9272471
1 parent
69859169
add detail and edit api
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
3 deletions
backend/routes/modules/s3/download/kbpark9898/test(1).txt
backend/routes/modules/s3/download/kbpark9898/test4.txt
backend/routes/modules/s3/download/kbpark9898/test6.txt
front-end/src/api/index.js
front-end/src/components/FileList.vue
backend/routes/modules/s3/download/kbpark9898/test(1).txt
deleted
100644 → 0
View file @
6985916
this is the second test edit
\ No newline at end of file
backend/routes/modules/s3/download/kbpark9898/test4.txt
deleted
100644 → 0
View file @
6985916
File mode changed
backend/routes/modules/s3/download/kbpark9898/test6.txt
deleted
100644 → 0
View file @
6985916
File mode changed
front-end/src/api/index.js
View file @
a927247
...
...
@@ -53,7 +53,7 @@ function uploadFile(fileData) {
}
function
detailFile
(
fileData
)
{
return
axios
.
get
(
`/api/file/
${
fileData
.
n
ame
}
`
,
{
return
axios
.
get
(
`/api/file/
${
fileData
.
fileN
ame
}
`
,
{
params
:
{
id
:
fileData
.
id
,
cur
:
fileData
.
cur
,
...
...
front-end/src/components/FileList.vue
View file @
a927247
...
...
@@ -46,6 +46,7 @@
v-for="item in this.$store.getters.fileL"
:key="item.title"
@click.right="showF(item, $event)"
@dblclick="detailF(item, $event); file_detail(item);"
@click=""
>
<v-list-item-avatar>
...
...
@@ -65,7 +66,30 @@
</v-list-item-action>
</v-list-item>
</v-list>
<!--file detial -->
<v-dialog
v-model="showdetailF"
max-width="290"
>
<v-card>
<v-card-title class="headline">
<v-text-field v-model="current_filename" ></v-text-field>
</v-card-title>
<v-card-text>
<v-text-field v-model="current_filedata" ></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color="green darken-1"
text
@click="showdetailF = false; modify_file();"
>
save
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<!-- Move Folder -->
<v-dialog v-model="dialog2" width="500px">
<v-card>
...
...
@@ -281,6 +305,8 @@ import {
moveFile,
delFavoriteFile,
addFavoriteFile,
detailFile,
modifyFile
} from '../api/index';
import Axios from 'axios';
...
...
@@ -295,10 +321,13 @@ export default {
files: [],
search: '',
id: '',
current_filename: null, //파일 상세정보 (이름)
current_filedata: null, //파일 상세정보 (내용)
dialog: false,
howMenu: false,
showMenu: false,
showMenuF: false, //파일 관련 메뉴
showdetailF:false, //txt 파일 상세정보 및 수정
x: 0,
y: 0,
dialog2: false,
...
...
@@ -587,6 +616,44 @@ export default {
this.dialog3 = false;
}
},
async file_detail(){
try{
const currentData = {
id: this.cfilename.user_id,
cur: this.cfilename.location,
fileName: this.cfilename.file_name
}
const detailData = await detailFile(currentData)
this.current_filename = detailData.data.file_name;
this.current_filedata = detailData.data.content;
console.log(this.current_filename);
console.log(this.current_filedata);
}catch(error){
console.log('에러');
console.log(error);
}
},
async modify_file(){
try{
const modifyData = {
user_id: cfilename.user_id,
cur: cfilename.location,
name: this.current_filename,
content: this.current_filedata
}
const result = await modifyFile(modifyData);
const after_data={
id: cfilename.user_id,
cur: cfilename.location,
fileName: this.current_filename
}
const detailData = await detailFile()
}catch(error){
console.log('에러');
console.log(error);
}
},
show(folderObj, e) {
e.preventDefault();
this.curfName = folderObj;
...
...
@@ -607,6 +674,16 @@ export default {
this.showMenuF = true;
});
},
detailF(fileObj, e) {
e.preventDefault();
this.cfilename = fileObj;
this.showdetailF = false;
this.x = e.clientX;
this.y = e.clientY;
this.$nextTick(() => {
this.showdetailF = true;
});
},
},
};
</script>
...
...
Please
register
or
login
to post a comment