fix: form-data请求体切换成文件上传无反应 (#1872)

Authored-by: chenjianxing <jianxing.chen@fit2cloud.com>
This commit is contained in:
metersphere-bot 2021-04-02 16:41:59 +08:00 committed by GitHub
parent 89cf36f9fb
commit 6e1545b619
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -39,7 +39,7 @@
</el-select> </el-select>
</el-col> </el-col>
<el-col class="item" v-if="item.type !== 'file'"> <el-col class="item" v-if="isActive && item.type !== 'file'">
<el-autocomplete <el-autocomplete
:disabled="isReadOnly" :disabled="isReadOnly"
size="small" size="small"
@ -64,7 +64,7 @@
</el-col> </el-col>
<el-col v-if="item.type === 'file'" class="item"> <el-col v-if="isActive && item.type === 'file'" class="item">
<ms-api-body-file-upload :parameter="item"/> <ms-api-body-file-upload :parameter="item"/>
</el-col> </el-col>
@ -126,6 +126,7 @@
currentItem: null, currentItem: null,
requireds: REQUIRED, requireds: REQUIRED,
isSelectAll: true, isSelectAll: true,
isActive: true
} }
}, },
watch: { watch: {
@ -231,6 +232,7 @@
} else { } else {
item.contentType = 'text/plain'; item.contentType = 'text/plain';
} }
this.reload();
}, },
selectAll() { selectAll() {
this.parameters.forEach(item => { this.parameters.forEach(item => {
@ -242,6 +244,12 @@
item.enable = false; item.enable = false;
}); });
}, },
reload() {
this.isActive = false;
this.$nextTick(() => {
this.isActive = true;
});
}
}, },
created() { created() {
if (this.parameters.length === 0 || this.parameters[this.parameters.length - 1].name) { if (this.parameters.length === 0 || this.parameters[this.parameters.length - 1].name) {