|
@@ -69,7 +69,7 @@
|
|
</div>
|
|
</div>
|
|
<!-- 上传器 -->
|
|
<!-- 上传器 -->
|
|
<el-dialog title="文件重新上传" :visible.sync="dialogVisible2" destroy-on-close width="15%" top="6vh" height="90%">
|
|
<el-dialog title="文件重新上传" :visible.sync="dialogVisible2" destroy-on-close width="15%" top="6vh" height="90%">
|
|
- <el-upload class="upload-demo" ref="upload2" action="" :http-request="beforeUpload2" :loading="uploadloading"
|
|
|
|
|
|
+ <el-upload class="upload-demo" ref="upload2" action="" :http-request="del_fileName" :loading="uploadloading"
|
|
:auto-upload="true">
|
|
:auto-upload="true">
|
|
<el-button slot="trigger" size="small" type="primary" :loading="loading" icon="el-icon-plus">选取文件
|
|
<el-button slot="trigger" size="small" type="primary" :loading="loading" icon="el-icon-plus">选取文件
|
|
</el-button>
|
|
</el-button>
|
|
@@ -283,7 +283,7 @@ export default {
|
|
<div class="contextmenu__item" id="editLabel">重命名</div>
|
|
<div class="contextmenu__item" id="editLabel">重命名</div>
|
|
<div class="contextmenu__item" id="delLabel">删除</div>
|
|
<div class="contextmenu__item" id="delLabel">删除</div>
|
|
<div class="contextmenu__item" id="beforeUpload">上传文件</div>
|
|
<div class="contextmenu__item" id="beforeUpload">上传文件</div>
|
|
- <div class="contextmenu__item" id="beforeUpload2">修改上传文件</div>`;
|
|
|
|
|
|
+ <div class="contextmenu__item" id="del_fileName">修改上传文件</div>`;
|
|
return menuHtml;
|
|
return menuHtml;
|
|
},
|
|
},
|
|
handleMenuClick(target, item) {
|
|
handleMenuClick(target, item) {
|
|
@@ -303,7 +303,7 @@ export default {
|
|
that.itemNode = item;
|
|
that.itemNode = item;
|
|
console.log('fileitemNode', that.itemNode)
|
|
console.log('fileitemNode', that.itemNode)
|
|
that.dialogVisible1 = true;
|
|
that.dialogVisible1 = true;
|
|
- } else if (target.id == "beforeUpload2") {
|
|
|
|
|
|
+ } else if (target.id == "del_fileName") {
|
|
// 修改上传的文件
|
|
// 修改上传的文件
|
|
that.itemNode = item;
|
|
that.itemNode = item;
|
|
that.dialogVisible2 = true;
|
|
that.dialogVisible2 = true;
|
|
@@ -1011,7 +1011,7 @@ export default {
|
|
foorData.append('file', file.file);
|
|
foorData.append('file', file.file);
|
|
foorData.append('id', that.itemNode._cfg.id);
|
|
foorData.append('id', that.itemNode._cfg.id);
|
|
foorData.append('name', that.itemNode._cfg.model.label);
|
|
foorData.append('name', that.itemNode._cfg.model.label);
|
|
- that.del_fileName(that.itemNode._cfg.id);
|
|
|
|
|
|
+ //that.del_fileName(that.itemNode._cfg.id);
|
|
that.axios.post('pass/ems/v1/uploadfiles/file2', foorData, {
|
|
that.axios.post('pass/ems/v1/uploadfiles/file2', foorData, {
|
|
headers: {
|
|
headers: {
|
|
'Content-Type': 'multipart/form-data'
|
|
'Content-Type': 'multipart/form-data'
|
|
@@ -1038,16 +1038,18 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 删除上传的文件
|
|
// 删除上传的文件
|
|
- del_fileName(id) {
|
|
|
|
|
|
+ del_fileName(file) {
|
|
let that = this;
|
|
let that = this;
|
|
|
|
+ let id = that.itemNode._cfg.id
|
|
if (id) {
|
|
if (id) {
|
|
that.axios.delete('pass/ems/v1/uploadfiles/' + id)
|
|
that.axios.delete('pass/ems/v1/uploadfiles/' + id)
|
|
.then(function (res) {
|
|
.then(function (res) {
|
|
if (res.code === '0') {
|
|
if (res.code === '0') {
|
|
that.$message({
|
|
that.$message({
|
|
- message: '删除成功',
|
|
|
|
|
|
+ message: '上传成功',
|
|
type: 'success'
|
|
type: 'success'
|
|
});
|
|
});
|
|
|
|
+ that.beforeUpload2(file);
|
|
} else {
|
|
} else {
|
|
if (res.code === '51') {
|
|
if (res.code === '51') {
|
|
}
|
|
}
|