refactor(测试跟踪): 回收站左侧模块树优化
--task=1008552 --bug=1015939,1015927,1015930 --user=宋昌昌 https://www.tapd.cn/55049933/s/1226931 https://www.tapd.cn/55049933/s/1226965 https://www.tapd.cn/55049933/s/1226980
This commit is contained in:
parent
ee1aff37a9
commit
ee740ad063
|
@ -164,4 +164,6 @@ public interface ExtTestCaseMapper {
|
||||||
int bathUpdateByCondition(@Param("request") QueryTestCaseRequest condition, @Param("record") TestCaseWithBLOBs testCaseWithBLOBs);
|
int bathUpdateByCondition(@Param("request") QueryTestCaseRequest condition, @Param("record") TestCaseWithBLOBs testCaseWithBLOBs);
|
||||||
|
|
||||||
List<TestCaseNodeDTO> getWorkspaceCountNodes(@Param("request") QueryTestCaseRequest request);
|
List<TestCaseNodeDTO> getWorkspaceCountNodes(@Param("request") QueryTestCaseRequest request);
|
||||||
|
|
||||||
|
void updateNoModuleTrashNodeToDefault(@Param("projectId") String projectId, @Param("defaultNodeId") String defaultNodeId, @Param("defaultNodePath") String defaultNodePath);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1351,4 +1351,16 @@
|
||||||
and p.workspace_id = #{request.workspaceId}
|
and p.workspace_id = #{request.workspaceId}
|
||||||
group by tcn.id;
|
group by tcn.id;
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="updateNoModuleTrashNodeToDefault">
|
||||||
|
update test_case
|
||||||
|
set node_id = #{defaultNodeId},
|
||||||
|
node_path = #{defaultNodePath}
|
||||||
|
where project_id = #{projectId}
|
||||||
|
and status = 'Trash'
|
||||||
|
and latest = true
|
||||||
|
and node_id not in (
|
||||||
|
select id from test_case_node where project_id = #{projectId}
|
||||||
|
)
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -280,6 +280,9 @@ public class TestCaseNodeService extends NodeTreeService<TestCaseNodeDTO> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TestCaseNodeDTO> getTrashCaseNode(String projectId, QueryTestCaseRequest request) {
|
public List<TestCaseNodeDTO> getTrashCaseNode(String projectId, QueryTestCaseRequest request) {
|
||||||
|
// 初始化回收站中模块被删除的用例, 挂在默认未规划模块, 获取回收站模块节点数据
|
||||||
|
TestCaseNode defaultNode = this.getDefaultNode(projectId);
|
||||||
|
extTestCaseMapper.updateNoModuleTrashNodeToDefault(projectId, defaultNode.getId(), defaultNode.getName());
|
||||||
request.setProjectId(projectId);
|
request.setProjectId(projectId);
|
||||||
request.setNodeIds(null);
|
request.setNodeIds(null);
|
||||||
List<TestCaseNodeDTO> countModules = extTestCaseMapper.getCountNodes(request);
|
List<TestCaseNodeDTO> countModules = extTestCaseMapper.getCountNodes(request);
|
||||||
|
|
|
@ -125,6 +125,9 @@ export default {
|
||||||
condition['customs'] = [];
|
condition['customs'] = [];
|
||||||
}
|
}
|
||||||
let value = component.value;
|
let value = component.value;
|
||||||
|
if (component.label === '用例状态' && value.length === 1 && value.indexOf('Trash') > -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (component.type === "multipleMember" || component.type === "checkbox" || component.type === "multipleSelect") {
|
if (component.type === "multipleMember" || component.type === "checkbox" || component.type === "multipleSelect") {
|
||||||
try {
|
try {
|
||||||
value = JSON.stringify(component.value);
|
value = JSON.stringify(component.value);
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
<ms-main-container>
|
<ms-main-container>
|
||||||
<el-tabs v-model="activeName" @tab-click="addTab" @tab-remove="closeConfirm">
|
<el-tabs v-model="activeName" @tab-click="addTab" @tab-remove="closeConfirm">
|
||||||
<el-tab-pane name="trash" v-if="trashEnable" :label="$t('commons.trash')">
|
<el-tab-pane name="trash" v-if="trashEnable" :label="$t('commons.trash')" :closable="true">
|
||||||
<ms-tab-button
|
<ms-tab-button
|
||||||
:isShowChangeButton="false">
|
:isShowChangeButton="false">
|
||||||
<template v-slot:version>
|
<template v-slot:version>
|
||||||
|
@ -318,11 +318,16 @@ export default {
|
||||||
this.$refs.minder.refresh();
|
this.$refs.minder.refresh();
|
||||||
}
|
}
|
||||||
if (oldVal === 'trash' && newVal === 'default') {
|
if (oldVal === 'trash' && newVal === 'default') {
|
||||||
|
this.condition.filters.status = [];
|
||||||
// 在回收站恢复后,切到列表页面刷新
|
// 在回收站恢复后,切到列表页面刷新
|
||||||
if (!this.hasRefreshDefault) {
|
if (!this.hasRefreshDefault) {
|
||||||
this.refreshAll();
|
this.refreshAll();
|
||||||
this.hasRefreshDefault = true;
|
this.hasRefreshDefault = true;
|
||||||
|
} else {
|
||||||
|
this.refresh();
|
||||||
}
|
}
|
||||||
|
} else if (newVal === 'default') {
|
||||||
|
this.refresh();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
activeDom(newVal, oldVal) {
|
activeDom(newVal, oldVal) {
|
||||||
|
@ -551,6 +556,14 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
closeConfirm(targetName) {
|
closeConfirm(targetName) {
|
||||||
|
this.activeName = 'default';
|
||||||
|
if (targetName === 'trash') {
|
||||||
|
this.trashEnable = false;
|
||||||
|
} else {
|
||||||
|
this.closeTabWithSave(targetName);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
closeTabWithSave(targetName) {
|
||||||
let t = this.tabs.filter(tab => tab.name === targetName);
|
let t = this.tabs.filter(tab => tab.name === targetName);
|
||||||
let message = "";
|
let message = "";
|
||||||
if (t && this.$store.state.testCaseMap.has(t[0].testCaseInfo.id) && this.$store.state.testCaseMap.get(t[0].testCaseInfo.id) > 0) {
|
if (t && this.$store.state.testCaseMap.has(t[0].testCaseInfo.id) && this.$store.state.testCaseMap.get(t[0].testCaseInfo.id) > 0) {
|
||||||
|
|
|
@ -651,6 +651,26 @@ export default {
|
||||||
// todo 处理高级搜索自定义字段部分
|
// todo 处理高级搜索自定义字段部分
|
||||||
this.condition.components = this.condition.components.filter(item => item.custom !== true);
|
this.condition.components = this.condition.components.filter(item => item.custom !== true);
|
||||||
let comp = getAdvSearchCustomField(this.condition, this.testCaseTemplate.customFields);
|
let comp = getAdvSearchCustomField(this.condition, this.testCaseTemplate.customFields);
|
||||||
|
// 系统字段国际化处理
|
||||||
|
comp.filter(element => {
|
||||||
|
if (element.label === '责任人') {
|
||||||
|
element.label = this.$t('custom_field.case_maintainer')
|
||||||
|
}
|
||||||
|
if (element.label === '用例等级') {
|
||||||
|
element.label = this.$t('custom_field.case_priority')
|
||||||
|
}
|
||||||
|
if (element.label === '用例状态') {
|
||||||
|
element.label = this.$t('custom_field.case_status')
|
||||||
|
// 回收站TAB页处理高级搜索用例状态字段
|
||||||
|
if (this.trashEnable) {
|
||||||
|
element.options = [{text: this.$t('test_track.plan.plan_status_trash'), value: 'Trash'}];
|
||||||
|
} else {
|
||||||
|
element.options.forEach(option => {
|
||||||
|
option.text = this.$t(option.text)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
this.condition.components.push(...comp);
|
this.condition.components.push(...comp);
|
||||||
this.setTestCaseDefaultValue(template);
|
this.setTestCaseDefaultValue(template);
|
||||||
this.typeArr = [];
|
this.typeArr = [];
|
||||||
|
@ -694,18 +714,24 @@ export default {
|
||||||
return row.priority;
|
return row.priority;
|
||||||
} else if (field.name === '责任人') {
|
} else if (field.name === '责任人') {
|
||||||
return row.maintainerName;
|
return row.maintainerName;
|
||||||
|
} else if (field.name === '用例状态') {
|
||||||
|
value = value === 'Trash' ? this.$t('test_track.plan.plan_status_trash') : value
|
||||||
}
|
}
|
||||||
return value ? value : defaultVal;
|
return value ? value : defaultVal;
|
||||||
},
|
},
|
||||||
getCustomFieldFilter(field) {
|
getCustomFieldFilter(field) {
|
||||||
if (field.name === '用例状态') {
|
if (field.name === '用例状态') {
|
||||||
let option = [];
|
let option = [];
|
||||||
field.options.forEach((item) => {
|
if (this.trashEnable) {
|
||||||
option.push({
|
option.push({text: this.$t('test_track.plan.plan_status_trash'), value: 'Trash'});
|
||||||
text: this.$t(item.text),
|
} else {
|
||||||
value: item.value
|
field.options.forEach((item) => {
|
||||||
})
|
option.push({
|
||||||
});
|
text: this.$t(item.text),
|
||||||
|
value: item.value
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
return option;
|
return option;
|
||||||
}
|
}
|
||||||
return getCustomFieldFilter(field, this.userFilter);
|
return getCustomFieldFilter(field, this.userFilter);
|
||||||
|
|
|
@ -29,7 +29,11 @@ export default {
|
||||||
},
|
},
|
||||||
list() {
|
list() {
|
||||||
this.result = getTestCaseTrashNodes(this.caseCondition, data => {
|
this.result = getTestCaseTrashNodes(this.caseCondition, data => {
|
||||||
this.trashTreeNodes = data;
|
if (data && data.length > 0) {
|
||||||
|
this.trashTreeNodes = data[0].children;
|
||||||
|
} else {
|
||||||
|
this.trashTreeNodes = [];
|
||||||
|
}
|
||||||
if (this.$refs.trashNodeTree) {
|
if (this.$refs.trashNodeTree) {
|
||||||
this.trashTreeNodes.forEach(firstLevel => {
|
this.trashTreeNodes.forEach(firstLevel => {
|
||||||
this.$refs.trashNodeTree.nodeExpand(firstLevel);
|
this.$refs.trashNodeTree.nodeExpand(firstLevel);
|
||||||
|
|
Loading…
Reference in New Issue