fix: 测试跟踪用例重复显示
This commit is contained in:
parent
deaf05dd5f
commit
d12ec06066
|
@ -14,13 +14,11 @@ import io.metersphere.excel.domain.ExcelResponse;
|
|||
import io.metersphere.service.CheckPermissionService;
|
||||
import io.metersphere.service.FileService;
|
||||
import io.metersphere.track.dto.TestCaseDTO;
|
||||
import io.metersphere.track.dto.TestPlanCaseDTO;
|
||||
import io.metersphere.track.request.testcase.EditTestCaseRequest;
|
||||
import io.metersphere.track.request.testcase.QueryTestCaseRequest;
|
||||
import io.metersphere.track.request.testcase.TestCaseBatchRequest;
|
||||
import io.metersphere.track.request.testcase.TestCaseMinderEditRequest;
|
||||
import io.metersphere.track.request.testplan.FileOperationRequest;
|
||||
import io.metersphere.track.request.testplancase.QueryTestPlanCaseRequest;
|
||||
import io.metersphere.track.service.TestCaseService;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
|
@ -126,8 +124,8 @@ public class TestCaseController {
|
|||
|
||||
@PostMapping(value = "/edit", consumes = {"multipart/form-data"})
|
||||
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
|
||||
public void editTestCase(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file") List<MultipartFile> files) {
|
||||
testCaseService.edit(request, files);
|
||||
public String editTestCase(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file") List<MultipartFile> files) {
|
||||
return testCaseService.edit(request, files);
|
||||
}
|
||||
|
||||
@PostMapping("/delete/{testCaseId}")
|
||||
|
|
|
@ -165,7 +165,7 @@ public class TestCaseService {
|
|||
String steps = tc.getSteps();
|
||||
String remark = tc.getRemark();
|
||||
if (StringUtils.equals(steps, testCase.getSteps()) && StringUtils.equals(remark, caseRemark)) {
|
||||
MSException.throwException(Translator.get("test_case_already_exists"));
|
||||
//MSException.throwException(Translator.get("test_case_already_exists"));
|
||||
isExt = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -323,11 +323,23 @@ export default {
|
|||
showTestCaseDetail(testCase) {
|
||||
this.testCaseReadOnly = true;
|
||||
},
|
||||
refresh() {
|
||||
refresh(data) {
|
||||
this.selectNodeIds = [];
|
||||
this.selectParentNodes = [];
|
||||
this.selectNode = {};
|
||||
this.refreshTable();
|
||||
this.setTable(data);
|
||||
|
||||
},
|
||||
setTable(data) {
|
||||
console.log(data)
|
||||
for (let index in this.tabs) {
|
||||
let tab = this.tabs[index];
|
||||
if (tab.name === this.activeName) {
|
||||
tab.label = data.name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
refreshAll() {
|
||||
this.$refs.nodeTree.list();
|
||||
|
|
|
@ -380,6 +380,7 @@ export default {
|
|||
testCases: [],
|
||||
index: 0,
|
||||
showInputTag: true,
|
||||
tableType:"",
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
@ -712,11 +713,6 @@ export default {
|
|||
this.dialogFormVisible = false;
|
||||
},
|
||||
saveCase() {
|
||||
/*
|
||||
document.getElementById("inputDelay").focus();
|
||||
*/
|
||||
|
||||
// 保存前在input框自动失焦,以免保存失败
|
||||
this.$refs['caseFrom'].validate((valid) => {
|
||||
if (valid) {
|
||||
let param = this.buildParam();
|
||||
|
@ -724,7 +720,10 @@ export default {
|
|||
let option = this.getOption(param);
|
||||
this.result = this.$request(option, (response) => {
|
||||
this.$success(this.$t('commons.save_success'));
|
||||
if (this.operationType == 'add' && this.isCreateContinue) {
|
||||
this.operationType="edit"
|
||||
this.form.id=response.id;
|
||||
this.$emit("refreshTestCase",)
|
||||
/*if (this.operationType == 'add' && this.isCreateContinue) {
|
||||
this.form.name = '';
|
||||
this.form.prerequisite = '';
|
||||
this.form.steps = [{
|
||||
|
@ -738,9 +737,11 @@ export default {
|
|||
this.tableData = [];
|
||||
this.$emit("refresh");
|
||||
return;
|
||||
}
|
||||
this.dialogFormVisible = false;
|
||||
this.$emit("refresh");
|
||||
}*/
|
||||
this.tableType='edit';
|
||||
this.$emit("refresh",this.form);
|
||||
console.log(response.data)
|
||||
this.form.id=response.data
|
||||
if (this.type === 'add' || this.type === 'copy') {
|
||||
param.id = response.data;
|
||||
this.$emit("caseCreate", param);
|
||||
|
@ -779,11 +780,15 @@ export default {
|
|||
return param;
|
||||
},
|
||||
getOption(param) {
|
||||
let formData = new FormData();
|
||||
let type = this.type
|
||||
if (this.type === 'copy') {
|
||||
let type={}
|
||||
if(this.tableType==='edit'){
|
||||
type='edit'
|
||||
}else if(this.type === 'copy'){
|
||||
type = 'add'
|
||||
}else{
|
||||
type=this.type
|
||||
}
|
||||
let formData = new FormData();
|
||||
let url = '/test/case/' + type;
|
||||
this.uploadList.forEach(f => {
|
||||
formData.append("file", f);
|
||||
|
|
|
@ -280,7 +280,7 @@ export default {
|
|||
none: 'None Organization',
|
||||
select: 'Select Organization',
|
||||
service_integration: 'Service integration',
|
||||
defect_manage: 'Defect management platform',
|
||||
defect_manage: 'Project management platform',
|
||||
message_settings: 'Message settings',
|
||||
message: {
|
||||
jenkins_task_notification: 'Jenkins task notification',
|
||||
|
|
|
@ -281,7 +281,7 @@ export default {
|
|||
select: '选择组织',
|
||||
delete_warning: '删除该组织将同步删除该组织下所有相关工作空间和相关工作空间下的所有项目,以及项目中的所有用例、接口测试、性能测试等,确定要删除吗?',
|
||||
service_integration: '服务集成',
|
||||
defect_manage: '缺陷管理平台',
|
||||
defect_manage: '项目管理平台',
|
||||
message_settings: '消息设置',
|
||||
message: {
|
||||
jenkins_task_notification: 'Jenkins接口调用任务通知',
|
||||
|
|
|
@ -281,7 +281,7 @@ export default {
|
|||
select: '選擇組織',
|
||||
delete_warning: '刪除該組織將同步刪除該組織下所有相關工作空間和相關工作空間下的所有項目,以及項目中的所有用例、接口測試、性能測試等,確定要刪除嗎?',
|
||||
service_integration: '服務集成',
|
||||
defect_manage: '缺陷管理平臺',
|
||||
defect_manage: '項目管理平臺',
|
||||
message_settings: '消息設置',
|
||||
message: {
|
||||
jenkins_task_notification: 'Jenkins接口調用任務通知',
|
||||
|
|
Loading…
Reference in New Issue