fix(性能测试): 性能测试查找附件不再限制文件格式
--bug=1029674 --user=宋天阳 【性能测试】github#26460,【性能测试】性能测试-资源文件处,上传.dat文件,提示上传成功,但是下面并没有显示出对应文件 https://www.tapd.cn/55049933/s/1411099
This commit is contained in:
parent
52deefe6fc
commit
e4d6984e6d
|
@ -369,11 +369,15 @@
|
||||||
<select id="getProjectFiles" resultType="io.metersphere.base.domain.FileMetadata">
|
<select id="getProjectFiles" resultType="io.metersphere.base.domain.FileMetadata">
|
||||||
SELECT file_metadata.*
|
SELECT file_metadata.*
|
||||||
FROM file_metadata
|
FROM file_metadata
|
||||||
WHERE file_metadata.type IN
|
WHERE
|
||||||
|
project_id = #{projectId,jdbcType=VARCHAR}
|
||||||
|
<if test="loadTypes != null and loadTypes.size() > 0">
|
||||||
|
AND file_metadata.type IN
|
||||||
<foreach collection="loadTypes" item="id" separator="," open="(" close=")">
|
<foreach collection="loadTypes" item="id" separator="," open="(" close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
AND project_id = #{projectId,jdbcType=VARCHAR}
|
</if>
|
||||||
|
|
||||||
<if test="request.name != null">
|
<if test="request.name != null">
|
||||||
AND file_metadata.name LIKE CONCAT('%', #{request.name}, '%')
|
AND file_metadata.name LIKE CONCAT('%', #{request.name}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
|
@ -752,18 +752,18 @@ public class PerformanceTestService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<FileMetadata> getProjectFiles(String projectId, String loadType, QueryProjectFileRequest request) {
|
public List<FileMetadata> getProjectFiles(String projectId, String loadType, QueryProjectFileRequest request) {
|
||||||
|
if (StringUtils.equalsIgnoreCase(loadType, "resource")) {
|
||||||
|
return extLoadTestMapper.getProjectFiles(projectId, null, request);
|
||||||
|
} else {
|
||||||
List<String> loadTypes = new ArrayList<>();
|
List<String> loadTypes = new ArrayList<>();
|
||||||
loadTypes.add(StringUtils.upperCase(loadType));
|
loadTypes.add(StringUtils.upperCase(loadType));
|
||||||
if (StringUtils.equalsIgnoreCase(loadType, "resource")) {
|
|
||||||
List<String> fileTypes = Arrays.stream(FileType.values()).filter(fileType -> !fileType.equals(FileType.JMX)).map(FileType::name).collect(Collectors.toList());
|
|
||||||
loadTypes.addAll(fileTypes);
|
|
||||||
}
|
|
||||||
if (StringUtils.equalsIgnoreCase(loadType, "all")) {
|
if (StringUtils.equalsIgnoreCase(loadType, "all")) {
|
||||||
List<String> fileTypes = Arrays.stream(FileType.values()).map(FileType::name).collect(Collectors.toList());
|
List<String> fileTypes = Arrays.stream(FileType.values()).map(FileType::name).collect(Collectors.toList());
|
||||||
loadTypes.addAll(fileTypes);
|
loadTypes.addAll(fileTypes);
|
||||||
}
|
}
|
||||||
return extLoadTestMapper.getProjectFiles(projectId, loadTypes, request);
|
return extLoadTestMapper.getProjectFiles(projectId, loadTypes, request);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public List<LoadTestExportJmx> exportJmx(List<String> fileIds) {
|
public List<LoadTestExportJmx> exportJmx(List<String> fileIds) {
|
||||||
if (CollectionUtils.isEmpty(fileIds)) {
|
if (CollectionUtils.isEmpty(fileIds)) {
|
||||||
|
|
|
@ -179,21 +179,16 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSelectionChange(selection, row) {
|
handleSelectionChange(selection, clickRow) {
|
||||||
if (this.selectIds.has(row.id)) {
|
this.selectIds = new Set;
|
||||||
this.selectIds.delete(row.id);
|
this.selectFiles = [];
|
||||||
for (let i = 0; i < this.selectFiles.length - 1; i++) {
|
if (selection.length != 0) {
|
||||||
if (this.selectFiles[i].id === row.id) {
|
selection.forEach(row => {
|
||||||
this.selectFiles.splice(i, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!this.selectIds.has(row.id)) {
|
|
||||||
this.selectIds.add(row.id);
|
this.selectIds.add(row.id);
|
||||||
}
|
|
||||||
if (this.selectFiles.filter(f => f.id === row.id).length === 0) {
|
if (this.selectFiles.filter(f => f.id === row.id).length === 0) {
|
||||||
this.selectFiles.push(row);
|
this.selectFiles.push(row);
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getProjectFiles() {
|
getProjectFiles() {
|
||||||
|
|
Loading…
Reference in New Issue