|
|
@@ -8,7 +8,7 @@
|
|
|
|
|
|
<div class="container">
|
|
|
<router-link to="/upload">
|
|
|
- <el-button type="primary" size="large">上传文件</el-button>
|
|
|
+ <el-button type="primary" size="medium">添加文件</el-button>
|
|
|
</router-link>
|
|
|
|
|
|
<el-table
|
|
|
@@ -18,21 +18,19 @@
|
|
|
|
|
|
<el-table-column label="文件名">
|
|
|
<template #default="scope">
|
|
|
- <span class="message-title">{{scope.row.fileName}}</span>
|
|
|
+ <el-button type="text" class="message-title" @click="handleFileDetail(scope.row.id)">
|
|
|
+ {{scope.row.fileName}}</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column width="300" label="操作">
|
|
|
<template #default="scope">
|
|
|
- <!----------------------------todo------------------------------->
|
|
|
- <!----------------------------获取文件详细信息、跳转到响应页面;删除文件------------------------------->
|
|
|
<div style="display:flex; width: 100%;">
|
|
|
- <el-button size="small" style="margin-right: 10px"
|
|
|
+ <el-button type="text" style="margin-right: 10px"
|
|
|
@click="handleFileDetail(scope.row.id)">查看</el-button>
|
|
|
- <el-button size="small" type="warning" style="margin-right: 10px"
|
|
|
+ <el-button type="text" style="margin-right: 10px; color: #e6a23c"
|
|
|
@click="handleShareDialog(scope.row.id);shareDialogVisible=true">分享</el-button>
|
|
|
- <!-- scope.$index 是数组下标,这里再传一个fileId handleFileDelete(scope.$index,scope.row.fileId) -->
|
|
|
- <el-button size="small" type="danger"
|
|
|
+ <el-button type="text" style="color: red"
|
|
|
@click="handleDeleteDialog(scope.row.id);deleteDialogVisible=true">删除</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -49,10 +47,10 @@
|
|
|
<span>确认要共享该文件到广场吗?</span>
|
|
|
<template #footer>
|
|
|
<span class="dialog-footer">
|
|
|
- <el-button @click="shareDialogVisible = false;">
|
|
|
- 取消
|
|
|
+ <el-button @click="shareDialogVisible = false;" size="medium">
|
|
|
+ 再想想
|
|
|
</el-button>
|
|
|
- <el-button type="warning" @click="shareDialogVisible = false;handleFileShare()">
|
|
|
+ <el-button type="warning" @click="shareDialogVisible = false;handleFileShare()" size="medium">
|
|
|
确认
|
|
|
</el-button>
|
|
|
</span>
|
|
|
@@ -68,10 +66,10 @@
|
|
|
<span>确认要删除该文件吗?</span>
|
|
|
<template #footer>
|
|
|
<span class="dialog-footer">
|
|
|
- <el-button @click="deleteDialogVisible = false;toDeleteFileId=0;">
|
|
|
- 取消
|
|
|
+ <el-button @click="deleteDialogVisible = false;toDeleteFileId=0;" size="medium">
|
|
|
+ 再想想
|
|
|
</el-button>
|
|
|
- <el-button type="danger" @click="deleteDialogVisible = false;toDeleteFileId=0;handleFileDelete()">
|
|
|
+ <el-button type="danger" @click="deleteDialogVisible = false;toDeleteFileId=0;handleFileDelete()" size="medium">
|
|
|
确认
|
|
|
</el-button>
|
|
|
</span>
|
|
|
@@ -98,13 +96,6 @@ export default {
|
|
|
let userId = localStorage.getItem("ms_userId");
|
|
|
let state = reactive({
|
|
|
fileList: [],
|
|
|
- picList:[
|
|
|
- {
|
|
|
- date: "2018-04-19 20:00:00",
|
|
|
- picId: "1",
|
|
|
- picName:"图片1"
|
|
|
- }
|
|
|
- ],
|
|
|
});
|
|
|
let shareDialogVisible=ref(false);
|
|
|
let toShareFileId=ref(0);
|
|
|
@@ -116,9 +107,7 @@ export default {
|
|
|
const getFileList=(userId)=>{
|
|
|
GetAllFile(userId).then(res=>{
|
|
|
if(res.msg === '成功'){
|
|
|
- console.log(res)
|
|
|
state.fileList=res.result;
|
|
|
- console.log(state.fileList)
|
|
|
}
|
|
|
else{
|
|
|
console.log("getFileList Error!");
|
|
|
@@ -144,7 +133,12 @@ export default {
|
|
|
}
|
|
|
|
|
|
const handleFileShare = ()=>{
|
|
|
- shareFile(toShareFileId).then(res=>{
|
|
|
+ const payload ={
|
|
|
+ userId: localStorage.getItem("ms_userId"),
|
|
|
+ fileId: toShareFileId
|
|
|
+ }
|
|
|
+ shareFile(payload).then(res=>{
|
|
|
+ console.log(res);
|
|
|
if(res.msg === '成功'){
|
|
|
ElMessage.success("分享成功!")
|
|
|
getFileList(userId);
|
|
|
@@ -162,7 +156,6 @@ export default {
|
|
|
|
|
|
//删除对应文件
|
|
|
const handleFileDelete = () => {
|
|
|
- console.log("fileId:"+toDeleteFileId)
|
|
|
deleteFile(toDeleteFileId).then(res=>{
|
|
|
if(res.msg === '成功'){
|
|
|
ElMessage.success("删除成功!")
|