修复版本管理编辑保存报错问题
This commit is contained in:
parent
ac11e23df5
commit
b8a08eea4f
|
|
@ -58,6 +58,7 @@
|
||||||
<script>
|
<script>
|
||||||
import uploadFile from "./upload-file";
|
import uploadFile from "./upload-file";
|
||||||
import { $uploadVersionFile, $version } from "@/api/version";
|
import { $uploadVersionFile, $version } from "@/api/version";
|
||||||
|
import { cancelToken, clearAllToken } from '@/utils/globalCancelToken.js'
|
||||||
|
|
||||||
const form = {
|
const form = {
|
||||||
source: "PC",
|
source: "PC",
|
||||||
|
|
@ -105,10 +106,12 @@ export default {
|
||||||
this.form = { ...form };
|
this.form = { ...form };
|
||||||
this.loadingText=''
|
this.loadingText=''
|
||||||
this.loading=false
|
this.loading=false
|
||||||
this.$refs.uploadFile.clearFiles();
|
|
||||||
},
|
},
|
||||||
diaClose() {
|
diaClose() {
|
||||||
|
this.$refs.uploadFile.clearFiles();
|
||||||
this.restForm();
|
this.restForm();
|
||||||
|
cancelToken()
|
||||||
|
|
||||||
},
|
},
|
||||||
uploadSuccess(res) {
|
uploadSuccess(res) {
|
||||||
this.form.img = res[0];
|
this.form.img = res[0];
|
||||||
|
|
@ -126,7 +129,8 @@ export default {
|
||||||
const { version } = this.form;
|
const { version } = this.form;
|
||||||
let fileRes=''
|
let fileRes=''
|
||||||
const file = this.$refs.uploadFile.getFileList();
|
const file = this.$refs.uploadFile.getFileList();
|
||||||
if(!this.hasUpload&&file){
|
console.log(file);
|
||||||
|
if(!this.hasUpload&&file&&file.status!='finished'){
|
||||||
this.loadingText='文件上传中,请耐心等待...'
|
this.loadingText='文件上传中,请耐心等待...'
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
fileRes = await $uploadVersionFile(file, { name:version });
|
fileRes = await $uploadVersionFile(file, { name:version });
|
||||||
|
|
@ -178,6 +182,7 @@ export default {
|
||||||
this.$refs.uploadFile.fileList = [{
|
this.$refs.uploadFile.fileList = [{
|
||||||
url: obj.url,
|
url: obj.url,
|
||||||
name: obj.url,
|
name: obj.url,
|
||||||
|
status: 'finished',
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue