Merge branch 'master' of https://github.com/metersphere/metersphere
Conflicts: backend/src/main/resources/db/migration/V78__v1.8_release.sql
This commit is contained in:
commit
7a251e2afb
|
@ -44,6 +44,15 @@ public class ApiAutomationController {
|
||||||
return PageUtils.setPageInfo(page, apiAutomationService.list(request));
|
return PageUtils.setPageInfo(page, apiAutomationService.list(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list/{projectId}")
|
||||||
|
@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER, RoleConstants.TEST_VIEWER}, logical = Logical.OR)
|
||||||
|
public List<ApiScenarioDTO> list(@PathVariable String projectId) {
|
||||||
|
ApiScenarioRequest request = new ApiScenarioRequest();
|
||||||
|
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
||||||
|
request.setProjectId(projectId);
|
||||||
|
return apiAutomationService.list(request);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping(value = "/create")
|
@PostMapping(value = "/create")
|
||||||
public ApiScenario create(@RequestPart("request") SaveApiScenarioRequest request, @RequestPart(value = "files") List<MultipartFile> bodyFiles) {
|
public ApiScenario create(@RequestPart("request") SaveApiScenarioRequest request, @RequestPart(value = "files") List<MultipartFile> bodyFiles) {
|
||||||
return apiAutomationService.create(request, bodyFiles);
|
return apiAutomationService.create(request, bodyFiles);
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class ApiTestCaseController {
|
||||||
if(!list.isEmpty()){
|
if(!list.isEmpty()){
|
||||||
return list.get(0);
|
return list.get(0);
|
||||||
}else {
|
}else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,6 +55,14 @@ public class ApiTestCaseController {
|
||||||
return PageUtils.setPageInfo(page, apiTestCaseService.listSimple(request));
|
return PageUtils.setPageInfo(page, apiTestCaseService.listSimple(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list/{projectId}")
|
||||||
|
public List<ApiTestCaseDTO> list(@PathVariable String projectId) {
|
||||||
|
ApiTestCaseRequest request = new ApiTestCaseRequest();
|
||||||
|
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
||||||
|
request.setProjectId(projectId);
|
||||||
|
return apiTestCaseService.listSimple(request);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/get/request")
|
@PostMapping("/get/request")
|
||||||
public Map<String, String> listSimple(@RequestBody ApiTestCaseRequest request) {
|
public Map<String, String> listSimple(@RequestBody ApiTestCaseRequest request) {
|
||||||
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
||||||
|
|
|
@ -18,5 +18,7 @@ public class FileMetadata implements Serializable {
|
||||||
|
|
||||||
private Long size;
|
private Long size;
|
||||||
|
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
|
@ -175,142 +175,142 @@ public class FileMetadataExample {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andNameIsNull() {
|
public Criteria andNameIsNull() {
|
||||||
addCriterion("name is null");
|
addCriterion("`name` is null");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andNameIsNotNull() {
|
public Criteria andNameIsNotNull() {
|
||||||
addCriterion("name is not null");
|
addCriterion("`name` is not null");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andNameEqualTo(String value) {
|
public Criteria andNameEqualTo(String value) {
|
||||||
addCriterion("name =", value, "name");
|
addCriterion("`name` =", value, "name");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andNameNotEqualTo(String value) {
|
public Criteria andNameNotEqualTo(String value) {
|
||||||
addCriterion("name <>", value, "name");
|
addCriterion("`name` <>", value, "name");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andNameGreaterThan(String value) {
|
public Criteria andNameGreaterThan(String value) {
|
||||||
addCriterion("name >", value, "name");
|
addCriterion("`name` >", value, "name");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andNameGreaterThanOrEqualTo(String value) {
|
public Criteria andNameGreaterThanOrEqualTo(String value) {
|
||||||
addCriterion("name >=", value, "name");
|
addCriterion("`name` >=", value, "name");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andNameLessThan(String value) {
|
public Criteria andNameLessThan(String value) {
|
||||||
addCriterion("name <", value, "name");
|
addCriterion("`name` <", value, "name");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andNameLessThanOrEqualTo(String value) {
|
public Criteria andNameLessThanOrEqualTo(String value) {
|
||||||
addCriterion("name <=", value, "name");
|
addCriterion("`name` <=", value, "name");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andNameLike(String value) {
|
public Criteria andNameLike(String value) {
|
||||||
addCriterion("name like", value, "name");
|
addCriterion("`name` like", value, "name");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andNameNotLike(String value) {
|
public Criteria andNameNotLike(String value) {
|
||||||
addCriterion("name not like", value, "name");
|
addCriterion("`name` not like", value, "name");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andNameIn(List<String> values) {
|
public Criteria andNameIn(List<String> values) {
|
||||||
addCriterion("name in", values, "name");
|
addCriterion("`name` in", values, "name");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andNameNotIn(List<String> values) {
|
public Criteria andNameNotIn(List<String> values) {
|
||||||
addCriterion("name not in", values, "name");
|
addCriterion("`name` not in", values, "name");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andNameBetween(String value1, String value2) {
|
public Criteria andNameBetween(String value1, String value2) {
|
||||||
addCriterion("name between", value1, value2, "name");
|
addCriterion("`name` between", value1, value2, "name");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andNameNotBetween(String value1, String value2) {
|
public Criteria andNameNotBetween(String value1, String value2) {
|
||||||
addCriterion("name not between", value1, value2, "name");
|
addCriterion("`name` not between", value1, value2, "name");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andTypeIsNull() {
|
public Criteria andTypeIsNull() {
|
||||||
addCriterion("type is null");
|
addCriterion("`type` is null");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andTypeIsNotNull() {
|
public Criteria andTypeIsNotNull() {
|
||||||
addCriterion("type is not null");
|
addCriterion("`type` is not null");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andTypeEqualTo(String value) {
|
public Criteria andTypeEqualTo(String value) {
|
||||||
addCriterion("type =", value, "type");
|
addCriterion("`type` =", value, "type");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andTypeNotEqualTo(String value) {
|
public Criteria andTypeNotEqualTo(String value) {
|
||||||
addCriterion("type <>", value, "type");
|
addCriterion("`type` <>", value, "type");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andTypeGreaterThan(String value) {
|
public Criteria andTypeGreaterThan(String value) {
|
||||||
addCriterion("type >", value, "type");
|
addCriterion("`type` >", value, "type");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andTypeGreaterThanOrEqualTo(String value) {
|
public Criteria andTypeGreaterThanOrEqualTo(String value) {
|
||||||
addCriterion("type >=", value, "type");
|
addCriterion("`type` >=", value, "type");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andTypeLessThan(String value) {
|
public Criteria andTypeLessThan(String value) {
|
||||||
addCriterion("type <", value, "type");
|
addCriterion("`type` <", value, "type");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andTypeLessThanOrEqualTo(String value) {
|
public Criteria andTypeLessThanOrEqualTo(String value) {
|
||||||
addCriterion("type <=", value, "type");
|
addCriterion("`type` <=", value, "type");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andTypeLike(String value) {
|
public Criteria andTypeLike(String value) {
|
||||||
addCriterion("type like", value, "type");
|
addCriterion("`type` like", value, "type");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andTypeNotLike(String value) {
|
public Criteria andTypeNotLike(String value) {
|
||||||
addCriterion("type not like", value, "type");
|
addCriterion("`type` not like", value, "type");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andTypeIn(List<String> values) {
|
public Criteria andTypeIn(List<String> values) {
|
||||||
addCriterion("type in", values, "type");
|
addCriterion("`type` in", values, "type");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andTypeNotIn(List<String> values) {
|
public Criteria andTypeNotIn(List<String> values) {
|
||||||
addCriterion("type not in", values, "type");
|
addCriterion("`type` not in", values, "type");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andTypeBetween(String value1, String value2) {
|
public Criteria andTypeBetween(String value1, String value2) {
|
||||||
addCriterion("type between", value1, value2, "type");
|
addCriterion("`type` between", value1, value2, "type");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andTypeNotBetween(String value1, String value2) {
|
public Criteria andTypeNotBetween(String value1, String value2) {
|
||||||
addCriterion("type not between", value1, value2, "type");
|
addCriterion("`type` not between", value1, value2, "type");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,62 +435,122 @@ public class FileMetadataExample {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andSizeIsNull() {
|
public Criteria andSizeIsNull() {
|
||||||
addCriterion("size is null");
|
addCriterion("`size` is null");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andSizeIsNotNull() {
|
public Criteria andSizeIsNotNull() {
|
||||||
addCriterion("size is not null");
|
addCriterion("`size` is not null");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andSizeEqualTo(Long value) {
|
public Criteria andSizeEqualTo(Long value) {
|
||||||
addCriterion("size =", value, "size");
|
addCriterion("`size` =", value, "size");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andSizeNotEqualTo(Long value) {
|
public Criteria andSizeNotEqualTo(Long value) {
|
||||||
addCriterion("size <>", value, "size");
|
addCriterion("`size` <>", value, "size");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andSizeGreaterThan(Long value) {
|
public Criteria andSizeGreaterThan(Long value) {
|
||||||
addCriterion("size >", value, "size");
|
addCriterion("`size` >", value, "size");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andSizeGreaterThanOrEqualTo(Long value) {
|
public Criteria andSizeGreaterThanOrEqualTo(Long value) {
|
||||||
addCriterion("size >=", value, "size");
|
addCriterion("`size` >=", value, "size");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andSizeLessThan(Long value) {
|
public Criteria andSizeLessThan(Long value) {
|
||||||
addCriterion("size <", value, "size");
|
addCriterion("`size` <", value, "size");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andSizeLessThanOrEqualTo(Long value) {
|
public Criteria andSizeLessThanOrEqualTo(Long value) {
|
||||||
addCriterion("size <=", value, "size");
|
addCriterion("`size` <=", value, "size");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andSizeIn(List<Long> values) {
|
public Criteria andSizeIn(List<Long> values) {
|
||||||
addCriterion("size in", values, "size");
|
addCriterion("`size` in", values, "size");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andSizeNotIn(List<Long> values) {
|
public Criteria andSizeNotIn(List<Long> values) {
|
||||||
addCriterion("size not in", values, "size");
|
addCriterion("`size` not in", values, "size");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andSizeBetween(Long value1, Long value2) {
|
public Criteria andSizeBetween(Long value1, Long value2) {
|
||||||
addCriterion("size between", value1, value2, "size");
|
addCriterion("`size` between", value1, value2, "size");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andSizeNotBetween(Long value1, Long value2) {
|
public Criteria andSizeNotBetween(Long value1, Long value2) {
|
||||||
addCriterion("size not between", value1, value2, "size");
|
addCriterion("`size` not between", value1, value2, "size");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSortIsNull() {
|
||||||
|
addCriterion("sort is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSortIsNotNull() {
|
||||||
|
addCriterion("sort is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSortEqualTo(Integer value) {
|
||||||
|
addCriterion("sort =", value, "sort");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSortNotEqualTo(Integer value) {
|
||||||
|
addCriterion("sort <>", value, "sort");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSortGreaterThan(Integer value) {
|
||||||
|
addCriterion("sort >", value, "sort");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSortGreaterThanOrEqualTo(Integer value) {
|
||||||
|
addCriterion("sort >=", value, "sort");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSortLessThan(Integer value) {
|
||||||
|
addCriterion("sort <", value, "sort");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSortLessThanOrEqualTo(Integer value) {
|
||||||
|
addCriterion("sort <=", value, "sort");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSortIn(List<Integer> values) {
|
||||||
|
addCriterion("sort in", values, "sort");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSortNotIn(List<Integer> values) {
|
||||||
|
addCriterion("sort not in", values, "sort");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSortBetween(Integer value1, Integer value2) {
|
||||||
|
addCriterion("sort between", value1, value2, "sort");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSortNotBetween(Integer value1, Integer value2) {
|
||||||
|
addCriterion("sort not between", value1, value2, "sort");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,5 +42,9 @@ public class TestCase implements Serializable {
|
||||||
|
|
||||||
private String tags;
|
private String tags;
|
||||||
|
|
||||||
|
private String demandId;
|
||||||
|
|
||||||
|
private String demandName;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
|
@ -1323,6 +1323,146 @@ public class TestCaseExample {
|
||||||
addCriterion("tags not between", value1, value2, "tags");
|
addCriterion("tags not between", value1, value2, "tags");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandIdIsNull() {
|
||||||
|
addCriterion("demand_id is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandIdIsNotNull() {
|
||||||
|
addCriterion("demand_id is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandIdEqualTo(String value) {
|
||||||
|
addCriterion("demand_id =", value, "demandId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandIdNotEqualTo(String value) {
|
||||||
|
addCriterion("demand_id <>", value, "demandId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandIdGreaterThan(String value) {
|
||||||
|
addCriterion("demand_id >", value, "demandId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandIdGreaterThanOrEqualTo(String value) {
|
||||||
|
addCriterion("demand_id >=", value, "demandId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandIdLessThan(String value) {
|
||||||
|
addCriterion("demand_id <", value, "demandId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandIdLessThanOrEqualTo(String value) {
|
||||||
|
addCriterion("demand_id <=", value, "demandId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandIdLike(String value) {
|
||||||
|
addCriterion("demand_id like", value, "demandId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandIdNotLike(String value) {
|
||||||
|
addCriterion("demand_id not like", value, "demandId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandIdIn(List<String> values) {
|
||||||
|
addCriterion("demand_id in", values, "demandId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandIdNotIn(List<String> values) {
|
||||||
|
addCriterion("demand_id not in", values, "demandId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandIdBetween(String value1, String value2) {
|
||||||
|
addCriterion("demand_id between", value1, value2, "demandId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandIdNotBetween(String value1, String value2) {
|
||||||
|
addCriterion("demand_id not between", value1, value2, "demandId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandNameIsNull() {
|
||||||
|
addCriterion("demand_name is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandNameIsNotNull() {
|
||||||
|
addCriterion("demand_name is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandNameEqualTo(String value) {
|
||||||
|
addCriterion("demand_name =", value, "demandName");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandNameNotEqualTo(String value) {
|
||||||
|
addCriterion("demand_name <>", value, "demandName");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandNameGreaterThan(String value) {
|
||||||
|
addCriterion("demand_name >", value, "demandName");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandNameGreaterThanOrEqualTo(String value) {
|
||||||
|
addCriterion("demand_name >=", value, "demandName");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandNameLessThan(String value) {
|
||||||
|
addCriterion("demand_name <", value, "demandName");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandNameLessThanOrEqualTo(String value) {
|
||||||
|
addCriterion("demand_name <=", value, "demandName");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandNameLike(String value) {
|
||||||
|
addCriterion("demand_name like", value, "demandName");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandNameNotLike(String value) {
|
||||||
|
addCriterion("demand_name not like", value, "demandName");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandNameIn(List<String> values) {
|
||||||
|
addCriterion("demand_name in", values, "demandName");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandNameNotIn(List<String> values) {
|
||||||
|
addCriterion("demand_name not in", values, "demandName");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandNameBetween(String value1, String value2) {
|
||||||
|
addCriterion("demand_name between", value1, value2, "demandName");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDemandNameNotBetween(String value1, String value2) {
|
||||||
|
addCriterion("demand_name not between", value1, value2, "demandName");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Criteria extends GeneratedCriteria {
|
public static class Criteria extends GeneratedCriteria {
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||||
<result column="size" jdbcType="BIGINT" property="size" />
|
<result column="size" jdbcType="BIGINT" property="size" />
|
||||||
|
<result column="sort" jdbcType="INTEGER" property="sort" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Example_Where_Clause">
|
<sql id="Example_Where_Clause">
|
||||||
<where>
|
<where>
|
||||||
|
@ -68,7 +69,7 @@
|
||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, name, type, create_time, update_time, size
|
id, `name`, `type`, create_time, update_time, `size`, sort
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByExample" parameterType="io.metersphere.base.domain.FileMetadataExample" resultMap="BaseResultMap">
|
<select id="selectByExample" parameterType="io.metersphere.base.domain.FileMetadataExample" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
|
@ -101,12 +102,12 @@
|
||||||
</if>
|
</if>
|
||||||
</delete>
|
</delete>
|
||||||
<insert id="insert" parameterType="io.metersphere.base.domain.FileMetadata">
|
<insert id="insert" parameterType="io.metersphere.base.domain.FileMetadata">
|
||||||
insert into file_metadata (id, name, type,
|
insert into file_metadata (id, `name`, `type`,
|
||||||
create_time, update_time, size
|
create_time, update_time, `size`,
|
||||||
)
|
sort)
|
||||||
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
||||||
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{size,jdbcType=BIGINT}
|
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{size,jdbcType=BIGINT},
|
||||||
)
|
#{sort,jdbcType=INTEGER})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.FileMetadata">
|
<insert id="insertSelective" parameterType="io.metersphere.base.domain.FileMetadata">
|
||||||
insert into file_metadata
|
insert into file_metadata
|
||||||
|
@ -115,10 +116,10 @@
|
||||||
id,
|
id,
|
||||||
</if>
|
</if>
|
||||||
<if test="name != null">
|
<if test="name != null">
|
||||||
name,
|
`name`,
|
||||||
</if>
|
</if>
|
||||||
<if test="type != null">
|
<if test="type != null">
|
||||||
type,
|
`type`,
|
||||||
</if>
|
</if>
|
||||||
<if test="createTime != null">
|
<if test="createTime != null">
|
||||||
create_time,
|
create_time,
|
||||||
|
@ -127,7 +128,10 @@
|
||||||
update_time,
|
update_time,
|
||||||
</if>
|
</if>
|
||||||
<if test="size != null">
|
<if test="size != null">
|
||||||
size,
|
`size`,
|
||||||
|
</if>
|
||||||
|
<if test="sort != null">
|
||||||
|
sort,
|
||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
@ -149,6 +153,9 @@
|
||||||
<if test="size != null">
|
<if test="size != null">
|
||||||
#{size,jdbcType=BIGINT},
|
#{size,jdbcType=BIGINT},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="sort != null">
|
||||||
|
#{sort,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
<select id="countByExample" parameterType="io.metersphere.base.domain.FileMetadataExample" resultType="java.lang.Long">
|
<select id="countByExample" parameterType="io.metersphere.base.domain.FileMetadataExample" resultType="java.lang.Long">
|
||||||
|
@ -164,10 +171,10 @@
|
||||||
id = #{record.id,jdbcType=VARCHAR},
|
id = #{record.id,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.name != null">
|
<if test="record.name != null">
|
||||||
name = #{record.name,jdbcType=VARCHAR},
|
`name` = #{record.name,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.type != null">
|
<if test="record.type != null">
|
||||||
type = #{record.type,jdbcType=VARCHAR},
|
`type` = #{record.type,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.createTime != null">
|
<if test="record.createTime != null">
|
||||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||||
|
@ -176,7 +183,10 @@
|
||||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.size != null">
|
<if test="record.size != null">
|
||||||
size = #{record.size,jdbcType=BIGINT},
|
`size` = #{record.size,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="record.sort != null">
|
||||||
|
sort = #{record.sort,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
</set>
|
</set>
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
|
@ -186,11 +196,12 @@
|
||||||
<update id="updateByExample" parameterType="map">
|
<update id="updateByExample" parameterType="map">
|
||||||
update file_metadata
|
update file_metadata
|
||||||
set id = #{record.id,jdbcType=VARCHAR},
|
set id = #{record.id,jdbcType=VARCHAR},
|
||||||
name = #{record.name,jdbcType=VARCHAR},
|
`name` = #{record.name,jdbcType=VARCHAR},
|
||||||
type = #{record.type,jdbcType=VARCHAR},
|
`type` = #{record.type,jdbcType=VARCHAR},
|
||||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||||
size = #{record.size,jdbcType=BIGINT}
|
`size` = #{record.size,jdbcType=BIGINT},
|
||||||
|
sort = #{record.sort,jdbcType=INTEGER}
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
<include refid="Update_By_Example_Where_Clause" />
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
</if>
|
</if>
|
||||||
|
@ -199,10 +210,10 @@
|
||||||
update file_metadata
|
update file_metadata
|
||||||
<set>
|
<set>
|
||||||
<if test="name != null">
|
<if test="name != null">
|
||||||
name = #{name,jdbcType=VARCHAR},
|
`name` = #{name,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="type != null">
|
<if test="type != null">
|
||||||
type = #{type,jdbcType=VARCHAR},
|
`type` = #{type,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="createTime != null">
|
<if test="createTime != null">
|
||||||
create_time = #{createTime,jdbcType=BIGINT},
|
create_time = #{createTime,jdbcType=BIGINT},
|
||||||
|
@ -211,18 +222,22 @@
|
||||||
update_time = #{updateTime,jdbcType=BIGINT},
|
update_time = #{updateTime,jdbcType=BIGINT},
|
||||||
</if>
|
</if>
|
||||||
<if test="size != null">
|
<if test="size != null">
|
||||||
size = #{size,jdbcType=BIGINT},
|
`size` = #{size,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="sort != null">
|
||||||
|
sort = #{sort,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
</set>
|
</set>
|
||||||
where id = #{id,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
</update>
|
</update>
|
||||||
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.FileMetadata">
|
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.FileMetadata">
|
||||||
update file_metadata
|
update file_metadata
|
||||||
set name = #{name,jdbcType=VARCHAR},
|
set `name` = #{name,jdbcType=VARCHAR},
|
||||||
type = #{type,jdbcType=VARCHAR},
|
`type` = #{type,jdbcType=VARCHAR},
|
||||||
create_time = #{createTime,jdbcType=BIGINT},
|
create_time = #{createTime,jdbcType=BIGINT},
|
||||||
update_time = #{updateTime,jdbcType=BIGINT},
|
update_time = #{updateTime,jdbcType=BIGINT},
|
||||||
size = #{size,jdbcType=BIGINT}
|
`size` = #{size,jdbcType=BIGINT},
|
||||||
|
sort = #{sort,jdbcType=INTEGER}
|
||||||
where id = #{id,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
|
@ -10,16 +10,18 @@
|
||||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||||
<result column="maintainer" jdbcType="VARCHAR" property="maintainer" />
|
<result column="maintainer" jdbcType="VARCHAR" property="maintainer" />
|
||||||
<result column="priority" jdbcType="VARCHAR" property="priority" />
|
<result column="priority" jdbcType="VARCHAR" property="priority" />
|
||||||
<result column="method" jdbcType="VARCHAR" property="method" />
|
<result column="method" jdbcType="VARCHAR" property="method"/>
|
||||||
<result column="prerequisite" jdbcType="VARCHAR" property="prerequisite" />
|
<result column="prerequisite" jdbcType="VARCHAR" property="prerequisite"/>
|
||||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
|
||||||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
<result column="update_time" jdbcType="BIGINT" property="updateTime"/>
|
||||||
<result column="test_id" jdbcType="VARCHAR" property="testId" />
|
<result column="test_id" jdbcType="VARCHAR" property="testId"/>
|
||||||
<result column="sort" jdbcType="INTEGER" property="sort" />
|
<result column="sort" jdbcType="INTEGER" property="sort"/>
|
||||||
<result column="num" jdbcType="INTEGER" property="num" />
|
<result column="num" jdbcType="INTEGER" property="num"/>
|
||||||
<result column="other_test_name" jdbcType="VARCHAR" property="otherTestName" />
|
<result column="other_test_name" jdbcType="VARCHAR" property="otherTestName"/>
|
||||||
<result column="review_status" jdbcType="VARCHAR" property="reviewStatus" />
|
<result column="review_status" jdbcType="VARCHAR" property="reviewStatus"/>
|
||||||
<result column="tags" jdbcType="VARCHAR" property="tags" />
|
<result column="tags" jdbcType="VARCHAR" property="tags"/>
|
||||||
|
<result column="demand_id" jdbcType="VARCHAR" property="demandId"/>
|
||||||
|
<result column="demand_name" jdbcType="VARCHAR" property="demandName"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestCaseWithBLOBs">
|
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestCaseWithBLOBs">
|
||||||
<result column="remark" jdbcType="LONGVARCHAR" property="remark" />
|
<result column="remark" jdbcType="LONGVARCHAR" property="remark" />
|
||||||
|
@ -86,7 +88,7 @@
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, node_id, node_path, project_id, `name`, `type`, maintainer, priority, `method`,
|
id, node_id, node_path, project_id, `name`, `type`, maintainer, priority, `method`,
|
||||||
prerequisite, create_time, update_time, test_id, sort, num, other_test_name, review_status,
|
prerequisite, create_time, update_time, test_id, sort, num, other_test_name, review_status,
|
||||||
tags
|
tags, demand_id, demand_name
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Blob_Column_List">
|
<sql id="Blob_Column_List">
|
||||||
remark, steps
|
remark, steps
|
||||||
|
@ -140,20 +142,22 @@
|
||||||
</if>
|
</if>
|
||||||
</delete>
|
</delete>
|
||||||
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
|
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
|
||||||
insert into test_case (id, node_id, node_path,
|
insert into test_case (id, node_id, node_path,
|
||||||
project_id, `name`, `type`,
|
project_id, `name`, `type`,
|
||||||
maintainer, priority, `method`,
|
maintainer, priority, `method`,
|
||||||
prerequisite, create_time, update_time,
|
prerequisite, create_time, update_time,
|
||||||
test_id, sort, num,
|
test_id, sort, num,
|
||||||
other_test_name, review_status, tags,
|
other_test_name, review_status, tags,
|
||||||
remark, steps)
|
demand_id, demand_name, remark,
|
||||||
values (#{id,jdbcType=VARCHAR}, #{nodeId,jdbcType=VARCHAR}, #{nodePath,jdbcType=VARCHAR},
|
steps)
|
||||||
#{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
values (#{id,jdbcType=VARCHAR}, #{nodeId,jdbcType=VARCHAR}, #{nodePath,jdbcType=VARCHAR},
|
||||||
#{maintainer,jdbcType=VARCHAR}, #{priority,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR},
|
#{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
||||||
#{prerequisite,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
|
#{maintainer,jdbcType=VARCHAR}, #{priority,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR},
|
||||||
#{testId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{num,jdbcType=INTEGER},
|
#{prerequisite,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
|
||||||
#{otherTestName,jdbcType=VARCHAR}, #{reviewStatus,jdbcType=VARCHAR}, #{tags,jdbcType=VARCHAR},
|
#{testId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{num,jdbcType=INTEGER},
|
||||||
#{remark,jdbcType=LONGVARCHAR}, #{steps,jdbcType=LONGVARCHAR})
|
#{otherTestName,jdbcType=VARCHAR}, #{reviewStatus,jdbcType=VARCHAR}, #{tags,jdbcType=VARCHAR},
|
||||||
|
#{demandId,jdbcType=VARCHAR}, #{demandName,jdbcType=VARCHAR}, #{remark,jdbcType=LONGVARCHAR},
|
||||||
|
#{steps,jdbcType=LONGVARCHAR})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
|
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
|
||||||
insert into test_case
|
insert into test_case
|
||||||
|
@ -212,6 +216,12 @@
|
||||||
<if test="tags != null">
|
<if test="tags != null">
|
||||||
tags,
|
tags,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="demandId != null">
|
||||||
|
demand_id,
|
||||||
|
</if>
|
||||||
|
<if test="demandName != null">
|
||||||
|
demand_name,
|
||||||
|
</if>
|
||||||
<if test="remark != null">
|
<if test="remark != null">
|
||||||
remark,
|
remark,
|
||||||
</if>
|
</if>
|
||||||
|
@ -274,6 +284,12 @@
|
||||||
<if test="tags != null">
|
<if test="tags != null">
|
||||||
#{tags,jdbcType=VARCHAR},
|
#{tags,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="demandId != null">
|
||||||
|
#{demandId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="demandName != null">
|
||||||
|
#{demandName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
<if test="remark != null">
|
<if test="remark != null">
|
||||||
#{remark,jdbcType=LONGVARCHAR},
|
#{remark,jdbcType=LONGVARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
@ -345,6 +361,12 @@
|
||||||
<if test="record.tags != null">
|
<if test="record.tags != null">
|
||||||
tags = #{record.tags,jdbcType=VARCHAR},
|
tags = #{record.tags,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="record.demandId != null">
|
||||||
|
demand_id = #{record.demandId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.demandName != null">
|
||||||
|
demand_name = #{record.demandName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
<if test="record.remark != null">
|
<if test="record.remark != null">
|
||||||
remark = #{record.remark,jdbcType=LONGVARCHAR},
|
remark = #{record.remark,jdbcType=LONGVARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
@ -366,18 +388,20 @@
|
||||||
`type` = #{record.type,jdbcType=VARCHAR},
|
`type` = #{record.type,jdbcType=VARCHAR},
|
||||||
maintainer = #{record.maintainer,jdbcType=VARCHAR},
|
maintainer = #{record.maintainer,jdbcType=VARCHAR},
|
||||||
priority = #{record.priority,jdbcType=VARCHAR},
|
priority = #{record.priority,jdbcType=VARCHAR},
|
||||||
`method` = #{record.method,jdbcType=VARCHAR},
|
`method` = #{record.method,jdbcType=VARCHAR},
|
||||||
prerequisite = #{record.prerequisite,jdbcType=VARCHAR},
|
prerequisite = #{record.prerequisite,jdbcType=VARCHAR},
|
||||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||||
test_id = #{record.testId,jdbcType=VARCHAR},
|
test_id = #{record.testId,jdbcType=VARCHAR},
|
||||||
sort = #{record.sort,jdbcType=INTEGER},
|
sort = #{record.sort,jdbcType=INTEGER},
|
||||||
num = #{record.num,jdbcType=INTEGER},
|
num = #{record.num,jdbcType=INTEGER},
|
||||||
other_test_name = #{record.otherTestName,jdbcType=VARCHAR},
|
other_test_name = #{record.otherTestName,jdbcType=VARCHAR},
|
||||||
review_status = #{record.reviewStatus,jdbcType=VARCHAR},
|
review_status = #{record.reviewStatus,jdbcType=VARCHAR},
|
||||||
tags = #{record.tags,jdbcType=VARCHAR},
|
tags = #{record.tags,jdbcType=VARCHAR},
|
||||||
remark = #{record.remark,jdbcType=LONGVARCHAR},
|
demand_id = #{record.demandId,jdbcType=VARCHAR},
|
||||||
steps = #{record.steps,jdbcType=LONGVARCHAR}
|
demand_name = #{record.demandName,jdbcType=VARCHAR},
|
||||||
|
remark = #{record.remark,jdbcType=LONGVARCHAR},
|
||||||
|
steps = #{record.steps,jdbcType=LONGVARCHAR}
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
<include refid="Update_By_Example_Where_Clause" />
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
</if>
|
</if>
|
||||||
|
@ -391,17 +415,19 @@
|
||||||
`name` = #{record.name,jdbcType=VARCHAR},
|
`name` = #{record.name,jdbcType=VARCHAR},
|
||||||
`type` = #{record.type,jdbcType=VARCHAR},
|
`type` = #{record.type,jdbcType=VARCHAR},
|
||||||
maintainer = #{record.maintainer,jdbcType=VARCHAR},
|
maintainer = #{record.maintainer,jdbcType=VARCHAR},
|
||||||
priority = #{record.priority,jdbcType=VARCHAR},
|
priority = #{record.priority,jdbcType=VARCHAR},
|
||||||
`method` = #{record.method,jdbcType=VARCHAR},
|
`method` = #{record.method,jdbcType=VARCHAR},
|
||||||
prerequisite = #{record.prerequisite,jdbcType=VARCHAR},
|
prerequisite = #{record.prerequisite,jdbcType=VARCHAR},
|
||||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||||
test_id = #{record.testId,jdbcType=VARCHAR},
|
test_id = #{record.testId,jdbcType=VARCHAR},
|
||||||
sort = #{record.sort,jdbcType=INTEGER},
|
sort = #{record.sort,jdbcType=INTEGER},
|
||||||
num = #{record.num,jdbcType=INTEGER},
|
num = #{record.num,jdbcType=INTEGER},
|
||||||
other_test_name = #{record.otherTestName,jdbcType=VARCHAR},
|
other_test_name = #{record.otherTestName,jdbcType=VARCHAR},
|
||||||
review_status = #{record.reviewStatus,jdbcType=VARCHAR},
|
review_status = #{record.reviewStatus,jdbcType=VARCHAR},
|
||||||
tags = #{record.tags,jdbcType=VARCHAR}
|
tags = #{record.tags,jdbcType=VARCHAR},
|
||||||
|
demand_id = #{record.demandId,jdbcType=VARCHAR},
|
||||||
|
demand_name = #{record.demandName,jdbcType=VARCHAR}
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
<include refid="Update_By_Example_Where_Clause" />
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
</if>
|
</if>
|
||||||
|
@ -460,6 +486,12 @@
|
||||||
<if test="tags != null">
|
<if test="tags != null">
|
||||||
tags = #{tags,jdbcType=VARCHAR},
|
tags = #{tags,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="demandId != null">
|
||||||
|
demand_id = #{demandId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="demandName != null">
|
||||||
|
demand_name = #{demandName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
<if test="remark != null">
|
<if test="remark != null">
|
||||||
remark = #{remark,jdbcType=LONGVARCHAR},
|
remark = #{remark,jdbcType=LONGVARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
@ -471,46 +503,50 @@
|
||||||
</update>
|
</update>
|
||||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
|
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
|
||||||
update test_case
|
update test_case
|
||||||
set node_id = #{nodeId,jdbcType=VARCHAR},
|
set node_id = #{nodeId,jdbcType=VARCHAR},
|
||||||
node_path = #{nodePath,jdbcType=VARCHAR},
|
node_path = #{nodePath,jdbcType=VARCHAR},
|
||||||
project_id = #{projectId,jdbcType=VARCHAR},
|
project_id = #{projectId,jdbcType=VARCHAR},
|
||||||
`name` = #{name,jdbcType=VARCHAR},
|
`name` = #{name,jdbcType=VARCHAR},
|
||||||
`type` = #{type,jdbcType=VARCHAR},
|
`type` = #{type,jdbcType=VARCHAR},
|
||||||
maintainer = #{maintainer,jdbcType=VARCHAR},
|
maintainer = #{maintainer,jdbcType=VARCHAR},
|
||||||
priority = #{priority,jdbcType=VARCHAR},
|
priority = #{priority,jdbcType=VARCHAR},
|
||||||
`method` = #{method,jdbcType=VARCHAR},
|
`method` = #{method,jdbcType=VARCHAR},
|
||||||
prerequisite = #{prerequisite,jdbcType=VARCHAR},
|
prerequisite = #{prerequisite,jdbcType=VARCHAR},
|
||||||
create_time = #{createTime,jdbcType=BIGINT},
|
create_time = #{createTime,jdbcType=BIGINT},
|
||||||
update_time = #{updateTime,jdbcType=BIGINT},
|
update_time = #{updateTime,jdbcType=BIGINT},
|
||||||
test_id = #{testId,jdbcType=VARCHAR},
|
test_id = #{testId,jdbcType=VARCHAR},
|
||||||
sort = #{sort,jdbcType=INTEGER},
|
sort = #{sort,jdbcType=INTEGER},
|
||||||
num = #{num,jdbcType=INTEGER},
|
num = #{num,jdbcType=INTEGER},
|
||||||
other_test_name = #{otherTestName,jdbcType=VARCHAR},
|
other_test_name = #{otherTestName,jdbcType=VARCHAR},
|
||||||
review_status = #{reviewStatus,jdbcType=VARCHAR},
|
review_status = #{reviewStatus,jdbcType=VARCHAR},
|
||||||
tags = #{tags,jdbcType=VARCHAR},
|
tags = #{tags,jdbcType=VARCHAR},
|
||||||
remark = #{remark,jdbcType=LONGVARCHAR},
|
demand_id = #{demandId,jdbcType=VARCHAR},
|
||||||
steps = #{steps,jdbcType=LONGVARCHAR}
|
demand_name = #{demandName,jdbcType=VARCHAR},
|
||||||
|
remark = #{remark,jdbcType=LONGVARCHAR},
|
||||||
|
steps = #{steps,jdbcType=LONGVARCHAR}
|
||||||
where id = #{id,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
</update>
|
</update>
|
||||||
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestCase">
|
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestCase">
|
||||||
update test_case
|
update test_case
|
||||||
set node_id = #{nodeId,jdbcType=VARCHAR},
|
set node_id = #{nodeId,jdbcType=VARCHAR},
|
||||||
node_path = #{nodePath,jdbcType=VARCHAR},
|
node_path = #{nodePath,jdbcType=VARCHAR},
|
||||||
project_id = #{projectId,jdbcType=VARCHAR},
|
project_id = #{projectId,jdbcType=VARCHAR},
|
||||||
`name` = #{name,jdbcType=VARCHAR},
|
`name` = #{name,jdbcType=VARCHAR},
|
||||||
`type` = #{type,jdbcType=VARCHAR},
|
`type` = #{type,jdbcType=VARCHAR},
|
||||||
maintainer = #{maintainer,jdbcType=VARCHAR},
|
maintainer = #{maintainer,jdbcType=VARCHAR},
|
||||||
priority = #{priority,jdbcType=VARCHAR},
|
priority = #{priority,jdbcType=VARCHAR},
|
||||||
`method` = #{method,jdbcType=VARCHAR},
|
`method` = #{method,jdbcType=VARCHAR},
|
||||||
prerequisite = #{prerequisite,jdbcType=VARCHAR},
|
prerequisite = #{prerequisite,jdbcType=VARCHAR},
|
||||||
create_time = #{createTime,jdbcType=BIGINT},
|
create_time = #{createTime,jdbcType=BIGINT},
|
||||||
update_time = #{updateTime,jdbcType=BIGINT},
|
update_time = #{updateTime,jdbcType=BIGINT},
|
||||||
test_id = #{testId,jdbcType=VARCHAR},
|
test_id = #{testId,jdbcType=VARCHAR},
|
||||||
sort = #{sort,jdbcType=INTEGER},
|
sort = #{sort,jdbcType=INTEGER},
|
||||||
num = #{num,jdbcType=INTEGER},
|
num = #{num,jdbcType=INTEGER},
|
||||||
other_test_name = #{otherTestName,jdbcType=VARCHAR},
|
other_test_name = #{otherTestName,jdbcType=VARCHAR},
|
||||||
review_status = #{reviewStatus,jdbcType=VARCHAR},
|
review_status = #{reviewStatus,jdbcType=VARCHAR},
|
||||||
tags = #{tags,jdbcType=VARCHAR}
|
tags = #{tags,jdbcType=VARCHAR},
|
||||||
|
demand_id = #{demandId,jdbcType=VARCHAR},
|
||||||
|
demand_name = #{demandName,jdbcType=VARCHAR}
|
||||||
where id = #{id,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
|
@ -110,15 +110,6 @@ public class EngineFactory {
|
||||||
final JSONArray jsonArray = JSONObject.parseArray(loadTest.getLoadConfiguration());
|
final JSONArray jsonArray = JSONObject.parseArray(loadTest.getLoadConfiguration());
|
||||||
|
|
||||||
for (int i = 0; i < jsonArray.size(); i++) {
|
for (int i = 0; i < jsonArray.size(); i++) {
|
||||||
if (jsonArray.get(i) instanceof Map) {
|
|
||||||
JSONObject o = jsonArray.getJSONObject(i);
|
|
||||||
String key = o.getString("key");
|
|
||||||
if ("TargetLevel".equals(key)) {
|
|
||||||
engineContext.addProperty(key, Math.round(((Integer) o.get("value")) * ratio));
|
|
||||||
} else {
|
|
||||||
engineContext.addProperty(key, o.get("value"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (jsonArray.get(i) instanceof List) {
|
if (jsonArray.get(i) instanceof List) {
|
||||||
JSONArray o = jsonArray.getJSONArray(i);
|
JSONArray o = jsonArray.getJSONArray(i);
|
||||||
for (int j = 0; j < o.size(); j++) {
|
for (int j = 0; j < o.size(); j++) {
|
||||||
|
|
|
@ -594,6 +594,100 @@ public class JmeterDocumentParser implements DocumentParser {
|
||||||
if (!hashTree.hasChildNodes()) {
|
if (!hashTree.hasChildNodes()) {
|
||||||
MSException.throwException(Translator.get("jmx_content_valid"));
|
MSException.throwException(Translator.get("jmx_content_valid"));
|
||||||
}
|
}
|
||||||
|
Object tgTypes = context.getProperty("tgType");
|
||||||
|
String tgType = "ThreadGroup";
|
||||||
|
if (tgTypes instanceof List) {
|
||||||
|
Object o = ((List<?>) tgTypes).get(0);
|
||||||
|
((List<?>) tgTypes).remove(0);
|
||||||
|
tgType = o.toString();
|
||||||
|
}
|
||||||
|
if (StringUtils.equals(tgType, THREAD_GROUP)) {
|
||||||
|
processBaseThreadGroup(threadGroup);
|
||||||
|
}
|
||||||
|
if (StringUtils.equals(tgType, CONCURRENCY_THREAD_GROUP)) {
|
||||||
|
processConcurrencyThreadGroup(threadGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processBaseThreadGroup(Element threadGroup) {
|
||||||
|
/*
|
||||||
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="登录" enabled="true">
|
||||||
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
||||||
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
|
||||||
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
||||||
|
<stringProp name="LoopController.loops">1</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
|
||||||
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
||||||
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
||||||
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
||||||
|
<boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
|
||||||
|
</ThreadGroup>
|
||||||
|
*/
|
||||||
|
removeChildren(threadGroup);
|
||||||
|
Document document = threadGroup.getOwnerDocument();
|
||||||
|
Object targetLevels = context.getProperty("TargetLevel");
|
||||||
|
String threads = "10";
|
||||||
|
if (targetLevels instanceof List) {
|
||||||
|
Object o = ((List<?>) targetLevels).get(0);
|
||||||
|
((List<?>) targetLevels).remove(0);
|
||||||
|
threads = o.toString();
|
||||||
|
}
|
||||||
|
Object rampUps = context.getProperty("RampUp");
|
||||||
|
String rampUp = "1";
|
||||||
|
if (rampUps instanceof List) {
|
||||||
|
Object o = ((List<?>) rampUps).get(0);
|
||||||
|
((List<?>) rampUps).remove(0);
|
||||||
|
rampUp = o.toString();
|
||||||
|
}
|
||||||
|
Object durations = context.getProperty("duration");
|
||||||
|
String duration = "2";
|
||||||
|
if (durations instanceof List) {
|
||||||
|
Object o = ((List<?>) durations).get(0);
|
||||||
|
((List<?>) durations).remove(0);
|
||||||
|
duration = o.toString();
|
||||||
|
}
|
||||||
|
Object deleteds = context.getProperty("deleted");
|
||||||
|
String deleted = "false";
|
||||||
|
if (deleteds instanceof List) {
|
||||||
|
Object o = ((List<?>) deleteds).get(0);
|
||||||
|
((List<?>) deleteds).remove(0);
|
||||||
|
deleted = o.toString();
|
||||||
|
}
|
||||||
|
Object enableds = context.getProperty("enabled");
|
||||||
|
String enabled = "true";
|
||||||
|
if (enableds instanceof List) {
|
||||||
|
Object o = ((List<?>) enableds).get(0);
|
||||||
|
((List<?>) enableds).remove(0);
|
||||||
|
enabled = o.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
threadGroup.setAttribute("enabled", enabled);
|
||||||
|
if (BooleanUtils.toBoolean(deleted)) {
|
||||||
|
threadGroup.setAttribute("enabled", "false");
|
||||||
|
}
|
||||||
|
Element elementProp = document.createElement("elementProp");
|
||||||
|
elementProp.setAttribute("name", "ThreadGroup.main_controller");
|
||||||
|
elementProp.setAttribute("elementType", "LoopController");
|
||||||
|
elementProp.setAttribute("guiclass", "LoopControlPanel");
|
||||||
|
elementProp.setAttribute("testclass", "LoopController");
|
||||||
|
elementProp.setAttribute("testname", "Loop Controller");
|
||||||
|
elementProp.setAttribute("enabled", "true");
|
||||||
|
elementProp.appendChild(createBoolProp(document, "LoopController.continue_forever", false));
|
||||||
|
elementProp.appendChild(createStringProp(document, "LoopController.loops", "-1"));
|
||||||
|
threadGroup.appendChild(elementProp);
|
||||||
|
threadGroup.appendChild(createStringProp(document, "ThreadGroup.on_sample_error", "continue"));
|
||||||
|
threadGroup.appendChild(createStringProp(document, "ThreadGroup.num_threads", threads));
|
||||||
|
threadGroup.appendChild(createStringProp(document, "ThreadGroup.ramp_time", rampUp));
|
||||||
|
threadGroup.appendChild(createStringProp(document, "ThreadGroup.duration", duration));
|
||||||
|
threadGroup.appendChild(createStringProp(document, "ThreadGroup.delay", "0"));
|
||||||
|
threadGroup.appendChild(createBoolProp(document, "ThreadGroup.scheduler", true));
|
||||||
|
threadGroup.appendChild(createBoolProp(document, "ThreadGroup.same_user_on_next_iteration", true));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processConcurrencyThreadGroup(Element threadGroup) {
|
||||||
// 重命名 tagName
|
// 重命名 tagName
|
||||||
Document document = threadGroup.getOwnerDocument();
|
Document document = threadGroup.getOwnerDocument();
|
||||||
document.renameNode(threadGroup, threadGroup.getNamespaceURI(), CONCURRENCY_THREAD_GROUP);
|
document.renameNode(threadGroup, threadGroup.getNamespaceURI(), CONCURRENCY_THREAD_GROUP);
|
||||||
|
|
|
@ -5,9 +5,11 @@ import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class EditTestPlanRequest extends TestPlanRequest {
|
public class EditTestPlanRequest extends TestPlanRequest {
|
||||||
private List<FileMetadata> updatedFileList;
|
private List<FileMetadata> updatedFileList;
|
||||||
|
private Map<String, Integer> fileSorts;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,11 @@ import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
@Getter
|
@Getter
|
||||||
public class SaveTestPlanRequest extends TestPlanRequest {
|
public class SaveTestPlanRequest extends TestPlanRequest {
|
||||||
private List<FileMetadata> updatedFileList;
|
private List<FileMetadata> updatedFileList;
|
||||||
|
private Map<String, Integer> fileSorts;
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,36 +135,37 @@ public class PerformanceTestService {
|
||||||
List<FileMetadata> importFiles = request.getUpdatedFileList();
|
List<FileMetadata> importFiles = request.getUpdatedFileList();
|
||||||
List<String> importFileIds = importFiles.stream().map(FileMetadata::getId).collect(Collectors.toList());
|
List<String> importFileIds = importFiles.stream().map(FileMetadata::getId).collect(Collectors.toList());
|
||||||
// 导入项目里其他的文件
|
// 导入项目里其他的文件
|
||||||
this.importFiles(importFileIds, loadTest.getId());
|
this.importFiles(importFileIds, loadTest.getId(), request.getFileSorts());
|
||||||
// 保存上传的文件
|
// 保存上传的文件
|
||||||
this.saveUploadFiles(files, loadTest.getId());
|
this.saveUploadFiles(files, loadTest.getId(), request.getFileSorts());
|
||||||
|
|
||||||
return loadTest.getId();
|
return loadTest.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveUploadFiles(List<MultipartFile> files, String testId) {
|
private void saveUploadFiles(List<MultipartFile> files, String testId, Map<String, Integer> fileSorts) {
|
||||||
if (files != null) {
|
if (files != null) {
|
||||||
files.forEach(file -> {
|
for (int i = 0; i < files.size(); i++) {
|
||||||
final FileMetadata fileMetadata = fileService.saveFile(file);
|
MultipartFile file = files.get(i);
|
||||||
|
final FileMetadata fileMetadata = fileService.saveFile(file, fileSorts.getOrDefault(file.getOriginalFilename(), i));
|
||||||
LoadTestFile loadTestFile = new LoadTestFile();
|
LoadTestFile loadTestFile = new LoadTestFile();
|
||||||
loadTestFile.setTestId(testId);
|
loadTestFile.setTestId(testId);
|
||||||
loadTestFile.setFileId(fileMetadata.getId());
|
loadTestFile.setFileId(fileMetadata.getId());
|
||||||
loadTestFileMapper.insert(loadTestFile);
|
loadTestFileMapper.insert(loadTestFile);
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void importFiles(List<String> importFileIds, String testId) {
|
private void importFiles(List<String> importFileIds, String testId, Map<String, Integer> fileSorts) {
|
||||||
importFileIds.forEach(fileId -> {
|
for (int i = 0; i < importFileIds.size(); i++) {
|
||||||
if (StringUtils.isBlank(fileId)) {
|
String fileId = importFileIds.get(i);
|
||||||
return;
|
|
||||||
}
|
|
||||||
FileMetadata fileMetadata = fileService.copyFile(fileId);
|
FileMetadata fileMetadata = fileService.copyFile(fileId);
|
||||||
|
fileMetadata.setSort(fileSorts.getOrDefault(fileMetadata.getName(), i));
|
||||||
|
fileService.updateFileMetadata(fileMetadata);
|
||||||
LoadTestFile loadTestFile = new LoadTestFile();
|
LoadTestFile loadTestFile = new LoadTestFile();
|
||||||
loadTestFile.setTestId(testId);
|
loadTestFile.setTestId(testId);
|
||||||
loadTestFile.setFileId(fileMetadata.getId());
|
loadTestFile.setFileId(fileMetadata.getId());
|
||||||
loadTestFileMapper.insert(loadTestFile);
|
loadTestFileMapper.insert(loadTestFile);
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private LoadTestWithBLOBs saveLoadTest(SaveTestPlanRequest request) {
|
private LoadTestWithBLOBs saveLoadTest(SaveTestPlanRequest request) {
|
||||||
|
@ -211,8 +212,8 @@ public class PerformanceTestService {
|
||||||
fileService.deleteFileByIds(deleteFileIds);
|
fileService.deleteFileByIds(deleteFileIds);
|
||||||
// 导入项目里其他的文件
|
// 导入项目里其他的文件
|
||||||
List<String> addFileIds = ListUtils.subtract(updatedFileIds, originFileIds);
|
List<String> addFileIds = ListUtils.subtract(updatedFileIds, originFileIds);
|
||||||
this.importFiles(addFileIds, request.getId());
|
this.importFiles(addFileIds, request.getId(), request.getFileSorts());
|
||||||
this.saveUploadFiles(files, request.getId());
|
this.saveUploadFiles(files, request.getId(), request.getFileSorts());
|
||||||
|
|
||||||
loadTest.setName(request.getName());
|
loadTest.setName(request.getName());
|
||||||
loadTest.setProjectId(request.getProjectId());
|
loadTest.setProjectId(request.getProjectId());
|
||||||
|
|
|
@ -47,6 +47,7 @@ public class FileService {
|
||||||
List<String> fileIds = loadTestFiles.stream().map(LoadTestFile::getFileId).collect(Collectors.toList());
|
List<String> fileIds = loadTestFiles.stream().map(LoadTestFile::getFileId).collect(Collectors.toList());
|
||||||
FileMetadataExample example = new FileMetadataExample();
|
FileMetadataExample example = new FileMetadataExample();
|
||||||
example.createCriteria().andIdIn(fileIds);
|
example.createCriteria().andIdIn(fileIds);
|
||||||
|
example.setOrderByClause("sort asc"); // 安装顺序排序
|
||||||
return fileMetadataMapper.selectByExample(example);
|
return fileMetadataMapper.selectByExample(example);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,6 +86,10 @@ public class FileService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileMetadata saveFile(MultipartFile file) {
|
public FileMetadata saveFile(MultipartFile file) {
|
||||||
|
return saveFile(file, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FileMetadata saveFile(MultipartFile file, Integer sort) {
|
||||||
final FileMetadata fileMetadata = new FileMetadata();
|
final FileMetadata fileMetadata = new FileMetadata();
|
||||||
fileMetadata.setId(UUID.randomUUID().toString());
|
fileMetadata.setId(UUID.randomUUID().toString());
|
||||||
fileMetadata.setName(file.getOriginalFilename());
|
fileMetadata.setName(file.getOriginalFilename());
|
||||||
|
@ -93,6 +98,7 @@ public class FileService {
|
||||||
fileMetadata.setUpdateTime(System.currentTimeMillis());
|
fileMetadata.setUpdateTime(System.currentTimeMillis());
|
||||||
FileType fileType = getFileType(fileMetadata.getName());
|
FileType fileType = getFileType(fileMetadata.getName());
|
||||||
fileMetadata.setType(fileType.name());
|
fileMetadata.setType(fileType.name());
|
||||||
|
fileMetadata.setSort(sort);
|
||||||
fileMetadataMapper.insert(fileMetadata);
|
fileMetadataMapper.insert(fileMetadata);
|
||||||
|
|
||||||
FileContent fileContent = new FileContent();
|
FileContent fileContent = new FileContent();
|
||||||
|
@ -107,7 +113,7 @@ public class FileService {
|
||||||
return fileMetadata;
|
return fileMetadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileMetadata saveFile(byte[] fileByte,String fileName,Long fileSize) {
|
public FileMetadata saveFile(byte[] fileByte, String fileName, Long fileSize) {
|
||||||
final FileMetadata fileMetadata = new FileMetadata();
|
final FileMetadata fileMetadata = new FileMetadata();
|
||||||
fileMetadata.setId(UUID.randomUUID().toString());
|
fileMetadata.setId(UUID.randomUUID().toString());
|
||||||
fileMetadata.setName(fileName);
|
fileMetadata.setName(fileName);
|
||||||
|
@ -175,4 +181,8 @@ public class FileService {
|
||||||
fileMetadataMapper.selectByExample(example);
|
fileMetadataMapper.selectByExample(example);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateFileMetadata(FileMetadata fileMetadata) {
|
||||||
|
fileMetadataMapper.updateByPrimaryKeySelective(fileMetadata);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package io.metersphere.track.controller;
|
||||||
|
|
||||||
|
import io.metersphere.track.dto.DemandDTO;
|
||||||
|
import io.metersphere.track.service.DemandService;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RequestMapping("demand")
|
||||||
|
@RestController
|
||||||
|
public class TestCaseDemandController {
|
||||||
|
@Resource
|
||||||
|
private DemandService DemandService;
|
||||||
|
|
||||||
|
@GetMapping("/list/{projectId}")
|
||||||
|
public List<DemandDTO> getDemandList(@PathVariable String projectId) {
|
||||||
|
return DemandService.getDemandList(projectId);
|
||||||
|
}
|
||||||
|
}
|
|
@ -45,8 +45,8 @@ public class TestCaseReviewController {
|
||||||
|
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
|
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
|
||||||
public void saveCaseReview(@RequestBody SaveTestCaseReviewRequest reviewRequest) {
|
public String saveCaseReview(@RequestBody SaveTestCaseReviewRequest reviewRequest) {
|
||||||
testCaseReviewService.saveTestCaseReview(reviewRequest);
|
return testCaseReviewService.saveTestCaseReview(reviewRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/project")
|
@PostMapping("/project")
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
package io.metersphere.track.dto;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
public class DemandDTO {
|
||||||
|
private String id;
|
||||||
|
private String name;
|
||||||
|
}
|
|
@ -41,7 +41,9 @@ public abstract class AbstractIssuePlatform implements IssuesPlatform {
|
||||||
protected String getPlatformConfig(String platform) {
|
protected String getPlatformConfig(String platform) {
|
||||||
SessionUser user = SessionUtils.getUser();
|
SessionUser user = SessionUtils.getUser();
|
||||||
String orgId = user.getLastOrganizationId();
|
String orgId = user.getLastOrganizationId();
|
||||||
|
/*
|
||||||
|
String orgId = "88aceecf-5764-4094-96a9-f82bd52e77ad";
|
||||||
|
*/
|
||||||
IntegrationRequest request = new IntegrationRequest();
|
IntegrationRequest request = new IntegrationRequest();
|
||||||
if (StringUtils.isBlank(orgId)) {
|
if (StringUtils.isBlank(orgId)) {
|
||||||
MSException.throwException("organization id is null");
|
MSException.throwException("organization id is null");
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package io.metersphere.track.issue;
|
package io.metersphere.track.issue;
|
||||||
|
|
||||||
import io.metersphere.base.domain.Issues;
|
import io.metersphere.base.domain.Issues;
|
||||||
|
import io.metersphere.track.dto.DemandDTO;
|
||||||
import io.metersphere.track.issue.domain.PlatformUser;
|
import io.metersphere.track.issue.domain.PlatformUser;
|
||||||
import io.metersphere.track.request.testcase.IssuesRequest;
|
import io.metersphere.track.request.testcase.IssuesRequest;
|
||||||
|
|
||||||
|
@ -10,18 +11,24 @@ public interface IssuesPlatform {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取平台相关联的缺陷
|
* 获取平台相关联的缺陷
|
||||||
|
*
|
||||||
* @return platform issues list
|
* @return platform issues list
|
||||||
*/
|
*/
|
||||||
List<Issues> getIssue();
|
List<Issues> getIssue();
|
||||||
|
|
||||||
|
/*获取平台相关需求*/
|
||||||
|
List<DemandDTO> getDemandList(String projectId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加缺陷到缺陷平台
|
* 添加缺陷到缺陷平台
|
||||||
|
*
|
||||||
* @param issuesRequest issueRequest
|
* @param issuesRequest issueRequest
|
||||||
*/
|
*/
|
||||||
void addIssue(IssuesRequest issuesRequest);
|
void addIssue(IssuesRequest issuesRequest);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除缺陷平台缺陷
|
* 删除缺陷平台缺陷
|
||||||
|
*
|
||||||
* @param id issue id
|
* @param id issue id
|
||||||
*/
|
*/
|
||||||
void deleteIssue(String id);
|
void deleteIssue(String id);
|
||||||
|
|
|
@ -7,6 +7,7 @@ import io.metersphere.commons.constants.IssuesManagePlatform;
|
||||||
import io.metersphere.commons.exception.MSException;
|
import io.metersphere.commons.exception.MSException;
|
||||||
import io.metersphere.commons.utils.EncryptUtils;
|
import io.metersphere.commons.utils.EncryptUtils;
|
||||||
import io.metersphere.commons.utils.LogUtil;
|
import io.metersphere.commons.utils.LogUtil;
|
||||||
|
import io.metersphere.track.dto.DemandDTO;
|
||||||
import io.metersphere.track.issue.domain.PlatformUser;
|
import io.metersphere.track.issue.domain.PlatformUser;
|
||||||
import io.metersphere.track.request.testcase.IssuesRequest;
|
import io.metersphere.track.request.testcase.IssuesRequest;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
@ -78,6 +79,11 @@ public class JiraPlatform extends AbstractIssuePlatform {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DemandDTO> getDemandList(String projectId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addIssue(IssuesRequest issuesRequest) {
|
public void addIssue(IssuesRequest issuesRequest) {
|
||||||
String config = getPlatformConfig(IssuesManagePlatform.Jira.toString());
|
String config = getPlatformConfig(IssuesManagePlatform.Jira.toString());
|
||||||
|
|
|
@ -5,6 +5,7 @@ import io.metersphere.base.domain.TestCaseIssues;
|
||||||
import io.metersphere.commons.constants.IssuesManagePlatform;
|
import io.metersphere.commons.constants.IssuesManagePlatform;
|
||||||
import io.metersphere.commons.user.SessionUser;
|
import io.metersphere.commons.user.SessionUser;
|
||||||
import io.metersphere.commons.utils.SessionUtils;
|
import io.metersphere.commons.utils.SessionUtils;
|
||||||
|
import io.metersphere.track.dto.DemandDTO;
|
||||||
import io.metersphere.track.issue.domain.PlatformUser;
|
import io.metersphere.track.issue.domain.PlatformUser;
|
||||||
import io.metersphere.track.request.testcase.IssuesRequest;
|
import io.metersphere.track.request.testcase.IssuesRequest;
|
||||||
|
|
||||||
|
@ -22,6 +23,11 @@ public class LocalPlatform extends AbstractIssuePlatform {
|
||||||
return extIssuesMapper.getIssues(testCaseId, IssuesManagePlatform.Local.toString());
|
return extIssuesMapper.getIssues(testCaseId, IssuesManagePlatform.Local.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DemandDTO> getDemandList(String projectId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addIssue(IssuesRequest issuesRequest) {
|
public void addIssue(IssuesRequest issuesRequest) {
|
||||||
SessionUser user = SessionUtils.getUser();
|
SessionUser user = SessionUtils.getUser();
|
||||||
|
|
|
@ -9,6 +9,7 @@ import io.metersphere.commons.exception.MSException;
|
||||||
import io.metersphere.commons.utils.LogUtil;
|
import io.metersphere.commons.utils.LogUtil;
|
||||||
import io.metersphere.commons.utils.SessionUtils;
|
import io.metersphere.commons.utils.SessionUtils;
|
||||||
import io.metersphere.controller.ResultHolder;
|
import io.metersphere.controller.ResultHolder;
|
||||||
|
import io.metersphere.track.dto.DemandDTO;
|
||||||
import io.metersphere.track.issue.domain.PlatformUser;
|
import io.metersphere.track.issue.domain.PlatformUser;
|
||||||
import io.metersphere.track.request.testcase.IssuesRequest;
|
import io.metersphere.track.request.testcase.IssuesRequest;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
@ -64,6 +65,23 @@ public class TapdPlatform extends AbstractIssuePlatform {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DemandDTO> getDemandList(String projectId) {
|
||||||
|
System.out.println(projectId);
|
||||||
|
List<DemandDTO> demandList = new ArrayList<>();
|
||||||
|
String url = "https://api.tapd.cn/stories?workspace_id=" + projectId;
|
||||||
|
ResultHolder call = call(url);
|
||||||
|
String listJson = JSON.toJSONString(call.getData());
|
||||||
|
JSONArray jsonArray = JSON.parseArray(listJson);
|
||||||
|
System.out.println(jsonArray);
|
||||||
|
for (int i = 0; i < jsonArray.size(); i++) {
|
||||||
|
JSONObject o = jsonArray.getJSONObject(i);
|
||||||
|
DemandDTO demand = o.getObject("Story", DemandDTO.class);
|
||||||
|
demandList.add(demand);
|
||||||
|
}
|
||||||
|
return demandList;
|
||||||
|
}
|
||||||
|
|
||||||
private Issues getTapdIssues(String projectId, String issuesId) {
|
private Issues getTapdIssues(String projectId, String issuesId) {
|
||||||
String url = "https://api.tapd.cn/bugs?workspace_id=" + projectId + "&id=" + issuesId;
|
String url = "https://api.tapd.cn/bugs?workspace_id=" + projectId + "&id=" + issuesId;
|
||||||
ResultHolder call = call(url);
|
ResultHolder call = call(url);
|
||||||
|
@ -208,4 +226,5 @@ public class TapdPlatform extends AbstractIssuePlatform {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import io.metersphere.base.domain.*;
|
||||||
import io.metersphere.commons.constants.IssuesManagePlatform;
|
import io.metersphere.commons.constants.IssuesManagePlatform;
|
||||||
import io.metersphere.commons.exception.MSException;
|
import io.metersphere.commons.exception.MSException;
|
||||||
import io.metersphere.commons.utils.LogUtil;
|
import io.metersphere.commons.utils.LogUtil;
|
||||||
|
import io.metersphere.track.dto.DemandDTO;
|
||||||
import io.metersphere.track.issue.domain.PlatformUser;
|
import io.metersphere.track.issue.domain.PlatformUser;
|
||||||
import io.metersphere.track.issue.domain.ZentaoBuild;
|
import io.metersphere.track.issue.domain.ZentaoBuild;
|
||||||
import io.metersphere.track.request.testcase.IssuesRequest;
|
import io.metersphere.track.request.testcase.IssuesRequest;
|
||||||
|
@ -85,6 +86,11 @@ public class ZentaoPlatform extends AbstractIssuePlatform {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DemandDTO> getDemandList(String projectId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private Issues getZentaoIssues(String bugId) {
|
private Issues getZentaoIssues(String bugId) {
|
||||||
String session = login();
|
String session = login();
|
||||||
HttpEntity<MultiValueMap> requestEntity = new HttpEntity<>(new HttpHeaders());
|
HttpEntity<MultiValueMap> requestEntity = new HttpEntity<>(new HttpHeaders());
|
||||||
|
|
|
@ -0,0 +1,76 @@
|
||||||
|
package io.metersphere.track.service;
|
||||||
|
|
||||||
|
import io.metersphere.base.domain.Issues;
|
||||||
|
import io.metersphere.base.domain.Project;
|
||||||
|
import io.metersphere.base.mapper.ProjectMapper;
|
||||||
|
import io.metersphere.commons.constants.IssuesManagePlatform;
|
||||||
|
import io.metersphere.commons.user.SessionUser;
|
||||||
|
import io.metersphere.commons.utils.SessionUtils;
|
||||||
|
import io.metersphere.service.ProjectService;
|
||||||
|
import io.metersphere.track.dto.DemandDTO;
|
||||||
|
import io.metersphere.track.issue.AbstractIssuePlatform;
|
||||||
|
import io.metersphere.track.issue.IssueFactory;
|
||||||
|
import io.metersphere.track.request.testcase.IssuesRequest;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class DemandService {
|
||||||
|
@Resource
|
||||||
|
private ProjectService projectService;
|
||||||
|
@Resource
|
||||||
|
private IssuesService issuesService;
|
||||||
|
@Resource
|
||||||
|
private ProjectMapper projectMapper;
|
||||||
|
|
||||||
|
public List<DemandDTO> getDemandList(String projectId) {
|
||||||
|
Project project = projectMapper.selectByPrimaryKey(projectId);
|
||||||
|
SessionUser user = SessionUtils.getUser();
|
||||||
|
/*
|
||||||
|
String orgId = "88aceecf-5764-4094-96a9-f82bd52e77ad";
|
||||||
|
*/
|
||||||
|
String orgId = user.getLastOrganizationId();
|
||||||
|
boolean tapd = issuesService.isIntegratedPlatform(orgId, IssuesManagePlatform.Tapd.toString());
|
||||||
|
boolean jira = issuesService.isIntegratedPlatform(orgId, IssuesManagePlatform.Jira.toString());
|
||||||
|
boolean zentao = issuesService.isIntegratedPlatform(orgId, IssuesManagePlatform.Zentao.toString());
|
||||||
|
List<DemandDTO> list = new ArrayList<>();
|
||||||
|
List<String> platforms = new ArrayList<>();
|
||||||
|
IssuesRequest issueRequest = new IssuesRequest();
|
||||||
|
if (tapd) {
|
||||||
|
// 是否关联了项目
|
||||||
|
String tapdId = project.getTapdId();
|
||||||
|
if (StringUtils.isNotBlank(tapdId)) {
|
||||||
|
platforms.add(IssuesManagePlatform.Tapd.name());
|
||||||
|
}
|
||||||
|
issueRequest.setProjectId(tapdId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jira) {
|
||||||
|
String jiraKey = project.getJiraKey();
|
||||||
|
if (StringUtils.isNotBlank(jiraKey)) {
|
||||||
|
platforms.add(IssuesManagePlatform.Jira.name());
|
||||||
|
}
|
||||||
|
issueRequest.setProjectId(jiraKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (zentao) {
|
||||||
|
String zentaoId = project.getZentaoId();
|
||||||
|
if (StringUtils.isNotBlank(zentaoId)) {
|
||||||
|
platforms.add(IssuesManagePlatform.Zentao.name());
|
||||||
|
}
|
||||||
|
issueRequest.setProjectId(zentaoId);
|
||||||
|
}
|
||||||
|
List<AbstractIssuePlatform> platformList = IssueFactory.createPlatforms(platforms, issueRequest);
|
||||||
|
platformList.forEach(platform -> {
|
||||||
|
List<DemandDTO> demand = platform.getDemandList(issueRequest.getProjectId());
|
||||||
|
list.addAll(demand);
|
||||||
|
});
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
|
@ -78,7 +78,7 @@ public class TestCaseReviewService {
|
||||||
@Resource
|
@Resource
|
||||||
private SystemParameterService systemParameterService;
|
private SystemParameterService systemParameterService;
|
||||||
|
|
||||||
public void saveTestCaseReview(SaveTestCaseReviewRequest reviewRequest) {
|
public String saveTestCaseReview(SaveTestCaseReviewRequest reviewRequest) {
|
||||||
checkCaseReviewExist(reviewRequest);
|
checkCaseReviewExist(reviewRequest);
|
||||||
String reviewId = UUID.randomUUID().toString();
|
String reviewId = UUID.randomUUID().toString();
|
||||||
List<String> userIds = reviewRequest.getUserIds();//执行人
|
List<String> userIds = reviewRequest.getUserIds();//执行人
|
||||||
|
@ -109,6 +109,7 @@ public class TestCaseReviewService {
|
||||||
.event(NoticeConstants.Event.CREATE)
|
.event(NoticeConstants.Event.CREATE)
|
||||||
.build();
|
.build();
|
||||||
noticeSendService.send(NoticeConstants.TaskType.REVIEW_TASK, noticeModel);
|
noticeSendService.send(NoticeConstants.TaskType.REVIEW_TASK, noticeModel);
|
||||||
|
return reviewRequest.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
//评审内容
|
//评审内容
|
||||||
|
|
|
@ -100,6 +100,8 @@ public class TestCaseService {
|
||||||
testCase.setUpdateTime(System.currentTimeMillis());
|
testCase.setUpdateTime(System.currentTimeMillis());
|
||||||
testCase.setNum(getNextNum(testCase.getProjectId()));
|
testCase.setNum(getNextNum(testCase.getProjectId()));
|
||||||
testCase.setReviewStatus(TestCaseReviewStatus.Prepare.name());
|
testCase.setReviewStatus(TestCaseReviewStatus.Prepare.name());
|
||||||
|
testCase.setDemandId(testCase.getDemandId());
|
||||||
|
testCase.setDemandName(testCase.getDemandName());
|
||||||
testCaseMapper.insert(testCase);
|
testCaseMapper.insert(testCase);
|
||||||
return testCase;
|
return testCase;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,24 @@ CREATE TABLE IF NOT EXISTS `api_document_share` (
|
||||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
-- test_case_review add coloumn
|
-- test_case_review add coloumn
|
||||||
|
ALTER TABLE test_case_review
|
||||||
|
ADD tags VARCHAR(2000) NULL;
|
||||||
|
|
||||||
|
-- swagger_url_project
|
||||||
|
alter table swagger_url_project
|
||||||
|
modify module_id varchar(120) null;
|
||||||
|
|
||||||
|
-- add_test_case
|
||||||
|
alter table test_case
|
||||||
|
add demand_id varchar(50) null;
|
||||||
|
|
||||||
|
alter table test_case
|
||||||
|
add demand_name varchar(999) null;
|
||||||
|
-- test_case_review add column
|
||||||
ALTER TABLE test_case_review ADD tags VARCHAR(2000) NULL;
|
ALTER TABLE test_case_review ADD tags VARCHAR(2000) NULL;
|
||||||
|
|
||||||
-- alter test_plan_api_scenario
|
-- alter test_plan_api_scenario
|
||||||
alter table test_plan_api_scenario change environment_id environment longtext null comment 'Relevance environment';
|
alter table test_plan_api_scenario change environment_id environment longtext null comment 'Relevance environment';
|
||||||
|
|
||||||
|
-- file add sort column
|
||||||
|
alter table file_metadata add sort int default 0;
|
|
@ -64,13 +64,14 @@
|
||||||
|
|
||||||
<!--要生成的数据库表 -->
|
<!--要生成的数据库表 -->
|
||||||
|
|
||||||
<table tableName="auth_source"/>
|
<!--<table tableName="auth_source"/>
|
||||||
<table tableName="swagger_url_project"/>
|
<table tableName="swagger_url_project"/>
|
||||||
<table tableName="user_header"/>
|
<table tableName="user_header"/>-->
|
||||||
<!--<table tableName="test_plan_api_scenario"/>-->
|
<!--<table tableName="test_plan_api_scenario"/>-->
|
||||||
<!--<table tableName="test_plan"/>-->
|
<!--<table tableName="test_plan"/>-->
|
||||||
<!--<table tableName="api_scenario_report"/>-->
|
<!--<table tableName="api_scenario_report"/>-->
|
||||||
<table tableName="test_case_review"/>
|
<!--<table tableName="test_case_review"/>-->
|
||||||
|
<table tableName="test_case"/>
|
||||||
|
|
||||||
</context>
|
</context>
|
||||||
</generatorConfiguration>
|
</generatorConfiguration>
|
|
@ -61,6 +61,11 @@ export const CASE_PRIORITY = [
|
||||||
{id: 'P3', label: 'P3'}
|
{id: 'P3', label: 'P3'}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
export const REVIEW_STATUS = [
|
||||||
|
{id: 'Prepare', label: '未评审'},
|
||||||
|
{id: 'Pass', label: '通过'},
|
||||||
|
{id: 'UnPass', label: '未通过'}
|
||||||
|
]
|
||||||
export const API_STATUS = [
|
export const API_STATUS = [
|
||||||
{id: 'Prepare', label: '未开始'},
|
{id: 'Prepare', label: '未开始'},
|
||||||
{id: 'Underway', label: '进行中'},
|
{id: 'Underway', label: '进行中'},
|
||||||
|
|
|
@ -49,25 +49,39 @@
|
||||||
size="mini"/>
|
size="mini"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<br>
|
<br>
|
||||||
<el-form-item :label="$t('load_test.ramp_up_time_within')">
|
<div v-if="threadGroup.tgType === 'com.blazemeter.jmeter.threads.concurrency.ConcurrencyThreadGroup'">
|
||||||
<el-input-number
|
<el-form-item :label="$t('load_test.ramp_up_time_within')">
|
||||||
:disabled="true"
|
<el-input-number
|
||||||
:min="1"
|
:disabled="true"
|
||||||
:max="threadGroup.duration"
|
:min="1"
|
||||||
v-model="threadGroup.rampUpTime"
|
:max="threadGroup.duration"
|
||||||
@change="calculateChart(threadGroup)"
|
v-model="threadGroup.rampUpTime"
|
||||||
size="mini"/>
|
@change="calculateChart(threadGroup)"
|
||||||
</el-form-item>
|
size="mini"/>
|
||||||
<el-form-item :label="$t('load_test.ramp_up_time_minutes')">
|
</el-form-item>
|
||||||
<el-input-number
|
<el-form-item :label="$t('load_test.ramp_up_time_minutes')">
|
||||||
:disabled="true"
|
<el-input-number
|
||||||
:min="1"
|
:disabled="true"
|
||||||
:max="Math.min(threadGroup.threadNumber, threadGroup.rampUpTime)"
|
:min="1"
|
||||||
v-model="threadGroup.step"
|
:max="Math.min(threadGroup.threadNumber, threadGroup.rampUpTime)"
|
||||||
@change="calculateChart(threadGroup)"
|
v-model="threadGroup.step"
|
||||||
size="mini"/>
|
@change="calculateChart(threadGroup)"
|
||||||
</el-form-item>
|
size="mini"/>
|
||||||
<el-form-item :label="$t('load_test.ramp_up_time_times')"/>
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('load_test.ramp_up_time_times')"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="threadGroup.tgType === 'ThreadGroup'">
|
||||||
|
<el-form-item :label="$t('load_test.ramp_up_time_within')">
|
||||||
|
<el-input-number
|
||||||
|
:disabled="true"
|
||||||
|
:min="1"
|
||||||
|
v-model="threadGroup.rampUpTime"
|
||||||
|
size="mini"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('load_test.ramp_up_time_seconds')"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div v-if="threadGroup.threadType === 'ITERATION'">
|
<div v-if="threadGroup.threadType === 'ITERATION'">
|
||||||
<el-form-item :label="$t('load_test.iterate_num')">
|
<el-form-item :label="$t('load_test.iterate_num')">
|
||||||
|
|
|
@ -190,6 +190,7 @@ export default {
|
||||||
}
|
}
|
||||||
// 基本配置
|
// 基本配置
|
||||||
this.test.updatedFileList = this.$refs.basicConfig.updatedFileList();
|
this.test.updatedFileList = this.$refs.basicConfig.updatedFileList();
|
||||||
|
this.test.fileSorts = this.$refs.basicConfig.fileSorts();
|
||||||
// 压力配置
|
// 压力配置
|
||||||
this.test.loadConfiguration = JSON.stringify(this.$refs.pressureConfig.convertProperty());
|
this.test.loadConfiguration = JSON.stringify(this.$refs.pressureConfig.convertProperty());
|
||||||
this.test.testResourcePoolId = this.$refs.pressureConfig.resourcePool;
|
this.test.testResourcePoolId = this.$refs.pressureConfig.resourcePool;
|
||||||
|
|
|
@ -121,7 +121,6 @@ export default {
|
||||||
|
|
||||||
if (this.loadType === 'resource') {
|
if (this.loadType === 'resource') {
|
||||||
rows.forEach(row => {
|
rows.forEach(row => {
|
||||||
this.fileList.push(row);
|
|
||||||
this.tableData.push(row);
|
this.tableData.push(row);
|
||||||
})
|
})
|
||||||
this.$success(this.$t('test_track.case.import.success'));
|
this.$success(this.$t('test_track.case.import.success'));
|
||||||
|
@ -142,7 +141,6 @@ export default {
|
||||||
this.scenarios.push(tg);
|
this.scenarios.push(tg);
|
||||||
});
|
});
|
||||||
let file = new File([d.jmx], d.name);
|
let file = new File([d.jmx], d.name);
|
||||||
this.fileList.push(file);
|
|
||||||
this.uploadList.push(file);
|
this.uploadList.push(file);
|
||||||
this.tableData.push({
|
this.tableData.push({
|
||||||
name: file.name,
|
name: file.name,
|
||||||
|
|
|
@ -138,7 +138,6 @@ export default {
|
||||||
this.scenarios.push(tg);
|
this.scenarios.push(tg);
|
||||||
});
|
});
|
||||||
let file = new File([d.jmx], d.name + ".jmx");
|
let file = new File([d.jmx], d.name + ".jmx");
|
||||||
this.fileList.push(file);
|
|
||||||
this.uploadList.push(file);
|
this.uploadList.push(file);
|
||||||
this.tableData.push({
|
this.tableData.push({
|
||||||
name: file.name,
|
name: file.name,
|
||||||
|
|
|
@ -46,7 +46,9 @@
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="ThreadGroup">
|
label="ThreadGroup">
|
||||||
<template v-slot:default="{row}">
|
<template v-slot:default="{row}">
|
||||||
{{ row.name.substring(row.name.lastIndexOf(".") + 1) }}
|
<el-select v-model="row.tgType" :placeholder="$t('commons.please_select')" size="small">
|
||||||
|
<el-option v-for="tg in threadGroupForSelect" :key="tg.tagName" :label="tg.name" :value="tg.testclass"></el-option>
|
||||||
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
@ -176,6 +178,20 @@ export default {
|
||||||
apiScenarios: [],
|
apiScenarios: [],
|
||||||
loadApiAutomationVisible: false,
|
loadApiAutomationVisible: false,
|
||||||
selectIds: new Set(),
|
selectIds: new Set(),
|
||||||
|
threadGroupForSelect: [
|
||||||
|
{
|
||||||
|
name: 'ThreadGroup',
|
||||||
|
tagName: 'ThreadGroup',
|
||||||
|
testclass: 'ThreadGroup',
|
||||||
|
guiclass: 'ThreadGroupGui'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ConcurrencyThreadGroup',
|
||||||
|
tagName: 'com.blazemeter.jmeter.threads.concurrency.ConcurrencyThreadGroup',
|
||||||
|
testclass: 'com.blazemeter.jmeter.threads.concurrency.ConcurrencyThreadGroup',
|
||||||
|
guiclass: "com.blazemeter.jmeter.threads.concurrency.ConcurrencyThreadGroupGui"
|
||||||
|
},
|
||||||
|
]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -348,6 +364,13 @@ export default {
|
||||||
updatedFileList() {
|
updatedFileList() {
|
||||||
return this.fileList;// 表示修改了已经上传的文件列表
|
return this.fileList;// 表示修改了已经上传的文件列表
|
||||||
},
|
},
|
||||||
|
fileSorts() {
|
||||||
|
let fileSorts = {};
|
||||||
|
this.tableData.forEach((f, index) => {
|
||||||
|
fileSorts[f.name] = index;
|
||||||
|
});
|
||||||
|
return fileSorts;
|
||||||
|
},
|
||||||
loadJMX() {
|
loadJMX() {
|
||||||
this.$refs.existFiles.open('jmx');
|
this.$refs.existFiles.open('jmx');
|
||||||
},
|
},
|
||||||
|
|
|
@ -62,25 +62,39 @@
|
||||||
size="mini"/>
|
size="mini"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<br>
|
<br>
|
||||||
<el-form-item :label="$t('load_test.ramp_up_time_within')">
|
<div v-if="threadGroup.tgType === 'com.blazemeter.jmeter.threads.concurrency.ConcurrencyThreadGroup'">
|
||||||
<el-input-number
|
<el-form-item :label="$t('load_test.ramp_up_time_within')">
|
||||||
:disabled="isReadOnly"
|
<el-input-number
|
||||||
:min="1"
|
:disabled="isReadOnly"
|
||||||
:max="threadGroup.duration"
|
:min="1"
|
||||||
v-model="threadGroup.rampUpTime"
|
:max="threadGroup.duration"
|
||||||
@change="calculateChart(threadGroup)"
|
v-model="threadGroup.rampUpTime"
|
||||||
size="mini"/>
|
@change="calculateChart(threadGroup)"
|
||||||
</el-form-item>
|
size="mini"/>
|
||||||
<el-form-item :label="$t('load_test.ramp_up_time_minutes')">
|
</el-form-item>
|
||||||
<el-input-number
|
<el-form-item :label="$t('load_test.ramp_up_time_minutes')">
|
||||||
:disabled="isReadOnly"
|
<el-input-number
|
||||||
:min="1"
|
:disabled="isReadOnly"
|
||||||
:max="Math.min(threadGroup.threadNumber, threadGroup.rampUpTime)"
|
:min="1"
|
||||||
v-model="threadGroup.step"
|
:max="Math.min(threadGroup.threadNumber, threadGroup.rampUpTime)"
|
||||||
@change="calculateChart(threadGroup)"
|
v-model="threadGroup.step"
|
||||||
size="mini"/>
|
@change="calculateChart(threadGroup)"
|
||||||
</el-form-item>
|
size="mini"/>
|
||||||
<el-form-item :label="$t('load_test.ramp_up_time_times')"/>
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('load_test.ramp_up_time_times')"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="threadGroup.tgType === 'ThreadGroup'">
|
||||||
|
<el-form-item :label="$t('load_test.ramp_up_time_within')">
|
||||||
|
<el-input-number
|
||||||
|
:disabled="isReadOnly"
|
||||||
|
:min="1"
|
||||||
|
v-model="threadGroup.rampUpTime"
|
||||||
|
size="mini"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('load_test.ramp_up_time_seconds')"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div v-if="threadGroup.threadType === 'ITERATION'">
|
<div v-if="threadGroup.threadType === 'ITERATION'">
|
||||||
<el-form-item :label="$t('load_test.iterate_num')">
|
<el-form-item :label="$t('load_test.iterate_num')">
|
||||||
|
@ -131,6 +145,7 @@ import MsChart from "@/business/components/common/chart/MsChart";
|
||||||
import {findThreadGroup} from "@/business/components/performance/test/model/ThreadGroup";
|
import {findThreadGroup} from "@/business/components/performance/test/model/ThreadGroup";
|
||||||
|
|
||||||
const HANDLER = "handler";
|
const HANDLER = "handler";
|
||||||
|
const THREAD_GROUP_TYPE = "tgType";
|
||||||
const TARGET_LEVEL = "TargetLevel";
|
const TARGET_LEVEL = "TargetLevel";
|
||||||
const RAMP_UP = "RampUp";
|
const RAMP_UP = "RampUp";
|
||||||
const ITERATE_RAMP_UP = "iterateRampUpTime";
|
const ITERATE_RAMP_UP = "iterateRampUpTime";
|
||||||
|
@ -265,6 +280,9 @@ export default {
|
||||||
case HANDLER:
|
case HANDLER:
|
||||||
this.threadGroups[i].handler = item.value;
|
this.threadGroups[i].handler = item.value;
|
||||||
break;
|
break;
|
||||||
|
case THREAD_GROUP_TYPE:
|
||||||
|
this.threadGroups[i].tgType = item.value;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -535,6 +553,7 @@ export default {
|
||||||
{key: ITERATE_RAMP_UP, value: this.threadGroups[i].iterateRampUp},
|
{key: ITERATE_RAMP_UP, value: this.threadGroups[i].iterateRampUp},
|
||||||
{key: ENABLED, value: this.threadGroups[i].enabled},
|
{key: ENABLED, value: this.threadGroups[i].enabled},
|
||||||
{key: DELETED, value: this.threadGroups[i].deleted},
|
{key: DELETED, value: this.threadGroups[i].deleted},
|
||||||
|
{key: THREAD_GROUP_TYPE, value: this.threadGroups[i].tgType},
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -29,6 +29,8 @@ export function findThreadGroup(jmxContent, handler) {
|
||||||
tg.deleted = 'false';
|
tg.deleted = 'false';
|
||||||
tg.handler = handler;
|
tg.handler = handler;
|
||||||
tg.enabled = tg.attributes.enabled;
|
tg.enabled = tg.attributes.enabled;
|
||||||
|
tg.tgType = tg.name;
|
||||||
|
tg.threadType = 'DURATION';
|
||||||
})
|
})
|
||||||
return threadGroups;
|
return threadGroups;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,40 +1,72 @@
|
||||||
<template>
|
<template>
|
||||||
<ms-container>
|
<ms-container v-if="renderComponent" v-loading="loading">
|
||||||
|
|
||||||
<ms-aside-container>
|
<ms-aside-container>
|
||||||
<test-case-node-tree
|
<test-case-node-tree
|
||||||
@nodeSelectEvent="nodeChange"
|
@nodeSelectEvent="nodeChange"
|
||||||
@refreshTable="refresh"
|
@refreshTable="refresh"
|
||||||
@setTreeNodes="setTreeNodes"
|
@setTreeNodes="setTreeNodes"
|
||||||
|
@exportTestCase="exportTestCase"
|
||||||
:type="'edit'"
|
:type="'edit'"
|
||||||
ref="nodeTree"/>
|
ref="nodeTree"/>
|
||||||
</ms-aside-container>
|
</ms-aside-container>
|
||||||
|
|
||||||
<ms-main-container>
|
<ms-main-container>
|
||||||
<test-case-list
|
<el-tabs v-model="activeName" @tab-click="addTab" @tab-remove="removeTab">
|
||||||
:module-options="moduleOptions"
|
<el-tab-pane name="default" :label="$t('api_test.definition.case_title')">
|
||||||
:select-node-ids="selectNodeIds"
|
<test-case-list
|
||||||
:select-parent-nodes="selectParentNodes"
|
:checkRedirectID="checkRedirectID"
|
||||||
:tree-nodes="treeNodes"
|
:module-options="moduleOptions"
|
||||||
@testCaseEdit="editTestCase"
|
:select-node-ids="selectNodeIds"
|
||||||
@testCaseCopy="copyTestCase"
|
:isRedirectEdit="isRedirectEdit"
|
||||||
@testCaseDetail="showTestCaseDetail"
|
:select-parent-nodes="selectParentNodes"
|
||||||
@refresh="refresh"
|
:tree-nodes="treeNodes"
|
||||||
@refreshAll="refreshAll"
|
@testCaseEdit="editTestCase"
|
||||||
@setCondition="setCondition"
|
@testCaseCopy="copyTestCase"
|
||||||
ref="testCaseList">
|
@testCaseDetail="showTestCaseDetail"
|
||||||
</test-case-list>
|
@refresh="refresh"
|
||||||
</ms-main-container>
|
@refreshAll="refreshAll"
|
||||||
|
@setCondition="setCondition"
|
||||||
|
ref="testCaseList">
|
||||||
|
</test-case-list>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane
|
||||||
|
:key="item.name"
|
||||||
|
v-for="(item) in tabs"
|
||||||
|
:label="item.label"
|
||||||
|
:name="item.name"
|
||||||
|
closable>
|
||||||
|
<div class="ms-api-scenario-div">
|
||||||
|
<test-case-edit
|
||||||
|
:currentTestCaseInfo="item.testCaseInfo"
|
||||||
|
@refresh="refreshTable"
|
||||||
|
@setModuleOptions="setModuleOptions"
|
||||||
|
:read-only="testCaseReadOnly"
|
||||||
|
:tree-nodes="treeNodes"
|
||||||
|
:select-node="selectNode"
|
||||||
|
:select-condition="condition"
|
||||||
|
:type="type"
|
||||||
|
@addTab="addTab"
|
||||||
|
ref="testCaseEdit">
|
||||||
|
</test-case-edit>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane name="add">
|
||||||
|
<template v-slot:label>
|
||||||
|
<el-dropdown @command="handleCommand" v-tester>
|
||||||
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" v-tester/>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item command="ADD">{{ $t('test_track.case.create') }}</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="CLOSE_ALL">{{ $t('api_test.definition.request.close_all_label') }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</template>
|
||||||
|
</el-tab-pane>
|
||||||
|
|
||||||
<test-case-edit
|
</el-tabs>
|
||||||
@refresh="refreshTable"
|
|
||||||
@setModuleOptions="setModuleOptions"
|
</ms-main-container>
|
||||||
:read-only="testCaseReadOnly"
|
|
||||||
:tree-nodes="treeNodes"
|
|
||||||
:select-node="selectNode"
|
|
||||||
:select-condition="condition"
|
|
||||||
ref="testCaseEditDialog">
|
|
||||||
</test-case-edit>
|
|
||||||
|
|
||||||
|
|
||||||
</ms-container>
|
</ms-container>
|
||||||
|
@ -50,7 +82,7 @@ import SelectMenu from "../common/SelectMenu";
|
||||||
import MsContainer from "../../common/components/MsContainer";
|
import MsContainer from "../../common/components/MsContainer";
|
||||||
import MsAsideContainer from "../../common/components/MsAsideContainer";
|
import MsAsideContainer from "../../common/components/MsAsideContainer";
|
||||||
import MsMainContainer from "../../common/components/MsMainContainer";
|
import MsMainContainer from "../../common/components/MsMainContainer";
|
||||||
import {checkoutTestManagerOrTestUser, getCurrentProjectID, hasRoles} from "../../../../common/js/utils";
|
import {checkoutTestManagerOrTestUser, getCurrentProjectID, getUUID, hasRoles} from "../../../../common/js/utils";
|
||||||
import TestCaseNodeTree from "../common/TestCaseNodeTree";
|
import TestCaseNodeTree from "../common/TestCaseNodeTree";
|
||||||
import {TrackEvent,LIST_CHANGE} from "@/business/components/common/head/ListEvent";
|
import {TrackEvent,LIST_CHANGE} from "@/business/components/common/head/ListEvent";
|
||||||
|
|
||||||
|
@ -72,18 +104,152 @@ export default {
|
||||||
testCaseReadOnly: true,
|
testCaseReadOnly: true,
|
||||||
selectNode: {},
|
selectNode: {},
|
||||||
condition: {},
|
condition: {},
|
||||||
moduleOptions: []
|
moduleOptions: [],
|
||||||
|
activeName: 'default',
|
||||||
|
tabs: [],
|
||||||
|
renderComponent:true,
|
||||||
|
loading: false,
|
||||||
|
type:''
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init(this.$route);
|
this.init(this.$route);
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
redirectID() {
|
||||||
|
this.renderComponent = false;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
// 在 DOM 中添加 my-component 组件
|
||||||
|
this.renderComponent = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
'$route'(to, from) {
|
'$route'(to, from) {
|
||||||
this.init(to);
|
this.init(to);
|
||||||
|
if (to.path.indexOf('/track/case/all') == -1) {
|
||||||
|
if (this.$refs && this.$refs.autoScenarioConfig) {
|
||||||
|
console.log(this.$refs.autoScenarioConfig);
|
||||||
|
this.$refs.autoScenarioConfig.forEach(item => {
|
||||||
|
/*item.removeListener();*/
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
checkRedirectID: function () {
|
||||||
|
let redirectIDParam = this.$route.params.redirectID;
|
||||||
|
this.changeRedirectParam(redirectIDParam);
|
||||||
|
return redirectIDParam;
|
||||||
|
},
|
||||||
|
isRedirectEdit: function () {
|
||||||
|
let redirectParam = this.$route.params.dataSelectRange;
|
||||||
|
this.checkRedirectEditPage(redirectParam);
|
||||||
|
return redirectParam;
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleCommand(e) {
|
||||||
|
switch (e) {
|
||||||
|
case "ADD":
|
||||||
|
this.addTab({name: 'add'});
|
||||||
|
break;
|
||||||
|
case "CLOSE_ALL":
|
||||||
|
this.handleTabClose();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this.addTab({name: 'add'});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeRedirectParam(redirectIDParam) {
|
||||||
|
this.redirectID = redirectIDParam;
|
||||||
|
if (redirectIDParam != null) {
|
||||||
|
if (this.redirectFlag == "none") {
|
||||||
|
this.activeName = "default";
|
||||||
|
this.addListener();
|
||||||
|
this.redirectFlag = "redirected";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.redirectFlag = "none";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
checkRedirectEditPage(redirectParam) {
|
||||||
|
if (redirectParam != null) {
|
||||||
|
let selectParamArr = redirectParam.split("edit:");
|
||||||
|
if (selectParamArr.length == 2) {
|
||||||
|
let scenarioId = selectParamArr[1];
|
||||||
|
let projectId = getCurrentProjectID();
|
||||||
|
//查找单条数据,跳转修改页面
|
||||||
|
/* let url = "/api/automation/list/" + 1 + "/" + 1;
|
||||||
|
this.$post(url, {id: scenarioId, projectId: projectId}, response => {
|
||||||
|
let data = response.data;
|
||||||
|
if (data != null) {
|
||||||
|
//如果树未加载
|
||||||
|
if (JSON.stringify(this.moduleOptions) === '{}') {
|
||||||
|
this.$refs.nodeTree.list();
|
||||||
|
}
|
||||||
|
let row = data.listObject[0];
|
||||||
|
row.tags = JSON.parse(row.tags);
|
||||||
|
this.editScenario(row);
|
||||||
|
}
|
||||||
|
});*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
addTab(tab) {
|
||||||
|
if (!getCurrentProjectID()) {
|
||||||
|
this.$warning(this.$t('commons.check_project_tip'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (tab.name === 'add') {
|
||||||
|
let label = this.$t('test_track.case.create');
|
||||||
|
let name = getUUID().substring(0, 8);
|
||||||
|
this.activeName = name;
|
||||||
|
this.type='add'
|
||||||
|
this.tabs.push({label: label, name: name, testCaseInfo: {testCaseModuleId: "", id: getUUID()}});
|
||||||
|
}
|
||||||
|
if (tab.name === 'edit') {
|
||||||
|
let label = this.$t('test_track.case.create');
|
||||||
|
let name = getUUID().substring(0, 8);
|
||||||
|
this.activeName = name;
|
||||||
|
label = tab.testCaseInfo.name;
|
||||||
|
this.tabs.push({label: label, name: name, testCaseInfo: tab.testCaseInfo});
|
||||||
|
}
|
||||||
|
if (this.$refs && this.$refs.testCaseEdit) {
|
||||||
|
this.$refs.testCaseEdit.forEach(item => {
|
||||||
|
/* item.removeListener();*/
|
||||||
|
}); // 删除所有tab的 ctrl + s 监听
|
||||||
|
this.addListener();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleTabClose() {
|
||||||
|
this.tabs = [];
|
||||||
|
this.activeName = "default";
|
||||||
|
this.refresh();
|
||||||
|
},
|
||||||
|
removeTab(targetName) {
|
||||||
|
this.tabs = this.tabs.filter(tab => tab.name !== targetName);
|
||||||
|
if (this.tabs.length > 0) {
|
||||||
|
this.activeName = this.tabs[this.tabs.length - 1].name;
|
||||||
|
this.addListener(); // 自动切换当前标签时,也添加监听
|
||||||
|
} else {
|
||||||
|
this.activeName = "default"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
exportTestCase(){
|
||||||
|
this.$refs.testCaseList.exportTestCase()
|
||||||
|
},
|
||||||
|
addListener() {
|
||||||
|
let index = this.tabs.findIndex(item => item.name === this.activeName); // 找到当前选中tab的index
|
||||||
|
if (index != -1) { // 为当前选中的tab添加监听
|
||||||
|
this.$nextTick(() => {
|
||||||
|
/*
|
||||||
|
this.$refs.testCaseEdit[index].addListener();
|
||||||
|
*/
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
init(route) {
|
init(route) {
|
||||||
let path = route.path;
|
let path = route.path;
|
||||||
if (path.indexOf("/track/case/edit") >= 0 || path.indexOf("/track/case/create") >= 0) {
|
if (path.indexOf("/track/case/edit") >= 0 || path.indexOf("/track/case/create") >= 0) {
|
||||||
|
@ -96,7 +262,9 @@ export default {
|
||||||
this.$warning(this.$t('commons.check_project_tip'));
|
this.$warning(this.$t('commons.check_project_tip'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
this.openRecentTestCaseEditDialog(caseId);
|
this.openRecentTestCaseEditDialog(caseId);
|
||||||
|
*/
|
||||||
this.$router.push('/track/case/all');
|
this.$router.push('/track/case/all');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -109,24 +277,32 @@ export default {
|
||||||
this.$refs.testCaseList.initTableData();
|
this.$refs.testCaseList.initTableData();
|
||||||
},
|
},
|
||||||
editTestCase(testCase) {
|
editTestCase(testCase) {
|
||||||
|
this.type="edit"
|
||||||
this.testCaseReadOnly = false;
|
this.testCaseReadOnly = false;
|
||||||
if (this.treeNodes.length < 1) {
|
if (this.treeNodes.length < 1) {
|
||||||
this.$warning(this.$t('test_track.case.create_module_first'));
|
this.$warning(this.$t('test_track.case.create_module_first'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$refs.testCaseEditDialog.open(testCase);
|
this.addTab({name: 'edit', testCaseInfo: testCase});
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
copyTestCase(testCase) {
|
copyTestCase(testCase) {
|
||||||
|
this.type="copy"
|
||||||
this.testCaseReadOnly = false;
|
this.testCaseReadOnly = false;
|
||||||
let item = {};
|
let item = {};
|
||||||
Object.assign(item, testCase);
|
testCase.isCopy = true;
|
||||||
item.name = '';
|
this.addTab({name: 'edit', testCaseInfo: testCase});
|
||||||
item.isCopy = true;
|
|
||||||
|
/*
|
||||||
this.$refs.testCaseEditDialog.open(item);
|
this.$refs.testCaseEditDialog.open(item);
|
||||||
|
*/
|
||||||
},
|
},
|
||||||
showTestCaseDetail(testCase) {
|
showTestCaseDetail(testCase) {
|
||||||
this.testCaseReadOnly = true;
|
this.testCaseReadOnly = true;
|
||||||
|
/*
|
||||||
this.$refs.testCaseEditDialog.open(testCase);
|
this.$refs.testCaseEditDialog.open(testCase);
|
||||||
|
*/
|
||||||
},
|
},
|
||||||
refresh() {
|
refresh() {
|
||||||
this.selectNodeIds = [];
|
this.selectNodeIds = [];
|
||||||
|
@ -143,11 +319,15 @@ export default {
|
||||||
// this.getProjectByCaseId(caseId);
|
// this.getProjectByCaseId(caseId);
|
||||||
this.$get('/test/case/get/' + caseId, response => {
|
this.$get('/test/case/get/' + caseId, response => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
|
/*
|
||||||
this.$refs.testCaseEditDialog.open(response.data);
|
this.$refs.testCaseEditDialog.open(response.data);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
/*
|
||||||
this.$refs.testCaseEditDialog.open();
|
this.$refs.testCaseEditDialog.open();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setTreeNodes(data) {
|
setTreeNodes(data) {
|
||||||
|
|
|
@ -0,0 +1,86 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog :visible.sync="dialogTableVisible">
|
||||||
|
|
||||||
|
<div v-loading="result.loading">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
:placeholder="$t('test_track.comment.send_comment')"
|
||||||
|
v-model="textarea"
|
||||||
|
maxlength="60"
|
||||||
|
show-word-limit
|
||||||
|
resize="none"
|
||||||
|
:autosize="{ minRows: 4, maxRows: 4}"
|
||||||
|
@keyup.ctrl.enter.native="sendComment"
|
||||||
|
:disabled="isReadOnly"
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
<el-button type="primary" size="mini" class="send-btn" @click="sendComment" :disabled="isReadOnly">
|
||||||
|
{{ $t('test_track.comment.send') }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ReviewCommentItem from "@/business/components/track/review/commom/ReviewCommentItem";
|
||||||
|
import {checkoutTestManagerOrTestUser, getUUID} from "@/common/js/utils";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "TestCaseComment",
|
||||||
|
components: {ReviewCommentItem},
|
||||||
|
props: {
|
||||||
|
caseId: String,
|
||||||
|
reviewId: String,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
result: {},
|
||||||
|
textarea: '',
|
||||||
|
isReadOnly: false,
|
||||||
|
dialogTableVisible: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.isReadOnly = !checkoutTestManagerOrTestUser();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
this.dialogTableVisible = true
|
||||||
|
},
|
||||||
|
sendComment() {
|
||||||
|
let comment = {};
|
||||||
|
comment.caseId = this.caseId;
|
||||||
|
comment.description = this.textarea;
|
||||||
|
if (!this.textarea) {
|
||||||
|
this.$warning(this.$t('test_track.comment.description_is_null'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.result = this.$post('/test/case/comment/save', comment, () => {
|
||||||
|
this.$success(this.$t('test_track.comment.send_success'));
|
||||||
|
this.refresh(comment.caseId);
|
||||||
|
this.textarea = '';
|
||||||
|
this.dialogTableVisible = false
|
||||||
|
});
|
||||||
|
},
|
||||||
|
refresh(id) {
|
||||||
|
this.$emit('getComments');
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.send-btn {
|
||||||
|
margin-top: 5px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-list {
|
||||||
|
overflow-y: scroll;
|
||||||
|
height: calc(100vh - 250px);
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,135 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog :close-on-click-modal="false" :title="$t('test_track.case.create')" :visible.sync="visible"
|
||||||
|
width="45%"
|
||||||
|
:destroy-on-close="true">
|
||||||
|
<el-form :model="testCaseForm" label-position="right" label-width="80px" size="small" :rules="rule"
|
||||||
|
ref="testCaseForm">
|
||||||
|
<el-form-item :label="$t('commons.name')" prop="name">
|
||||||
|
<el-input v-model="testCaseForm.name" autocomplete="off" :placeholder="$t('commons.name')"/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item :label="$t('api_test.automation.scenario.principal')" prop="principal">
|
||||||
|
<el-select v-model="testCaseForm.maintainer"
|
||||||
|
:placeholder="$t('api_test.automation.scenario.principal')" filterable size="small"
|
||||||
|
style="width: 100%">
|
||||||
|
<el-option
|
||||||
|
v-for="item in userOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.id + ' (' + item.name + ')'"
|
||||||
|
:value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item :label="$t('api_test.automation.scenario.follow_people')" prop="followPeople">
|
||||||
|
<el-select v-model="testCaseForm.followPeople"
|
||||||
|
:placeholder="$t('api_test.automation.scenario.follow_people')" filterable size="small"
|
||||||
|
style="width: 100%">
|
||||||
|
<el-option
|
||||||
|
v-for="item in userOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.id + ' (' + item.name + ')'"
|
||||||
|
:value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item :label="$t('commons.description')" prop="description" style="margin-bottom: 29px">
|
||||||
|
<el-input class="ms-http-textarea" v-model="testCaseForm.description"
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{ minRows: 2, maxRows: 10}"
|
||||||
|
:rows="2" size="small"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<template v-slot:footer>
|
||||||
|
<ms-dialog-footer
|
||||||
|
@cancel="visible = false"
|
||||||
|
:isShow="true"
|
||||||
|
title="编辑详情"
|
||||||
|
@saveAsEdit="saveTestCase(true)"
|
||||||
|
@confirm="saveTestCase">
|
||||||
|
</ms-dialog-footer>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {getCurrentProjectID, getCurrentUser, getUUID} from "@/common/js/utils";
|
||||||
|
import {WORKSPACE_ID} from "@/common/js/constants";
|
||||||
|
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "TestCaseCreate",
|
||||||
|
components: {MsDialogFooter},
|
||||||
|
data(){
|
||||||
|
return{
|
||||||
|
testCaseForm:{},
|
||||||
|
visible: false,
|
||||||
|
currentModule: {},
|
||||||
|
userOptions: [],
|
||||||
|
rule: {
|
||||||
|
name: [
|
||||||
|
{required: true, message: this.$t('test_track.case.input_name'), trigger: 'blur'},
|
||||||
|
{max: 100, message: this.$t('test_track.length_less_than') + '100', trigger: 'blur'}
|
||||||
|
],
|
||||||
|
principal: [{
|
||||||
|
required: true,
|
||||||
|
message: this.$t('api_test.automation.scenario.select_principal'),
|
||||||
|
trigger: 'change'
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
saveTestCase(){
|
||||||
|
this.$refs['testCaseForm'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
let path = "/api/automation/create";
|
||||||
|
this.setParameter();
|
||||||
|
/* this.$fileUpload(path, null, [], this.scenarioForm, () => {
|
||||||
|
this.visible = false;
|
||||||
|
if (saveAs) {
|
||||||
|
this.scenarioForm.request = JSON.stringify(this.scenarioForm.request);
|
||||||
|
this.$emit('saveAsEdit', this.scenarioForm);
|
||||||
|
} else {
|
||||||
|
this.$emit('refresh');
|
||||||
|
}
|
||||||
|
});*/
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
setParameter() {
|
||||||
|
this.scenarioForm.projectId = getCurrentProjectID();
|
||||||
|
this.scenarioForm.id = getUUID().substring(0, 8);
|
||||||
|
this.scenarioForm.protocol = this.currentProtocol;
|
||||||
|
|
||||||
|
if (this.currentModule && this.currentModule.id != "root") {
|
||||||
|
this.scenarioForm.modulePath = this.currentModule.method !== undefined ? this.currentModule.method : null;
|
||||||
|
this.scenarioForm.apiScenarioModuleId = this.currentModule.id;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getMaintainerOptions() {
|
||||||
|
let workspaceId = localStorage.getItem(WORKSPACE_ID);
|
||||||
|
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
|
||||||
|
this.userOptions = response.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
open(currentModule) {
|
||||||
|
this.scenarioForm = {principal: getCurrentUser().id};
|
||||||
|
this.currentModule = currentModule;
|
||||||
|
this.getMaintainerOptions();
|
||||||
|
this.visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -1,283 +1,302 @@
|
||||||
<template>
|
<template>
|
||||||
|
<el-card>
|
||||||
|
<div class="card-content">
|
||||||
|
<div class="ms-main-div" @click="showAll">
|
||||||
|
|
||||||
<el-dialog :close-on-click-modal="false" class="case-dialog"
|
<!--操作按钮-->
|
||||||
@close="close"
|
<div class="ms-opt-btn">
|
||||||
:title="operationType == 'edit' ? ( readOnly ? $t('test_track.case.view_case') : $t('test_track.case.edit_case')) : $t('test_track.case.create')"
|
<el-button v-if="type!='add'" id="inputDelay" type="primary" size="small" @click="saveCase" title="ctrl + s">
|
||||||
:visible.sync="dialogFormVisible" width="85%" v-if="dialogFormVisible">
|
{{ $t('commons.save') }}
|
||||||
|
</el-button>
|
||||||
|
<el-dropdown v-else split-button type="primary" class="ms-api-buttion" @click="handleCommand"
|
||||||
|
@command="handleCommand" size="small" style="float: right;margin-right: 20px">
|
||||||
|
{{ $t('commons.save') }}
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item command="ADD_AND_CREATE">{{ $t('test_track.case.save_create_continue') }}</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</div>
|
||||||
|
<el-form :model="form" :rules="rules" ref="caseFrom" v-loading="result.loading" class="case-form">
|
||||||
|
<div class="tip">{{ $t('test_track.plan_view.base_info') }}</div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="7">
|
||||||
|
<el-form-item
|
||||||
|
:placeholder="$t('test_track.case.input_name')"
|
||||||
|
:label="$t('test_track.case.name')"
|
||||||
|
:label-width="formLabelWidth"
|
||||||
|
prop="name">
|
||||||
|
<el-input :disabled="readOnly" v-model="form.name" size="small" class="ms-case-input"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<template v-slot:title>
|
<el-col :span="7">
|
||||||
<el-row>
|
<el-form-item :label="$t('test_track.case.module')" :label-width="formLabelWidth" prop="module">
|
||||||
<el-col :span="4">
|
<el-select
|
||||||
<span>
|
v-model="form.module"
|
||||||
{{
|
:disabled="readOnly"
|
||||||
operationType == 'edit' ? (readOnly ? $t('test_track.case.view_case') : $t('test_track.case.edit_case')) : $t('test_track.case.create')
|
:placeholder="$t('test_track.case.input_module')"
|
||||||
}}
|
filterable
|
||||||
</span>
|
class="ms-case-input">
|
||||||
</el-col>
|
<el-option
|
||||||
<el-col class="head-right" :span="19">
|
v-for="item in moduleOptions"
|
||||||
<ms-previous-next-button v-if="operationType == 'edit'" :index="index" @pre="handlePre" @next="handleNext" :list="testCases"/>
|
:key="item.id"
|
||||||
</el-col>
|
:label="item.path"
|
||||||
</el-row>
|
:value="item.id"
|
||||||
</template>
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="7">
|
||||||
|
<el-form-item label="状态" :label-width="formLabelWidth" prop="reviewStatus">
|
||||||
|
<el-select size="small" v-model="form.reviewStatus" class="ms-case-input">
|
||||||
|
<el-option v-for="item in options" :key="item.id" :label="item.label" :value="item.id"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="10">
|
<el-row>
|
||||||
<div>
|
<el-col :span="7">
|
||||||
<el-col :span="17">
|
<el-form-item :label="$t('commons.tag')" :label-width="formLabelWidth" prop="tag">
|
||||||
<el-card class="container">
|
<ms-input-tag :currentScenario="form" v-if="showInputTag" ref="tag" class="ms-case-input"/>
|
||||||
<el-form :model="form" :rules="rules" ref="caseFrom" v-loading="result.loading" class="case-form">
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="7">
|
||||||
|
<el-form-item label="责任人" :label-width="formLabelWidth" prop="maintainer">
|
||||||
|
<el-select :disabled="readOnly" v-model="form.maintainer"
|
||||||
|
:placeholder="$t('test_track.case.input_maintainer')" filterable class="ms-case-input">
|
||||||
|
<el-option
|
||||||
|
v-for="item in maintainerOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.id + ' (' + item.name + ')'"
|
||||||
|
:value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-row>
|
</el-col>
|
||||||
<el-col :span="8" :offset="1">
|
|
||||||
<el-form-item
|
|
||||||
:placeholder="$t('test_track.case.input_name')"
|
|
||||||
:label="$t('test_track.case.name')"
|
|
||||||
:label-width="formLabelWidth"
|
|
||||||
prop="name">
|
|
||||||
<el-input class="case-name" :disabled="readOnly" v-model="form.name"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="11" :offset="2">
|
<el-col :span="7">
|
||||||
<el-form-item :label="$t('test_track.case.module')" :label-width="formLabelWidth" prop="module">
|
<el-form-item :label="$t('test_track.case.priority')" :label-width="formLabelWidth" prop="priority">
|
||||||
<el-select
|
<el-select :disabled="readOnly" v-model="form.priority" clearable
|
||||||
v-model="form.module"
|
:placeholder="$t('test_track.case.input_priority')" class="ms-case-input">
|
||||||
|
<el-option label="P0" value="P0"></el-option>
|
||||||
|
<el-option label="P1" value="P1"></el-option>
|
||||||
|
<el-option label="P2" value="P2"></el-option>
|
||||||
|
<el-option label="P3" value="P3"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="7">
|
||||||
|
<el-form-item :label="$t('test_track.case.type')" :label-width="formLabelWidth" prop="type">
|
||||||
|
<el-select @change="typeChange" :disabled="readOnly" v-model="form.type"
|
||||||
|
:placeholder="$t('test_track.case.input_type')" class="ms-case-input">
|
||||||
|
<el-option :label="$t('commons.performance')" value="performance"></el-option>
|
||||||
|
<el-option :label="$t('commons.api')" value="api"></el-option>
|
||||||
|
<el-option :label="$t('api_test.home_page.failed_case_list.table_value.case_type.api')"
|
||||||
|
value="testcase"></el-option>
|
||||||
|
<el-option :label="$t('api_test.home_page.failed_case_list.table_value.case_type.scene')"
|
||||||
|
value="automation"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="7">
|
||||||
|
<el-form-item :label="$t('test_track.case.relate_test')" :label-width="formLabelWidth" prop="testId">
|
||||||
|
<el-select filterable :disabled="readOnly" v-model="form.testId"
|
||||||
|
:placeholder="$t('test_track.case.input_type')" class="ms-case-input">
|
||||||
|
<el-option
|
||||||
|
v-for="item in testOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="7" v-if="form.testId=='other'">
|
||||||
|
<el-form-item :label="$t('test_track.case.test_name')" :label-width="formLabelWidth" prop="testId">
|
||||||
|
<el-input v-model="form.otherTestName" :placeholder="$t('test_track.case.input_test_case')"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="10">
|
||||||
|
<el-form-item label="关联需求" :label-width="formLabelWidth" prop="demandId">
|
||||||
|
<el-select filterable :disabled="readOnly" v-model="form.demandId"
|
||||||
|
:placeholder="$t('test_track.case.input_type')" class="ms-case-input">
|
||||||
|
<el-option
|
||||||
|
v-for="item in demandOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="10">
|
||||||
|
<el-form-item label="需求名称" :label-width="formLabelWidth" prop="demandName" v-if="form.demandId=='other'">
|
||||||
|
<el-input v-model="form.demandName"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<div class="tip">步骤信息</div>
|
||||||
|
<el-row style="margin-top: 10px;">
|
||||||
|
<el-col :span="1" :offset="1">{{ $t('test_track.case.prerequisite') }}:</el-col>
|
||||||
|
<el-col :span="19">
|
||||||
|
<el-form-item prop="prerequisite">
|
||||||
|
<el-input :disabled="readOnly" v-model="form.prerequisite"
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{ minRows: 2, maxRows: 4}"
|
||||||
|
:rows="2"
|
||||||
|
:placeholder="$t('test_track.case.input_prerequisite')"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="1" :offset="1">{{ $t('test_track.case.steps') }}:</el-col>
|
||||||
|
<el-col :span="19">
|
||||||
|
<el-table
|
||||||
|
v-if="isStepTableAlive"
|
||||||
|
:data="form.steps"
|
||||||
|
class="tb-edit"
|
||||||
|
border
|
||||||
|
size="mini"
|
||||||
|
:default-sort="{prop: 'num', order: 'ascending'}"
|
||||||
|
highlight-current-row>
|
||||||
|
<el-table-column :label="$t('test_track.case.number')" prop="num" min-width="10%"></el-table-column>
|
||||||
|
<el-table-column :label="$t('test_track.case.step_desc')" prop="desc" min-width="35%">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<el-input
|
||||||
|
class="table-edit-input"
|
||||||
|
size="mini"
|
||||||
:disabled="readOnly"
|
:disabled="readOnly"
|
||||||
:placeholder="$t('test_track.case.input_module')"
|
type="textarea"
|
||||||
filterable>
|
:autosize="{ minRows: 1, maxRows: 6}"
|
||||||
<el-option
|
:rows="2"
|
||||||
v-for="item in moduleOptions"
|
v-model="scope.row.desc"
|
||||||
:key="item.id"
|
:placeholder="$t('commons.input_content')"
|
||||||
:label="item.path"
|
clearable/>
|
||||||
:value="item.id">
|
</template>
|
||||||
</el-option>
|
</el-table-column>
|
||||||
</el-select>
|
<el-table-column :label="$t('test_track.case.expected_results')" prop="result" min-width="35%">
|
||||||
</el-form-item>
|
<template v-slot:default="scope">
|
||||||
</el-col>
|
<el-input
|
||||||
</el-row>
|
class="table-edit-input"
|
||||||
|
size="mini"
|
||||||
<el-row>
|
:disabled="readOnly"
|
||||||
<el-col :span="10" :offset="1">
|
type="textarea"
|
||||||
<el-form-item :label="$t('test_track.case.maintainer')" :label-width="formLabelWidth" prop="maintainer">
|
:autosize="{ minRows: 1, maxRows: 6}"
|
||||||
<el-select :disabled="readOnly" v-model="form.maintainer"
|
:rows="2"
|
||||||
:placeholder="$t('test_track.case.input_maintainer')" filterable>
|
v-model="scope.row.result"
|
||||||
<el-option
|
:placeholder="$t('commons.input_content')"
|
||||||
v-for="item in maintainerOptions"
|
clearable/>
|
||||||
:key="item.id"
|
</template>
|
||||||
:label="item.id + ' (' + item.name + ')'"
|
</el-table-column>
|
||||||
:value="item.id">
|
<el-table-column :label="$t('commons.input_content')" min-width="25%">
|
||||||
</el-option>
|
<template v-slot:default="scope">
|
||||||
</el-select>
|
<el-button
|
||||||
</el-form-item>
|
type="primary"
|
||||||
</el-col>
|
:disabled="readOnly"
|
||||||
<el-col :span="12">
|
icon="el-icon-plus"
|
||||||
<el-form-item :label="$t('test_track.case.priority')" :label-width="formLabelWidth" prop="priority">
|
circle size="mini"
|
||||||
<el-select :disabled="readOnly" v-model="form.priority" clearable
|
@click="handleAddStep(scope.$index, scope.row)"></el-button>
|
||||||
:placeholder="$t('test_track.case.input_priority')">
|
<el-button
|
||||||
<el-option label="P0" value="P0"></el-option>
|
icon="el-icon-document-copy"
|
||||||
<el-option label="P1" value="P1"></el-option>
|
type="success"
|
||||||
<el-option label="P2" value="P2"></el-option>
|
:disabled="readOnly"
|
||||||
<el-option label="P3" value="P3"></el-option>
|
circle size="mini"
|
||||||
</el-select>
|
@click="handleCopyStep(scope.$index, scope.row)"></el-button>
|
||||||
</el-form-item>
|
<el-button
|
||||||
</el-col>
|
type="danger"
|
||||||
</el-row>
|
icon="el-icon-delete"
|
||||||
<el-row>
|
circle size="mini"
|
||||||
<el-col :span="10" :offset="1">
|
@click="handleDeleteStep(scope.$index, scope.row)"
|
||||||
<el-form-item :label="$t('commons.tag')" :label-width="formLabelWidth" prop="tag">
|
:disabled="readOnly || (scope.$index == 0 && form.steps.length <= 1)"></el-button>
|
||||||
<ms-input-tag :currentScenario="form" v-if="showInputTag" ref="tag"/>
|
</template>
|
||||||
</el-form-item>
|
</el-table-column>
|
||||||
</el-col>
|
</el-table>
|
||||||
</el-row>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
<el-row>
|
<el-row style="margin-top: 10px;">
|
||||||
<el-col :span="10" :offset="1">
|
<el-col :span="1" :offset="1">{{ $t('commons.remark') }}:</el-col>
|
||||||
<el-form-item :label="$t('test_track.case.type')" :label-width="formLabelWidth" prop="type">
|
<el-col :span="19">
|
||||||
<el-select @change="typeChange" :disabled="readOnly" v-model="form.type"
|
<el-form-item prop="remark">
|
||||||
:placeholder="$t('test_track.case.input_type')">
|
<el-input v-model="form.remark"
|
||||||
<el-option :label="$t('commons.functional')" value="functional"></el-option>
|
:autosize="{ minRows: 2, maxRows: 4}"
|
||||||
<el-option :label="$t('commons.performance')" value="performance"></el-option>
|
|
||||||
<el-option :label="$t('commons.api')" value="api"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item :label="$t('test_track.case.method')" :label-width="formLabelWidth" prop="method">
|
|
||||||
<el-select :disabled="readOnly" v-model="form.method" :placeholder="$t('test_track.case.input_method')">
|
|
||||||
<el-option
|
|
||||||
v-for="item in methodOptions"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row v-if="form.method && form.method == 'auto'">
|
|
||||||
<el-col :span="9" :offset="1">
|
|
||||||
<el-form-item :label="$t('test_track.case.relate_test')" :label-width="formLabelWidth" prop="testId">
|
|
||||||
<el-select filterable :disabled="readOnly" v-model="form.testId"
|
|
||||||
:placeholder="$t('test_track.case.input_type')">
|
|
||||||
<el-option
|
|
||||||
v-for="item in testOptions"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="9" :offset="1" v-if="form.testId=='other'">
|
|
||||||
<el-form-item :label="$t('test_track.case.test_name')" :label-width="formLabelWidth" prop="testId">
|
|
||||||
<el-input v-model="form.otherTestName" :placeholder="$t('test_track.case.input_test_case')"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row style="margin-top: 15px;">
|
|
||||||
<el-col :offset="2">{{ $t('test_track.case.prerequisite') }}:</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row type="flex" justify="center" style="margin-top: 10px;">
|
|
||||||
<el-col :span="20">
|
|
||||||
<el-form-item prop="prerequisite">
|
|
||||||
<el-input :disabled="readOnly" v-model="form.prerequisite"
|
|
||||||
type="textarea"
|
|
||||||
:autosize="{ minRows: 2, maxRows: 4}"
|
|
||||||
:rows="2"
|
|
||||||
:placeholder="$t('test_track.case.input_prerequisite')"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row v-if="form.method && form.method != 'auto'" style="margin-bottom: 10px">
|
|
||||||
<el-col :offset="2">{{ $t('test_track.case.steps') }}:</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row v-if="form.method && form.method != 'auto'" type="flex" justify="center">
|
|
||||||
<el-col :span="20">
|
|
||||||
<el-table
|
|
||||||
v-if="isStepTableAlive"
|
|
||||||
:data="form.steps"
|
|
||||||
class="tb-edit"
|
|
||||||
border
|
|
||||||
size="mini"
|
|
||||||
:default-sort="{prop: 'num', order: 'ascending'}"
|
|
||||||
highlight-current-row>
|
|
||||||
<el-table-column :label="$t('test_track.case.number')" prop="num" min-width="10%"></el-table-column>
|
|
||||||
<el-table-column :label="$t('test_track.case.step_desc')" prop="desc" min-width="35%">
|
|
||||||
<template v-slot:default="scope">
|
|
||||||
<el-input
|
|
||||||
class="table-edit-input"
|
|
||||||
size="mini"
|
|
||||||
:disabled="readOnly"
|
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:autosize="{ minRows: 1, maxRows: 6}"
|
:disabled="readOnly"
|
||||||
:rows="2"
|
:rows="2"
|
||||||
v-model="scope.row.desc"
|
:placeholder="$t('commons.input_content')"></el-input>
|
||||||
:placeholder="$t('commons.input_content')"
|
</el-form-item>
|
||||||
clearable/>
|
</el-col>
|
||||||
</template>
|
</el-row>
|
||||||
</el-table-column>
|
<div class="tip">其他信息</div>
|
||||||
<el-table-column :label="$t('test_track.case.expected_results')" prop="result" min-width="35%">
|
<el-row>
|
||||||
<template v-slot:default="scope">
|
<el-col :span="20" :offset="1">{{ $t('test_track.case.attachment') }}:</el-col>
|
||||||
<el-input
|
</el-row>
|
||||||
class="table-edit-input"
|
<el-row>
|
||||||
size="mini"
|
<el-col :span="19" :offset="2">
|
||||||
:disabled="readOnly"
|
<el-upload
|
||||||
type="textarea"
|
accept=".jpg,.jpeg,.png,.xlsx,.doc,.pdf,.docx"
|
||||||
:autosize="{ minRows: 1, maxRows: 6}"
|
action=""
|
||||||
:rows="2"
|
:show-file-list="false"
|
||||||
v-model="scope.row.result"
|
:before-upload="beforeUpload"
|
||||||
:placeholder="$t('commons.input_content')"
|
:http-request="handleUpload"
|
||||||
clearable/>
|
:on-exceed="handleExceed"
|
||||||
</template>
|
multiple
|
||||||
</el-table-column>
|
:limit="8"
|
||||||
<el-table-column :label="$t('commons.input_content')" min-width="25%">
|
:file-list="fileList">
|
||||||
<template v-slot:default="scope">
|
<el-button icon="el-icon-plus" size="mini"></el-button>
|
||||||
<el-button
|
<span slot="tip" class="el-upload__tip"> {{ $t('test_track.case.upload_tip') }} </span>
|
||||||
type="primary"
|
</el-upload>
|
||||||
:disabled="readOnly"
|
</el-col>
|
||||||
icon="el-icon-plus"
|
</el-row>
|
||||||
circle size="mini"
|
<el-row>
|
||||||
@click="handleAddStep(scope.$index, scope.row)"></el-button>
|
<el-col :span="19" :offset="2">
|
||||||
<el-button
|
<test-case-attachment :table-data="tableData"
|
||||||
icon="el-icon-document-copy"
|
:read-only="readOnly"
|
||||||
type="success"
|
:is-delete="true"
|
||||||
:disabled="readOnly"
|
@handleDelete="handleDelete"
|
||||||
circle size="mini"
|
/>
|
||||||
@click="handleCopyStep(scope.$index, scope.row)"></el-button>
|
</el-col>
|
||||||
<el-button
|
</el-row>
|
||||||
type="danger"
|
<el-row style="margin-top: 10px" v-if="type!='add'">
|
||||||
icon="el-icon-delete"
|
<el-col :span="20" :offset="1">{{ $t('test_track.review.comment') }}:
|
||||||
circle size="mini"
|
<el-button icon="el-icon-plus" type="mini" @click="openComment"></el-button>
|
||||||
@click="handleDeleteStep(scope.$index, scope.row)"
|
</el-col>
|
||||||
:disabled="readOnly || (scope.$index == 0 && form.steps.length <= 1)"></el-button>
|
</el-row>
|
||||||
</template>
|
<el-row v-if="type!='add'">
|
||||||
</el-table-column>
|
<el-col :span="20" :offset="1">
|
||||||
</el-table>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row style="margin-top: 15px;margin-bottom: 10px">
|
<review-comment-item v-for="(comment,index) in comments"
|
||||||
<el-col :offset="2">{{ $t('commons.remark') }}:</el-col>
|
:key="index"
|
||||||
</el-row>
|
:comment="comment"
|
||||||
<el-row type="flex" justify="center">
|
@refresh="getComments"/>
|
||||||
<el-col :span="20">
|
<div v-if="comments.length === 0" style="text-align: center">
|
||||||
<el-form-item prop="remark">
|
<i class="el-icon-chat-line-square" style="font-size: 15px;color: #8a8b8d;">
|
||||||
<el-input v-model="form.remark"
|
<span style="font-size: 15px; color: #8a8b8d;">
|
||||||
:autosize="{ minRows: 2, maxRows: 4}"
|
{{ $t('test_track.comment.no_comment') }}
|
||||||
type="textarea"
|
</span>
|
||||||
:disabled="readOnly"
|
</i>
|
||||||
:rows="2"
|
</div>
|
||||||
:placeholder="$t('commons.input_content')"></el-input>
|
</el-col>
|
||||||
</el-form-item>
|
</el-row>
|
||||||
</el-col>
|
<test-case-comment :case-id="form.id"
|
||||||
</el-row>
|
@getComments="getComments" ref="testCaseComment"/>
|
||||||
|
|
||||||
<el-row style="margin-top: 15px;margin-bottom: 10px">
|
</el-form>
|
||||||
<el-col :offset="2" :span="20">{{ $t('test_track.case.attachment') }}:
|
|
||||||
<el-upload
|
|
||||||
accept=".jpg,.jpeg,.png,.xlsx,.doc,.pdf,.docx"
|
|
||||||
action=""
|
|
||||||
:show-file-list="false"
|
|
||||||
:before-upload="beforeUpload"
|
|
||||||
:http-request="handleUpload"
|
|
||||||
:on-exceed="handleExceed"
|
|
||||||
multiple
|
|
||||||
:limit="8"
|
|
||||||
:file-list="fileList">
|
|
||||||
<el-button icon="el-icon-plus" size="mini"></el-button>
|
|
||||||
<span slot="tip" class="el-upload__tip"> {{ $t('test_track.case.upload_tip') }} </span>
|
|
||||||
</el-upload>
|
|
||||||
</el-col>
|
|
||||||
<el-col :offset="2" :span="20">
|
|
||||||
<test-case-attachment :table-data="tableData"
|
|
||||||
:read-only="readOnly"
|
|
||||||
:is-delete="true"
|
|
||||||
@handleDelete="handleDelete"
|
|
||||||
/>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
</el-form>
|
|
||||||
<el-row style="float: right; margin-bottom: 20px;margin-top: 20px">
|
|
||||||
<el-switch v-if="operationType == 'add'"
|
|
||||||
v-model="isCreateContinue"
|
|
||||||
:active-text="$t('test_track.case.save_create_continue')">
|
|
||||||
</el-switch>
|
|
||||||
<ms-dialog-footer v-if="!readOnly"
|
|
||||||
@cancel="dialogFormVisible = false"
|
|
||||||
@confirm="saveCase"/>
|
|
||||||
</el-row>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="7">
|
|
||||||
<case-comment :case-id="testCase ? testCase.id : ''" class="comment-card"/>
|
|
||||||
</el-col>
|
|
||||||
</div>
|
</div>
|
||||||
</el-row>
|
</div>
|
||||||
|
</el-card>
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
@ -295,12 +314,21 @@ import {buildNodePath} from "../../../api/definition/model/NodeTree";
|
||||||
import CaseComment from "@/business/components/track/case/components/CaseComment";
|
import CaseComment from "@/business/components/track/case/components/CaseComment";
|
||||||
import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag";
|
import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag";
|
||||||
import MsPreviousNextButton from "../../../common/components/MsPreviousNextButton";
|
import MsPreviousNextButton from "../../../common/components/MsPreviousNextButton";
|
||||||
|
import {ELEMENTS} from "@/business/components/api/automation/scenario/Setting";
|
||||||
|
import TestCaseComment from "@/business/components/track/case/components/TestCaseComment";
|
||||||
|
import ReviewCommentItem from "@/business/components/track/review/commom/ReviewCommentItem";
|
||||||
|
import {API_STATUS, REVIEW_STATUS} from "@/business/components/api/definition/model/JsonData";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestCaseEdit",
|
name: "TestCaseEdit",
|
||||||
components: {MsPreviousNextButton, MsInputTag, CaseComment, MsDialogFooter, TestCaseAttachment},
|
components: {
|
||||||
|
ReviewCommentItem,
|
||||||
|
TestCaseComment, MsPreviousNextButton, MsInputTag, CaseComment, MsDialogFooter, TestCaseAttachment
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
options: REVIEW_STATUS,
|
||||||
|
comments: [],
|
||||||
result: {},
|
result: {},
|
||||||
projectId: "",
|
projectId: "",
|
||||||
dialogFormVisible: false,
|
dialogFormVisible: false,
|
||||||
|
@ -321,10 +349,14 @@ export default {
|
||||||
}],
|
}],
|
||||||
remark: '',
|
remark: '',
|
||||||
tags: [],
|
tags: [],
|
||||||
|
demandId: '',
|
||||||
|
demandName: '',
|
||||||
},
|
},
|
||||||
|
readOnly: false,
|
||||||
moduleOptions: [],
|
moduleOptions: [],
|
||||||
maintainerOptions: [],
|
maintainerOptions: [],
|
||||||
testOptions: [],
|
testOptions: [],
|
||||||
|
demandOptions: [],
|
||||||
workspaceId: '',
|
workspaceId: '',
|
||||||
fileList: [],
|
fileList: [],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
@ -361,19 +393,27 @@ export default {
|
||||||
treeNodes: {
|
treeNodes: {
|
||||||
type: Array
|
type: Array
|
||||||
},
|
},
|
||||||
readOnly: {
|
currentTestCaseInfo: {},
|
||||||
type: Boolean,
|
setModuleOptions: {
|
||||||
default: true
|
type: Array
|
||||||
},
|
},
|
||||||
|
/*readOnly: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},*/
|
||||||
selectNode: {
|
selectNode: {
|
||||||
type: Object
|
type: Object
|
||||||
},
|
},
|
||||||
selectCondition: {
|
selectCondition: {
|
||||||
type: Object
|
type: Object
|
||||||
},
|
},
|
||||||
|
type: String
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getSelectOptions();
|
this.getSelectOptions();
|
||||||
|
if (this.type === 'edit' || this.type === 'copy') {
|
||||||
|
this.open(this.currentTestCaseInfo)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
treeNodes() {
|
treeNodes() {
|
||||||
|
@ -384,9 +424,46 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleCommand(e) {
|
||||||
|
if (e === "ADD_AND_CREATE") {
|
||||||
|
this.$refs['caseFrom'].validate((valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
this.saveCase();
|
||||||
|
} else {
|
||||||
|
this.saveCase();
|
||||||
|
let tab={}
|
||||||
|
tab.name='add'
|
||||||
|
this.$emit('addTab',tab)}
|
||||||
|
})
|
||||||
|
}else {
|
||||||
|
this.saveCase();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
openComment() {
|
||||||
|
this.$refs.testCaseComment.open()
|
||||||
|
},
|
||||||
|
getComments(testCase) {
|
||||||
|
let id = '';
|
||||||
|
if (testCase) {
|
||||||
|
id = testCase.id;
|
||||||
|
} else {
|
||||||
|
id = this.form.id;
|
||||||
|
}
|
||||||
|
this.result = this.$get('/test/case/comment/list/' + id, res => {
|
||||||
|
this.comments = res.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
showAll() {
|
||||||
|
if (!this.customizeVisible) {
|
||||||
|
this.operatingElements = ELEMENTS.get("ALL");
|
||||||
|
this.selectedTreeNode = undefined;
|
||||||
|
}
|
||||||
|
//this.reload();
|
||||||
|
},
|
||||||
reload() {
|
reload() {
|
||||||
this.isStepTableAlive = false;
|
this.isStepTableAlive = false;
|
||||||
this.$nextTick(() => (this.isStepTableAlive = true));
|
this.$nextTick(() => (this.isStepTableAlive = true));
|
||||||
|
console.log(this.form)
|
||||||
},
|
},
|
||||||
open(testCase) {
|
open(testCase) {
|
||||||
this.projectId = getCurrentProjectID();
|
this.projectId = getCurrentProjectID();
|
||||||
|
@ -401,7 +478,7 @@ export default {
|
||||||
//修改
|
//修改
|
||||||
this.operationType = 'edit';
|
this.operationType = 'edit';
|
||||||
//复制
|
//复制
|
||||||
if (testCase.name === '') {
|
if (this.type === 'copy') {
|
||||||
this.operationType = 'add';
|
this.operationType = 'add';
|
||||||
this.setFormData(testCase);
|
this.setFormData(testCase);
|
||||||
this.setTestCaseExtInfo(testCase);
|
this.setTestCaseExtInfo(testCase);
|
||||||
|
@ -427,7 +504,6 @@ export default {
|
||||||
this.getSelectOptions();
|
this.getSelectOptions();
|
||||||
this.reload();
|
this.reload();
|
||||||
}
|
}
|
||||||
this.dialogFormVisible = true;
|
|
||||||
},
|
},
|
||||||
handlePre() {
|
handlePre() {
|
||||||
this.index--;
|
this.index--;
|
||||||
|
@ -534,11 +610,17 @@ export default {
|
||||||
this.dialogFormVisible = false;
|
this.dialogFormVisible = false;
|
||||||
},
|
},
|
||||||
saveCase() {
|
saveCase() {
|
||||||
|
/*
|
||||||
|
document.getElementById("inputDelay").focus();
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 保存前在input框自动失焦,以免保存失败
|
||||||
this.$refs['caseFrom'].validate((valid) => {
|
this.$refs['caseFrom'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let param = this.buildParam();
|
let param = this.buildParam();
|
||||||
if (this.validate(param)) {
|
if (this.validate(param)) {
|
||||||
let option = this.getOption(param);
|
let option = this.getOption(param);
|
||||||
|
console.log(option)
|
||||||
this.result = this.$request(option, () => {
|
this.result = this.$request(option, () => {
|
||||||
this.$success(this.$t('commons.save_success'));
|
this.$success(this.$t('commons.save_success'));
|
||||||
if (this.operationType == 'add' && this.isCreateContinue) {
|
if (this.operationType == 'add' && this.isCreateContinue) {
|
||||||
|
@ -569,6 +651,7 @@ export default {
|
||||||
},
|
},
|
||||||
buildParam() {
|
buildParam() {
|
||||||
let param = {};
|
let param = {};
|
||||||
|
|
||||||
Object.assign(param, this.form);
|
Object.assign(param, this.form);
|
||||||
param.steps = JSON.stringify(this.form.steps);
|
param.steps = JSON.stringify(this.form.steps);
|
||||||
param.nodeId = this.form.module;
|
param.nodeId = this.form.module;
|
||||||
|
@ -581,9 +664,7 @@ export default {
|
||||||
param.projectId = this.projectId;
|
param.projectId = this.projectId;
|
||||||
}
|
}
|
||||||
param.name = param.name.trim();
|
param.name = param.name.trim();
|
||||||
if (param.method != 'auto') {
|
|
||||||
param.testId = null;
|
|
||||||
}
|
|
||||||
if (this.form.tags instanceof Array) {
|
if (this.form.tags instanceof Array) {
|
||||||
this.form.tags = JSON.stringify(this.form.tags);
|
this.form.tags = JSON.stringify(this.form.tags);
|
||||||
}
|
}
|
||||||
|
@ -591,8 +672,14 @@ export default {
|
||||||
return param;
|
return param;
|
||||||
},
|
},
|
||||||
getOption(param) {
|
getOption(param) {
|
||||||
|
console.log(this.type)
|
||||||
|
console.log("3452")
|
||||||
let formData = new FormData();
|
let formData = new FormData();
|
||||||
let url = '/test/case/' + this.operationType;
|
let type = this.type
|
||||||
|
if (this.type === 'copy') {
|
||||||
|
type = 'add'
|
||||||
|
}
|
||||||
|
let url = '/test/case/' + type;
|
||||||
this.uploadList.forEach(f => {
|
this.uploadList.forEach(f => {
|
||||||
formData.append("file", f);
|
formData.append("file", f);
|
||||||
});
|
});
|
||||||
|
@ -654,21 +741,33 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getTestOptions() {
|
getTestOptions() {
|
||||||
|
this.projectId = getCurrentProjectID()
|
||||||
this.testOptions = [];
|
this.testOptions = [];
|
||||||
if (this.projectId && this.form.type != '' && this.form.type != 'functional') {
|
let url = '';
|
||||||
this.result = this.$get('/' + this.form.type + '/list/' + this.projectId, response => {
|
if (this.form.type === 'testcase' || this.form.type === 'automation') {
|
||||||
|
url = '/api/' + this.form.type + '/list/' + this.projectId
|
||||||
|
} else if (this.form.type === 'performance' || this.form.type === 'api') {
|
||||||
|
url = '/' + this.form.type + '/list/' + this.projectId
|
||||||
|
}
|
||||||
|
if (this.projectId && this.form.type != '' && this.form.type != 'undefined') {
|
||||||
|
this.result = this.$get(url, response => {
|
||||||
this.testOptions = response.data;
|
this.testOptions = response.data;
|
||||||
this.testOptions.unshift({id: 'other', name: this.$t('test_track.case.other')})
|
this.testOptions.unshift({id: 'other', name: this.$t('test_track.case.other')})
|
||||||
});
|
});
|
||||||
} else if (this.form.type === 'functional') {
|
|
||||||
this.testOptions = [{id: 'other', name: this.$t('test_track.case.other')}];
|
|
||||||
this.form.testId = 'other';
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getDemandOptions() {
|
||||||
|
this.projectId = getCurrentProjectID()
|
||||||
|
this.result = this.$get("demand/list/" + this.projectId, response => {
|
||||||
|
this.demandOptions = response.data;
|
||||||
|
this.demandOptions.unshift({id: 'other', name: this.$t('test_track.case.other')})
|
||||||
|
});
|
||||||
|
},
|
||||||
getSelectOptions() {
|
getSelectOptions() {
|
||||||
this.getModuleOptions();
|
this.getModuleOptions();
|
||||||
this.getMaintainerOptions();
|
this.getMaintainerOptions();
|
||||||
this.getTestOptions();
|
this.getTestOptions();
|
||||||
|
this.getDemandOptions()
|
||||||
},
|
},
|
||||||
|
|
||||||
resetForm() {
|
resetForm() {
|
||||||
|
@ -826,4 +925,25 @@ export default {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tip {
|
||||||
|
padding: 3px 5px;
|
||||||
|
font-size: 16px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border-left: 4px solid #783887;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-main-div {
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-opt-btn {
|
||||||
|
position: fixed;
|
||||||
|
right: 50px;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-case-input {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -3,40 +3,25 @@
|
||||||
<div class="card-container">
|
<div class="card-container">
|
||||||
<el-card class="card-content" v-loading="result.loading">
|
<el-card class="card-content" v-loading="result.loading">
|
||||||
<template v-slot:header>
|
<template v-slot:header>
|
||||||
|
|
||||||
<ms-table-header :is-tester-permission="true" :condition.sync="condition" @search="initTableData"
|
<ms-table-header :is-tester-permission="true" :condition.sync="condition" @search="initTableData"
|
||||||
:tip="$t('commons.search_by_name_or_id')"
|
:tip="$t('commons.search_by_name_or_id')" title="" :show-create="false"
|
||||||
:create-tip="$t('test_track.case.create')" @create="testCaseCreate">
|
/>
|
||||||
<template v-slot:title>
|
|
||||||
<node-breadcrumb class="table-title" :nodes="selectParentNodes" @refresh="refresh"/>
|
|
||||||
</template>
|
|
||||||
<template v-slot:button>
|
|
||||||
<ms-table-button :is-tester-permission="true" icon="el-icon-download"
|
|
||||||
:content="$t('test_track.case.import.import')" @click="importTestCase"/>
|
|
||||||
<ms-table-button :is-tester-permission="true" icon="el-icon-upload2"
|
|
||||||
:content="$t('test_track.case.export.export')" @click="handleBatch('export')"/>
|
|
||||||
</template>
|
|
||||||
</ms-table-header>
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<test-case-import @refreshAll="refreshAll" ref="testCaseImport"/>
|
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
border
|
border
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
@sort-change="sort"
|
@sort-change="sort"
|
||||||
@filter-change="filter"
|
@filter-change="filter"
|
||||||
@select-all="handleSelectAll"
|
@select-all="handleSelectAll"
|
||||||
@select="handleSelect"
|
@select="handleSelect"
|
||||||
@header-dragend="headerDragend"
|
@header-dragend="headerDragend"
|
||||||
@cell-mouse-enter="showPopover"
|
@cell-mouse-enter="showPopover"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
class="test-content adjust-table ms-select-all-fixed"
|
class="test-content adjust-table ms-select-all-fixed"
|
||||||
ref="table" @row-click="handleEdit">
|
ref="table" @row-click="handleEdit">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
width="50"
|
width="50"
|
||||||
type="selection"/>
|
type="selection"/>
|
||||||
|
|
||||||
<ms-table-header-select-popover v-show="total>0"
|
<ms-table-header-select-popover v-show="total>0"
|
||||||
:page-size="pageSize > total ? total : pageSize"
|
:page-size="pageSize > total ? total : pageSize"
|
||||||
|
@ -52,80 +37,80 @@
|
||||||
<template v-for="(item, index) in tableLabel">
|
<template v-for="(item, index) in tableLabel">
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="item.id == 'num'"
|
v-if="item.id == 'num'"
|
||||||
prop="num"
|
prop="num"
|
||||||
sortable="custom"
|
sortable="custom"
|
||||||
:label="$t('commons.id')"
|
:label="$t('commons.id')"
|
||||||
:key="index"
|
:key="index"
|
||||||
show-overflow-tooltip>
|
show-overflow-tooltip>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="item.id == 'name'"
|
v-if="item.id == 'name'"
|
||||||
prop="name"
|
prop="name"
|
||||||
:label="$t('commons.name')"
|
:label="$t('commons.name')"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
:key="index"
|
:key="index"
|
||||||
>
|
>
|
||||||
<template v-slot:default="scope">
|
<!-- <template v-slot:default="scope">
|
||||||
<!--<div @mouseover="showDetail(scope.row)">
|
<!–<div @mouseover="showDetail(scope.row)">
|
||||||
<p>{{ scope.row.name }}</p>
|
<p>{{ scope.row.name }}</p>
|
||||||
</div>-->
|
</div>–>
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="right-end"
|
placement="right-end"
|
||||||
:title="$t('test_track.case.view_case')"
|
:title="$t('test_track.case.view_case')"
|
||||||
trigger="hover"
|
trigger="hover"
|
||||||
>
|
>
|
||||||
<test-case-detail v-if="currentCaseId === scope.row.id" :test-case-id="currentCaseId"/>
|
<test-case-detail v-if="currentCaseId === scope.row.id" :test-case-id="currentCaseId"/>
|
||||||
<span slot="reference">{{ scope.row.name }}</span>
|
<span slot="reference">{{ scope.row.name }}</span>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</template>
|
</template>-->
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="item.id == 'priority'"
|
v-if="item.id == 'priority'"
|
||||||
prop="priority"
|
prop="priority"
|
||||||
:filters="priorityFilters"
|
:filters="priorityFilters"
|
||||||
column-key="priority"
|
column-key="priority"
|
||||||
min-width="100px"
|
min-width="100px"
|
||||||
:label="$t('test_track.case.priority')"
|
:label="$t('test_track.case.priority')"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
:key="index">
|
:key="index">
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
<priority-table-item :value="scope.row.priority"/>
|
<priority-table-item :value="scope.row.priority"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
v-if="item.id == 'type'"
|
v-if="item.id == 'type'"
|
||||||
prop="type"
|
prop="type"
|
||||||
:filters="typeFilters"
|
:filters="typeFilters"
|
||||||
column-key="type"
|
column-key="type"
|
||||||
:label="$t('test_track.case.type')"
|
:label="$t('test_track.case.type')"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
:key="index">
|
:key="index">
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
<type-table-item :value="scope.row.type"/>
|
<type-table-item :value="scope.row.type"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>-->
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
v-if="item.id=='method'"
|
v-if="item.id=='method'"
|
||||||
prop="method"
|
prop="method"
|
||||||
column-key="method"
|
column-key="method"
|
||||||
:filters="methodFilters"
|
:filters="methodFilters"
|
||||||
min-width="100px"
|
min-width="100px"
|
||||||
:label="$t('test_track.case.method')"
|
:label="$t('test_track.case.method')"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
:key="index">
|
:key="index">
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
<method-table-item :value="scope.row.method"/>
|
<method-table-item :value="scope.row.method"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>-->
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="item.id=='status'"
|
v-if="item.id=='status'"
|
||||||
:filters="statusFilters"
|
:filters="statusFilters"
|
||||||
column-key="status"
|
column-key="status"
|
||||||
min-width="100px"
|
min-width="100px"
|
||||||
:label="$t('test_track.case.status')"
|
:label="$t('test_track.case.status')"
|
||||||
:key="index">
|
:key="index">
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
<span class="el-dropdown-link">
|
<span class="el-dropdown-link">
|
||||||
<review-status :value="scope.row.reviewStatus"/>
|
<review-status :value="scope.row.reviewStatus"/>
|
||||||
|
@ -135,27 +120,28 @@
|
||||||
|
|
||||||
<el-table-column v-if="item.id=='tags'" prop="tags" :label="$t('commons.tag')" :key="index">
|
<el-table-column v-if="item.id=='tags'" prop="tags" :label="$t('commons.tag')" :key="index">
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
<ms-tag v-for="(itemName,index) in scope.row.tags" :key="index" type="success" effect="plain" :content="itemName" style="margin-left: 5px"/>
|
<ms-tag v-for="(itemName,index) in scope.row.tags" :key="index" type="success" effect="plain"
|
||||||
|
:content="itemName" style="margin-left: 5px"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="item.id=='nodePath'"
|
v-if="item.id=='nodePath'"
|
||||||
prop="nodePath"
|
prop="nodePath"
|
||||||
:label="$t('test_track.case.module')"
|
:label="$t('test_track.case.module')"
|
||||||
min-width="150px"
|
min-width="150px"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
:key="index">
|
:key="index">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="item.id=='updateTime'"
|
v-if="item.id=='updateTime'"
|
||||||
prop="updateTime"
|
prop="updateTime"
|
||||||
sortable="custom"
|
sortable="custom"
|
||||||
:label="$t('commons.update_time')"
|
:label="$t('commons.update_time')"
|
||||||
min-width="150px"
|
min-width="150px"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
:key="index">
|
:key="index">
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
@ -170,12 +156,12 @@
|
||||||
@deleteClick="handleDelete(scope.row)">
|
@deleteClick="handleDelete(scope.row)">
|
||||||
<template v-slot:middle>
|
<template v-slot:middle>
|
||||||
<ms-table-operator-button :is-tester-permission="true" :tip="$t('commons.copy')"
|
<ms-table-operator-button :is-tester-permission="true" :tip="$t('commons.copy')"
|
||||||
icon="el-icon-document-copy"
|
icon="el-icon-document-copy"
|
||||||
type="success" @exec="handleCopy(scope.row)"/>
|
type="success" @exec="handleCopy(scope.row)"/>
|
||||||
</template>
|
</template>
|
||||||
</ms-table-operator>
|
</ms-table-operator>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<header-custom ref="headerCustom" :initTableData="initTableData" :optionalFields=headerItems
|
<header-custom ref="headerCustom" :initTableData="initTableData" :optionalFields=headerItems
|
||||||
:type=type></header-custom>
|
:type=type></header-custom>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -415,6 +401,7 @@ export default {
|
||||||
handleCopy(testCase) {
|
handleCopy(testCase) {
|
||||||
this.$get('test/case/get/' + testCase.id, response => {
|
this.$get('test/case/get/' + testCase.id, response => {
|
||||||
let testCase = response.data;
|
let testCase = response.data;
|
||||||
|
testCase.name='copy_'+testCase.name
|
||||||
this.$emit('testCaseCopy', testCase);
|
this.$emit('testCaseCopy', testCase);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,25 +1,57 @@
|
||||||
<template>
|
<template>
|
||||||
<ms-node-tree
|
<div>
|
||||||
v-loading="result.loading"
|
<slot name="header"></slot>
|
||||||
:tree-nodes="treeNodes"
|
<ms-node-tree
|
||||||
:type="'edit'"
|
v-loading="result.loading"
|
||||||
@add="add"
|
:tree-nodes="treeNodes"
|
||||||
@edit="edit"
|
:type="'edit'"
|
||||||
@drag="drag"
|
@add="add"
|
||||||
@remove="remove"
|
@edit="edit"
|
||||||
@nodeSelectEvent="nodeChange"
|
@drag="drag"
|
||||||
@refresh="list"
|
@remove="remove"
|
||||||
ref="nodeTree"/>
|
@nodeSelectEvent="nodeChange"
|
||||||
|
@refresh="list"
|
||||||
|
ref="nodeTree">
|
||||||
|
<template v-slot:header>
|
||||||
|
<el-input :placeholder="$t('test_track.module.search')" v-model="condition.filterText" size="small">
|
||||||
|
<template v-slot:append>
|
||||||
|
<el-dropdown size="small" split-button type="primary" class="ms-api-button"
|
||||||
|
@click="handleCommand('add-api')"
|
||||||
|
v-tester
|
||||||
|
@command="handleCommand">
|
||||||
|
<el-button icon="el-icon-folder-add" @click="addTestCase"></el-button>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item command="add-testcase">{{ $t('test_track.case.create') }}</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="import">{{ $t('api_test.api_import.label') }}</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="export">{{ $t('api_test.export_config') }}</el-dropdown-item>
|
||||||
|
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</template>
|
||||||
|
</ms-node-tree>
|
||||||
|
<test-case-import @refreshAll="refreshAll" ref="testCaseImport"></test-case-import>
|
||||||
|
<test-case-create
|
||||||
|
@saveAsEdit="saveAsEdit"
|
||||||
|
@refresh="refresh"
|
||||||
|
ref="testCaseCreate"
|
||||||
|
></test-case-create>
|
||||||
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import NodeEdit from "./NodeEdit";
|
import NodeEdit from "./NodeEdit";
|
||||||
import {getCurrentProjectID} from "../../../../common/js/utils";
|
import {getCurrentProjectID} from "../../../../common/js/utils";
|
||||||
import MsNodeTree from "./NodeTree";
|
import MsNodeTree from "./NodeTree";
|
||||||
|
import {buildNodePath} from "@/business/components/api/definition/model/NodeTree";
|
||||||
|
import TestCaseCreate from "@/business/components/track/case/components/TestCaseCreate";
|
||||||
|
import TestCaseImport from "@/business/components/track/case/components/TestCaseImport";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestCaseNodeTree",
|
name: "TestCaseNodeTree",
|
||||||
components: {MsNodeTree, NodeEdit},
|
components: {TestCaseImport, TestCaseCreate, MsNodeTree, NodeEdit},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
|
@ -28,76 +60,114 @@ export default {
|
||||||
},
|
},
|
||||||
result: {},
|
result: {},
|
||||||
treeNodes: [],
|
treeNodes: [],
|
||||||
projectId: ""
|
projectId: "",
|
||||||
};
|
condition: {
|
||||||
},
|
filterText: "",
|
||||||
props: {
|
trashEnable: false
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
default: "view"
|
|
||||||
},
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
default: "view"
|
||||||
},
|
},
|
||||||
watch: {
|
},
|
||||||
treeNodes() {
|
watch: {
|
||||||
this.$emit('setTreeNodes', this.treeNodes);
|
treeNodes() {
|
||||||
|
this.$emit('setTreeNodes', this.treeNodes);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.projectId = getCurrentProjectID();
|
||||||
|
this.list();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
addTestCase(){
|
||||||
|
if (!getCurrentProjectID()) {
|
||||||
|
this.$warning(this.$t('commons.check_project_tip'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$refs.testCaseCreate.open(this.currentModule)
|
||||||
|
},
|
||||||
|
saveAsEdit(data) {
|
||||||
|
this.$emit('saveAsEdit', data);
|
||||||
|
},
|
||||||
|
refresh() {
|
||||||
|
this.$emit("refreshTable");
|
||||||
|
},
|
||||||
|
refreshAll() {
|
||||||
|
this.selectRows.clear();
|
||||||
|
this.$emit('refreshAll');
|
||||||
|
},
|
||||||
|
handleCommand(e) {
|
||||||
|
switch (e) {
|
||||||
|
case "add-testcase":
|
||||||
|
this.addTestCase();
|
||||||
|
break;
|
||||||
|
case "import":
|
||||||
|
if (!getCurrentProjectID()) {
|
||||||
|
this.$warning(this.$t('commons.check_project_tip'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$refs.testCaseImport.open();
|
||||||
|
break;
|
||||||
|
case "export":
|
||||||
|
this.$emit('exportTestCase')
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
list() {
|
||||||
this.projectId = getCurrentProjectID();
|
if (this.projectId) {
|
||||||
this.list();
|
this.result = this.$get("/case/node/list/" + this.projectId, response => {
|
||||||
|
this.treeNodes = response.data;
|
||||||
|
if (this.$refs.nodeTree) {
|
||||||
|
this.$refs.nodeTree.filter();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
edit(param) {
|
||||||
|
param.projectId = this.projectId;
|
||||||
list() {
|
this.$post("/case/node/edit", param, () => {
|
||||||
if (this.projectId) {
|
this.$success(this.$t('commons.save_success'));
|
||||||
this.result = this.$get("/case/node/list/" + this.projectId, response => {
|
this.list();
|
||||||
this.treeNodes = response.data;
|
this.$emit("refreshTable");
|
||||||
if (this.$refs.nodeTree) {
|
}, (error) => {
|
||||||
this.$refs.nodeTree.filter();
|
this.list();
|
||||||
}
|
});
|
||||||
});
|
},
|
||||||
}
|
add(param) {
|
||||||
},
|
param.projectId = this.projectId;
|
||||||
edit(param) {
|
this.$post("/case/node/add", param, () => {
|
||||||
param.projectId = this.projectId;
|
this.$success(this.$t('commons.save_success'));
|
||||||
this.$post("/case/node/edit", param, () => {
|
this.list();
|
||||||
this.$success(this.$t('commons.save_success'));
|
}, (error) => {
|
||||||
this.list();
|
this.list();
|
||||||
this.$emit("refreshTable");
|
});
|
||||||
}, (error) => {
|
},
|
||||||
this.list();
|
remove(nodeIds) {
|
||||||
});
|
this.$post("/case/node/delete", nodeIds, () => {
|
||||||
},
|
this.list();
|
||||||
add(param) {
|
this.$emit("refreshTable")
|
||||||
param.projectId = this.projectId;
|
}, (error) => {
|
||||||
this.$post("/case/node/add", param, () => {
|
this.list();
|
||||||
this.$success(this.$t('commons.save_success'));
|
});
|
||||||
this.list();
|
},
|
||||||
}, (error) => {
|
drag(param, list) {
|
||||||
this.list();
|
this.$post("/case/node/drag", param, () => {
|
||||||
});
|
this.$post("/case/node/pos", list);
|
||||||
},
|
this.list();
|
||||||
remove(nodeIds) {
|
}, (error) => {
|
||||||
this.$post("/case/node/delete", nodeIds, () => {
|
this.list();
|
||||||
this.list();
|
});
|
||||||
this.$emit("refreshTable")
|
},
|
||||||
}, (error) => {
|
nodeChange(node, nodeIds, pNodes) {
|
||||||
this.list();
|
this.$emit("nodeSelectEvent", node, nodeIds, pNodes);
|
||||||
});
|
},
|
||||||
},
|
}
|
||||||
drag(param, list) {
|
};
|
||||||
this.$post("/case/node/drag", param, () => {
|
|
||||||
this.$post("/case/node/pos", list);
|
|
||||||
this.list();
|
|
||||||
}, (error) => {
|
|
||||||
this.list();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
nodeChange(node, nodeIds, pNodes) {
|
|
||||||
this.$emit("nodeSelectEvent", node, nodeIds, pNodes);
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
Loading…
Reference in New Issue