fix(项目设置): 修复环境通用配置csv上传文件的相关问题
--bug=1027648 --user=王孝刚 【项目设置】github#25453,【项目设置】-项目环境:1、创建环境通用配置类型选择CSV,删除已上传文件重新上传提示“一次只能上传一个文件”;2、没有上传文件点击下载没有提示信息。 https://www.tapd.cn/55049933/s/1391974
This commit is contained in:
parent
a08ae64fa9
commit
80f649c15c
|
@ -846,6 +846,9 @@ public class MockConfigService {
|
||||||
if (project != null) {
|
if (project != null) {
|
||||||
RequestMockParams requestMockParams = MockApiUtils.genRequestMockParamsFromHttpRequest(request, true);
|
RequestMockParams requestMockParams = MockApiUtils.genRequestMockParamsFromHttpRequest(request, true);
|
||||||
String urlSuffix = this.getUrlSuffix(project.getSystemId(), request);
|
String urlSuffix = this.getUrlSuffix(project.getSystemId(), request);
|
||||||
|
LogUtil.info("Mock urlSuffix:{}", urlSuffix);
|
||||||
|
LogUtil.info("Mock requestHeaderMap:{}", requestHeaderMap);
|
||||||
|
LogUtil.info("Mock requestMockParams:{}", requestMockParams);
|
||||||
List<ApiDefinitionWithBLOBs> qualifiedApiList = apiDefinitionService.preparedUrl(project.getId(), method, urlSuffix, requestHeaderMap.get(MockApiHeaders.MOCK_API_RESOURCE_ID));
|
List<ApiDefinitionWithBLOBs> qualifiedApiList = apiDefinitionService.preparedUrl(project.getId(), method, urlSuffix, requestHeaderMap.get(MockApiHeaders.MOCK_API_RESOURCE_ID));
|
||||||
for (ApiDefinitionWithBLOBs api : qualifiedApiList) {
|
for (ApiDefinitionWithBLOBs api : qualifiedApiList) {
|
||||||
if (StringUtils.isEmpty(returnStr)) {
|
if (StringUtils.isEmpty(returnStr)) {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
:delete-fuc="openDelEnv" @itemSelected="environmentSelected" ref="environmentItems"/>
|
:delete-fuc="openDelEnv" @itemSelected="environmentSelected" ref="environmentItems"/>
|
||||||
<environment-edit :if-create="ifCreate" :environment="currentEnvironment"
|
<environment-edit :if-create="ifCreate" :environment="currentEnvironment"
|
||||||
ref="environmentEdit" :is-read-only="isReadOnly"
|
ref="environmentEdit" :is-read-only="isReadOnly"
|
||||||
@confirm="save" :is-project="true"
|
@confirm="save" :is-project="true" :key="currentEnvironment.id"
|
||||||
@close="close" @refreshAfterSave="refresh">
|
@close="close" @refreshAfterSave="refresh">
|
||||||
</environment-edit>
|
</environment-edit>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
|
|
@ -58,7 +58,8 @@
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-button size="small" style="margin: 3px 5px" @click="download">下载</el-button>
|
<el-button size="small" style="margin: 3px 5px" @click="download" :disabled="this.parameter.files.length === 0">
|
||||||
|
{{this.$t('project.file_download')}}</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<ms-file-batch-move ref="module" @setModuleId="setModuleId"/>
|
<ms-file-batch-move ref="module" @setModuleId="setModuleId"/>
|
||||||
|
@ -194,12 +195,14 @@ export default {
|
||||||
callback: (action) => {
|
callback: (action) => {
|
||||||
if (action === 'confirm') {
|
if (action === 'confirm') {
|
||||||
this.$refs.upload.handleRemove(file);
|
this.$refs.upload.handleRemove(file);
|
||||||
|
this.$refs.uploadLocal.handleRemove(file);
|
||||||
for (let i = 0; i < this.parameter.files.length; i++) {
|
for (let i = 0; i < this.parameter.files.length; i++) {
|
||||||
let paramFileName = this.parameter.files[i].name ?
|
let paramFileName = this.parameter.files[i].name ?
|
||||||
this.parameter.files[i].name : this.parameter.files[i].file.name;
|
this.parameter.files[i].name : this.parameter.files[i].file.name;
|
||||||
if (fileName === paramFileName) {
|
if (fileName === paramFileName) {
|
||||||
this.parameter.files.splice(i, 1);
|
this.parameter.files.splice(i, 1);
|
||||||
this.$refs.upload.handleRemove(file);
|
this.$refs.upload.handleRemove(file);
|
||||||
|
this.$refs.uploadLocal.handleRemove(file);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue