Commit 177fc2fd authored by zhanglw's avatar zhanglw

文件删除

parent 1c4bd121
......@@ -3194,6 +3194,14 @@ var HttpReq = function(){
responseType: 'blob'
})
},
//开采管理-删除文件
deleteExcelOrFbx: function(data){
return request({
url: '/api/miningManagement/deleteExcelOrFbx',
method: 'delete',
data: data,
})
},
},
......
......@@ -43,6 +43,7 @@
<template slot-scope="scope">
<el-button v-if="query.type==='excel'" size="mini" type="text" icon="el-icon-view" @click="viewTable(scope.row)">在线预览</el-button>
<el-button size="mini" type="text" icon="el-icon-download" @click="downloadFile(scope.row)">下载</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="toDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
......@@ -125,6 +126,24 @@ export default {
})
},
methods: {
toDelete(item) {
this.$confirm(`确认删除文件:${item.fileName}?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
HttpReq.truckDispatching.deleteExcelOrFbx({fileName:item.fileName, type:this.query.type}).then((res) => {
this.$notify({
title: res.msg,
type: res.code === 200 ? 'success' : 'error',
duration: 2500
})
if (res.code === 200) {
this.loadData()
}
})
}).catch(() => {})
},
download(text, name, suffix) {
var link = document.createElement('a');
link.style.display = 'none';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment