Merge remote-tracking branch 'origin/v1.7' into v1.7

This commit is contained in:
wenyann 2021-01-29 15:53:35 +08:00
commit 2145fc3f65
2 changed files with 21 additions and 3 deletions

View File

@ -67,6 +67,19 @@
}); });
} }
} }
if (item && item.files) {
item.files.forEach(fileItem => {
if (fileItem.file) {
if (!fileItem.id) {
let fileId = getUUID().substring(0, 12);
fileItem.name = fileItem.file.name;
fileItem.id = fileId;
}
obj.bodyUploadIds.push(fileItem.id);
bodyUploadFiles.push(fileItem.file);
}
});
}
}, },
recursiveFile(arr, bodyUploadFiles, obj) { recursiveFile(arr, bodyUploadFiles, obj) {
arr.forEach(item => { arr.forEach(item => {
@ -86,6 +99,11 @@
this.recursiveFile(item.hashTree, bodyUploadFiles, obj); this.recursiveFile(item.hashTree, bodyUploadFiles, obj);
} }
}) })
if (request.variables) {
request.variables.forEach(item => {
this.setFiles(item, bodyUploadFiles, obj);
})
}
return bodyUploadFiles; return bodyUploadFiles;
}, },
run() { run() {

View File

@ -1,5 +1,5 @@
<template> <template>
<div> <div v-loading="isReloadData">
<el-row> <el-row>
<el-col :span="21" style="padding-bottom: 20px"> <el-col :span="21" style="padding-bottom: 20px">
<div style="border:1px #DCDFE6 solid; height: 100%;border-radius: 4px ;width: 100% ;margin: 20px"> <div style="border:1px #DCDFE6 solid; height: 100%;border-radius: 4px ;width: 100% ;margin: 20px">
@ -28,7 +28,7 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item :label="$t('api_test.request.sql.dataSource')" prop="dataSourceId" style="margin-left: 10px"> <el-form-item :label="$t('api_test.request.sql.dataSource')" prop="dataSourceId" style="margin-left: 10px">
<el-select v-model="request.dataSourceId" size="small"> <el-select v-model="request.dataSourceId" size="small" @change="reload">
<el-option v-for="(item, index) in databaseConfigsOptions" :key="index" :value="item.id" :label="item.name"/> <el-option v-for="(item, index) in databaseConfigsOptions" :key="index" :value="item.id" :label="item.name"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -143,7 +143,7 @@
activeName: "variables", activeName: "variables",
rules: { rules: {
environmentId: [{required: true, message: this.$t('api_test.definition.request.run_env'), trigger: 'change'}], environmentId: [{required: true, message: this.$t('api_test.definition.request.run_env'), trigger: 'change'}],
dataSourceId: [{required: true, message: this.$t('api_test.request.sql.dataSource'), trigger: 'change'}], dataSourceId: [{required: true, message: this.$t('api_test.request.sql.dataSource'), trigger: 'blur'}],
}, },
} }
}, },