上传文件中不可保存

This commit is contained in:
18571350067 2022-02-26 11:32:35 +08:00
parent e0519a475b
commit 9007f9204f
1 changed files with 6 additions and 1 deletions

View File

@ -2,7 +2,7 @@
<a-card :bordered="false" :title="pageName"> <a-card :bordered="false" :title="pageName">
<template slot="extra"> <template slot="extra">
<a-button @click="goback">返回</a-button> <a-button @click="goback">返回</a-button>
<a-button type="primary" @click="save">保存</a-button> <a-button type="primary" @click="save" :disabled="save">保存</a-button>
</template> </template>
<a-tabs type="card" :default-active-key="parentTabKey" @change="parentcallback"> <a-tabs type="card" :default-active-key="parentTabKey" @change="parentcallback">
<a-tab-pane key="1" tab="文件上传"> <a-tab-pane key="1" tab="文件上传">
@ -157,6 +157,7 @@ import { dictionaryDropDown } from '@/api/sys/dictionaryItem';
export default { export default {
data() { data() {
return { return {
save:false,
pageName: '', pageName: '',
// treeData: [], // treeData: [],
ifResources: this.$route.query.ifResources, ifResources: this.$route.query.ifResources,
@ -286,6 +287,9 @@ export default {
this.uploadLoading = true; this.uploadLoading = true;
this.uploadButtonText = '上传中...'; this.uploadButtonText = '上传中...';
//
this.save= true;
// //
const data = new FormData(); const data = new FormData();
data.append('file', file); data.append('file', file);
@ -299,6 +303,7 @@ export default {
axios axios
.post(ossUpload(), data, { headers: header }) .post(ossUpload(), data, { headers: header })
.then(res => { .then(res => {
this.save = false;
this.uploadLoading = false; this.uploadLoading = false;
this.uploadButtonText = '选择文件'; this.uploadButtonText = '选择文件';
if (res.data.code === 200) { if (res.data.code === 200) {