Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
q4speed 2020-05-08 00:00:05 +08:00
commit b5e7b74633
101 changed files with 1669 additions and 2423 deletions

View File

@ -42,7 +42,6 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
@ -53,7 +52,9 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
@ -118,10 +119,6 @@
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
@ -187,6 +184,16 @@
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<addResources>true</addResources>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
<exclude>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
@ -255,6 +262,11 @@
<artifactId>mysql-connector-java</artifactId>
<version>5.1.41</version>
</dependency>
<dependency>
<groupId>com.itfsw</groupId>
<artifactId>mybatis-generator-plugin</artifactId>
<version>1.3.8</version>
</dependency>
</dependencies>
</plugin>
</plugins>

View File

@ -1,7 +1,10 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class ApiTest implements Serializable {
private String id;
@ -18,60 +21,4 @@ public class ApiTest implements Serializable {
private Long updateTime;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId == null ? null : projectId.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
}

View File

@ -1,27 +1,14 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class ApiTestFile implements Serializable {
private String testId;
private String fileId;
private static final long serialVersionUID = 1L;
public String getTestId() {
return testId;
}
public void setTestId(String testId) {
this.testId = testId == null ? null : testId.trim();
}
public String getFileId() {
return fileId;
}
public void setFileId(String fileId) {
this.fileId = fileId == null ? null : fileId.trim();
}
}

View File

@ -1,7 +1,10 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class ApiTestReport implements Serializable {
private String id;
@ -20,68 +23,4 @@ public class ApiTestReport implements Serializable {
private String content;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getTestId() {
return testId;
}
public void setTestId(String testId) {
this.testId = testId == null ? null : testId.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
}

View File

@ -1,27 +1,18 @@
package io.metersphere.base.domain;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ApiTestWithBLOBs extends ApiTest implements Serializable {
private String scenarioDefinition;
private String schedule;
private static final long serialVersionUID = 1L;
public String getScenarioDefinition() {
return scenarioDefinition;
}
public void setScenarioDefinition(String scenarioDefinition) {
this.scenarioDefinition = scenarioDefinition == null ? null : scenarioDefinition.trim();
}
public String getSchedule() {
return schedule;
}
public void setSchedule(String schedule) {
this.schedule = schedule == null ? null : schedule.trim();
}
}

View File

@ -1,27 +1,14 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class FileContent implements Serializable {
private String fileId;
private byte[] file;
private static final long serialVersionUID = 1L;
public String getFileId() {
return fileId;
}
public void setFileId(String fileId) {
this.fileId = fileId == null ? null : fileId.trim();
}
public byte[] getFile() {
return file;
}
public void setFile(byte[] file) {
this.file = file;
}
}

View File

@ -1,7 +1,10 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class FileMetadata implements Serializable {
private String id;
@ -16,52 +19,4 @@ public class FileMetadata implements Serializable {
private Long size;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public Long getSize() {
return size;
}
public void setSize(Long size) {
this.size = size;
}
}

View File

@ -1,7 +1,10 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class LoadTest implements Serializable {
private String id;
@ -20,68 +23,4 @@ public class LoadTest implements Serializable {
private String testResourcePoolId;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId == null ? null : projectId.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public String getTestResourcePoolId() {
return testResourcePoolId;
}
public void setTestResourcePoolId(String testResourcePoolId) {
this.testResourcePoolId = testResourcePoolId == null ? null : testResourcePoolId.trim();
}
}

View File

@ -1,27 +1,14 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class LoadTestFile implements Serializable {
private String testId;
private String fileId;
private static final long serialVersionUID = 1L;
public String getTestId() {
return testId;
}
public void setTestId(String testId) {
this.testId = testId == null ? null : testId.trim();
}
public String getFileId() {
return fileId;
}
public void setFileId(String fileId) {
this.fileId = fileId == null ? null : fileId.trim();
}
}

View File

@ -1,7 +1,10 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class LoadTestReport implements Serializable {
private String id;
@ -16,52 +19,4 @@ public class LoadTestReport implements Serializable {
private String status;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getTestId() {
return testId;
}
public void setTestId(String testId) {
this.testId = testId == null ? null : testId.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
}

View File

@ -1,27 +1,14 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class LoadTestReportDetail implements Serializable {
private String reportId;
private String content;
private static final long serialVersionUID = 1L;
public String getReportId() {
return reportId;
}
public void setReportId(String reportId) {
this.reportId = reportId == null ? null : reportId.trim();
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
}

View File

@ -1,9 +1,12 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class LoadTestReportLog implements Serializable {
private Long id;
private String id;
private String reportId;
@ -12,36 +15,4 @@ public class LoadTestReportLog implements Serializable {
private String content;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getReportId() {
return reportId;
}
public void setReportId(String reportId) {
this.reportId = reportId == null ? null : reportId.trim();
}
public String getResourceId() {
return resourceId;
}
public void setResourceId(String resourceId) {
this.resourceId = resourceId == null ? null : resourceId.trim();
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
}

View File

@ -114,52 +114,62 @@ public class LoadTestReportLogExample {
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}

View File

@ -1,9 +1,12 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class LoadTestReportResult implements Serializable {
private Long id;
private String id;
private String reportId;
@ -12,36 +15,4 @@ public class LoadTestReportResult implements Serializable {
private String reportValue;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getReportId() {
return reportId;
}
public void setReportId(String reportId) {
this.reportId = reportId == null ? null : reportId.trim();
}
public String getReportKey() {
return reportKey;
}
public void setReportKey(String reportKey) {
this.reportKey = reportKey == null ? null : reportKey.trim();
}
public String getReportValue() {
return reportValue;
}
public void setReportValue(String reportValue) {
this.reportValue = reportValue == null ? null : reportValue.trim();
}
}

View File

@ -114,52 +114,62 @@ public class LoadTestReportResultExample {
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}

View File

@ -1,27 +1,18 @@
package io.metersphere.base.domain;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class LoadTestReportWithBLOBs extends LoadTestReport implements Serializable {
private String description;
private String content;
private static final long serialVersionUID = 1L;
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
}

View File

@ -1,7 +1,14 @@
package io.metersphere.base.domain;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class LoadTestWithBLOBs extends LoadTest implements Serializable {
private String loadConfiguration;
@ -10,28 +17,4 @@ public class LoadTestWithBLOBs extends LoadTest implements Serializable {
private String schedule;
private static final long serialVersionUID = 1L;
public String getLoadConfiguration() {
return loadConfiguration;
}
public void setLoadConfiguration(String loadConfiguration) {
this.loadConfiguration = loadConfiguration == null ? null : loadConfiguration.trim();
}
public String getAdvancedConfiguration() {
return advancedConfiguration;
}
public void setAdvancedConfiguration(String advancedConfiguration) {
this.advancedConfiguration = advancedConfiguration == null ? null : advancedConfiguration.trim();
}
public String getSchedule() {
return schedule;
}
public void setSchedule(String schedule) {
this.schedule = schedule == null ? null : schedule.trim();
}
}

View File

@ -1,7 +1,10 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class Organization implements Serializable {
private String id;
@ -14,44 +17,4 @@ public class Organization implements Serializable {
private Long updateTime;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
}

View File

@ -1,7 +1,10 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class Project implements Serializable {
private String id;
@ -16,52 +19,4 @@ public class Project implements Serializable {
private Long updateTime;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getWorkspaceId() {
return workspaceId;
}
public void setWorkspaceId(String workspaceId) {
this.workspaceId = workspaceId == null ? null : workspaceId.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
}

View File

@ -1,7 +1,10 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class Role implements Serializable {
private String id;
@ -16,52 +19,4 @@ public class Role implements Serializable {
private Long updateTime;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
}

View File

@ -1,7 +1,10 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class SystemParameter implements Serializable {
private String paramKey;
@ -12,36 +15,4 @@ public class SystemParameter implements Serializable {
private Integer sort;
private static final long serialVersionUID = 1L;
public String getParamKey() {
return paramKey;
}
public void setParamKey(String paramKey) {
this.paramKey = paramKey == null ? null : paramKey.trim();
}
public String getParamValue() {
return paramValue;
}
public void setParamValue(String paramValue) {
this.paramValue = paramValue == null ? null : paramValue.trim();
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
}

View File

@ -1,7 +1,10 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class TestCase implements Serializable {
private String id;
@ -28,100 +31,4 @@ public class TestCase implements Serializable {
private Long updateTime;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public Integer getNodeId() {
return nodeId;
}
public void setNodeId(Integer nodeId) {
this.nodeId = nodeId;
}
public String getNodePath() {
return nodePath;
}
public void setNodePath(String nodePath) {
this.nodePath = nodePath == null ? null : nodePath.trim();
}
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId == null ? null : projectId.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
public String getMaintainer() {
return maintainer;
}
public void setMaintainer(String maintainer) {
this.maintainer = maintainer == null ? null : maintainer.trim();
}
public String getPriority() {
return priority;
}
public void setPriority(String priority) {
this.priority = priority == null ? null : priority.trim();
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method == null ? null : method.trim();
}
public String getPrerequisite() {
return prerequisite;
}
public void setPrerequisite(String prerequisite) {
this.prerequisite = prerequisite == null ? null : prerequisite.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
}

View File

@ -1,7 +1,10 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class TestCaseNode implements Serializable {
private Integer id;
@ -18,60 +21,4 @@ public class TestCaseNode implements Serializable {
private Long updateTime;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId == null ? null : projectId.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public Integer getpId() {
return pId;
}
public void setpId(Integer pId) {
this.pId = pId;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
}

View File

@ -1,47 +1,19 @@
package io.metersphere.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class TestCaseReport implements Serializable {
private Long id;
private String name;
private String planId;
private Long startTime;
private Long endTime;
private String content;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getPlanId() {
return planId;
}
public void setPlanId(String planId) {
this.planId = planId == null ? null : planId.trim();
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
}

View File

@ -234,73 +234,123 @@ public class TestCaseReportExample {
return (Criteria) this;
}
public Criteria andPlanIdIsNull() {
addCriterion("plan_id is null");
public Criteria andStartTimeIsNull() {
addCriterion("start_time is null");
return (Criteria) this;
}
public Criteria andPlanIdIsNotNull() {
addCriterion("plan_id is not null");
public Criteria andStartTimeIsNotNull() {
addCriterion("start_time is not null");
return (Criteria) this;
}
public Criteria andPlanIdEqualTo(String value) {
addCriterion("plan_id =", value, "planId");
public Criteria andStartTimeEqualTo(Long value) {
addCriterion("start_time =", value, "startTime");
return (Criteria) this;
}
public Criteria andPlanIdNotEqualTo(String value) {
addCriterion("plan_id <>", value, "planId");
public Criteria andStartTimeNotEqualTo(Long value) {
addCriterion("start_time <>", value, "startTime");
return (Criteria) this;
}
public Criteria andPlanIdGreaterThan(String value) {
addCriterion("plan_id >", value, "planId");
public Criteria andStartTimeGreaterThan(Long value) {
addCriterion("start_time >", value, "startTime");
return (Criteria) this;
}
public Criteria andPlanIdGreaterThanOrEqualTo(String value) {
addCriterion("plan_id >=", value, "planId");
public Criteria andStartTimeGreaterThanOrEqualTo(Long value) {
addCriterion("start_time >=", value, "startTime");
return (Criteria) this;
}
public Criteria andPlanIdLessThan(String value) {
addCriterion("plan_id <", value, "planId");
public Criteria andStartTimeLessThan(Long value) {
addCriterion("start_time <", value, "startTime");
return (Criteria) this;
}
public Criteria andPlanIdLessThanOrEqualTo(String value) {
addCriterion("plan_id <=", value, "planId");
public Criteria andStartTimeLessThanOrEqualTo(Long value) {
addCriterion("start_time <=", value, "startTime");
return (Criteria) this;
}
public Criteria andPlanIdLike(String value) {
addCriterion("plan_id like", value, "planId");
public Criteria andStartTimeIn(List<Long> values) {
addCriterion("start_time in", values, "startTime");
return (Criteria) this;
}
public Criteria andPlanIdNotLike(String value) {
addCriterion("plan_id not like", value, "planId");
public Criteria andStartTimeNotIn(List<Long> values) {
addCriterion("start_time not in", values, "startTime");
return (Criteria) this;
}
public Criteria andPlanIdIn(List<String> values) {
addCriterion("plan_id in", values, "planId");
public Criteria andStartTimeBetween(Long value1, Long value2) {
addCriterion("start_time between", value1, value2, "startTime");
return (Criteria) this;
}
public Criteria andPlanIdNotIn(List<String> values) {
addCriterion("plan_id not in", values, "planId");
public Criteria andStartTimeNotBetween(Long value1, Long value2) {
addCriterion("start_time not between", value1, value2, "startTime");
return (Criteria) this;
}
public Criteria andPlanIdBetween(String value1, String value2) {
addCriterion("plan_id between", value1, value2, "planId");
public Criteria andEndTimeIsNull() {
addCriterion("end_time is null");
return (Criteria) this;
}
public Criteria andPlanIdNotBetween(String value1, String value2) {
addCriterion("plan_id not between", value1, value2, "planId");
public Criteria andEndTimeIsNotNull() {
addCriterion("end_time is not null");
return (Criteria) this;
}
public Criteria andEndTimeEqualTo(Long value) {
addCriterion("end_time =", value, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeNotEqualTo(Long value) {
addCriterion("end_time <>", value, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeGreaterThan(Long value) {
addCriterion("end_time >", value, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeGreaterThanOrEqualTo(Long value) {
addCriterion("end_time >=", value, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeLessThan(Long value) {
addCriterion("end_time <", value, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeLessThanOrEqualTo(Long value) {
addCriterion("end_time <=", value, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeIn(List<Long> values) {
addCriterion("end_time in", values, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeNotIn(List<Long> values) {
addCriterion("end_time not in", values, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeBetween(Long value1, Long value2) {
addCriterion("end_time between", value1, value2, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeNotBetween(Long value1, Long value2) {
addCriterion("end_time not between", value1, value2, "endTime");
return (Criteria) this;
}
}

View File

@ -1,7 +1,9 @@
package io.metersphere.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class TestCaseReportTemplate implements Serializable {
private Long id;
@ -12,36 +14,4 @@ public class TestCaseReportTemplate implements Serializable {
private String content;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getWorkspaceId() {
return workspaceId;
}
public void setWorkspaceId(String workspaceId) {
this.workspaceId = workspaceId == null ? null : workspaceId.trim();
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
}

View File

@ -1,27 +1,18 @@
package io.metersphere.base.domain;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class TestCaseWithBLOBs extends TestCase implements Serializable {
private String remark;
private String steps;
private static final long serialVersionUID = 1L;
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public String getSteps() {
return steps;
}
public void setSteps(String steps) {
this.steps = steps == null ? null : steps.trim();
}
}

View File

@ -1,7 +1,9 @@
package io.metersphere.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class TestPlan implements Serializable {
private String id;
@ -9,6 +11,8 @@ public class TestPlan implements Serializable {
private String workspaceId;
private Long reportId;
private String name;
private String description;
@ -30,108 +34,4 @@ public class TestPlan implements Serializable {
private String tags;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId == null ? null : projectId.trim();
}
public String getWorkspaceId() {
return workspaceId;
}
public void setWorkspaceId(String workspaceId) {
this.workspaceId = workspaceId == null ? null : workspaceId.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public String getStage() {
return stage;
}
public void setStage(String stage) {
this.stage = stage == null ? null : stage.trim();
}
public String getPrincipal() {
return principal;
}
public void setPrincipal(String principal) {
this.principal = principal == null ? null : principal.trim();
}
public String getTestCaseMatchRule() {
return testCaseMatchRule;
}
public void setTestCaseMatchRule(String testCaseMatchRule) {
this.testCaseMatchRule = testCaseMatchRule == null ? null : testCaseMatchRule.trim();
}
public String getExecutorMatchRule() {
return executorMatchRule;
}
public void setExecutorMatchRule(String executorMatchRule) {
this.executorMatchRule = executorMatchRule == null ? null : executorMatchRule.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public String getTags() {
return tags;
}
public void setTags(String tags) {
this.tags = tags == null ? null : tags.trim();
}
}

View File

@ -314,6 +314,66 @@ public class TestPlanExample {
return (Criteria) this;
}
public Criteria andReportIdIsNull() {
addCriterion("report_id is null");
return (Criteria) this;
}
public Criteria andReportIdIsNotNull() {
addCriterion("report_id is not null");
return (Criteria) this;
}
public Criteria andReportIdEqualTo(Long value) {
addCriterion("report_id =", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdNotEqualTo(Long value) {
addCriterion("report_id <>", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdGreaterThan(Long value) {
addCriterion("report_id >", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdGreaterThanOrEqualTo(Long value) {
addCriterion("report_id >=", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdLessThan(Long value) {
addCriterion("report_id <", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdLessThanOrEqualTo(Long value) {
addCriterion("report_id <=", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdIn(List<Long> values) {
addCriterion("report_id in", values, "reportId");
return (Criteria) this;
}
public Criteria andReportIdNotIn(List<Long> values) {
addCriterion("report_id not in", values, "reportId");
return (Criteria) this;
}
public Criteria andReportIdBetween(Long value1, Long value2) {
addCriterion("report_id between", value1, value2, "reportId");
return (Criteria) this;
}
public Criteria andReportIdNotBetween(Long value1, Long value2) {
addCriterion("report_id not between", value1, value2, "reportId");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;

View File

@ -1,7 +1,10 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class TestPlanTestCase implements Serializable {
private Integer id;
@ -22,76 +25,4 @@ public class TestPlanTestCase implements Serializable {
private String results;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getPlanId() {
return planId;
}
public void setPlanId(String planId) {
this.planId = planId == null ? null : planId.trim();
}
public String getCaseId() {
return caseId;
}
public void setCaseId(String caseId) {
this.caseId = caseId == null ? null : caseId.trim();
}
public String getExecutor() {
return executor;
}
public void setExecutor(String executor) {
this.executor = executor == null ? null : executor.trim();
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public String getResults() {
return results;
}
public void setResults(String results) {
this.results = results == null ? null : results.trim();
}
}

View File

@ -1,7 +1,10 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class TestResource implements Serializable {
private String id;
@ -16,52 +19,4 @@ public class TestResource implements Serializable {
private String configuration;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getTestResourcePoolId() {
return testResourcePoolId;
}
public void setTestResourcePoolId(String testResourcePoolId) {
this.testResourcePoolId = testResourcePoolId == null ? null : testResourcePoolId.trim();
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public String getConfiguration() {
return configuration;
}
public void setConfiguration(String configuration) {
this.configuration = configuration == null ? null : configuration.trim();
}
}

View File

@ -1,7 +1,10 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class TestResourcePool implements Serializable {
private String id;
@ -18,60 +21,4 @@ public class TestResourcePool implements Serializable {
private Long updateTime;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
}

View File

@ -1,7 +1,10 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class User implements Serializable {
private String id;
@ -26,92 +29,4 @@ public class User implements Serializable {
private String phone;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email == null ? null : email.trim();
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language == null ? null : language.trim();
}
public String getLastWorkspaceId() {
return lastWorkspaceId;
}
public void setLastWorkspaceId(String lastWorkspaceId) {
this.lastWorkspaceId = lastWorkspaceId == null ? null : lastWorkspaceId.trim();
}
public String getLastOrganizationId() {
return lastOrganizationId;
}
public void setLastOrganizationId(String lastOrganizationId) {
this.lastOrganizationId = lastOrganizationId == null ? null : lastOrganizationId.trim();
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone == null ? null : phone.trim();
}
}

View File

@ -1,7 +1,10 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class UserRole implements Serializable {
private String id;
@ -16,52 +19,4 @@ public class UserRole implements Serializable {
private Long updateTime;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId == null ? null : userId.trim();
}
public String getRoleId() {
return roleId;
}
public void setRoleId(String roleId) {
this.roleId = roleId == null ? null : roleId.trim();
}
public String getSourceId() {
return sourceId;
}
public void setSourceId(String sourceId) {
this.sourceId = sourceId == null ? null : sourceId.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
}

View File

@ -1,7 +1,10 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class Workspace implements Serializable {
private String id;
@ -16,52 +19,4 @@ public class Workspace implements Serializable {
private Long updateTime;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getOrganizationId() {
return organizationId;
}
public void setOrganizationId(String organizationId) {
this.organizationId = organizationId == null ? null : organizationId.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
}

View File

@ -11,7 +11,7 @@ public interface LoadTestReportLogMapper {
int deleteByExample(LoadTestReportLogExample example);
int deleteByPrimaryKey(Long id);
int deleteByPrimaryKey(String id);
int insert(LoadTestReportLog record);
@ -21,7 +21,7 @@ public interface LoadTestReportLogMapper {
List<LoadTestReportLog> selectByExample(LoadTestReportLogExample example);
LoadTestReportLog selectByPrimaryKey(Long id);
LoadTestReportLog selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") LoadTestReportLog record, @Param("example") LoadTestReportLogExample example);

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.metersphere.base.mapper.LoadTestReportLogMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.LoadTestReportLog">
<id column="id" jdbcType="BIGINT" property="id" />
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="report_id" jdbcType="VARCHAR" property="reportId" />
<result column="resource_id" jdbcType="VARCHAR" property="resourceId" />
</resultMap>
@ -103,17 +103,17 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from load_test_report_log
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from load_test_report_log
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.LoadTestReportLogExample">
delete from load_test_report_log
@ -124,7 +124,7 @@
<insert id="insert" parameterType="io.metersphere.base.domain.LoadTestReportLog">
insert into load_test_report_log (id, report_id, resource_id,
content)
values (#{id,jdbcType=BIGINT}, #{reportId,jdbcType=VARCHAR}, #{resourceId,jdbcType=VARCHAR},
values (#{id,jdbcType=VARCHAR}, #{reportId,jdbcType=VARCHAR}, #{resourceId,jdbcType=VARCHAR},
#{content,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.LoadTestReportLog">
@ -145,7 +145,7 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
#{id,jdbcType=VARCHAR},
</if>
<if test="reportId != null">
#{reportId,jdbcType=VARCHAR},
@ -168,7 +168,7 @@
update load_test_report_log
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.reportId != null">
report_id = #{record.reportId,jdbcType=VARCHAR},
@ -186,7 +186,7 @@
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update load_test_report_log
set id = #{record.id,jdbcType=BIGINT},
set id = #{record.id,jdbcType=VARCHAR},
report_id = #{record.reportId,jdbcType=VARCHAR},
resource_id = #{record.resourceId,jdbcType=VARCHAR},
content = #{record.content,jdbcType=LONGVARCHAR}
@ -196,7 +196,7 @@
</update>
<update id="updateByExample" parameterType="map">
update load_test_report_log
set id = #{record.id,jdbcType=BIGINT},
set id = #{record.id,jdbcType=VARCHAR},
report_id = #{record.reportId,jdbcType=VARCHAR},
resource_id = #{record.resourceId,jdbcType=VARCHAR}
<if test="_parameter != null">
@ -216,19 +216,19 @@
content = #{content,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.LoadTestReportLog">
update load_test_report_log
set report_id = #{reportId,jdbcType=VARCHAR},
resource_id = #{resourceId,jdbcType=VARCHAR},
content = #{content,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.LoadTestReportLog">
update load_test_report_log
set report_id = #{reportId,jdbcType=VARCHAR},
resource_id = #{resourceId,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -11,7 +11,7 @@ public interface LoadTestReportResultMapper {
int deleteByExample(LoadTestReportResultExample example);
int deleteByPrimaryKey(Long id);
int deleteByPrimaryKey(String id);
int insert(LoadTestReportResult record);
@ -21,7 +21,7 @@ public interface LoadTestReportResultMapper {
List<LoadTestReportResult> selectByExample(LoadTestReportResultExample example);
LoadTestReportResult selectByPrimaryKey(Long id);
LoadTestReportResult selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") LoadTestReportResult record, @Param("example") LoadTestReportResultExample example);

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.metersphere.base.mapper.LoadTestReportResultMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.LoadTestReportResult">
<id column="id" jdbcType="BIGINT" property="id" />
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="report_id" jdbcType="VARCHAR" property="reportId" />
<result column="report_key" jdbcType="VARCHAR" property="reportKey" />
</resultMap>
@ -103,17 +103,17 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from load_test_report_result
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from load_test_report_result
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.LoadTestReportResultExample">
delete from load_test_report_result
@ -124,7 +124,7 @@
<insert id="insert" parameterType="io.metersphere.base.domain.LoadTestReportResult">
insert into load_test_report_result (id, report_id, report_key,
report_value)
values (#{id,jdbcType=BIGINT}, #{reportId,jdbcType=VARCHAR}, #{reportKey,jdbcType=VARCHAR},
values (#{id,jdbcType=VARCHAR}, #{reportId,jdbcType=VARCHAR}, #{reportKey,jdbcType=VARCHAR},
#{reportValue,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.LoadTestReportResult">
@ -145,7 +145,7 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
#{id,jdbcType=VARCHAR},
</if>
<if test="reportId != null">
#{reportId,jdbcType=VARCHAR},
@ -168,7 +168,7 @@
update load_test_report_result
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.reportId != null">
report_id = #{record.reportId,jdbcType=VARCHAR},
@ -186,7 +186,7 @@
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update load_test_report_result
set id = #{record.id,jdbcType=BIGINT},
set id = #{record.id,jdbcType=VARCHAR},
report_id = #{record.reportId,jdbcType=VARCHAR},
report_key = #{record.reportKey,jdbcType=VARCHAR},
report_value = #{record.reportValue,jdbcType=LONGVARCHAR}
@ -196,7 +196,7 @@
</update>
<update id="updateByExample" parameterType="map">
update load_test_report_result
set id = #{record.id,jdbcType=BIGINT},
set id = #{record.id,jdbcType=VARCHAR},
report_id = #{record.reportId,jdbcType=VARCHAR},
report_key = #{record.reportKey,jdbcType=VARCHAR}
<if test="_parameter != null">
@ -216,19 +216,19 @@
report_value = #{reportValue,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.LoadTestReportResult">
update load_test_report_result
set report_id = #{reportId,jdbcType=VARCHAR},
report_key = #{reportKey,jdbcType=VARCHAR},
report_value = #{reportValue,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.LoadTestReportResult">
update load_test_report_result
set report_id = #{reportId,jdbcType=VARCHAR},
report_key = #{reportKey,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -102,22 +102,19 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseNode">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into test_case_node (project_id, name, p_id,
level, create_time, update_time
)
values (#{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pId,jdbcType=INTEGER},
#{level,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}
)
insert into test_case_node (id, project_id, name,
p_id, level, create_time,
update_time)
values (#{id,jdbcType=INTEGER}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{pId,jdbcType=INTEGER}, #{level,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseNode">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into test_case_node
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="projectId != null">
project_id,
</if>
@ -138,6 +135,9 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>

View File

@ -4,7 +4,8 @@
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestCaseReport">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="plan_id" jdbcType="VARCHAR" property="planId" />
<result column="start_time" jdbcType="BIGINT" property="startTime" />
<result column="end_time" jdbcType="BIGINT" property="endTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestCaseReport">
<result column="content" jdbcType="LONGVARCHAR" property="content" />
@ -68,7 +69,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, name, plan_id
id, name, start_time, end_time
</sql>
<sql id="Blob_Column_List">
content
@ -125,10 +126,10 @@
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into test_case_report (name, plan_id, content
)
values (#{name,jdbcType=VARCHAR}, #{planId,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR}
)
insert into test_case_report (name, start_time, end_time,
content)
values (#{name,jdbcType=VARCHAR}, #{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT},
#{content,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseReport">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
@ -139,8 +140,11 @@
<if test="name != null">
name,
</if>
<if test="planId != null">
plan_id,
<if test="startTime != null">
start_time,
</if>
<if test="endTime != null">
end_time,
</if>
<if test="content != null">
content,
@ -150,8 +154,11 @@
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="planId != null">
#{planId,jdbcType=VARCHAR},
<if test="startTime != null">
#{startTime,jdbcType=BIGINT},
</if>
<if test="endTime != null">
#{endTime,jdbcType=BIGINT},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARCHAR},
@ -173,8 +180,11 @@
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.planId != null">
plan_id = #{record.planId,jdbcType=VARCHAR},
<if test="record.startTime != null">
start_time = #{record.startTime,jdbcType=BIGINT},
</if>
<if test="record.endTime != null">
end_time = #{record.endTime,jdbcType=BIGINT},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=LONGVARCHAR},
@ -188,7 +198,8 @@
update test_case_report
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
plan_id = #{record.planId,jdbcType=VARCHAR},
start_time = #{record.startTime,jdbcType=BIGINT},
end_time = #{record.endTime,jdbcType=BIGINT},
content = #{record.content,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -198,7 +209,8 @@
update test_case_report
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
plan_id = #{record.planId,jdbcType=VARCHAR}
start_time = #{record.startTime,jdbcType=BIGINT},
end_time = #{record.endTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -209,8 +221,11 @@
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="planId != null">
plan_id = #{planId,jdbcType=VARCHAR},
<if test="startTime != null">
start_time = #{startTime,jdbcType=BIGINT},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=BIGINT},
</if>
<if test="content != null">
content = #{content,jdbcType=LONGVARCHAR},
@ -221,14 +236,16 @@
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.TestCaseReport">
update test_case_report
set name = #{name,jdbcType=VARCHAR},
plan_id = #{planId,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=BIGINT},
end_time = #{endTime,jdbcType=BIGINT},
content = #{content,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestCaseReport">
update test_case_report
set name = #{name,jdbcType=VARCHAR},
plan_id = #{planId,jdbcType=VARCHAR}
start_time = #{startTime,jdbcType=BIGINT},
end_time = #{endTime,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@ -5,6 +5,7 @@
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="workspace_id" jdbcType="VARCHAR" property="workspaceId" />
<result column="report_id" jdbcType="BIGINT" property="reportId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="status" jdbcType="VARCHAR" property="status" />
@ -77,8 +78,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, project_id, workspace_id, name, description, status, stage, principal, test_case_match_rule,
executor_match_rule, create_time, update_time
id, project_id, workspace_id, report_id, name, description, status, stage, principal,
test_case_match_rule, executor_match_rule, create_time, update_time
</sql>
<sql id="Blob_Column_List">
tags
@ -133,15 +134,15 @@
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestPlan">
insert into test_plan (id, project_id, workspace_id,
name, description, status,
stage, principal, test_case_match_rule,
executor_match_rule, create_time, update_time,
tags)
report_id, name, description,
status, stage, principal,
test_case_match_rule, executor_match_rule, create_time,
update_time, tags)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
#{stage,jdbcType=VARCHAR}, #{principal,jdbcType=VARCHAR}, #{testCaseMatchRule,jdbcType=VARCHAR},
#{executorMatchRule,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{tags,jdbcType=LONGVARCHAR})
#{reportId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{stage,jdbcType=VARCHAR}, #{principal,jdbcType=VARCHAR},
#{testCaseMatchRule,jdbcType=VARCHAR}, #{executorMatchRule,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT}, #{tags,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestPlan">
insert into test_plan
@ -155,6 +156,9 @@
<if test="workspaceId != null">
workspace_id,
</if>
<if test="reportId != null">
report_id,
</if>
<if test="name != null">
name,
</if>
@ -196,6 +200,9 @@
<if test="workspaceId != null">
#{workspaceId,jdbcType=VARCHAR},
</if>
<if test="reportId != null">
#{reportId,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
@ -246,6 +253,9 @@
<if test="record.workspaceId != null">
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
</if>
<if test="record.reportId != null">
report_id = #{record.reportId,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
@ -286,6 +296,7 @@
set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
report_id = #{record.reportId,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
status = #{record.status,jdbcType=VARCHAR},
@ -305,6 +316,7 @@
set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
report_id = #{record.reportId,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
status = #{record.status,jdbcType=VARCHAR},
@ -327,6 +339,9 @@
<if test="workspaceId != null">
workspace_id = #{workspaceId,jdbcType=VARCHAR},
</if>
<if test="reportId != null">
report_id = #{reportId,jdbcType=BIGINT},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
@ -364,6 +379,7 @@
update test_plan
set project_id = #{projectId,jdbcType=VARCHAR},
workspace_id = #{workspaceId,jdbcType=VARCHAR},
report_id = #{reportId,jdbcType=BIGINT},
name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR},
@ -380,6 +396,7 @@
update test_plan
set project_id = #{projectId,jdbcType=VARCHAR},
workspace_id = #{workspaceId,jdbcType=VARCHAR},
report_id = #{reportId,jdbcType=BIGINT},
name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR},

View File

@ -1,13 +0,0 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.controller.request.resourcepool.QueryResourcePoolRequest;
import io.metersphere.dto.TestResourcePoolDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtTestReourcePoolMapper {
List<TestResourcePoolDTO> listResourcePools(@Param("request") QueryResourcePoolRequest request);
// List<TestResource> listResourcesByPoolId(@Param("poolId") String poolId);
}

View File

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="io.metersphere.base.mapper.ext.ExtTestReourcePoolMapper">
<resultMap id="TestReourcePoolResultMap" type="io.metersphere.dto.TestResourcePoolDTO">
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="type" jdbcType="VARCHAR" property="type"/>
<result column="description" jdbcType="VARCHAR" property="description"/>
<result column="status" jdbcType="VARCHAR" property="status"/>
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
<result column="update_time" jdbcType="BIGINT" property="updateTime"/>
<collection property="resources" column="id" ofType="io.metersphere.base.domain.TestResource"
select="io.metersphere.base.mapper.ext.ExtTestReourcePoolMapper.listResourcesByPoolId">
</collection>
</resultMap>
<select id="listResourcePools" resultMap="TestReourcePoolResultMap">
SELECT * FROM test_resource_pool
<where>
<if test="request.name != null">
and test_resource_pool.name like CONCAT('%', #{request.name},'%')
</if>
</where>
</select>
<select id="listResourcesByPoolId" resultType="io.metersphere.base.domain.TestResource">
SELECT * FROM test_resource WHERE test_resource_pool_id = #{id}
</select>
</mapper>

View File

@ -1,5 +1,10 @@
package io.metersphere.commons.utils;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class MybatisInterceptorConfig {
private String modelName;
private String attrName;
@ -9,7 +14,6 @@ public class MybatisInterceptorConfig {
private String undoClass;
private String undoMethod;
public MybatisInterceptorConfig() {
}
@ -17,100 +21,25 @@ public class MybatisInterceptorConfig {
* 用时需谨慎
* 主要配置多个的时候参数少一点
*
* @param modelName
* @param modelClass
* @param attrName
*/
public MybatisInterceptorConfig(String modelName, String attrName) {
this.modelName = modelName;
public MybatisInterceptorConfig(Class<?> modelClass, String attrName) {
this.modelName = modelClass.getName();
this.attrName = attrName;
this.interceptorClass = "io.metersphere.commons.utils.EncryptUtils";
this.interceptorClass = EncryptUtils.class.getName();
this.interceptorMethod = "aesEncrypt";
this.undoClass = "io.metersphere.commons.utils.EncryptUtils";
this.undoClass = EncryptUtils.class.getName();
this.undoMethod = "aesDecrypt";
}
public MybatisInterceptorConfig(String modelName, String attrName, String attrNameForList) {
this.modelName = modelName;
public MybatisInterceptorConfig(Class<?> modelClass, String attrName, Class<?> interceptorClass, String interceptorMethod, String undoMethod) {
this.modelName = modelClass.getName();
this.attrName = attrName;
this.attrNameForList = attrNameForList;
this.interceptorClass = "io.metersphere.commons.utils.EncryptUtils";
this.interceptorMethod = "aesEncrypt";
this.undoClass = "io.metersphere.commons.utils.EncryptUtils";
this.undoMethod = "aesDecrypt";
}
public MybatisInterceptorConfig(String modelName, String attrName, String interceptorClass, String interceptorMethod, String undoMethod) {
this.modelName = modelName;
this.attrName = attrName;
this.interceptorClass = interceptorClass;
this.interceptorClass = interceptorClass.getName();
this.interceptorMethod = interceptorMethod;
this.undoClass = interceptorClass;
this.undoClass = interceptorClass.getName();
this.undoMethod = undoMethod;
}
public MybatisInterceptorConfig(String modelName, String attrName, String attrNameForList, String interceptorClass, String interceptorMethod, String undoMethod) {
this.modelName = modelName;
this.attrName = attrName;
this.attrNameForList = attrNameForList;
this.interceptorClass = interceptorClass;
this.interceptorMethod = interceptorMethod;
this.undoClass = interceptorClass;
this.undoMethod = undoMethod;
}
public String getModelName() {
return modelName;
}
public void setModelName(String modelName) {
this.modelName = modelName;
}
public String getAttrName() {
return attrName;
}
public void setAttrName(String attrName) {
this.attrName = attrName;
}
public String getAttrNameForList() {
return attrNameForList;
}
public void setAttrNameForList(String attrNameForList) {
this.attrNameForList = attrNameForList;
}
public String getInterceptorMethod() {
return interceptorMethod;
}
public void setInterceptorMethod(String interceptorMethod) {
this.interceptorMethod = interceptorMethod;
}
public String getUndoMethod() {
return undoMethod;
}
public void setUndoMethod(String undoMethod) {
this.undoMethod = undoMethod;
}
public String getInterceptorClass() {
return interceptorClass;
}
public void setInterceptorClass(String interceptorClass) {
this.interceptorClass = interceptorClass;
}
public String getUndoClass() {
return undoClass;
}
public void setUndoClass(String undoClass) {
this.undoClass = undoClass;
}
}

View File

@ -1,6 +1,9 @@
package io.metersphere.config;
import com.github.pagehelper.PageInterceptor;
import io.metersphere.base.domain.FileContent;
import io.metersphere.base.domain.TestResource;
import io.metersphere.commons.utils.CompressUtils;
import io.metersphere.commons.utils.MybatisInterceptorConfig;
import io.metersphere.interceptor.MybatisInterceptor;
import org.mybatis.spring.annotation.MapperScan;
@ -37,7 +40,8 @@ public class MybatisConfig {
public MybatisInterceptor dbInterceptor() {
MybatisInterceptor interceptor = new MybatisInterceptor();
List<MybatisInterceptorConfig> configList = new ArrayList<>();
configList.add(new MybatisInterceptorConfig("io.metersphere.base.domain.FileContent", "file", "io.metersphere.commons.utils.CompressUtils", "zip", "unzip"));
configList.add(new MybatisInterceptorConfig(FileContent.class, "file", CompressUtils.class, "zip", "unzip"));
configList.add(new MybatisInterceptorConfig(TestResource.class, "configuration"));
interceptor.setInterceptorConfigList(configList);
return interceptor;
}

View File

@ -1,6 +1,7 @@
package io.metersphere.controller;
import io.metersphere.base.domain.TestCaseReport;
import io.metersphere.controller.request.testCaseReport.CreateReportRequest;
import io.metersphere.service.TestCaseReportService;
import org.springframework.web.bind.annotation.*;
@ -25,8 +26,8 @@ public class TestCaseReportController {
}
@PostMapping("/add")
public void add(@RequestBody TestCaseReport TestCaseReport){
testCaseReportService.addTestCaseReport(TestCaseReport);
public Long addByTemplateId(@RequestBody CreateReportRequest request){
return testCaseReportService.addTestCaseReportByTemplateId(request);
}
@PostMapping("/edit")

View File

@ -1,6 +1,7 @@
package io.metersphere.controller;
import io.metersphere.base.domain.TestCaseReportTemplate;
import io.metersphere.controller.request.testCaseReport.QueryTemplateRequest;
import io.metersphere.service.TestCaseReportTemplateService;
import org.springframework.web.bind.annotation.*;
@ -15,7 +16,7 @@ public class TestCaseReportTemplateController {
TestCaseReportTemplateService testCaseReportTemplateService;
@PostMapping("/list")
public List<TestCaseReportTemplate> list(@RequestBody TestCaseReportTemplate request) {
public List<TestCaseReportTemplate> list(@RequestBody QueryTemplateRequest request) {
return testCaseReportTemplateService.listTestCaseReportTemplate(request);
}

View File

@ -49,7 +49,7 @@ public class TestPlanController {
}
@PostMapping("/get/{testPlanId}")
public List<TestPlan> getTestPlan(@PathVariable String testPlanId){
public TestPlan getTestPlan(@PathVariable String testPlanId){
return testPlanService.getTestPlan(testPlanId);
}

View File

@ -3,11 +3,14 @@ package io.metersphere.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.base.domain.TestResourcePool;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.resourcepool.QueryResourcePoolRequest;
import io.metersphere.dto.TestResourcePoolDTO;
import io.metersphere.service.TestResourcePoolService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -15,6 +18,7 @@ import java.util.List;
@RequestMapping("testresourcepool")
@RestController
@RequiresRoles(RoleConstants.ADMIN)
public class TestResourcePoolController {
@Resource
@ -35,6 +39,11 @@ public class TestResourcePoolController {
testResourcePoolService.updateTestResourcePool(testResourcePoolDTO);
}
@GetMapping("/update/{poolId}/{status}")
public void updateTestResourcePoolStatus(@PathVariable String poolId, @PathVariable String status) {
testResourcePoolService.updateTestResourcePoolStatus(poolId, status);
}
@PostMapping("list/{goPage}/{pageSize}")
public Pager<List<TestResourcePoolDTO>> listResourcePools(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryResourcePoolRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
@ -42,6 +51,7 @@ public class TestResourcePoolController {
}
@GetMapping("list/all/valid")
@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER, RoleConstants.TEST_VIEWER}, logical = Logical.OR)
public List<TestResourcePool> listValidResourcePools() {
return testResourcePoolService.listValidResourcePools();
}

View File

@ -27,7 +27,7 @@ public class UserRoleController {
@GetMapping("/list/ws/{workspaceId}/{userId}")
@RequiresRoles(value = {RoleConstants.ADMIN,RoleConstants.ORG_ADMIN}, logical = Logical.OR)
public List<Role> getWorkspaceMemberRole(@PathVariable String workspaceId, @PathVariable String userId) {
public List<Role> getWorkspaceMemberRoles(@PathVariable String workspaceId, @PathVariable String userId) {
return userRoleService.getWorkspaceMemberRoles(workspaceId, userId);
}
}

View File

@ -0,0 +1,9 @@
package io.metersphere.controller.request.testCaseReport;
import lombok.Data;
@Data
public class CreateReportRequest {
String planId;
Long templateId;
}

View File

@ -0,0 +1,9 @@
package io.metersphere.controller.request.testCaseReport;
import io.metersphere.base.domain.TestCaseReportTemplate;
import lombok.Data;
@Data
public class QueryTemplateRequest extends TestCaseReportTemplate {
Boolean queryDefault;
}

View File

@ -63,7 +63,7 @@ public class KubernetesTestEngine extends AbstractEngine {
kubernetesProvider.confirmNamespace(context.getNamespace());
// create cm
try (KubernetesClient client = kubernetesProvider.getKubernetesClient()) {
String configMapName = context.getTestId() + "-files";
String configMapName = "jmeter-" + context.getTestId() + "-files";
ConfigMap configMap = client.configMaps().inNamespace(context.getNamespace()).withName(configMapName).get();
if (configMap == null) {
ConfigMap item = new ConfigMap();

View File

@ -1,7 +1,10 @@
package io.metersphere.report.base;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ChartsData {
/**
@ -52,20 +55,4 @@ public class ChartsData {
public void setyAxis2(BigDecimal yAxis2) {
this.yAxis2 = yAxis2;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}

View File

@ -1,41 +1,13 @@
package io.metersphere.report.base;
import lombok.Data;
@Data
public class Errors {
private String errorType;
private String errorNumber;
private String precentOfErrors;
private String precentOfAllSamples;
private String percentOfErrors;
private String percentOfAllSamples;
public String getErrorType() {
return errorType;
}
public void setErrorType(String errorType) {
this.errorType = errorType;
}
public String getErrorNumber() {
return errorNumber;
}
public void setErrorNumber(String errorNumber) {
this.errorNumber = errorNumber;
}
public String getPrecentOfErrors() {
return precentOfErrors;
}
public void setPrecentOfErrors(String precentOfErrors) {
this.precentOfErrors = precentOfErrors;
}
public String getPrecentOfAllSamples() {
return precentOfAllSamples;
}
public void setPrecentOfAllSamples(String precentOfAllSamples) {
this.precentOfAllSamples = precentOfAllSamples;
}
}

View File

@ -1,5 +1,8 @@
package io.metersphere.report.base;
import lombok.Data;
@Data
public class ErrorsTop5 {
private String sample;
@ -16,107 +19,4 @@ public class ErrorsTop5 {
private String error5;
private String error5Size;
public String getSample() {
return sample;
}
public void setSample(String sample) {
this.sample = sample;
}
public String getSamples() {
return samples;
}
public void setSamples(String samples) {
this.samples = samples;
}
public String getErrorsAllSize() {
return errorsAllSize;
}
public void setErrorsAllSize(String errorsAllSize) {
this.errorsAllSize = errorsAllSize;
}
public String getError1() {
return error1;
}
public void setError1(String error1) {
this.error1 = error1;
}
public String getError1Size() {
return error1Size;
}
public void setError1Size(String error1Size) {
this.error1Size = error1Size;
}
public String getError2() {
return error2;
}
public void setError2(String error2) {
this.error2 = error2;
}
public String getError2Size() {
return error2Size;
}
public void setError2Size(String error2Size) {
this.error2Size = error2Size;
}
public String getError3() {
return error3;
}
public void setError3(String error3) {
this.error3 = error3;
}
public String getError3Size() {
return error3Size;
}
public void setError3Size(String error3Size) {
this.error3Size = error3Size;
}
public String getError4() {
return error4;
}
public void setError4(String error4) {
this.error4 = error4;
}
public String getError4Size() {
return error4Size;
}
public void setError4Size(String error4Size) {
this.error4Size = error4Size;
}
public String getError5() {
return error5;
}
public void setError5(String error5) {
this.error5 = error5;
}
public String getError5Size() {
return error5Size;
}
public void setError5Size(String error5Size) {
this.error5Size = error5Size;
}
}

View File

@ -1,32 +1,12 @@
package io.metersphere.report.base;
import lombok.Data;
@Data
public class ReportTimeInfo {
private String duration;
private String startTime;
private String endTime;
public String getDuration() {
return duration;
}
public void setDuration(String duration) {
this.duration = duration;
}
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
}

View File

@ -1,5 +1,8 @@
package io.metersphere.report.base;
import lombok.Data;
@Data
public class Statistics {
private String label;
@ -28,107 +31,4 @@ public class Statistics {
private String sent;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getSamples() {
return samples;
}
public void setSamples(String samples) {
this.samples = samples;
}
public String getKo() {
return ko;
}
public void setKo(String ko) {
this.ko = ko;
}
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
public String getAverage() {
return average;
}
public void setAverage(String average) {
this.average = average;
}
public String getMin() {
return min;
}
public void setMin(String min) {
this.min = min;
}
public String getMax() {
return max;
}
public void setMax(String max) {
this.max = max;
}
public String getTp90() {
return tp90;
}
public void setTp90(String tp90) {
this.tp90 = tp90;
}
public String getTp95() {
return tp95;
}
public void setTp95(String tp95) {
this.tp95 = tp95;
}
public String getTp99() {
return tp99;
}
public void setTp99(String tp99) {
this.tp99 = tp99;
}
public String getTransactions() {
return transactions;
}
public void setTransactions(String transactions) {
this.transactions = transactions;
}
public String getSent() {
return sent;
}
public void setSent(String sent) {
this.sent = sent;
}
public String getReceived() {
return received;
}
public void setReceived(String received) {
this.received = received;
}
}

View File

@ -1,5 +1,8 @@
package io.metersphere.report.base;
import lombok.Data;
@Data
public class TestOverview {
private String maxUsers;
@ -9,51 +12,4 @@ public class TestOverview {
private String responseTime90;
private String avgBandwidth;
public String getMaxUsers() {
return maxUsers;
}
public void setMaxUsers(String maxUsers) {
this.maxUsers = maxUsers;
}
public String getAvgThroughput() {
return avgThroughput;
}
public void setAvgThroughput(String avgThroughput) {
this.avgThroughput = avgThroughput;
}
public String getErrors() {
return errors;
}
public void setErrors(String errors) {
this.errors = errors;
}
public String getAvgResponseTime() {
return avgResponseTime;
}
public void setAvgResponseTime(String avgResponseTime) {
this.avgResponseTime = avgResponseTime;
}
public String getResponseTime90() {
return responseTime90;
}
public void setResponseTime90(String responseTime90) {
this.responseTime90 = responseTime90;
}
public String getAvgBandwidth() {
return avgBandwidth;
}
public void setAvgBandwidth(String avgBandwidth) {
this.avgBandwidth = avgBandwidth;
}
}

View File

@ -228,6 +228,7 @@ public class PerformanceTestService {
List<TestResource> testResourceList = testResourceService.getResourcesByPoolId(resourcePoolId);
testResourceList.forEach(r -> {
LoadTestReportLog record = new LoadTestReportLog();
record.setId(UUID.randomUUID().toString());
record.setReportId(testReport.getId());
record.setResourceId(r.getId());
record.setContent(StringUtils.EMPTY);

View File

@ -92,7 +92,7 @@ public class TestCaseNodeService {
List<TestCaseNodeDTO> childrens = Optional.ofNullable(nodeTree.getChildren()).orElse(new ArrayList<>());
lowerNodes.forEach(node -> {
if (node.getpId().equals(rootNode.getId())){
if (node.getPId().equals(rootNode.getId())){
childrens.add(buildNodeTree(nodeLevelMap, node));
nodeTree.setChildren(childrens);
}
@ -327,7 +327,7 @@ public class TestCaseNodeService {
private Integer insertTestCaseNode(String nodeName, Integer pId, String projectId, Integer level) {
TestCaseNode testCaseNode = new TestCaseNode();
testCaseNode.setName(nodeName.trim());
testCaseNode.setpId(pId);
testCaseNode.setPId(pId);
testCaseNode.setProjectId(projectId);
testCaseNode.setCreateTime(System.currentTimeMillis());
testCaseNode.setUpdateTime(System.currentTimeMillis());

View File

@ -2,7 +2,13 @@ package io.metersphere.service;
import io.metersphere.base.domain.TestCaseReport;
import io.metersphere.base.domain.TestCaseReportExample;
import io.metersphere.base.domain.TestCaseReportTemplate;
import io.metersphere.base.domain.TestPlan;
import io.metersphere.base.mapper.TestCaseReportMapper;
import io.metersphere.base.mapper.TestCaseReportTemplateMapper;
import io.metersphere.base.mapper.TestPlanMapper;
import io.metersphere.commons.utils.BeanUtils;
import io.metersphere.controller.request.testCaseReport.CreateReportRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -17,14 +23,17 @@ public class TestCaseReportService {
@Resource
TestCaseReportMapper testCaseReportMapper;
@Resource
TestPlanMapper testPlanMapper;
@Resource
TestCaseReportTemplateMapper testCaseReportTemplateMapper;
public List<TestCaseReport> listTestCaseReport(TestCaseReport request) {
TestCaseReportExample example = new TestCaseReportExample();
if ( StringUtils.isNotBlank(request.getName()) ) {
example.createCriteria().andNameEqualTo(request.getName());
}
if ( StringUtils.isNotBlank(request.getPlanId()) ) {
example.createCriteria().andPlanIdEqualTo(request.getPlanId());
}
return testCaseReportMapper.selectByExample(example);
}
@ -43,4 +52,18 @@ public class TestCaseReportService {
public int deleteTestCaseReport(Long id) {
return testCaseReportMapper.deleteByPrimaryKey(id);
}
public Long addTestCaseReportByTemplateId(CreateReportRequest request) {
TestCaseReportTemplate template = testCaseReportTemplateMapper.selectByPrimaryKey(request.getTemplateId());
TestCaseReport report = new TestCaseReport();
BeanUtils.copyBean(report, template);
TestPlan testPlan = testPlanMapper.selectByPrimaryKey(request.getPlanId());
report.setName(testPlan.getName());
report.setId(null);
testCaseReportMapper.insert(report);
testPlan.setReportId(report.getId());
testPlanMapper.updateByPrimaryKeySelective(testPlan);
return report.getId();
}
}

View File

@ -4,6 +4,7 @@ import io.metersphere.base.domain.TestCaseReportTemplate;
import io.metersphere.base.domain.TestCaseReportTemplateExample;
import io.metersphere.base.mapper.TestCaseReportMapper;
import io.metersphere.base.mapper.TestCaseReportTemplateMapper;
import io.metersphere.controller.request.testCaseReport.QueryTemplateRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -18,15 +19,21 @@ public class TestCaseReportTemplateService {
@Resource
TestCaseReportTemplateMapper testCaseReportTemplateMapper;
public List<TestCaseReportTemplate> listTestCaseReportTemplate(TestCaseReportTemplate request) {
public List<TestCaseReportTemplate> listTestCaseReportTemplate(QueryTemplateRequest request) {
TestCaseReportTemplateExample example = new TestCaseReportTemplateExample();
TestCaseReportTemplateExample.Criteria criteria1 = example.createCriteria();
TestCaseReportTemplateExample.Criteria criteria2 = example.createCriteria();
if ( StringUtils.isNotBlank(request.getName()) ) {
example.createCriteria().andNameEqualTo(request.getName());
criteria1.andNameLike("%" + request.getName() + "%");
criteria2.andNameLike("%" + request.getName() + "%");
}
if ( StringUtils.isNotBlank(request.getWorkspaceId()) ) {
example.createCriteria().andWorkspaceIdEqualTo(request.getWorkspaceId());
criteria1.andWorkspaceIdEqualTo(request.getWorkspaceId());
}
if (request.getQueryDefault() != null) {
criteria2.andWorkspaceIdIsNull();
example.or(criteria2);
}
example.or(example.createCriteria().andWorkspaceIdIsNull());
return testCaseReportTemplateMapper.selectByExample(example);
}

View File

@ -53,10 +53,8 @@ public class TestPlanService {
}
public List<TestPlan> getTestPlan(String testPlanId) {
TestPlanExample testPlanExample = new TestPlanExample();
testPlanExample.createCriteria().andIdEqualTo(testPlanId);
return testPlanMapper.selectByExampleWithBLOBs(testPlanExample);
public TestPlan getTestPlan(String testPlanId) {
return testPlanMapper.selectByPrimaryKey(testPlanId);
}
public int editTestPlan(TestPlan testPlan) {

View File

@ -7,15 +7,16 @@ import io.metersphere.base.domain.TestResourcePool;
import io.metersphere.base.domain.TestResourcePoolExample;
import io.metersphere.base.mapper.TestResourceMapper;
import io.metersphere.base.mapper.TestResourcePoolMapper;
import io.metersphere.base.mapper.ext.ExtTestReourcePoolMapper;
import io.metersphere.commons.constants.ResourcePoolTypeEnum;
import io.metersphere.commons.constants.ResourceStatusEnum;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.LogUtil;
import io.metersphere.controller.request.resourcepool.QueryResourcePoolRequest;
import io.metersphere.dto.NodeDTO;
import io.metersphere.dto.TestResourcePoolDTO;
import io.metersphere.engine.kubernetes.provider.KubernetesProvider;
import io.metersphere.i18n.Translator;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.http.HttpStatus;
@ -25,6 +26,8 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
@ -46,8 +49,6 @@ public class TestResourcePoolService {
@Resource
private TestResourceMapper testResourceMapper;
@Resource
private ExtTestReourcePoolMapper extTestReourcePoolMapper;
@Resource
private RestTemplate restTemplate;
public TestResourcePoolDTO addTestResourcePool(TestResourcePoolDTO testResourcePool) {
@ -71,19 +72,68 @@ public class TestResourcePoolService {
testResourcePoolMapper.updateByPrimaryKeySelective(testResourcePool);
}
public List<TestResourcePoolDTO> listResourcePools(QueryResourcePoolRequest request) {
return extTestReourcePoolMapper.listResourcePools(request);
}
private void validateTestResourcePool(TestResourcePoolDTO testResourcePool) {
if (StringUtils.equalsIgnoreCase(testResourcePool.getType(), ResourcePoolTypeEnum.K8S.name())) {
validateK8s(testResourcePool);
public void updateTestResourcePoolStatus(String poolId, String status) {
TestResourcePool testResourcePool = testResourcePoolMapper.selectByPrimaryKey(poolId);
if (testResourcePool == null) {
MSException.throwException("Resource Pool not found.");
}
testResourcePool.setUpdateTime(System.currentTimeMillis());
testResourcePool.setStatus(status);
// 禁用资源池
if (INVALID.name().equals(status)) {
testResourcePoolMapper.updateByPrimaryKeySelective(testResourcePool);
return;
}
validateNodes(testResourcePool);
TestResourcePoolDTO testResourcePoolDTO = new TestResourcePoolDTO();
try {
BeanUtils.copyProperties(testResourcePoolDTO, testResourcePool);
TestResourceExample example2 = new TestResourceExample();
example2.createCriteria().andTestResourcePoolIdEqualTo(poolId);
List<TestResource> testResources = testResourceMapper.selectByExampleWithBLOBs(example2);
testResourcePoolDTO.setResources(testResources);
if (validateTestResourcePool(testResourcePoolDTO)) {
testResourcePoolMapper.updateByPrimaryKeySelective(testResourcePool);
} else {
MSException.throwException("Resource Pool is invalid.");
}
} catch (IllegalAccessException | InvocationTargetException e) {
LogUtil.error(e);
}
}
private void validateNodes(TestResourcePoolDTO testResourcePool) {
public List<TestResourcePoolDTO> listResourcePools(QueryResourcePoolRequest request) {
TestResourcePoolExample example = new TestResourcePoolExample();
TestResourcePoolExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(request.getName())) {
criteria.andNameLike(StringUtils.wrapIfMissing(request.getName(), "%"));
}
List<TestResourcePool> testResourcePools = testResourcePoolMapper.selectByExample(example);
List<TestResourcePoolDTO> testResourcePoolDTOS = new ArrayList<>();
testResourcePools.forEach(pool -> {
TestResourceExample example2 = new TestResourceExample();
example2.createCriteria().andTestResourcePoolIdEqualTo(pool.getId());
List<TestResource> testResources = testResourceMapper.selectByExampleWithBLOBs(example2);
TestResourcePoolDTO testResourcePoolDTO = new TestResourcePoolDTO();
try {
BeanUtils.copyProperties(testResourcePoolDTO, pool);
testResourcePoolDTO.setResources(testResources);
testResourcePoolDTOS.add(testResourcePoolDTO);
} catch (IllegalAccessException | InvocationTargetException e) {
LogUtil.error(e);
}
});
return testResourcePoolDTOS;
}
private boolean validateTestResourcePool(TestResourcePoolDTO testResourcePool) {
if (StringUtils.equalsIgnoreCase(testResourcePool.getType(), ResourcePoolTypeEnum.K8S.name())) {
return validateK8s(testResourcePool);
}
return validateNodes(testResourcePool);
}
private boolean validateNodes(TestResourcePoolDTO testResourcePool) {
if (CollectionUtils.isEmpty(testResourcePool.getResources())) {
MSException.throwException(Translator.get("no_nodes_message"));
}
@ -100,19 +150,21 @@ public class TestResourcePoolService {
MSException.throwException(Translator.get("duplicate_node_ip"));
}
testResourcePool.setStatus(VALID.name());
boolean isValid = true;
for (TestResource resource : testResourcePool.getResources()) {
NodeDTO nodeDTO = JSON.parseObject(resource.getConfiguration(), NodeDTO.class);
boolean isValidate = validateNode(nodeDTO);
if (!isValidate) {
testResourcePool.setStatus(ResourceStatusEnum.INVALID.name());
resource.setStatus(ResourceStatusEnum.INVALID.name());
isValid = false;
} else {
resource.setStatus(VALID.name());
}
resource.setTestResourcePoolId(testResourcePool.getId());
updateTestResource(resource);
}
return isValid;
}
private boolean validateNode(NodeDTO node) {
@ -124,7 +176,7 @@ public class TestResourcePoolService {
}
}
private void validateK8s(TestResourcePoolDTO testResourcePool) {
private boolean validateK8s(TestResourcePoolDTO testResourcePool) {
if (CollectionUtils.isEmpty(testResourcePool.getResources()) || testResourcePool.getResources().size() != 1) {
throw new RuntimeException(Translator.get("only_one_k8s"));
@ -132,18 +184,21 @@ public class TestResourcePoolService {
TestResource testResource = testResourcePool.getResources().get(0);
testResource.setTestResourcePoolId(testResourcePool.getId());
boolean isValid;
try {
KubernetesProvider provider = new KubernetesProvider(testResource.getConfiguration());
provider.validateCredential();
testResource.setStatus(VALID.name());
testResourcePool.setStatus(VALID.name());
isValid = true;
} catch (Exception e) {
testResource.setStatus(ResourceStatusEnum.INVALID.name());
testResourcePool.setStatus(ResourceStatusEnum.INVALID.name());
isValid = false;
}
deleteTestResource(testResourcePool.getId());
updateTestResource(testResource);
return isValid;
}
private void updateTestResource(TestResource testResource) {
@ -168,6 +223,10 @@ public class TestResourcePoolService {
List<TestResourcePoolDTO> testResourcePools = listResourcePools(request);
// 重新校验 pool
for (TestResourcePoolDTO pool : testResourcePools) {
// 手动设置成无效的, 排除
if (INVALID.name().equals(pool.getStatus())) {
continue;
}
try {
updateTestResourcePool(pool);
} catch (MSException e) {
@ -180,4 +239,5 @@ public class TestResourcePoolService {
example.createCriteria().andStatusEqualTo(ResourceStatusEnum.VALID.name());
return testResourcePoolMapper.selectByExample(example);
}
}

View File

@ -1,5 +1,5 @@
CREATE TABLE IF NOT EXISTS `file_content` (
`file_id` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT 'File ID',
`file_id` varchar(64) NOT NULL COMMENT 'File ID',
`file` longblob COMMENT 'File content',
PRIMARY KEY (`file_id`)
)
@ -70,29 +70,24 @@ CREATE TABLE IF NOT EXISTS `load_test_report_detail` (
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_bin;
CREATE TABLE IF NOT EXISTS `load_test_report_result` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`report_id` varchar(50) NOT NULL,
`report_key` varchar(64) DEFAULT NULL,
`report_value` text,
PRIMARY KEY (`id`),
KEY `load_test_report_result_report_id_report_key_index` (`report_id`,`report_key`)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_bin;
CREATE TABLE IF NOT EXISTS `load_test_report_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`report_id` varchar(50) NOT NULL,
`resource_id` varchar(50) DEFAULT NULL,
`content` longtext,
`id` varchar(50) NOT NULL,
`report_id` varchar(50) NOT NULL,
`resource_id` varchar(50) DEFAULT NULL,
`content` longtext ,
PRIMARY KEY (`id`),
KEY `load_test_report_log_report_id_resource_name_index` (`report_id`,`resource_id`)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_bin;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
CREATE TABLE IF NOT EXISTS `load_test_report_result` (
`id` varchar(50) NOT NULL,
`report_id` varchar(50) NOT NULL,
`report_key` varchar(64) DEFAULT NULL,
`report_value` text ,
PRIMARY KEY (`id`),
KEY `load_test_report_result_report_id_report_key_index` (`report_id`,`report_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
CREATE TABLE IF NOT EXISTS `organization` (
`id` varchar(50) NOT NULL COMMENT 'Organization ID',
@ -145,7 +140,7 @@ CREATE TABLE IF NOT EXISTS `system_parameter` (
CREATE TABLE IF NOT EXISTS `test_resource` (
`id` varchar(50) NOT NULL COMMENT 'Test resource ID',
`test_resource_pool_id` varchar(50) COLLATE utf8mb4_bin NOT NULL COMMENT 'Test resource pool ID this test resource belongs to',
`test_resource_pool_id` varchar(50) NOT NULL COMMENT 'Test resource pool ID this test resource belongs to',
`configuration` longtext COMMENT 'Test resource configuration',
`status` varchar(64) NOT NULL COMMENT 'Test resource status',
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
@ -217,13 +212,13 @@ CREATE TABLE IF NOT EXISTS `workspace` (
-- api start
CREATE TABLE IF NOT EXISTS `api_test` (
`id` varchar(50) COLLATE utf8mb4_bin NOT NULL COMMENT 'Test ID',
`project_id` varchar(50) COLLATE utf8mb4_bin NOT NULL COMMENT 'Project ID this test belongs to',
`name` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT 'Test name',
`description` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'Test description',
`scenario_definition` longtext COLLATE utf8mb4_bin COMMENT 'Scenario definition (JSON format)',
`schedule` longtext COLLATE utf8mb4_bin COMMENT 'Test schedule (cron list)',
`status` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL,
`id` varchar(50) NOT NULL COMMENT 'Test ID',
`project_id` varchar(50) NOT NULL COMMENT 'Project ID this test belongs to',
`name` varchar(64) NOT NULL COMMENT 'Test name',
`description` varchar(255) DEFAULT NULL COMMENT 'Test description',
`scenario_definition` longtext COMMENT 'Scenario definition (JSON format)',
`schedule` longtext COMMENT 'Test schedule (cron list)',
`status` varchar(64) DEFAULT NULL,
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
PRIMARY KEY (`id`)
@ -260,6 +255,7 @@ CREATE TABLE IF NOT EXISTS `test_plan` (
`id` varchar(50) NOT NULL COMMENT 'Test Plan ID',
`project_id` varchar(50) NOT NULL COMMENT 'Project ID this plan belongs to',
`workspace_id` varchar(50) NOT NULL COMMENT 'Workspace ID this plan belongs to',
`report_id` bigint(20) COMMENT 'Test plan report',
`name` varchar(64) NOT NULL COMMENT 'Plan name',
`description` varchar(255) DEFAULT NULL COMMENT 'Plan description',
`status` varchar(20) NOT NULL COMMENT 'Plan status',
@ -344,8 +340,9 @@ CREATE TABLE IF NOT EXISTS `test_case_report_template` (
CREATE TABLE IF NOT EXISTS `test_case_report` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(64) NOT NULL COMMENT 'Test case report name',
`plan_id` varchar(50) NOT NULL COMMENT 'Plan ID relation to',
`content` longtext COMMENT 'Report content (JSON format)',
`start_time` bigint(13) COMMENT 'Test start time',
`end_time` bigint(13) COMMENT 'Test end time',
PRIMARY KEY (`id`)
)
ENGINE=InnoDB

View File

@ -10,4 +10,4 @@ INSERT INTO role (id, name, description, type, create_time, update_time) VALUES
INSERT INTO role (id, name, description, type, create_time, update_time) VALUES ('test_user', '测试人员', null, null, 1581576575948, 1581576575948);
INSERT INTO role (id, name, description, type, create_time, update_time) VALUES ('test_viewer', 'Viewer', null, null, 1581576575948, 1581576575948);
INSERT INTO test_case_report_template (name,content) VALUES ("默认模版","{\"components\":[1,2,3,4,5],\"contentMap\":{\"richTextComponentTitleSet\":{},\"richTextComponentContentSet\":{}}}");
INSERT INTO test_case_report_template (name,content) VALUES ("默认模版","{\"components\": [1,2,3,4,5]}");

View File

@ -10,7 +10,20 @@
<context id="mysql" targetRuntime="MyBatis3">
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"/>
<plugin type="org.mybatis.generator.plugins.UnmergeableXmlMappersPlugin" />
<!-- Lombok插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LombokPlugin">
<!-- @Data 默认开启,同时插件会对子类自动附加@EqualsAndHashCode(callSuper = true)@ToString(callSuper = true) -->
<property name="@Data" value="true"/>
<!-- @Builder 必须在 Lombok 版本 >= 1.18.2 的情况下开启,对存在继承关系的类自动替换成@SuperBuilder -->
<property name="@Builder" value="false"/>
<!-- @NoArgsConstructor 和 @AllArgsConstructor 使用规则和Lombok一致 -->
<property name="@AllArgsConstructor" value="false"/>
<property name="@NoArgsConstructor" value="false"/>
<!-- @Getter、@Setter、@Accessors 等使用规则参见官方文档 -->
<property name="@Accessors(chain = true)" value="false"/>
<!-- 临时解决IDEA工具对@SuperBuilder的不支持问题开启后(默认未开启)插件在遇到@SuperBuilder注解时会调用ModelBuilderPlugin来生成相应的builder代码 -->
<property name="supportSuperBuilderForIdea" value="false"/>
</plugin>
<!-- 用来除去时间信息的这在配合类似subversion的代码管理工具时使用很有效因为可以减少没有必要的注释迁入 -->
<commentGenerator>
<property name="suppressDate" value="true"/>
@ -46,14 +59,15 @@
<!--要生成的数据库表 -->
<table tableName="api_test"/>
<table tableName="api_test_file"/>
<table tableName="api_test_report"/>
<!--<table tableName="test_case_node">-->
<!--<generatedKey column="id" sqlStatement="MySql" identity="true"/>-->
<!--</table>-->
<!--<table tableName="test_case"/>-->
<!--<table tableName="test_plan_test_case"/>-->
<table tableName="test_plan"/>
<table tableName="test_case_report">
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>
<table tableName="test_case_report_template">
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>
</context>
</generatorConfiguration>

View File

@ -0,0 +1,35 @@
<template>
<div>
<ms-tag v-for="(role, index) in roles"
:key="index"
:effect="effect"
:type="type"
:content="role.name"/>
</div>
</template>
<script>
import MsTag from "./MsTag";
export default {
name: "MsRolesTag",
components: {MsTag},
props: {
type: {
type: String,
default: 'primary',
},
roles: {
type: Array
},
effect: {
type: String,
default: 'dark',
}
}
}
</script>
<style scoped>
</style>

View File

@ -6,6 +6,7 @@
:effect="effect">
<el-button @click="exec()"
@click.stop="clickStop"
@keydown.enter.native.prevent
circle
:type="type"
:icon="icon"

View File

@ -1,6 +1,5 @@
<template>
<div id="menu-bar" v-if="isRouterAlive">
<div id="menu-bar">
<el-row type="flex">
<el-col :span="8">
<el-menu class="header-menu" :unique-opened="true" mode="horizontal" router :default-active='$route.path'>
@ -24,8 +23,8 @@
<el-divider/>
<ms-show-all :index="'/performance/test/all'"/>
<ms-create-button :index="'/performance/test/create'" :title="$t('load_test.create')"/>
<el-menu-item :index="testCaseProjectPath" class="blank_item"></el-menu-item>
<el-menu-item :index="testEditPath" class="blank_item"></el-menu-item>
<!-- <el-menu-item :index="testCaseProjectPath" class="blank_item"></el-menu-item>-->
<!-- <el-menu-item :index="testEditPath" class="blank_item"></el-menu-item>-->
</el-submenu>
<el-submenu v-if="isCurrentWorkspaceUser"
@ -45,7 +44,6 @@
<el-col :span="8"/>
</el-row>
</div>
</template>
<script>
@ -67,10 +65,10 @@
data() {
return {
isCurrentWorkspaceUser: false,
testCaseProjectPath: '',
testEditPath: '',
reportViewPath: '',
isRouterAlive: true,
// testCaseProjectPath: '',
// testEditPath: '',
// reportViewPath: '',
// isRouterAlive: true,
projectRecent: {
title: this.$t('project.recent'),
url: "/project/recent/5",
@ -104,32 +102,32 @@
mounted() {
this.isCurrentWorkspaceUser = checkoutCurrentWorkspace();
},
watch: {
'$route'(to, from) {
let path = to.path;
//
if (path.indexOf("/performance/test/") >= 0) {
this.testCaseProjectPath = '/performance/test/' + this.$route.params.projectId;
this.reload();
}
if (path.indexOf("/performance/test/edit/") >= 0) {
this.testEditPath = '/performance/test/edit/' + this.$route.params.testId;
this.reload();
}
if (path.indexOf("/performance/report/view/") >= 0) {
this.reportViewPath = '/performance/report/view/' + this.$route.params.reportId;
this.reload();
}
}
},
methods: {
reload() {
this.isRouterAlive = false;
this.$nextTick(function () {
this.isRouterAlive = true;
})
}
}
// watch: {
// '$route'(to, from) {
// let path = to.path;
// //
// if (path.indexOf("/performance/test/") >= 0) {
// this.testCaseProjectPath = '/performance/test/' + this.$route.params.projectId;
// this.reload();
// }
// if (path.indexOf("/performance/test/edit/") >= 0) {
// this.testEditPath = '/performance/test/edit/' + this.$route.params.testId;
// this.reload();
// }
// if (path.indexOf("/performance/report/view/") >= 0) {
// this.reportViewPath = '/performance/report/view/' + this.$route.params.reportId;
// this.reload();
// }
// }
// },
// methods: {
// reload() {
// this.isRouterAlive = false;
// this.$nextTick(function () {
// this.isRouterAlive = true;
// })
// }
// }
}
</script>

View File

@ -6,27 +6,29 @@
<el-col :span="16">
<el-row>
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/' }">{{projectName}}</el-breadcrumb-item>
<el-breadcrumb-item>{{testName}}</el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/performance/test/' + this.projectId }">{{projectName}}
</el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/performance/test/edit/' + this.testId }">{{testName}}
</el-breadcrumb-item>
<el-breadcrumb-item>{{reportName}}</el-breadcrumb-item>
</el-breadcrumb>
</el-row>
<el-row class="ms-report-view-btns">
<el-button type="primary" plain size="mini">立即停止</el-button>
<el-button type="success" plain size="mini">再次执行</el-button>
<el-button type="info" plain size="mini">导出</el-button>
<el-button type="warning" plain size="mini">比较</el-button>
<el-button type="primary" plain size="mini">{{$t('report.test_stop_now')}}</el-button>
<el-button type="success" plain size="mini">{{$t('report.test_execute_again')}}</el-button>
<el-button type="info" plain size="mini">{{$t('report.export')}}</el-button>
<el-button type="warning" plain size="mini">{{$t('report.compare')}}</el-button>
</el-row>
</el-col>
<el-col :span="8">
<span class="ms-report-time-desc">
持续时间 {{minutes}} 分钟 {{seconds}}
{{$t('report.test_duration', [this.minutes, this.seconds])}}
</span>
<span class="ms-report-time-desc">
开始时间 {{startTime}}
{{$t('report.test_start_time')}}{{startTime}}
</span>
<span class="ms-report-time-desc">
结束时间 {{endTime}}
{{$t('report.test_end_time')}}{{endTime}}
</span>
</el-col>
</el-row>
@ -74,7 +76,9 @@
reportId: '',
status: '',
reportName: '',
testId: '',
testName: '',
projectId: '',
projectName: '',
startTime: '0',
endTime: '0',
@ -90,7 +94,9 @@
let data = res.data;
if (data) {
this.reportName = data.name;
this.testId = data.testId;
this.testName = data.testName;
this.projectId = data.projectId;
this.projectName = data.projectName;
}
})
@ -118,11 +124,11 @@
this.status = data.status;
switch (data.status) {
case 'Error':
this.$warning("报告生成错误,无法查看!");
this.$warning(this.$t('report.generation_error'));
break;
case 'Starting':
case 'Reporting':
this.$info("报告生成中....");
this.$info(this.$t('report.being_generated'));
break;
case 'Running':
break;

View File

@ -136,10 +136,10 @@
},
handleEdit(report) {
if (report.status === "Error") {
this.$warning("报告生成错误,无法查看!");
this.$warning(this.$t('report.generation_error'));
return false
} else if (report.status === "Starting") {
this.$info("报告生成中...")
this.$info(this.$t('being_generated'))
return false
}
this.$router.push({
@ -172,10 +172,4 @@
width: 100%;
}
.table-page {
padding-top: 20px;
margin-right: -9px;
float: right;
}
</style>

View File

@ -19,12 +19,12 @@
sortable>
</el-table-column>
<el-table-column
prop="precentOfErrors"
prop="percentOfErrors"
label="% in errors"
sortable>
</el-table-column>
<el-table-column
prop="precentOfAllSamples"
prop="percentOfAllSamples"
label="% in all samples"
sortable>
</el-table-column>

View File

@ -31,7 +31,7 @@
</el-form>
<template v-slot:footer>
<div class="dialog-footer">
<el-button type="primary" onkeydown="return false;" @click="submit('form')" size="medium">
<el-button type="primary" @keydown.enter.native.prevent @click="submit('form')" size="medium">
{{$t('commons.save')}}
</el-button>
</div>

View File

@ -3,7 +3,7 @@
<div class="menus">
<ms-current-user/>
<el-divider/>
<h1>设置</h1>
<h1>{{$t('commons.setting')}}</h1>
<ms-setting-menu/>
</div>
<div class="container">

View File

@ -11,17 +11,12 @@
<el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column prop="roles" :label="$t('commons.role')" width="140">
<template v-slot:default="scope">
<el-tag v-for="(role, index) in scope.row.roles" :key="index" size="mini" effect="dark">
{{ role.name }}
</el-tag>
<ms-roles-tag :roles="scope.row.roles"/>
</template>
</el-table-column>
<el-table-column>
<template v-slot:default="scope">
<el-button @click="edit(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" size="mini"
circle/>
<el-button @click="del(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" size="mini"
circle/>
<ms-table-operator @editClick="edit(scope.row)" @deleteClick="del(scope.row)"/>
</template>
</el-table-column>
</el-table>
@ -58,8 +53,9 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;"
@click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
<el-button @click="submitForm('form')" @keydown.enter.native.prevent type="primary"
size="medium">{{$t('commons.save')}}
</el-button>
</span>
</template>
</el-dialog>
@ -92,8 +88,9 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;"
@click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
<el-button @click="updateOrgMember('updateUserForm')" @keydown.enter.native.prevent type="primary"
size="medium">{{$t('commons.save')}}
</el-button>
</span>
</template>
</el-dialog>
@ -105,10 +102,12 @@
import {TokenKey} from "../../../../common/js/constants";
import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader";
import MsRolesTag from "../../common/components/MsRolesTag";
import MsTableOperator from "../../common/components/MsTableOperator";
export default {
name: "MsOrganizationMember",
components: {MsCreateBox, MsTablePagination, MsTableHeader},
components: {MsCreateBox, MsTablePagination, MsTableHeader, MsRolesTag, MsTableOperator},
created() {
this.initTableData();
},

View File

@ -16,10 +16,7 @@
</el-table-column>
<el-table-column>
<template v-slot:default="scope">
<el-button @click="edit(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" size="mini"
circle/>
<el-button @click="del(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" size="mini"
circle/>
<ms-table-operator @editClick="edit(scope.row)" @deleteClick="del(scope.row)"/>
</template>
</el-table-column>
</el-table>
@ -38,8 +35,9 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;"
@click="submit('form')" size="medium">{{$t('commons.save')}}</el-button>
<el-button @click="submit('form')" @keydown.enter.native.prevent type="primary"
size="medium">{{$t('commons.save')}}
</el-button>
</span>
</template>
</el-dialog>
@ -55,26 +53,23 @@
<el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column :label="$t('commons.role')" width="120">
<template v-slot:default="scope">
<el-tag v-for="(role, index) in scope.row.roles" :key="index" size="mini" effect="dark" type="success">
{{ role.name }}
</el-tag>
<ms-roles-tag :roles="scope.row.roles" type="success"/>
</template>
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<el-button @click="editMember(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit"
size="mini" circle/>
<el-button @click="delMember(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete"
size="mini" circle/>
<ms-table-operator @editClick="editMember(scope.row)" @deleteClick="delMember(scope.row)"/>
</template>
</el-table-column>
</el-table>
<ms-table-pagination :change="dialogSearch" :current-page.sync="dialogCurrentPage" :page-size.sync="dialogPageSize"
<ms-table-pagination :change="dialogSearch" :current-page.sync="dialogCurrentPage"
:page-size.sync="dialogPageSize"
:total="dialogTotal"/>
</el-dialog>
<!-- add workspace member dialog -->
<el-dialog :title="$t('member.create')" :visible.sync="dialogWsMemberAddVisible" width="30%" :destroy-on-close="true"
<el-dialog :title="$t('member.create')" :visible.sync="dialogWsMemberAddVisible" width="30%"
:destroy-on-close="true"
@close="closeFunc">
<el-form :model="memberForm" ref="form" :rules="wsMemberRule" label-position="right" label-width="100px"
size="small">
@ -105,14 +100,16 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;"
@click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
<el-button @click="submitForm('form')" @keydown.enter.native.prevent type="primary"
size="medium">{{$t('commons.save')}}
</el-button>
</span>
</template>
</el-dialog>
<!-- update workspace member dialog -->
<el-dialog :title="$t('member.modify')" :visible.sync="dialogWsMemberUpdateVisible" width="30%" :destroy-on-close="true"
<el-dialog :title="$t('member.modify')" :visible.sync="dialogWsMemberUpdateVisible" width="30%"
:destroy-on-close="true"
@close="closeFunc">
<el-form :model="memberForm" label-position="right" label-width="100px" size="small" ref="updateUserForm">
<el-form-item label="ID" prop="id">
@ -141,8 +138,9 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;"
@click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
<el-button @click="updateOrgMember('updateUserForm')" @keydown.enter.native.prevent type="primary"
size="medium">{{$t('commons.save')}}
</el-button>
</span>
</template>
</el-dialog>
@ -156,10 +154,12 @@
import {TokenKey} from "../../../../common/js/constants";
import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader";
import MsRolesTag from "../../common/components/MsRolesTag";
import MsTableOperator from "../../common/components/MsTableOperator";
export default {
name: "MsOrganizationWorkspace",
components: {MsCreateBox, MsTablePagination, MsTableHeader},
components: {MsCreateBox, MsTablePagination, MsTableHeader, MsRolesTag, MsTableOperator},
mounted() {
this.list();
},

View File

@ -27,8 +27,10 @@
</el-table-column>
</el-table>
<el-dialog :title="$t('member.modify_personal_info')" :visible.sync="updateVisible" width="30%" :destroy-on-close="true" @close="closeFunc">
<el-form :model="form" label-position="right" label-width="100px" size="small" :rules="rule" ref="updateUserForm">
<el-dialog :title="$t('member.modify_personal_info')" :visible.sync="updateVisible" width="30%"
:destroy-on-close="true" @close="closeFunc">
<el-form :model="form" label-position="right" label-width="100px" size="small" :rules="rule"
ref="updateUserForm">
<el-form-item label="ID" prop="id">
<el-input v-model="form.id" autocomplete="off" :disabled="true"/>
</el-form-item>
@ -44,8 +46,9 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;"
@click="updateUser('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
<el-button @click="updateUser('updateUserForm')" @keydown.enter.native.prevent type="primary"
size="medium">{{$t('commons.save')}}
</el-button>
</span>
</template>
</el-dialog>
@ -68,7 +71,7 @@
rule: {
name: [
{required: true, message: this.$t('member.input_name'), trigger: 'blur'},
{ min: 2, max: 10, message: this.$t('commons.input_limit', [2, 10]), trigger: 'blur' },
{min: 2, max: 10, message: this.$t('commons.input_limit', [2, 10]), trigger: 'blur'},
{
required: true,
pattern: /^[\u4e00-\u9fa5_a-zA-Z0-9.·-]+$/,
@ -85,7 +88,7 @@
}
],
email: [
{ required: true, message: this.$t('member.input_email'), trigger: 'blur' },
{required: true, message: this.$t('member.input_email'), trigger: 'blur'},
{
required: true,
pattern: /^([A-Za-z0-9_\-.])+@([A-Za-z0-9]+\.)+[A-Za-z]{2,6}$/,
@ -112,7 +115,7 @@
updateUser(updateUserForm) {
this.$refs[updateUserForm].validate(valide => {
if (valide) {
this.result = this.$post(this.updatePath, this.form,response => {
this.result = this.$post(this.updatePath, this.form, response => {
this.$success(this.$t('commons.modify_success'));
localStorage.setItem(TokenKey, JSON.stringify(response.data));
this.updateVisible = false;

View File

@ -19,10 +19,7 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<el-button @click="edit(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" size="mini"
circle/>
<el-button @click="del(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" size="mini"
circle/>
<ms-table-operator @editClick="edit(scope.row)" @deleteClick="del(scope.row)"/>
</template>
</el-table-column>
</el-table>
@ -41,17 +38,12 @@
<el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column :label="$t('commons.role')" width="140">
<template v-slot:default="scope">
<el-tag v-for="(role, index) in scope.row.roles" :key="index" size="mini" effect="dark">
{{ role.name }}
</el-tag>
<ms-roles-tag :roles="scope.row.roles"/>
</template>
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<el-button @click="editMember(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit"
size="mini" circle/>
<el-button @click="delMember(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete"
size="mini" circle/>
<ms-table-operator @editClick="editMember(scope.row)" @deleteClick="delMember(scope.row)"/>
</template>
</el-table-column>
</el-table>
@ -74,8 +66,9 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;"
@click="createOrganization('createOrganization')" size="medium">{{$t('commons.save')}}</el-button>
<el-button @click="createOrganization('createOrganization')" @keydown.enter.native.prevent type="primary"
size="medium">{{$t('commons.save')}}
</el-button>
</span>
</template>
</el-dialog>
@ -95,9 +88,9 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;"
@click="updateOrganization('updateOrganizationForm')"
size="medium">{{$t('organization.modify')}}</el-button>
<el-button @click="updateOrganization('updateOrganizationForm')" @keydown.enter.native.prevent type="primary"
size="medium">{{$t('organization.modify')}}
</el-button>
</span>
</template>
</el-dialog>
@ -135,8 +128,9 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;"
@click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
<el-button @click="submitForm('form')" @keydown.enter.native.prevent type="primary"
size="medium">{{$t('commons.save')}}
</el-button>
</span>
</template>
</el-dialog>
@ -172,8 +166,9 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;"
@click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
<el-button @click="updateOrgMember('updateUserForm')" @keydown.enter.native.prevent type="primary"
size="medium">{{$t('commons.save')}}
</el-button>
</span>
</template>
</el-dialog>
@ -185,10 +180,12 @@
import MsCreateBox from "../CreateBox";
import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader";
import MsRolesTag from "../../common/components/MsRolesTag";
import MsTableOperator from "../../common/components/MsTableOperator";
export default {
name: "MsOrganization",
components: {MsCreateBox, MsTablePagination, MsTableHeader},
components: {MsCreateBox, MsTablePagination, MsTableHeader, MsRolesTag, MsTableOperator},
data() {
return {
queryPath: '/organization/list',

View File

@ -18,8 +18,7 @@
</el-table-column>
<el-table-column>
<template v-slot:default="scope">
<el-button @click="edit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="del(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
<ms-table-operator @editClick="edit(scope.row)" @deleteClick="del(scope.row)"/>
</template>
</el-table-column>
</el-table>
@ -50,7 +49,7 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" @click="submit('form')" size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" @keydown.enter.native.prevent @click="submit('form')" size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
@ -78,7 +77,7 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateWorkspace('updateForm')" onkeydown="return false;"
<el-button type="primary" @click="updateWorkspace('updateForm')" @keydown.enter.native.prevent
size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
@ -96,17 +95,12 @@
<el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column :label="$t('commons.role')" width="120">
<template v-slot:default="scope">
<el-tag v-for="(role, index) in scope.row.roles" :key="index" size="mini" effect="dark" type="success">
{{ role.name }}
</el-tag>
<ms-roles-tag :roles="scope.row.roles" type="success"/>
</template>
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<el-button @click="editMember(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit"
size="mini" circle/>
<el-button @click="delMember(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete"
size="mini" circle/>
<ms-table-operator @editClick="editMember(scope.row)" @deleteClick="delMember(scope.row)"/>
</template>
</el-table-column>
</el-table>
@ -116,7 +110,8 @@
</el-dialog>
<!-- add workspace member dialog -->
<el-dialog :title="$t('member.create')" :visible.sync="dialogWsMemberAddVisible" width="30%" :destroy-on-close="true"
<el-dialog :title="$t('member.create')" :visible.sync="dialogWsMemberAddVisible" width="30%"
:destroy-on-close="true"
@close="closeFunc">
<el-form :model="memberForm" ref="form" :rules="wsMemberRule" label-position="right" label-width="100px"
size="small">
@ -147,13 +142,16 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" @keydown.enter.native.prevent @click="submitForm('form')" size="medium">
{{$t('commons.save')}}
</el-button>
</span>
</template>
</el-dialog>
<!-- update workspace member dialog -->
<el-dialog :title="$t('member.modify')" :visible.sync="dialogWsMemberUpdateVisible" width="30%" :destroy-on-close="true"
<el-dialog :title="$t('member.modify')" :visible.sync="dialogWsMemberUpdateVisible" width="30%"
:destroy-on-close="true"
@close="closeFunc">
<el-form :model="memberForm" label-position="right" label-width="100px" size="small" ref="updateUserForm">
<el-form-item label="ID" prop="id">
@ -182,8 +180,9 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" @click="updateOrgMember('updateUserForm')" onkeydown="return false;"
size="medium">{{$t('commons.save')}}</el-button>
<el-button type="primary" @click="updateOrgMember('updateUserForm')" @keydown.enter.native.prevent
size="medium">{{$t('commons.save')}}
</el-button>
</span>
</template>
@ -197,10 +196,12 @@
import {Message} from "element-ui";
import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader";
import MsRolesTag from "../../common/components/MsRolesTag";
import MsTableOperator from "../../common/components/MsTableOperator";
export default {
name: "MsSystemWorkspace",
components: {MsCreateBox, MsTablePagination, MsTableHeader},
components: {MsCreateBox, MsTablePagination, MsTableHeader, MsRolesTag, MsTableOperator},
mounted() {
this.list();
},

View File

@ -11,7 +11,7 @@
<el-table-column prop="description" :label="$t('commons.description')"/>
<el-table-column prop="type" :label="$t('test_resource_pool.type')">
<template v-slot:default="scope">
<span v-if="scope.row.type === 'NODE'">Single Docker</span>
<span v-if="scope.row.type === 'NODE'">Node</span>
<span v-if="scope.row.type === 'K8S'">Kubernetes</span>
</template>
</el-table-column>
@ -38,8 +38,7 @@
</el-table-column>
<el-table-column>
<template v-slot:default="scope">
<el-button @click="edit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="del(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
<ms-table-operator @editClick="edit(scope.row)" @deleteClick="del(scope.row)"/>
</template>
</el-table-column>
</el-table>
@ -64,7 +63,7 @@
<el-select v-model="form.type" :placeholder="$t('test_resource_pool.select_pool_type')"
@change="changeResourceType()">
<el-option key="K8S" value="K8S" label="Kubernetes">Kubernetes</el-option>
<el-option key="NODE" value="NODE" label="Node">Single Docker</el-option>
<el-option key="NODE" value="NODE" label="Node">Node</el-option>
</el-select>
</el-form-item>
<div v-for="(item,index) in infoList " :key="index">
@ -122,9 +121,10 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;"
@click="createTestResourcePool('createTestResourcePoolForm')"
size="medium">{{$t('commons.create')}}</el-button>
<el-button @click="createTestResourcePool('createTestResourcePoolForm')" @keydown.enter.native.prevent
type="primary"
size="medium">{{$t('commons.create')}}
</el-button>
</span>
</template>
</el-dialog>
@ -146,7 +146,7 @@
<el-select v-model="form.type" :placeholder="$t('test_resource_pool.select_pool_type')"
@change="changeResourceType()">
<el-option key="K8S" value="K8S" label="Kubernetes">Kubernetes</el-option>
<el-option key="NODE" value="NODE" label="Node">Single Docker</el-option>
<el-option key="NODE" value="NODE" label="Node">Node</el-option>
</el-select>
</el-form-item>
<div v-for="(item,index) in infoList " :key="index">
@ -202,9 +202,10 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;"
@click="updateTestResourcePool('updateTestResourcePoolForm')"
size="medium">{{$t('commons.save')}}</el-button>
<el-button @click="updateTestResourcePool('updateTestResourcePoolForm')" @keydown.enter.native.prevent
type="primary"
size="medium">{{$t('commons.save')}}
</el-button>
</span>
</template>
</el-dialog>
@ -216,10 +217,11 @@
import MsCreateBox from "../CreateBox";
import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader";
import MsTableOperator from "../../common/components/MsTableOperator";
export default {
name: "MsTestResourcePool",
components: {MsCreateBox, MsTablePagination, MsTableHeader},
components: {MsCreateBox, MsTablePagination, MsTableHeader, MsTableOperator},
data() {
return {
result: {},
@ -413,9 +415,13 @@
this.form = {};
},
changeSwitch(row) {
this.result = this.$post('/testresourcepool/update', row).then(() => {
this.$success(this.$t('test_resource_pool.status_change_success'));
})
this.result = this.$get('/testresourcepool/update/' + row.id + '/' + row.status)
.then(() => {
this.$success(this.$t('test_resource_pool.status_change_success'));
}).catch(() => {
this.$error(this.$t('test_resource_pool.status_change_failed'));
row.status = 'INVALID';
})
}
}
}

View File

@ -30,8 +30,7 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<el-button @click="edit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="del(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
<ms-table-operator @editClick="edit(scope.row)" @deleteClick="del(scope.row)"/>
</template>
</el-table-column>
</el-table>
@ -59,8 +58,8 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;"
@click="createUser('createUserForm')" size="medium">创建</el-button>
<el-button @click="createUser('createUserForm')" @keydown.enter.native.prevent type="primary"
size="medium">{{$t('commons.save')}}</el-button>
</span>
</template>
</el-dialog>
@ -83,8 +82,9 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;"
@click="updateUser('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
<el-button @click="updateUser('updateUserForm')" @keydown.enter.native.prevent type="primary"
size="medium">{{$t('commons.save')}}
</el-button>
</span>
</template>
</el-dialog>
@ -96,10 +96,11 @@
import MsCreateBox from "../CreateBox";
import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader";
import MsTableOperator from "../../common/components/MsTableOperator";
export default {
name: "MsUser",
components: {MsCreateBox, MsTablePagination, MsTableHeader},
components: {MsCreateBox, MsTablePagination, MsTableHeader, MsTableOperator},
data() {
return {
queryPath: '/user/special/list',

View File

@ -12,10 +12,10 @@
<el-main>
<testcase-template-item v-for="item in templates" :key="item.id"
:template="item" @templateEdit="templateEdit"/>
:template="item" @templateEdit="templateEdit" @refresh="initData"/>
</el-main>
<test-case-report-template-edit ref="templateEdit"/>
<test-case-report-template-edit ref="templateEdit" @refresh="initData"/>
</el-card>
@ -57,11 +57,8 @@
this.templates = response.data;
});
},
templateCreate() {
},
templateEdit(template) {
this.$refs.templateEdit.open(template);
templateEdit(id) {
this.$refs.templateEdit.open(id);
}
}
}
@ -69,6 +66,8 @@
<style scoped>
.el-card {
min-height: 300px;
}
</style>

View File

@ -9,19 +9,14 @@
<el-table-column prop="name" :label="$t('commons.username')"/>
<el-table-column prop="email" :label="$t('commons.email')"/>
<el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column prop="roles" label="角色" width="120">
<el-table-column prop="roles" :label="$t('commons.role')" width="120">
<template v-slot:default="scope">
<el-tag v-for="(role, index) in scope.row.roles" :key="index" size="mini" effect="dark" type="success">
{{ role.name }}
</el-tag>
<ms-roles-tag :roles="scope.row.roles" type="success"/>
</template>
</el-table-column>
<el-table-column>
<template v-slot:default="scope">
<el-button @click="edit(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" size="mini"
circle v-permission="['test_manager']"/>
<el-button @click="del(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" size="mini"
circle v-permission="['test_manager']"/>
<ms-table-operator @editClick="edit(scope.row)" @deleteClick="del(scope.row)" v-permission="['test_manager']"/>
</template>
</el-table-column>
</el-table>
@ -29,9 +24,10 @@
:total="total"/>
</el-card>
<el-dialog title="添加成员" :visible.sync="createVisible" width="30%" :destroy-on-close="true" @close="closeFunc">
<el-dialog :title="$t('member.create')" :visible.sync="createVisible" width="30%" :destroy-on-close="true"
@close="closeFunc">
<el-form :model="form" ref="form" :rules="rules" label-position="right" label-width="100px" size="small">
<el-form-item label="成员" prop="userIds">
<el-form-item :label="$t('commons.member')" prop="userIds">
<el-select v-model="form.userIds" multiple :placeholder="$t('member.please_choose_member')"
class="select-width">
<el-option
@ -44,7 +40,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="角色" prop="roleIds">
<el-form-item :label="$t('commons.role')" prop="roleIds">
<el-select v-model="form.roleIds" multiple :placeholder="$t('role.please_choose_role')" class="select-width">
<el-option
v-for="item in form.roles"
@ -57,13 +53,15 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;"
@click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button>
<el-button @click="submitForm('form')" @keydown.enter.native.prevent type="primary"
size="medium">{{$t('commons.save')}}
</el-button>
</span>
</template>
</el-dialog>
<el-dialog title="修改成员" :visible.sync="updateVisible" width="30%" :destroy-on-close="true" @close="closeFunc">
<el-dialog :title="$t('member.modify')" :visible.sync="updateVisible" width="30%" :destroy-on-close="true"
@close="closeFunc">
<el-form :model="form" label-position="right" label-width="100px" size="small" ref="updateUserForm">
<el-form-item label="ID" prop="id">
<el-input v-model="form.id" autocomplete="off" :disabled="true"/>
@ -77,7 +75,7 @@
<el-form-item :label="$t('commons.phone')" prop="phone">
<el-input v-model="form.phone" autocomplete="off"/>
</el-form-item>
<el-form-item label="角色" prop="roleIds">
<el-form-item :label="$t('commons.role')" prop="roleIds">
<el-select v-model="form.roleIds" multiple :placeholder="$t('role.please_choose_role')" class="select-width">
<el-option
v-for="item in form.allroles"
@ -90,8 +88,9 @@
</el-form>
<template v-slot:footer>
<span class="dialog-footer">
<el-button type="primary" onkeydown="return false;"
@click="updateWorkspaceMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button>
<el-button @click="updateWorkspaceMember('updateUserForm')" @keydown.enter.native.prevent type="primary"
size="medium">{{$t('commons.save')}}
</el-button>
</span>
</template>
</el-dialog>
@ -104,10 +103,12 @@
import {TokenKey} from "../../../../common/js/constants";
import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader";
import MsRolesTag from "../../common/components/MsRolesTag";
import MsTableOperator from "../../common/components/MsTableOperator";
export default {
name: "MsMember",
components: {MsCreateBox, MsTablePagination, MsTableHeader},
components: {MsCreateBox, MsTablePagination, MsTableHeader, MsRolesTag, MsTableOperator},
data() {
return {
result: {},

View File

@ -3,34 +3,38 @@
<common-component :title="'基础信息'">
<el-row type="flex" justify="space-between">
<el-col :span="12">
<span>所属项目</span>
<span class="item-value">{{reportInfo.project}}</span>
</el-col>
<el-col :span="12">
<span>测试负责人</span>
<span class="item-value">{{reportInfo.principal}}</span>
</el-col>
</el-row>
<template>
<el-row type="flex" justify="space-between">
<el-col :span="12">
<span>开始时间</span>
<span class="item-value">{{reportInfo.startTime}}</span>
</el-col>
<el-col :span="12">
<span>结束时间</span>
<span class="item-value">{{reportInfo.endTime}}</span>
</el-col>
</el-row>
<el-row type="flex" justify="space-between">
<el-col :span="12">
<span>所属项目</span>
<span class="item-value">{{reportInfo.project}}</span>
</el-col>
<el-col :span="12">
<span>测试负责人</span>
<span class="item-value">{{reportInfo.principal}}</span>
</el-col>
</el-row>
<el-row type="flex" justify="space-between">
<el-col :span="12">
<span>测试执行人</span>
<span v-for="item in reportInfo.executors" :key="item">{{item}}</span>
</el-col>
</el-row>
<el-row type="flex" justify="space-between">
<el-col :span="12">
<span>开始时间</span>
<span class="item-value">{{reportInfo.startTime}}</span>
</el-col>
<el-col :span="12">
<span>结束时间</span>
<span class="item-value">{{reportInfo.endTime}}</span>
</el-col>
</el-row>
<el-row type="flex" justify="space-between">
<el-col :span="12">
<span>测试执行人</span>
<span v-for="item in reportInfo.executors" :key="item">{{item}}</span>
</el-col>
</el-row>
</template>
</common-component>

View File

@ -1,17 +1,18 @@
<template>
<el-card class="template-component">
<template v-slot:header>
<template v-slot:header >
<slot name="header">
<span class="title">{{title}}</span>
</slot>
</template>
<el-main>
<slot></slot>
</el-main>
<template>
<el-main>
<slot></slot>
</el-main>
</template>
</el-card>
@ -30,6 +31,9 @@
type: String,
default: '标题'
}
},
methods: {
}
}
</script>

View File

@ -0,0 +1,47 @@
<template>
<common-component>
<template v-slot:header>
<el-input v-model="preview.title"></el-input>
</template>
<template>
<ckeditor :editor="editor" v-model="preview.content" :config="editorConfig"></ckeditor>
</template>
</common-component>
</template>
<script>
import CommonComponent from "./CommonComponent";
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
export default {
name: "RichTextComponent",
components: {CommonComponent},
data() {
return {
editor: ClassicEditor,
// editorData: '<p>Content of the editor.</p>',
editorConfig: {
// The configuration of the editor.
}
}
},
props: {
preview: Object,
default() {
return {
title: '',
content: '<p>Content of the editor.</p>'
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,82 @@
<template>
<el-row type="flex" class="head-bar">
<el-col :span="12">
<div class="name-edit">
<el-input :placeholder="'请填写模版名称'" v-model="template.name" @change="change"/>
<span v-if="template.name">{{template.name}}</span>
<span class="name-tip" v-if="!template.name">请填写模版名称</span>
</div>
</el-col>
<el-col :span="12" class="head-right">
<el-button plain size="mini" @click="handleCancel">{{$t('test_track.return')}}</el-button>
<el-button type="primary" size="mini" @click="handleSave">{{$t('test_track.save')}}</el-button>
</el-col>
</el-row>
</template>
<script>
export default {
name: "TemplateComponentEditHeader",
data() {
return {
}
},
props: {
template: {
type: Object,
default() {
return {}
}
},
},
methods: {
handleCancel() {
this.$emit('cancel');
},
handleSave() {
this.$emit('save');
},
change() {
this.$emit('update:template', this.templateName);
}
}
}
</script>
<style scoped>
.head-right {
text-align: right;
}
.head-bar {
background: white;
height: 45px;
line-height: 45px;
padding: 0 10px;
border: 1px solid #EBEEF5;
box-shadow: 0 0 2px 0 rgba(31,31,31,0.15), 0 1px 2px 0 rgba(31,31,31,0.15);
}
.name-edit:hover span {
display: none;
}
.name-edit .el-input {
display: none;
width: 200px;
}
.name-edit:hover .el-input{
display: inline-block;
}
.name-tip {
color: #909399;
}
</style>

View File

@ -7,95 +7,66 @@
size="100%"
ref="drawer"
v-loading="result.loading">
<template v-slot:default="scope">
<el-row type="flex" class="head-bar">
<el-col :span="12">
<div class="name-edit">
<el-input :placeholder="'请填写模版名称'" v-model="name"/>
<span v-if="name != ''">{{name}}</span>
<span v-if="name == ''">请填写模版名称</span>
</div>
</el-col>
<el-col :span="12" class="head-right">
<el-button plain size="mini" @click="handleClose">{{$t('test_track.return')}}</el-button>
<el-button type="primary" size="mini" @click="handleClose">{{$t('test_track.save')}}</el-button>
</el-col>
</el-row>
<template-component-edit-header :template="template" @cancel="handleClose" @save="handleSave"/>
<div class="container">
<el-aside>
<div class="description">
<span class="title">组件库</span>
<span>从组件库把需要使用的组件拖到右侧预览测试报告的效果系统组件只能添加一次自定义组件可以设定默认的标题和内容</span>
</div>
<draggable
class="component-group"
:list="components"
:group="{ name: 'people', pull: 'clone', put: false }"
:clone="cloneDog"
@change="log">
<template-component-bar v-for="item in components" :key="item.id" :component="item"/>
</draggable>
</el-aside>
<el-main>
<draggable
class="preview-group"
:list="previews"
group="people"
@change="log">
<base-info-component/>
<test-result-component/>
<test-result-chart-component/>
<el-card class="template-component" v-for="item in previews" :key="item.id">
<template v-slot:header>
{{item.name}}
</template>
<ckeditor :editor="editor" v-model="editorData" :config="editorConfig"></ckeditor>
</el-card>
</draggable>
</el-main>
<el-aside>
<div class="description">
<span class="title">组件库</span>
<span>从组件库把需要使用的组件拖到右侧预览测试报告的效果系统组件只能添加一次自定义组件可以设定默认的标题和内容</span>
</div>
<draggable
class="dragArea list-group"
:list="components"
:group="{ name: 'component', pull: 'clone', put: false }"
:clone="clonePreview">
<transition-group>
<template-component-bar v-for="item in components" :key="item" :component="componentMap.get(item)"/>
</transition-group>
</draggable>
</el-aside>
<el-main>
<draggable
class="dragArea list-group"
:list="previews"
@change="change"
group="component">
<transition-group>
<div class="preview" v-for="item in previews" :key="item.id">
<base-info-component v-if="item.id == 1"/>
<test-result-component v-if="item.id == 2"/>
<test-result-chart-component v-if="item.id == 3"/>
<rich-text-component :preview="item" v-if="item.type != 'system'"/>
<i class="el-icon-error" @click="handleDelete(item)"/>
</div>
</transition-group>
</draggable>
</el-main>
</div>
</template>
</el-drawer>
</template>
<script>
import draggable from 'vuedraggable';
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
import BaseInfoComponent from "./TemplateComponent/BaseInfoComponent";
import TestResultComponent from "./TemplateComponent/TestResultComponent";
import TestResultChartComponent from "./TemplateComponent/TestResultChartComponent";
import TemplateComponentBar from "./TemplateComponentBar";
import RichTextComponent from "./TemplateComponent/RichTextComponent";
import TemplateComponentEditHeader from "./TemplateComponentEditHeader";
import {WORKSPACE_ID} from '../../../../../common/js/constants';
import {jsonToMap, mapToJson} from "../../../../../common/js/utils";
let idGlobal = 8;
export default {
name: "TestCaseReportTemplateEdit",
components: {
TemplateComponentEditHeader,
RichTextComponent,
TemplateComponentBar,
TestResultChartComponent,
TestResultComponent,
@ -105,45 +76,172 @@
data() {
return {
showDialog: false,
template: {},
result: {},
name: '',
type: 'edit',
components: [
{ name: "基础信息", id: 1 , type: 'system'},
{ name: "测试结果", id: 2 , type: 'system'},
{ name: "测试结果分布", id: 3 ,type: 'system'},
{ name: "自定义模块", id: 4 ,type: 'custom'}
],
previews: [
{ name: "cat 5", id: 5 },
{ name: "cat 6", id: 6 },
{ name: "cat 7", id: 7 }
],
editor: ClassicEditor,
editorData: '<p>Content of the editor.</p>',
editorConfig: {
// The configuration of the editor.
}
componentMap: new Map(
[
[1, { name: "基础信息", id: 1 , type: 'system'}],
[2, { name: "测试结果", id: 2 , type: 'system'}],
[3, { name: "测试结果分布", id: 3 ,type: 'system'}],
[4, { name: "自定义模块", id: 4 ,type: 'custom'}]
]
),
components: [4],
previews: [],
template: {},
isReport: false
}
},
methods: {
open() {
open(id, isReport) {
if (isReport) {
this.isReport = isReport;
}
this.template = {
name: '',
content: {
components: [1,2,3,4],
customComponent: new Map()
}
};
this.previews = [];
this.components = [4];
if (id) {
this.type = 'edit';
this.getTemplateById(id);
} else {
this.type = 'add';
this.initComponents();
}
this.showDialog = true;
},
initComponents() {
this.componentMap.forEach((value, key) =>{
if (this.template.content.components.indexOf(key) < 0 && this.components.indexOf(key) < 0) {
this.components.push(key);
}
});
this.template.content.components.forEach(item => {
let preview = this.componentMap.get(item);
if (preview && preview.type != 'custom') {
this.previews.push(preview);
} else {
if (this.template.content.customComponent) {
let customComponent = this.template.content.customComponent.get(item.toString());
if (customComponent) {
this.previews.push({id: item, title: customComponent.title, content: customComponent.content});
}
}
}
});
},
handleClose() {
this.showDialog = false;
},
log: function(evt) {
window.console.log(evt);
change(evt) {
if (evt.added) {
let preview = evt.added.element;
if ( preview.type == 'system') {
for (let i = 0; i < this.components.length; i++) {
this.deleteComponentById(preview.id);
}
}
}
},
cloneDog({ id }) {
clonePreview(componentId) {
let component = this.componentMap.get(componentId);
let id = componentId;
if (component.type != 'system') {
id = this.generateComponentId();
}
return {
id: idGlobal++,
name: `cat ${id}`
id: id,
name: component.name,
type: component.type,
};
},
handleDelete(preview) {
if (this.previews.length == 1) {
this.$warning('请至少保留一个组件');
return;
}
for (let i = 0; i < this.previews.length; i++) {
if (this.previews[i].id == preview.id) {
this.previews.splice(i,1);
if (preview.type == 'system') {
this.components.push(preview.id);
}
break;
}
}
},
generateComponentId() {
return Date.parse(new Date()) + Math.ceil(Math.random()*100000);
},
deleteComponentById(id) {
for (let i = 0; i < this.components.length; i++) {
if (this.components[i] == id) {
this.components.splice(i,1);
break;
}
}
},
getTemplateById(id) {
let url = '/case/report/template/get/';
if (this.isReport) {
url = '/case/report/get/';
}
this.$get(url + id, (response) =>{
this.template = response.data;
this.template.content = JSON.parse(response.data.content);
if (this.template.content.customComponent) {
this.template.content.customComponent = jsonToMap(this.template.content.customComponent);
}
this.initComponents();
});
},
handleSave() {
if (this.template.name == '') {
this.$warning('请填写模版名称');
return;
}
let param = {};
this.buildParam(param);
let url = '/case/report/template/';
if (this.isReport) {
url = '/case/report/';
}
this.$post(url + this.type, param, () =>{
this.$success('保存成功');
this.showDialog = false;
this.$emit('refresh');
});
},
buildParam(param) {
let content = {};
content.components = [];
this.previews.forEach(item => {
content.components.push(item.id);
if (!this.componentMap.get(item.id)) {
content.customComponent = new Map();
content.customComponent.set(item.id, {title: item.title, content: item.content})
}
});
param.name = this.template.name;
if (content.customComponent) {
content.customComponent = mapToJson(content.customComponent);
}
param.content = JSON.stringify(content);
if (this.type == 'edit') {
param.id = this.template.id;
} else {
param.workspaceId = localStorage.getItem(WORKSPACE_ID);
}
if (this.template.workspaceId) {
param.workspaceId = localStorage.getItem(WORKSPACE_ID);
}
}
}
}
@ -151,32 +249,6 @@
<style scoped>
.head-right {
text-align: right;
}
.head-bar {
background: white;
height: 45px;
line-height: 45px;
padding: 0 10px;
border: 1px solid #EBEEF5;
box-shadow: 0 0 2px 0 rgba(31,31,31,0.15), 0 1px 2px 0 rgba(31,31,31,0.15);
}
.name-edit:hover span {
display: none;
}
.name-edit .el-input {
display: none;
width: 200px;
}
.name-edit:hover .el-input{
display: inline-block;
}
.el-aside {
border: 1px solid #EBEEF5;
box-sizing: border-box;
@ -204,6 +276,10 @@
width: 80%;
}
.el-card:hover {
box-shadow: 0 0 2px 2px #409EFF;
}
.description > span {
display: block;
padding-bottom: 5px;
@ -218,4 +294,26 @@
background: #F5F5F5;
}
.preview {
position: relative;
}
.el-icon-error {
position: absolute;
right: 11%;
top: 13px;
color: gray;
display:none;
font-size: 20px;
}
.el-icon-error:hover {
display: inline;
color: red;
}
.template-component:hover+i {
display: inline;
}
</style>

View File

@ -1,7 +1,7 @@
<template>
<div class="testcase-template" @click="templateEdit">
<div class="template-img" @click="templateDelete">
<i class="el-icon-error" v-if="template.workspaceId"/>
<div class="template-img">
<i class="el-icon-error" @click.stop="templateDelete"/>
</div>
<span class="demonstration">{{ template.name }}</span>
</div>
@ -20,11 +20,26 @@
},
methods: {
templateEdit() {
this.$emit('templateEdit', this.template);
this.$emit('templateEdit', this.template.id);
},
templateDelete() {
this.post('/case/report/template/delete/' + this.template.id, () => {
if (!this.template.workspaceId) {
this.$warning('不能删除默认模版');
return;
}
this.$alert(this.$t('load_test.delete_file_confirm') + this.template.name + "", '', {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
this.handleDelete();
}
}
});
},
handleDelete() {
this.$post('/case/report/template/delete/' + this.template.id, {}, () => {
this.$success('删除成功');
this.$emit('refresh');
});
}
}
@ -67,7 +82,7 @@
cursor: pointer;
}
.template-img > i {
.template-img > i{
display:none;
float: right;
color: gray;

View File

@ -1,12 +1,12 @@
<template>
<el-dialog :title="$t('test_track.plan_view.change_executor')"
<el-dialog :title="$t('test_track.case.move')"
:visible.sync="dialogVisible"
:before-close="close"
width="20%">
<el-select v-model.trim="module"
:placeholder="$t('test_track.plan_view.select_executor')"
:placeholder="$t('test_track.case.move')"
filterable>
<el-option v-for="item in moduleOptions" :key="item.id"
:label="item.path" :value="item.id"></el-option>

View File

@ -5,7 +5,7 @@
<ms-tag v-if="value == 'Pass'" type="success" :content="$t('test_track.plan_view.pass')"/>
<ms-tag v-if="value == 'Failure'" type="danger" :content="$t('test_track.plan_view.failure')"/>
<ms-tag v-if="value == 'Blocking'" type="warning" :content="$t('test_track.plan_view.blocking')"/>
<ms-tag v-if="value == 'Skip'" type="info" :content="$t('test_track.plan.plan_view.skip')"/>
<ms-tag v-if="value == 'Skip'" type="info" :content="$t('test_track.plan_view.skip')"/>
</div>
</template>

View File

@ -0,0 +1,148 @@
<template>
<div>
<el-drawer
:before-close="handleClose"
:visible.sync="showDialog"
:with-header="false"
size="100%"
ref="drawer"
v-loading="result.loading">
<template v-slot:default="scope">
<el-row type="flex" class="head-bar">
<el-col :span="12">
<div class="name-edit">
<el-button plain size="mini" icon="el-icon-back" @click="handleClose">{{$t('test_track.return')}}</el-button>
&nbsp;
<span>{{report.name}}</span>
</div>
</el-col>
<el-col :span="12" class="head-right">
<el-button plain size="mini" @click="handleEdit">编辑组件</el-button>
</el-col>
</el-row>
<div class="container">
<el-main>
<div class="preview" v-for="item in previews" :key="item.id">
<base-info-component v-if="item.id == 1"/>
<test-result-component v-if="item.id == 2"/>
<test-result-chart-component v-if="item.id == 3"/>
<rich-text-component :preview="item" v-if="item.type != 'system'"/>
</div>
</el-main>
</div>
</template>
</el-drawer>
<test-case-report-template-edit ref="templateEdit" @refresh="getReport"/>
</div>
</template>
<script>
import {jsonToMap} from "../../../../../../common/js/utils";
import BaseInfoComponent from "../../../../settings/workspace/components/TemplateComponent/BaseInfoComponent";
import TestResultChartComponent from "../../../../settings/workspace/components/TemplateComponent/TestResultChartComponent";
import TestResultComponent from "../../../../settings/workspace/components/TemplateComponent/TestResultComponent";
import RichTextComponent from "../../../../settings/workspace/components/TemplateComponent/RichTextComponent";
import TestCaseReportTemplateEdit from "../../../../settings/workspace/components/TestCaseReportTemplateEdit";
export default {
name: "TestCaseReportView",
components: {
TestCaseReportTemplateEdit,
RichTextComponent, TestResultComponent, TestResultChartComponent, BaseInfoComponent},
data() {
return {
result: {},
showDialog: false,
previews: [],
report: {},
reportId: '',
componentMap: new Map(
[
[1, { name: "基础信息", id: 1 , type: 'system'}],
[2, { name: "测试结果", id: 2 , type: 'system'}],
[3, { name: "测试结果分布", id: 3 ,type: 'system'}],
[4, { name: "自定义模块", id: 4 ,type: 'custom'}]
]
)
}
},
methods: {
open(id) {
if (id) {
this.reportId = id;
}
this.getReport();
this.showDialog = true;
},
getReport() {
this.result = this.$get('/case/report/get/' + this.reportId, response => {
this.report = response.data;
this.report.content = JSON.parse(response.data.content);
if (this.report.content.customComponent) {
this.report.content.customComponent = jsonToMap(this.report.content.customComponent);
}
this.initPreviews();
});
},
initPreviews() {
this.previews = [];
this.report.content.components.forEach(item => {
let preview = this.componentMap.get(item);
if (preview && preview.type != 'custom') {
this.previews.push(preview);
} else {
if (this.report.content.customComponent) {
let customComponent = this.report.content.customComponent.get(item.toString());
if (customComponent) {
this.previews.push({id: item, title: customComponent.title, content: customComponent.content});
}
}
}
});
},
handleClose() {
this.showDialog = false;
},
handleEdit() {
this.$refs.templateEdit.open(this.reportId, true);
}
}
}
</script>
<style scoped>
.el-main {
height: calc(100vh - 70px);
width: 100%;
}
.head-bar {
background: white;
height: 45px;
line-height: 45px;
padding: 0 10px;
border: 1px solid #EBEEF5;
box-shadow: 0 0 2px 0 rgba(31,31,31,0.15), 0 1px 2px 0 rgba(31,31,31,0.15);
}
.container {
height: 100vh;
background: #F5F5F5;
}
.el-card {
width: 70%;
margin: 5px auto;
}
.head-right {
text-align: right;
}
</style>

View File

@ -1,111 +1,115 @@
<template>
<el-card v-loading="result.loading">
<template v-slot:header>
<ms-table-header :condition.sync="condition" @search="initTableData" :show-create="false">
<template v-slot:title>
<node-breadcrumb class="table-title" :node-names="selectNodeNames" @refresh="refresh"/>
</template>
<template v-slot:button>
<ms-table-button v-if="!showMyTestCase" icon="el-icon-s-custom" :content="$t('test_track.plan_view.my_case')" @click="searchMyTestCase"/>
<ms-table-button v-if="showMyTestCase" icon="el-icon-files" :content="$t('test_track.plan_view.all_case')" @click="searchMyTestCase"/>
<ms-table-button icon="el-icon-connection" :content="$t('test_track.plan_view.relevance_test_case')" @click="$emit('openTestCaseRelevanceDialog')"/>
<ms-table-button icon="el-icon-edit-outline" :content="$t('test_track.plan_view.change_execution_results')" @click="handleBatch('status')"/>
<ms-table-button icon="el-icon-user" :content="$t('test_track.plan_view.change_executor')" @click="handleBatch('executor')"/>
</template>
</ms-table-header>
</template>
<template v-slot:header>
<ms-table-header :condition.sync="condition" @search="initTableData" :show-create="false">
<template v-slot:title>
<node-breadcrumb class="table-title" :node-names="selectNodeNames" @refresh="refresh"/>
</template>
<template v-slot:button>
<ms-table-button v-if="!showMyTestCase" icon="el-icon-s-custom" :content="$t('test_track.plan_view.my_case')" @click="searchMyTestCase"/>
<ms-table-button v-if="showMyTestCase" icon="el-icon-files" :content="$t('test_track.plan_view.all_case')" @click="searchMyTestCase"/>
<ms-table-button icon="el-icon-connection" :content="$t('test_track.plan_view.relevance_test_case')" @click="$emit('openTestCaseRelevanceDialog')"/>
<ms-table-button icon="el-icon-edit-outline" :content="$t('test_track.plan_view.change_execution_results')" @click="handleBatch('status')"/>
<ms-table-button icon="el-icon-user" :content="$t('test_track.plan_view.change_executor')" @click="handleBatch('executor')"/>
<ms-table-button v-if="!testPlan.reportId" icon="el-icon-document" :content="$t('创建测试报告')" @click="openTestReport"/>
<ms-table-button v-if="testPlan.reportId" icon="el-icon-document" :content="$t('查看测试报告')" @click="openReport"/>
</template>
</ms-table-header>
</template>
<executor-edit ref="executorEdit" :select-ids="selectIds" @refresh="initTableData"/>
<status-edit ref="statusEdit" :select-ids="selectIds" @refresh="initTableData"/>
<executor-edit ref="executorEdit" :select-ids="selectIds" @refresh="initTableData"/>
<status-edit ref="statusEdit" :select-ids="selectIds" @refresh="initTableData"/>
<el-table
@select-all="handleSelectAll"
@select="handleSelectionChange"
row-key="id"
:data="tableData">
<el-table
@select-all="handleSelectAll"
@select="handleSelectionChange"
row-key="id"
:data="tableData">
<el-table-column
type="selection"></el-table-column>
<el-table-column
type="selection"></el-table-column>
<el-table-column
prop="name"
:label="$t('commons.name')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="priority"
:filters="priorityFilters"
:filter-method="filter"
:label="$t('test_track.case.priority')">
<template v-slot:default="scope">
<priority-table-item :value="scope.row.priority" ref="priority"/>
</template>
</el-table-column>
<el-table-column
prop="name"
:label="$t('commons.name')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="priority"
:filters="priorityFilters"
:filter-method="filter"
:label="$t('test_track.case.priority')">
<template v-slot:default="scope">
<priority-table-item :value="scope.row.priority" ref="priority"/>
</template>
</el-table-column>
<el-table-column
prop="type"
:filters="typeFilters"
:filter-method="filter"
:label="$t('test_track.case.type')"
show-overflow-tooltip>
<template v-slot:default="scope">
<type-table-item :value="scope.row.type"/>
</template>
</el-table-column>
<el-table-column
prop="type"
:filters="typeFilters"
:filter-method="filter"
:label="$t('test_track.case.type')"
show-overflow-tooltip>
<template v-slot:default="scope">
<type-table-item :value="scope.row.type"/>
</template>
</el-table-column>
<el-table-column
prop="method"
:filters="methodFilters"
:filter-method="filter"
:label="$t('test_track.case.method')"
show-overflow-tooltip>
<template v-slot:default="scope">
<method-table-item :value="scope.row.method"/>
</template>
</el-table-column>
<el-table-column
prop="method"
:filters="methodFilters"
:filter-method="filter"
:label="$t('test_track.case.method')"
show-overflow-tooltip>
<template v-slot:default="scope">
<method-table-item :value="scope.row.method"/>
</template>
</el-table-column>
<el-table-column
prop="executor"
:label="$t('test_track.plan_view.executor')">
</el-table-column>
<el-table-column
prop="executor"
:label="$t('test_track.plan_view.executor')">
</el-table-column>
<el-table-column
prop="status"
:filters="statusFilters"
:filter-method="filter"
:label="$t('test_track.plan_view.execute_result')">
<template v-slot:default="scope">
<status-table-item :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column
prop="status"
:filters="statusFilters"
:filter-method="filter"
:label="$t('test_track.plan_view.execute_result')">
<template v-slot:default="scope">
<status-table-item :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column
sortable
prop="updateTime"
:label="$t('commons.update_time')"
show-overflow-tooltip>
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
:label="$t('commons.operating')">
<template v-slot:default="scope">
<ms-table-operator-button :tip="$t('commons.edit')" icon="el-icon-edit" @exec="handleEdit(scope.row)" />
<ms-table-operator-button :tip="$t('test_track.plan_view.cancel_relevance')" icon="el-icon-unlock" type="danger" @exec="handleDelete(scope.row)"/>
<!--<ms-table-operator @editClick="handleEdit(scope.row, scope.$index)" @deleteClick="handleDelete(scope.row)"/>-->
</template>
</el-table-column>
</el-table>
<el-table-column
sortable
prop="updateTime"
:label="$t('commons.update_time')"
show-overflow-tooltip>
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
:label="$t('commons.operating')">
<template v-slot:default="scope">
<ms-table-operator-button :tip="$t('commons.edit')" icon="el-icon-edit" @exec="handleEdit(scope.row)" />
<ms-table-operator-button :tip="$t('test_track.plan_view.cancel_relevance')" icon="el-icon-unlock" type="danger" @exec="handleDelete(scope.row)"/>
</template>
</el-table-column>
</el-table>
<ms-table-pagination :change="search" :current-page.sync="currentPage" :page-size.sync="pageSize"
:total="total"/>
<ms-table-pagination :change="search" :current-page.sync="currentPage" :page-size.sync="pageSize"
:total="total"/>
<test-plan-test-case-edit
ref="testPlanTestCaseEdit"
:search-param="condition"
@refresh="refresh"
@refreshTable="search"/>
<test-plan-test-case-edit
ref="testPlanTestCaseEdit"
:search-param="condition"
@refresh="refresh"
@refreshTable="search"/>
<test-report-template-list @openReport="openReport" :plan-id="planId" ref="testReporTtemplateList"/>
<test-case-report-view ref="testCaseReportView"/>
</el-card>
</template>
@ -128,10 +132,14 @@
import MethodTableItem from "../../../common/tableItems/planview/MethodTableItem";
import MsTableOperator from "../../../../common/components/MsTableOperator";
import MsTableOperatorButton from "../../../../common/components/MsTableOperatorButton";
import TestReportTemplateList from "./TestReportTemplateList";
import TestCaseReportView from "./TestCaseReportView";
export default {
name: "TestPlanTestCaseList",
components: {
TestCaseReportView,
TestReportTemplateList,
MsTableOperatorButton,
MsTableOperator,
MethodTableItem,
@ -150,6 +158,7 @@
pageSize: 10,
total: 0,
selectIds: new Set(),
testPlan: {},
priorityFilters: [
{text: 'P0', value: 'P0'},
{text: 'P1', value: 'P1'},
@ -186,13 +195,15 @@
},
watch: {
planId() {
this.getTestPlanById();
this.initTableData();
},
selectNodeIds() {
this.search();
}
},
created: function () {
mounted() {
this.getTestPlanById();
this.initTableData();
},
methods: {
@ -279,6 +290,22 @@
filter(value, row, column) {
const property = column['property'];
return row[property] === value;
},
openTestReport() {
this.$refs.testReporTtemplateList.open();
},
getTestPlanById() {
if (this.planId) {
this.$post('/test/plan/get/' + this.planId, {}, response => {
this.testPlan = response.data;
});
}
},
openReport(id) {
if (!id) {
id = this.testPlan.reportId;
}
this.$refs.testCaseReportView.open(id);
}
}
}

View File

@ -0,0 +1,65 @@
<template>
<el-dialog :title="'选择模版'"
:visible.sync="templateVisible"
width="50%">
<el-main>
<testcase-template-item v-for="item in templates" :key="item.id"
:template="item" @templateEdit="createTemplate" @refresh="initData"/>
</el-main>
</el-dialog>
</template>
<script>
import TestcaseTemplateItem from "../../../../settings/workspace/components/TestcaseTemplateItem";
import {WORKSPACE_ID} from "../../../../../../common/js/constants";
export default {
name: "TestReportTemplateList",
components: {TestcaseTemplateItem},
data() {
return {
templateVisible: false,
templates: []
}
},
props: {
planId: {
type: String
}
},
methods: {
initData() {
let condition = {};
condition.queryDefault = true;
condition.workspaceId = localStorage.getItem(WORKSPACE_ID);
this.result = this.$post('/case/report/template/list', condition, response => {
this.templates = response.data;
});
},
createTemplate(templateId) {
let param = {};
param.planId = this.planId;
param.templateId = templateId;
this.$post('/case/report/add', param, response => {
this.$emit('openReport', response.data);
this.templateVisible = false;
});
},
open() {
this.templateVisible = true;
this.initData();
}
}
}
</script>
<style scoped>
.el-main >>> .testcase-template:hover i{
display: none;
}
</style>

View File

@ -25,3 +25,10 @@ body {
word-wrap: break-word;
white-space: nowrap;
}
/*解决高度塌陷和边距重叠*/
.clearfix:before,.clearfix:after{
content: "";
display: table;
clear: both;
}

View File

@ -37,3 +37,21 @@ export function saveLocalStorage(response) {
// 保存角色
localStorage.setItem("roles", roles);
}
export function jsonToMap(jsonStr) {
let obj = JSON.parse(jsonStr);
let strMap = new Map();
for (let k of Object.keys(obj)) {
strMap.set(k,obj[k]);
}
return strMap;
}
export function mapToJson(strMap){
let obj= Object.create(null);
for (let[k,v] of strMap) {
obj[k] = v;
}
return JSON.stringify(obj);
}

View File

@ -2,6 +2,7 @@ export default {
commons: {
'workspace': 'Workspace',
'organization': 'Organization',
'setting': 'Setting',
'project': 'Project',
'name': 'Name',
'description': 'Description',
@ -117,6 +118,15 @@ export default {
'test_error_log': 'Test Error Log',
'test_log_details': 'Test Log Details',
'test_details': 'Test Details',
'test_duration': 'Test Duration{0} minutes {1} seconds',
'test_start_time': 'Test Start Time',
'test_end_time': 'Test End Time',
'test_stop_now': 'Test Stop Now',
'test_execute_again': 'Test Execute Again',
'export': 'Export',
'compare': 'Compare',
'generation_error': 'Report generation error, cannot be viewed!',
'being_generated': 'Report is being generated...',
},
load_test: {
'recent': 'Recent Tests',
@ -305,6 +315,7 @@ export default {
'fill_the_data': 'Please complete the data',
'delete_prompt': 'This operation will permanently delete the resource pool, continue?',
'status_change_success': 'Successfully changed the status!',
'status_change_failed': 'Failed to change the status!',
},
i18n: {
'home': 'Home'

Some files were not shown because too many files have changed in this diff Show More