|
@@ -74,7 +74,8 @@
|
|
|
>
|
|
|
<template #default="scope">
|
|
|
<div class="operations">
|
|
|
- <el-button type="primary" class="bt1" size="mini" @click="checkFile(scope.row.url)" style="background: #477edd">详情查看</el-button>
|
|
|
+ <el-button type="primary" class="bt1" size="mini" @click="checkFile(scope.row.url)" style="background: #477edd">详情查看</el-button>
|
|
|
+ <el-button type="primary" class="bt1" size="mini" @click="DelFile(scope.$index)" style="background: #477edd">删除</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -152,6 +153,28 @@
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
+ DelFile(index){
|
|
|
+ this.$confirm("你确定要删除该文件吗?",'删除文件确认').then(res=>{
|
|
|
+ this.tableData.splice(index,1)
|
|
|
+ this.ajax.post(this.$store.state.api+"/AddProjectFile",{
|
|
|
+ uid:this.$store.state.userInfo.userid,
|
|
|
+ cid:JSON.parse(localStorage.getItem('pid')),
|
|
|
+ file:JSON.stringify(this.tableData)
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.data==1){
|
|
|
+ this.$message.success("删除成功")
|
|
|
+ }else{
|
|
|
+ this.$message.error("删除失败")
|
|
|
+ }
|
|
|
+ this.getData();
|
|
|
+ }).catch(err=>{
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ }).catch(err=>{
|
|
|
+ console.log("取消删除文件")
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
ProgressFormat(value){ //进度条
|
|
|
return value ==100?'100%':`${value}%`
|
|
|
},
|