mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 12:09:13 +08:00
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 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=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
AND project_id = #{projectId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
|
||||
<if test="request.name != null">
|
||||
AND file_metadata.name LIKE CONCAT('%', #{request.name}, '%')
|
||||
</if>
|
||||
|
@ -752,18 +752,18 @@ public class PerformanceTestService {
|
||||
}
|
||||
|
||||
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<>();
|
||||
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")) {
|
||||
List<String> fileTypes = Arrays.stream(FileType.values()).map(FileType::name).collect(Collectors.toList());
|
||||
loadTypes.addAll(fileTypes);
|
||||
}
|
||||
return extLoadTestMapper.getProjectFiles(projectId, loadTypes, request);
|
||||
}
|
||||
}
|
||||
|
||||
public List<LoadTestExportJmx> exportJmx(List<String> fileIds) {
|
||||
if (CollectionUtils.isEmpty(fileIds)) {
|
||||
|
@ -179,21 +179,16 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
handleSelectionChange(selection, row) {
|
||||
if (this.selectIds.has(row.id)) {
|
||||
this.selectIds.delete(row.id);
|
||||
for (let i = 0; i < this.selectFiles.length - 1; i++) {
|
||||
if (this.selectFiles[i].id === row.id) {
|
||||
this.selectFiles.splice(i, 1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!this.selectIds.has(row.id)) {
|
||||
handleSelectionChange(selection, clickRow) {
|
||||
this.selectIds = new Set;
|
||||
this.selectFiles = [];
|
||||
if (selection.length != 0) {
|
||||
selection.forEach(row => {
|
||||
this.selectIds.add(row.id);
|
||||
}
|
||||
if (this.selectFiles.filter(f => f.id === row.id).length === 0) {
|
||||
this.selectFiles.push(row);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getProjectFiles() {
|
||||
|
Loading…
Reference in New Issue
Block a user