fix: 全量删除UI报告会删除接口报告

This commit is contained in:
chenjianxing 2022-04-13 15:06:27 +08:00 committed by 刘瑞斌
parent e12ec631a1
commit f4aaccee4a
3 changed files with 12 additions and 2 deletions

View File

@ -169,7 +169,8 @@ public class ApiScenarioReportStructureService {
StepTreeDTO children = new StepTreeDTO(element.getString("name"), resourceId, element.getString("type"), resourceId, element.getIntValue("index")); StepTreeDTO children = new StepTreeDTO(element.getString("name"), resourceId, element.getString("type"), resourceId, element.getIntValue("index"));
if (StringUtils.isNotBlank(children.getType()) && children.getType().equals("MsUiCommand")) { if (StringUtils.isNotBlank(children.getType()) && children.getType().equals("MsUiCommand")) {
children.setResourceId(resourceId); children.setResourceId(resourceId);
children.setLabel(element.getString("command")); children.setLabel(element.getString("name"));
children.setCmdType(element.getString("commandType"));
} else if (StringUtils.isNotEmpty(dto.getAllIndex())) { } else if (StringUtils.isNotEmpty(dto.getAllIndex())) {
children.setAllIndex(dto.getAllIndex() + "_" + (children.getIndex() == 0 ? (i + 1) : children.getIndex())); children.setAllIndex(dto.getAllIndex() + "_" + (children.getIndex() == 0 ? (i + 1) : children.getIndex()));
children.setResourceId(resourceId + "_" + children.getAllIndex()); children.setResourceId(resourceId + "_" + children.getAllIndex());
@ -177,7 +178,6 @@ public class ApiScenarioReportStructureService {
children.setAllIndex("" + (children.getIndex() == 0 ? (i + 1) : children.getIndex())); children.setAllIndex("" + (children.getIndex() == 0 ? (i + 1) : children.getIndex()));
children.setResourceId(resourceId + "_" + children.getAllIndex()); children.setResourceId(resourceId + "_" + children.getAllIndex());
} }
children.setCmdType(element.getString("commandType"));
dto.getChildren().add(children); dto.getChildren().add(children);
if (element.containsKey("hashTree") && !requests.contains(children.getType())) { if (element.containsKey("hashTree") && !requests.contains(children.getType())) {
JSONArray elementJSONArray = element.getJSONArray("hashTree"); JSONArray elementJSONArray = element.getJSONArray("hashTree");

View File

@ -261,6 +261,15 @@
<if test="request.projectId != null"> <if test="request.projectId != null">
AND r.project_id = #{request.projectId} AND r.project_id = #{request.projectId}
</if> </if>
<if test="request.isUi">
AND r.report_type like 'UI%'
</if>
<if test="!request.isUi">
AND r.report_type not like 'UI%'
</if>
<if test="request.filters != null and request.filters.size() > 0"> <if test="request.filters != null and request.filters.size() > 0">
<foreach collection="request.filters.entrySet()" index="key" item="values"> <foreach collection="request.filters.entrySet()" index="key" item="values">
<if test="values != null and values.size() > 0"> <if test="values != null and values.size() > 0">

View File

@ -379,6 +379,7 @@ export default {
sendParam.selectAllDate = this.isSelectAllDate; sendParam.selectAllDate = this.isSelectAllDate;
sendParam.unSelectIds = this.unSelection; sendParam.unSelectIds = this.unSelection;
sendParam = Object.assign(sendParam, this.condition); sendParam = Object.assign(sendParam, this.condition);
sendParam.isUi = this.isUI;
this.$post('/api/scenario/report/batch/delete', sendParam, () => { this.$post('/api/scenario/report/batch/delete', sendParam, () => {
this.selectRows.clear(); this.selectRows.clear();
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));