Merge branch 'master' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
5781cc7b1e
|
@ -24,6 +24,7 @@ public class ApiTestCaseRequest {
|
|||
private List<String> moduleIds;
|
||||
private List<OrderRequest> orders;
|
||||
private Map<String, List<String>> filters;
|
||||
private Map<String, Object> combine;
|
||||
private boolean isSelectThisWeedData;
|
||||
private long createTime = 0;
|
||||
}
|
||||
|
|
|
@ -42,11 +42,13 @@ public class Body {
|
|||
return true;
|
||||
} else return false;
|
||||
}
|
||||
|
||||
public boolean isOldKV() {
|
||||
if (StringUtils.equals(type, KV)) {
|
||||
return true;
|
||||
} else return false;
|
||||
}
|
||||
|
||||
public List<KeyValue> getBodyParams(HTTPSamplerProxy sampler, String requestId) {
|
||||
List<KeyValue> body = new ArrayList<>();
|
||||
if (this.isKV() || this.isBinary()) {
|
||||
|
@ -65,7 +67,7 @@ public class Body {
|
|||
this.raw = JSONSchemaGenerator.getJson(com.alibaba.fastjson.JSON.toJSONString(this.getJsonSchema()));
|
||||
}
|
||||
}
|
||||
KeyValue keyValue = new KeyValue("", this.getRaw());
|
||||
KeyValue keyValue = new KeyValue("", "JSON-SCHEMA", this.getRaw(), true, true);
|
||||
keyValue.setEnable(true);
|
||||
keyValue.setEncode(false);
|
||||
body.add(keyValue);
|
||||
|
|
|
@ -31,6 +31,14 @@ public class KeyValue {
|
|||
this(name, value, description, null);
|
||||
}
|
||||
|
||||
public KeyValue(String name, String type, String value, boolean required, boolean enable) {
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.value = value;
|
||||
this.required = required;
|
||||
this.enable = enable;
|
||||
}
|
||||
|
||||
public KeyValue(String name, String value, String description, String contentType) {
|
||||
this(name, value, description, contentType, true);
|
||||
}
|
||||
|
@ -49,7 +57,7 @@ public class KeyValue {
|
|||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return (StringUtils.isNotBlank(name) && StringUtils.isNotBlank(value)) && !StringUtils.equalsIgnoreCase(type, "file");
|
||||
return ((StringUtils.isNotBlank(name) && StringUtils.isNotBlank(value)) || "JSON-SCHEMA".equals(type)) && !StringUtils.equalsIgnoreCase(type, "file");
|
||||
}
|
||||
|
||||
public boolean isFile() {
|
||||
|
|
|
@ -147,6 +147,25 @@
|
|||
<property name="object" value="${condition}.creator"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.path != null">
|
||||
and api_definition.path
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.path"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.method != null">
|
||||
and api_definition.method
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.method"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.tags != null">
|
||||
and api_definition.tags
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.tags"/>
|
||||
</include>
|
||||
</if>
|
||||
|
||||
</sql>
|
||||
|
||||
<sql id="condition">
|
||||
|
|
|
@ -7,7 +7,94 @@
|
|||
<result column="project_name" property="projectName"/>
|
||||
<result column="user_name" property="userName"/>
|
||||
</resultMap>
|
||||
<sql id="condition">
|
||||
<choose>
|
||||
<when test='${object}.operator == "like"'>
|
||||
like CONCAT('%', #{${object}.value},'%')
|
||||
</when>
|
||||
<when test='${object}.operator == "not like"'>
|
||||
not like CONCAT('%', #{${object}.value},'%')
|
||||
</when>
|
||||
<when test='${object}.operator == "in"'>
|
||||
in
|
||||
<foreach collection="${object}.value" item="v" separator="," open="(" close=")">
|
||||
#{v}
|
||||
</foreach>
|
||||
</when>
|
||||
<when test='${object}.operator == "not in"'>
|
||||
not in
|
||||
<foreach collection="${object}.value" item="v" separator="," open="(" close=")">
|
||||
#{v}
|
||||
</foreach>
|
||||
</when>
|
||||
<when test='${object}.operator == "between"'>
|
||||
between #{${object}.value[0]} and #{${object}.value[1]}
|
||||
</when>
|
||||
<when test='${object}.operator == "gt"'>
|
||||
> #{${object}.value}
|
||||
</when>
|
||||
<when test='${object}.operator == "lt"'>
|
||||
< #{${object}.value}
|
||||
</when>
|
||||
<when test='${object}.operator == "ge"'>
|
||||
>= #{${object}.value}
|
||||
</when>
|
||||
<when test='${object}.operator == "le"'>
|
||||
<= #{${object}.value}
|
||||
</when>
|
||||
<when test='${object}.operator == "current user"'>
|
||||
= '${@io.metersphere.commons.utils.SessionUtils@getUserId()}'
|
||||
</when>
|
||||
<otherwise>
|
||||
= #{${object}.value}
|
||||
</otherwise>
|
||||
</choose>
|
||||
</sql>
|
||||
<sql id="combine">
|
||||
<if test='${condition}.name != null and (${name} == null or ${name} == "")'>
|
||||
and api_scenario.name
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.name"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.updateTime != null">
|
||||
and api_scenario.update_time
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.updateTime"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.createTime != null">
|
||||
and api_scenario.create_time
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.createTime"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.priority != null">
|
||||
and api_scenario.level
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.priority"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.creator != null">
|
||||
and api_scenario.user_id
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.creator"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.tags != null">
|
||||
and api_scenario.tags
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.tags"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.status != null">
|
||||
and api_scenario.last_result
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.status"/>
|
||||
</include>
|
||||
</if>
|
||||
|
||||
</sql>
|
||||
<select id="list" resultMap="BaseResultMap">
|
||||
select api_scenario.id, api_scenario.project_id, api_scenario.tags, api_scenario.user_id, api_scenario.num,
|
||||
api_scenario.api_scenario_module_id,api_scenario.module_path, api_scenario.name, api_scenario.level,
|
||||
|
@ -19,6 +106,13 @@
|
|||
left join project on api_scenario.project_id = project.id
|
||||
left join user on api_scenario.user_id = user.id
|
||||
<where>
|
||||
<if test="request.combine != null">
|
||||
<include refid="combine">
|
||||
<property name="condition" value="request.combine"/>
|
||||
<property name="name" value="request.name"/>
|
||||
</include>
|
||||
</if>
|
||||
|
||||
<if test="request.name != null">
|
||||
and api_scenario.name like CONCAT('%', #{request.name},'%')
|
||||
</if>
|
||||
|
|
|
@ -144,7 +144,51 @@
|
|||
</otherwise>
|
||||
</choose>
|
||||
</sql>
|
||||
<sql id="combine">
|
||||
<if test='${condition}.name != null and (${name} == null or ${name} == "")'>
|
||||
and atc.name
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.name"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.updateTime != null">
|
||||
and atc.update_time
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.updateTime"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.createTime != null">
|
||||
and atc.create_time
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.createTime"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.priority != null">
|
||||
and atc.priority
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.priority"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.creator != null">
|
||||
and atc.user_id
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.creator"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.tags != null">
|
||||
and atc.tags
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.tags"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.status != null">
|
||||
and ader.status
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.status"/>
|
||||
</include>
|
||||
</if>
|
||||
|
||||
</sql>
|
||||
<select id="list" resultType="io.metersphere.api.dto.definition.ApiTestCaseResult">
|
||||
select
|
||||
atc.id,
|
||||
|
@ -180,6 +224,13 @@
|
|||
resource_id) as ader
|
||||
on atc.id = ader.resource_id
|
||||
<where>
|
||||
<if test="request.combine != null">
|
||||
<include refid="combine">
|
||||
<property name="condition" value="request.combine"/>
|
||||
<property name="name" value="request.name"/>
|
||||
</include>
|
||||
</if>
|
||||
|
||||
<if test="request.name != null and request.name!=''">
|
||||
and atc.name like CONCAT('%', #{request.name},'%')
|
||||
</if>
|
||||
|
@ -196,18 +247,26 @@
|
|||
AND atc.api_definition_id = #{request.apiDefinitionId}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
<if test="request.orders != null and request.orders.size() > 0">
|
||||
order by
|
||||
<foreach collection="request.orders" separator="," item="order">
|
||||
atc.${order.name} ${order.type}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="listSimple" resultType="io.metersphere.api.dto.definition.ApiTestCaseDTO">
|
||||
select
|
||||
c.id, c.project_id, c.name, c.api_definition_id, c.priority, c.description, c.create_user_id, c.update_user_id, c.create_time, c.update_time, c.num,
|
||||
atc.id, atc.project_id, atc.name, atc.api_definition_id, atc.priority, atc.description, atc.create_user_id, atc.update_user_id, atc.create_time, atc.update_time, atc.num,
|
||||
a.module_id, a.path, a.protocol
|
||||
from
|
||||
api_test_case c
|
||||
api_test_case atc
|
||||
inner join
|
||||
api_definition a
|
||||
on
|
||||
c.api_definition_id = a.id
|
||||
atc.api_definition_id = a.id
|
||||
<if test="request.protocol != null and request.protocol!=''">
|
||||
and a.protocol = #{request.protocol}
|
||||
</if>
|
||||
|
@ -219,27 +278,33 @@
|
|||
and a.status != 'Trash'
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<where>
|
||||
<if test="request.combine != null">
|
||||
<include refid="combine">
|
||||
<property name="condition" value="request.combine"/>
|
||||
<property name="name" value="request.name"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="request.projectId != null and request.projectId!=''">
|
||||
c.project_id = #{request.projectId}
|
||||
and atc.project_id = #{request.projectId}
|
||||
</if>
|
||||
<if test="request.id != null and request.id!=''">
|
||||
and c.id = #{request.id}
|
||||
and atc.id = #{request.id}
|
||||
</if>
|
||||
<if test="request.ids != null and request.ids.size() > 0">
|
||||
<if test="request.projectId != null and request.projectId!=''">
|
||||
and
|
||||
</if>
|
||||
c.id in
|
||||
atc.id in
|
||||
<foreach collection="request.ids" item="caseId" separator="," open="(" close=")">
|
||||
#{caseId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request.name != null and request.name!=''">
|
||||
and c.name like CONCAT('%', #{request.name},'%')
|
||||
and atc.name like CONCAT('%', #{request.name},'%')
|
||||
</if>
|
||||
<if test="request.createTime > 0">
|
||||
and c.create_time >= #{request.createTime}
|
||||
and atc.create_time >= #{request.createTime}
|
||||
</if>
|
||||
<if test="request.moduleIds != null and request.moduleIds.size() > 0">
|
||||
and a.module_id in
|
||||
|
@ -252,7 +317,7 @@
|
|||
<if test="values != null and values.size() > 0">
|
||||
<choose>
|
||||
<when test="key == 'priority'">
|
||||
and c.priority in
|
||||
and atc.priority in
|
||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||
#{value}
|
||||
</foreach>
|
||||
|
@ -261,6 +326,7 @@
|
|||
</if>
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
<if test="request.orders != null and request.orders.size() > 0">
|
||||
order by
|
||||
<foreach collection="request.orders" separator="," item="order">
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?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.ExtLoadTestMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="io.metersphere.dto.LoadTestDTO"
|
||||
extends="io.metersphere.base.mapper.LoadTestMapper.BaseResultMap">
|
||||
<result column="project_name" property="projectName"/>
|
||||
|
@ -14,37 +13,37 @@
|
|||
|
||||
<sql id="combine">
|
||||
<if test='${condition}.name != null and (${name} == null or ${name} == "")'>
|
||||
and load_test.name
|
||||
AND load_test.name
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.name"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.updateTime != null">
|
||||
and load_test.update_time
|
||||
AND load_test.update_time
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.updateTime"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.projectName != null">
|
||||
and project.name
|
||||
AND project.name
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.projectName"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.createTime != null">
|
||||
and load_test.create_time
|
||||
AND load_test.create_time
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.createTime"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.status != null">
|
||||
and load_test.status
|
||||
AND load_test.status
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.status"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.creator != null">
|
||||
and load_test.user_id
|
||||
AND load_test.user_id
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.creator"/>
|
||||
</include>
|
||||
|
@ -53,10 +52,10 @@
|
|||
|
||||
<select id="list" resultMap="BaseResultMap"
|
||||
parameterType="io.metersphere.track.request.testplan.QueryTestPlanRequest">
|
||||
select load_test.*, project.name as project_name, user.name as user_name
|
||||
from load_test
|
||||
left join project on load_test.project_id = project.id
|
||||
left join user on load_test.user_id = user.id
|
||||
SELECT load_test.*, project.name AS project_name, user.name AS user_name
|
||||
FROM load_test
|
||||
LEFT JOIN project ON load_test.project_id = project.id
|
||||
LEFT JOIN user ON load_test.user_id = user.id
|
||||
<where>
|
||||
<if test="request.combine != null">
|
||||
<include refid="combine">
|
||||
|
@ -65,10 +64,10 @@
|
|||
</include>
|
||||
</if>
|
||||
<if test="request.name != null">
|
||||
and load_test.name like CONCAT('%', #{request.name},'%')
|
||||
and load_test.name LIKE CONCAT('%', #{request.name}, '%')
|
||||
</if>
|
||||
<if test="request.userId != null">
|
||||
and load_test.user_id= #{request.userId}
|
||||
AND load_test.user_id = #{request.userId}
|
||||
</if>
|
||||
<if test="request.workspaceId != null">
|
||||
AND project.workspace_id = #{request.workspaceId}
|
||||
|
@ -82,23 +81,33 @@
|
|||
<if test="request.filters != null and request.filters.size() > 0">
|
||||
<foreach collection="request.filters.entrySet()" index="key" item="values">
|
||||
<if test="values != null and values.size() > 0">
|
||||
and load_test.status in
|
||||
<choose>
|
||||
<when test="key == 'status'">
|
||||
AND load_test.status IN
|
||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||
#{value}
|
||||
</foreach>
|
||||
</when>
|
||||
<when test="key == 'user_id'">
|
||||
AND load_test.user_id IN
|
||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||
#{value}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
<if test="request.orders != null and request.orders.size() > 0">
|
||||
order by
|
||||
ORDER BY
|
||||
<foreach collection="request.orders" separator="," item="order">
|
||||
load_test.${order.name} ${order.type}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="getLoadTestByProjectId" resultType="io.metersphere.base.domain.LoadTest">
|
||||
SELECT id,name
|
||||
SELECT id, name
|
||||
FROM load_test
|
||||
WHERE project_id = #{projectId}
|
||||
</select>
|
||||
|
|
|
@ -95,6 +95,13 @@
|
|||
<property name="object" value="${condition}.creator"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="${condition}.tags != null">
|
||||
and test_case.tags
|
||||
<include refid="condition">
|
||||
<property name="object" value="${condition}.tags"/>
|
||||
</include>
|
||||
</if>
|
||||
|
||||
</sql>
|
||||
|
||||
<select id="getTestCaseByNotInReview" resultType="io.metersphere.base.domain.TestCase">
|
||||
|
|
|
@ -168,6 +168,9 @@ public class UserController {
|
|||
|
||||
@GetMapping("/info/{userId}")
|
||||
public UserDTO getUserInfo(@PathVariable(value = "userId") String userId) {
|
||||
if (!StringUtils.equals(userId, SessionUtils.getUserId())) {
|
||||
MSException.throwException(Translator.get("not_authorized"));
|
||||
}
|
||||
return userService.getUserInfo(userId);
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 9f4a9bbf46fc1333dbcccea21f83e27e3ec10b1f
|
||||
Subproject commit 068127ce59ea8b016434ed52a9de4a7a4b13bdb4
|
|
@ -3,7 +3,7 @@
|
|||
<el-card class="table-card" v-loading="loading">
|
||||
<template v-slot:header>
|
||||
<ms-table-header :condition.sync="condition" @search="selectByParam" title=""
|
||||
:show-create="false"/>
|
||||
:show-create="false" />
|
||||
</template>
|
||||
|
||||
<el-table ref="scenarioTable" border :data="tableData" class="adjust-table ms-select-all" @select-all="select" @select="select"
|
||||
|
@ -93,22 +93,24 @@
|
|||
</el-drawer>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MsTableHeader from "@/business/components/common/components/MsTableHeader";
|
||||
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
|
||||
import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn";
|
||||
import MsTag from "../../../common/components/MsTag";
|
||||
import {getUUID, getCurrentProjectID} from "@/common/js/utils";
|
||||
import MsApiReportDetail from "../report/ApiReportDetail";
|
||||
import MsTableMoreBtn from "./TableMoreBtn";
|
||||
import MsScenarioExtendButtons from "@/business/components/api/automation/scenario/ScenarioExtendBtns";
|
||||
import MsTestPlanList from "./testplan/TestPlanList";
|
||||
import MsTableSelectAll from "../../../common/components/table/MsTableSelectAll";
|
||||
import MsTableHeader from "@/business/components/common/components/MsTableHeader";
|
||||
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
|
||||
import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn";
|
||||
import MsTag from "../../../common/components/MsTag";
|
||||
import {getUUID, getCurrentProjectID} from "@/common/js/utils";
|
||||
import MsApiReportDetail from "../report/ApiReportDetail";
|
||||
import MsTableMoreBtn from "./TableMoreBtn";
|
||||
import MsScenarioExtendButtons from "@/business/components/api/automation/scenario/ScenarioExtendBtns";
|
||||
import MsTestPlanList from "./testplan/TestPlanList";
|
||||
import MsTableSelectAll from "../../../common/components/table/MsTableSelectAll";
|
||||
import {API_CASE_CONFIGS} from "@/business/components/common/components/search/search-components";
|
||||
|
||||
export default {
|
||||
export default {
|
||||
name: "MsApiScenarioList",
|
||||
components: {
|
||||
MsTableSelectAll,
|
||||
|
@ -135,7 +137,9 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
condition: {},
|
||||
condition: {
|
||||
components: API_CASE_CONFIGS
|
||||
},
|
||||
currentScenario: {},
|
||||
schedule: {},
|
||||
selection: [],
|
||||
|
@ -211,7 +215,7 @@ export default {
|
|||
this.condition.selectThisWeedData = false;
|
||||
this.condition.executeStatus = null;
|
||||
this.isSelectThissWeekData();
|
||||
switch (this.selectDataRange){
|
||||
switch (this.selectDataRange) {
|
||||
case 'thisWeekCount':
|
||||
this.condition.selectThisWeedData = true;
|
||||
break;
|
||||
|
@ -226,7 +230,6 @@ export default {
|
|||
break;
|
||||
}
|
||||
this.selection = [];
|
||||
|
||||
this.selectAll = false;
|
||||
this.unSelection = [];
|
||||
this.selectDataCounts = 0;
|
||||
|
@ -416,12 +419,12 @@ export default {
|
|||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/deep/ .el-drawer__header {
|
||||
/deep/ .el-drawer__header {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -524,8 +524,7 @@
|
|||
}
|
||||
this.sort();
|
||||
this.reload();
|
||||
}
|
||||
,
|
||||
},
|
||||
nodeClick(e) {
|
||||
if (e.referenced != 'REF' && e.referenced != 'Deleted') {
|
||||
this.operatingElements = ELEMENTS.get(e.type);
|
||||
|
@ -533,8 +532,7 @@
|
|||
this.operatingElements = [];
|
||||
}
|
||||
this.selectedTreeNode = e;
|
||||
}
|
||||
,
|
||||
},
|
||||
suggestClick(node) {
|
||||
this.response = {};
|
||||
if (node.parent && node.parent.data.requestResult) {
|
||||
|
@ -544,13 +542,11 @@
|
|||
showAll() {
|
||||
this.operatingElements = ELEMENTS.get("ALL");
|
||||
this.selectedTreeNode = undefined;
|
||||
this.reload();
|
||||
}
|
||||
,
|
||||
//this.reload();
|
||||
},
|
||||
apiListImport() {
|
||||
this.$refs.scenarioApiRelevance.open();
|
||||
}
|
||||
,
|
||||
},
|
||||
recursiveSorting(arr) {
|
||||
for (let i in arr) {
|
||||
arr[i].index = Number(i) + 1;
|
||||
|
@ -558,8 +554,7 @@
|
|||
this.recursiveSorting(arr[i].hashTree);
|
||||
}
|
||||
}
|
||||
}
|
||||
,
|
||||
},
|
||||
sort() {
|
||||
for (let i in this.scenarioDefinition) {
|
||||
this.scenarioDefinition[i].index = Number(i) + 1;
|
||||
|
@ -567,8 +562,7 @@
|
|||
this.recursiveSorting(this.scenarioDefinition[i].hashTree);
|
||||
}
|
||||
}
|
||||
}
|
||||
,
|
||||
},
|
||||
addCustomizeApi(request) {
|
||||
this.customizeVisible = false;
|
||||
request.enable === undefined ? request.enable = true : request.enable;
|
||||
|
@ -1034,5 +1028,6 @@
|
|||
.ms-opt-btn {
|
||||
position: fixed;
|
||||
right: 50px;
|
||||
z-index: 1;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -18,19 +18,26 @@
|
|||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div>
|
||||
<el-select size="small" :placeholder="$t('api_test.definition.request.grade_info')" v-model="condition.priority"
|
||||
<el-select size="small" :placeholder="$t('api_test.definition.request.grade_order_asc')" v-model="condition.order"
|
||||
:disabled="isCaseEdit"
|
||||
class="ms-api-header-select" @change="getApiTest" clearable>
|
||||
<el-option v-for="grd in priorities" :key="grd.id" :label="grd.name" :value="grd.id"/>
|
||||
class="ms-api-header-select" @change="search" clearable>
|
||||
<el-option v-for="grd in priorities" :key="grd.id" :label="$t(grd.label)" :value="grd.id"/>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="3">
|
||||
<el-col :span="4">
|
||||
<div class="ms-api-header-select" style="margin-right: 20px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-input size="small" :placeholder="$t('api_test.definition.request.select_case')"
|
||||
:disabled="isCaseEdit"
|
||||
v-model="condition.name" @blur="getApiTest" @keyup.enter.native="getApiTest" />
|
||||
v-model="condition.name" @blur="search" @keyup.enter.native="search"/>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-link type="primary" style="margin-left: 5px" @click="open">{{$t('commons.adv_search.title')}}</el-link>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
|
@ -43,7 +50,7 @@
|
|||
</div>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="2" v-if="!(isReadOnly || isCaseEdit)">
|
||||
<el-col :span="1" v-if="!(isReadOnly || isCaseEdit)">
|
||||
<el-dropdown size="small" split-button type="primary" class="ms-api-header-select" @click="addCase"
|
||||
@command="handleCommand" v-tester>
|
||||
+{{$t('api_test.definition.request.case')}}
|
||||
|
@ -54,6 +61,10 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<!--高级搜索-->
|
||||
<ms-table-adv-search-bar :condition.sync="condition" :showLink="false" ref="searchBar" @search="search"/>
|
||||
|
||||
</el-header>
|
||||
</template>
|
||||
|
||||
|
@ -64,10 +75,11 @@
|
|||
import MsTag from "../../../../common/components/MsTag";
|
||||
import MsEnvironmentSelect from "./MsEnvironmentSelect";
|
||||
import {API_METHOD_COLOUR} from "../../model/JsonData";
|
||||
import MsTableAdvSearchBar from "@/business/components/common/components/search/MsTableAdvSearchBar";
|
||||
|
||||
export default {
|
||||
name: "ApiCaseHeader",
|
||||
components: {MsEnvironmentSelect, MsTag, ApiEnvironmentConfig},
|
||||
components: {MsEnvironmentSelect, MsTag, ApiEnvironmentConfig, MsTableAdvSearchBar},
|
||||
data() {
|
||||
return {
|
||||
environments: [],
|
||||
|
@ -86,7 +98,7 @@
|
|||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -132,9 +144,19 @@
|
|||
setEnvironment(data) {
|
||||
this.$emit('setEnvironment', data);
|
||||
},
|
||||
getApiTest() {
|
||||
search() {
|
||||
if (this.priorities && this.condition.order) {
|
||||
for (let index in this.priorities) {
|
||||
if (this.priorities[index].id === this.condition.order) {
|
||||
this.condition.orders = [this.priorities[index]];
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$emit('getApiTest');
|
||||
},
|
||||
open() {
|
||||
this.$refs.searchBar.open();
|
||||
},
|
||||
addCase() {
|
||||
this.$emit('addCase');
|
||||
},
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
|
||||
<label class="ms-api-label" style="padding-left: 20px; padding-right: 20px;">{{ $t('commons.tag') }}</label>
|
||||
<ms-input-tag :currentScenario="apiCase" ref="tag" style="float: right;margin-right: 215px;margin-top: -3px;"/>
|
||||
<ms-input-tag :currentScenario="apiCase" ref="tag" style="float: right;margin-right: 215px;margin-top: -3px;" @keyup.enter.native="saveTestCase(apiCase)"/>
|
||||
|
||||
<div v-if="apiCase.id" style="color: #999999;font-size: 12px">
|
||||
<span>
|
||||
|
|
|
@ -43,21 +43,21 @@
|
|||
</template>
|
||||
<script>
|
||||
|
||||
import ApiCaseHeader from "./ApiCaseHeader";
|
||||
import ApiCaseItem from "./ApiCaseItem";
|
||||
import MsRun from "../Run";
|
||||
import {getCurrentProjectID, getUUID} from "@/common/js/utils";
|
||||
import MsDrawer from "../../../../common/components/MsDrawer";
|
||||
import {PRIORITY} from "../../model/JsonData";
|
||||
import ApiCaseHeader from "./ApiCaseHeader";
|
||||
import ApiCaseItem from "./ApiCaseItem";
|
||||
import MsRun from "../Run";
|
||||
import {getCurrentProjectID, getUUID} from "@/common/js/utils";
|
||||
import MsDrawer from "../../../../common/components/MsDrawer";
|
||||
import {CASE_ORDER} from "../../model/JsonData";
|
||||
import {API_CASE_CONFIGS} from "@/business/components/common/components/search/search-components";
|
||||
|
||||
export default {
|
||||
export default {
|
||||
name: 'ApiCaseList',
|
||||
components: {
|
||||
MsDrawer,
|
||||
MsRun,
|
||||
ApiCaseHeader,
|
||||
ApiCaseItem,
|
||||
|
||||
},
|
||||
props: {
|
||||
createCase: String,
|
||||
|
@ -74,7 +74,7 @@ export default {
|
|||
environment: {},
|
||||
isReadOnly: false,
|
||||
selectedEvent: Object,
|
||||
priorities: PRIORITY,
|
||||
priorities: CASE_ORDER,
|
||||
apiCaseList: [],
|
||||
batchLoading: false,
|
||||
singleLoading: false,
|
||||
|
@ -85,7 +85,9 @@ export default {
|
|||
testCaseId: "",
|
||||
checkedCases: new Set(),
|
||||
visible: false,
|
||||
condition: {},
|
||||
condition: {
|
||||
components: API_CASE_CONFIGS
|
||||
},
|
||||
api: {}
|
||||
}
|
||||
},
|
||||
|
@ -118,6 +120,7 @@ export default {
|
|||
this.api = api;
|
||||
// testCaseId 不为空则为用例编辑页面
|
||||
this.testCaseId = testCaseId;
|
||||
this.condition = {components: API_CASE_CONFIGS};
|
||||
this.getApiTest();
|
||||
this.visible = true;
|
||||
},
|
||||
|
@ -173,9 +176,9 @@ export default {
|
|||
}
|
||||
}
|
||||
this.apiCaseList = response.data;
|
||||
if (this.apiCaseList.length == 0 && !this.loaded) {
|
||||
this.addCase();
|
||||
}
|
||||
// if (this.apiCaseList.length == 0 && !this.loaded) {
|
||||
// this.addCase();
|
||||
// }
|
||||
this.apiCaseList.forEach(apiCase => {
|
||||
if (apiCase.tags && apiCase.tags.length > 0) {
|
||||
apiCase.tags = JSON.parse(apiCase.tags);
|
||||
|
@ -250,15 +253,15 @@ export default {
|
|||
} else {
|
||||
this.$warning("没有可执行的用例!");
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.ms-drawer >>> .ms-drawer-body {
|
||||
.ms-drawer >>> .ms-drawer-body {
|
||||
margin-top: 80px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<api-list-container
|
||||
:is-api-list-enable="isApiListEnable"
|
||||
@isApiListEnableChange="isApiListEnableChange">
|
||||
<el-link type="primary" style="float:right;margin-top: 5px" @click="open">{{$t('commons.adv_search.title')}}</el-link>
|
||||
|
||||
<el-input placeholder="搜索" @blur="search" @keyup.enter.native="search" class="search-input" size="small"
|
||||
v-model="condition.name"/>
|
||||
|
@ -89,39 +90,44 @@
|
|||
<ms-set-environment ref="setEnvironment" :testCase="clickRow" @createPerformance="createPerformance"/>
|
||||
<!--查看引用-->
|
||||
<ms-reference-view ref="viewRef"/>
|
||||
<!--高级搜索-->
|
||||
<ms-table-adv-search-bar :condition.sync="condition" :showLink="false" ref="searchBar" @search="initTable"/>
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import MsTableOperator from "../../../../common/components/MsTableOperator";
|
||||
import MsTableOperatorButton from "../../../../common/components/MsTableOperatorButton";
|
||||
import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent";
|
||||
import MsTablePagination from "../../../../common/pagination/TablePagination";
|
||||
import MsTag from "../../../../common/components/MsTag";
|
||||
import MsApiCaseList from "../case/ApiCaseList";
|
||||
import MsContainer from "../../../../common/components/MsContainer";
|
||||
import MsBottomContainer from "../BottomContainer";
|
||||
import ShowMoreBtn from "../../../../track/case/components/ShowMoreBtn";
|
||||
import MsBatchEdit from "../basis/BatchEdit";
|
||||
import {API_METHOD_COLOUR, CASE_PRIORITY, REQ_METHOD} from "../../model/JsonData";
|
||||
import MsTableOperator from "../../../../common/components/MsTableOperator";
|
||||
import MsTableOperatorButton from "../../../../common/components/MsTableOperatorButton";
|
||||
import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent";
|
||||
import MsTablePagination from "../../../../common/pagination/TablePagination";
|
||||
import MsTag from "../../../../common/components/MsTag";
|
||||
import MsApiCaseList from "../case/ApiCaseList";
|
||||
import MsContainer from "../../../../common/components/MsContainer";
|
||||
import MsBottomContainer from "../BottomContainer";
|
||||
import ShowMoreBtn from "../../../../track/case/components/ShowMoreBtn";
|
||||
import MsBatchEdit from "../basis/BatchEdit";
|
||||
import {API_METHOD_COLOUR, CASE_PRIORITY, REQ_METHOD} from "../../model/JsonData";
|
||||
|
||||
import {getBodyUploadFiles,getCurrentProjectID} from "@/common/js/utils";
|
||||
import ApiListContainer from "./ApiListContainer";
|
||||
import PriorityTableItem from "../../../../track/common/tableItems/planview/PriorityTableItem";
|
||||
import ApiCaseList from "../case/ApiCaseList";
|
||||
import {_filter, _sort} from "../../../../../../common/js/utils";
|
||||
import {_handleSelect, _handleSelectAll} from "../../../../../../common/js/tableUtils";
|
||||
import MsApiCaseTableExtendBtns from "../reference/ApiCaseTableExtendBtns";
|
||||
import MsReferenceView from "../reference/ReferenceView";
|
||||
import MsSetEnvironment from "@/business/components/api/definition/components/basis/SetEnvironment";
|
||||
import TestPlan from "@/business/components/api/definition/components/jmeter/components/test-plan";
|
||||
import ThreadGroup from "@/business/components/api/definition/components/jmeter/components/thread-group";
|
||||
import {parseEnvironment} from "@/business/components/api/test/model/EnvironmentModel";
|
||||
import MsTableSelectAll from "../../../../common/components/table/MsTableSelectAll";
|
||||
import {getBodyUploadFiles, getCurrentProjectID} from "@/common/js/utils";
|
||||
import ApiListContainer from "./ApiListContainer";
|
||||
import PriorityTableItem from "../../../../track/common/tableItems/planview/PriorityTableItem";
|
||||
import ApiCaseList from "../case/ApiCaseList";
|
||||
import {_filter, _sort} from "../../../../../../common/js/utils";
|
||||
import {_handleSelect, _handleSelectAll} from "../../../../../../common/js/tableUtils";
|
||||
import MsApiCaseTableExtendBtns from "../reference/ApiCaseTableExtendBtns";
|
||||
import MsReferenceView from "../reference/ReferenceView";
|
||||
import MsSetEnvironment from "@/business/components/api/definition/components/basis/SetEnvironment";
|
||||
import TestPlan from "@/business/components/api/definition/components/jmeter/components/test-plan";
|
||||
import ThreadGroup from "@/business/components/api/definition/components/jmeter/components/thread-group";
|
||||
import {parseEnvironment} from "@/business/components/api/test/model/EnvironmentModel";
|
||||
import MsTableSelectAll from "../../../../common/components/table/MsTableSelectAll";
|
||||
import MsTableAdvSearchBar from "@/business/components/common/components/search/MsTableAdvSearchBar";
|
||||
import {API_CASE_CONFIGS} from "@/business/components/common/components/search/search-components";
|
||||
|
||||
export default {
|
||||
export default {
|
||||
name: "ApiCaseSimpleList",
|
||||
components: {
|
||||
MsTableSelectAll,
|
||||
|
@ -140,10 +146,13 @@ export default {
|
|||
MsBatchEdit,
|
||||
MsApiCaseTableExtendBtns,
|
||||
MsReferenceView,
|
||||
MsTableAdvSearchBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
condition: {},
|
||||
condition: {
|
||||
components: API_CASE_CONFIGS
|
||||
},
|
||||
selectCase: {},
|
||||
result: {},
|
||||
moduleId: "",
|
||||
|
@ -275,7 +284,6 @@ export default {
|
|||
this.condition.id = selectParamArr[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (this.condition.projectId) {
|
||||
this.result = this.$post('/api/testcase/list/' + this.currentPage + "/" + this.pageSize, this.condition, response => {
|
||||
this.total = response.data.itemCount;
|
||||
|
@ -284,12 +292,9 @@ export default {
|
|||
});
|
||||
}
|
||||
},
|
||||
// getMaintainerOptions() {
|
||||
// let workspaceId = localStorage.getItem(WORKSPACE_ID);
|
||||
// this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
|
||||
// this.valueArr.userId = response.data;
|
||||
// });
|
||||
// },
|
||||
open() {
|
||||
this.$refs.searchBar.open();
|
||||
},
|
||||
handleSelect(selection, row) {
|
||||
_handleSelect(this, selection, row, this.selectRows);
|
||||
this.selectRowsCount(this.selectRows)
|
||||
|
@ -539,30 +544,30 @@ export default {
|
|||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.operate-button > div {
|
||||
.operate-button > div {
|
||||
display: inline-block;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.request-method {
|
||||
.request-method {
|
||||
padding: 0 5px;
|
||||
color: #1E90FF;
|
||||
}
|
||||
}
|
||||
|
||||
.api-el-tag {
|
||||
.api-el-tag {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.search-input {
|
||||
.search-input {
|
||||
float: right;
|
||||
width: 300px;
|
||||
/*margin-bottom: 20px;*/
|
||||
margin-right: 20px;
|
||||
}
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.ms-select-all >>> th:first-child {
|
||||
margin-top: 20px;
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
:is-api-list-enable="isApiListEnable"
|
||||
@isApiListEnableChange="isApiListEnableChange">
|
||||
|
||||
<el-input placeholder="搜索" @blur="search" class="search-input" size="small" @keyup.enter.native="search"
|
||||
<el-link type="primary" @click="open" style="float: right;margin-top: 5px">{{$t('commons.adv_search.title')}}</el-link>
|
||||
<el-input :placeholder="$t('api_monitor.please_search')" @blur="search" class="search-input" size="small" @keyup.enter.native="search"
|
||||
v-model="condition.name"/>
|
||||
|
||||
<el-table v-loading="result.loading"
|
||||
|
@ -33,13 +34,13 @@
|
|||
sortable="custom"/>
|
||||
<el-table-column prop="name" :label="$t('api_test.definition.api_name')"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"/>
|
||||
sortable="custom" min-width="120px"/>
|
||||
<el-table-column
|
||||
prop="status"
|
||||
column-key="status"
|
||||
sortable="custom"
|
||||
:filters="statusFilters"
|
||||
:label="$t('api_test.definition.api_status')">
|
||||
:label="$t('api_test.definition.api_status')" min-width="120px">
|
||||
<template v-slot:default="scope">
|
||||
<span class="el-dropdown-link">
|
||||
<api-status :value="scope.row.status"/>
|
||||
|
@ -53,7 +54,7 @@
|
|||
column-key="method"
|
||||
:filters="methodFilters"
|
||||
:label="$t('api_test.definition.api_type')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip min-width="120px">
|
||||
<template v-slot:default="scope" class="request-method">
|
||||
<el-tag size="mini" :style="{'background-color': getColor(true, scope.row.method), border: getColor(true, scope.row.method)}"
|
||||
class="api-el-tag">
|
||||
|
@ -62,17 +63,17 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="path"
|
||||
:label="$t('api_test.definition.api_path')"
|
||||
show-overflow-tooltip/>
|
||||
|
||||
<el-table-column
|
||||
prop="userName"
|
||||
sortable="custom"
|
||||
:filters="userFilters"
|
||||
column-key="user_id"
|
||||
:label="$t('api_test.definition.api_principal')"
|
||||
show-overflow-tooltip min-width="100px"/>
|
||||
|
||||
<el-table-column
|
||||
prop="path"
|
||||
:label="$t('api_test.definition.api_path')"
|
||||
show-overflow-tooltip/>
|
||||
|
||||
<el-table-column prop="tags" :label="$t('commons.tag')">
|
||||
|
@ -124,31 +125,36 @@
|
|||
<ms-api-case-list @refresh="initTable" @showExecResult="showExecResult" :currentApi="selectApi" ref="caseList"/>
|
||||
<!--批量编辑-->
|
||||
<ms-batch-edit ref="batchEdit" @batchEdit="batchEdit" :typeArr="typeArr" :value-arr="valueArr"/>
|
||||
<!--高级搜索-->
|
||||
<ms-table-adv-search-bar :condition.sync="condition" :showLink="false" ref="searchBar" @search="search"/>
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import MsTableHeader from '../../../../common/components/MsTableHeader';
|
||||
import MsTableOperator from "../../../../common/components/MsTableOperator";
|
||||
import MsTableOperatorButton from "../../../../common/components/MsTableOperatorButton";
|
||||
import MsTableButton from "../../../../common/components/MsTableButton";
|
||||
import MsTablePagination from "../../../../common/pagination/TablePagination";
|
||||
import MsTag from "../../../../common/components/MsTag";
|
||||
import MsApiCaseList from "../case/ApiCaseList";
|
||||
import MsContainer from "../../../../common/components/MsContainer";
|
||||
import MsBottomContainer from "../BottomContainer";
|
||||
import ShowMoreBtn from "../../../../track/case/components/ShowMoreBtn";
|
||||
import MsBatchEdit from "../basis/BatchEdit";
|
||||
import {API_METHOD_COLOUR, API_STATUS, REQ_METHOD} from "../../model/JsonData";
|
||||
import {_filter, _sort, getCurrentProjectID} from "@/common/js/utils";
|
||||
import {WORKSPACE_ID} from '@/common/js/constants';
|
||||
import ApiListContainer from "./ApiListContainer";
|
||||
import MsTableSelectAll from "../../../../common/components/table/MsTableSelectAll";
|
||||
import ApiStatus from "@/business/components/api/definition/components/list/ApiStatus";
|
||||
import MsTableHeader from '../../../../common/components/MsTableHeader';
|
||||
import MsTableOperator from "../../../../common/components/MsTableOperator";
|
||||
import MsTableOperatorButton from "../../../../common/components/MsTableOperatorButton";
|
||||
import MsTableButton from "../../../../common/components/MsTableButton";
|
||||
import MsTablePagination from "../../../../common/pagination/TablePagination";
|
||||
import MsTag from "../../../../common/components/MsTag";
|
||||
import MsApiCaseList from "../case/ApiCaseList";
|
||||
import MsContainer from "../../../../common/components/MsContainer";
|
||||
import MsBottomContainer from "../BottomContainer";
|
||||
import ShowMoreBtn from "../../../../track/case/components/ShowMoreBtn";
|
||||
import MsBatchEdit from "../basis/BatchEdit";
|
||||
import {API_METHOD_COLOUR, API_STATUS, REQ_METHOD} from "../../model/JsonData";
|
||||
import {_filter, _sort, getCurrentProjectID} from "@/common/js/utils";
|
||||
import {WORKSPACE_ID} from '@/common/js/constants';
|
||||
import ApiListContainer from "./ApiListContainer";
|
||||
import MsTableSelectAll from "../../../../common/components/table/MsTableSelectAll";
|
||||
import ApiStatus from "@/business/components/api/definition/components/list/ApiStatus";
|
||||
import MsTableAdvSearchBar from "@/business/components/common/components/search/MsTableAdvSearchBar";
|
||||
import {API_DEFINITION_CONFIGS} from "@/business/components/common/components/search/search-components";
|
||||
|
||||
export default {
|
||||
export default {
|
||||
name: "ApiList",
|
||||
components: {
|
||||
ApiStatus,
|
||||
|
@ -164,11 +170,14 @@ export default {
|
|||
MsContainer,
|
||||
MsBottomContainer,
|
||||
ShowMoreBtn,
|
||||
MsBatchEdit
|
||||
MsBatchEdit,
|
||||
MsTableAdvSearchBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
condition: {},
|
||||
condition: {
|
||||
components: API_DEFINITION_CONFIGS
|
||||
},
|
||||
selectApi: {},
|
||||
result: {},
|
||||
moduleId: "",
|
||||
|
@ -272,12 +281,9 @@ export default {
|
|||
},
|
||||
initTable() {
|
||||
this.selectRows = new Set();
|
||||
|
||||
this.selectAll = false;
|
||||
this.unSelection = [];
|
||||
this.selectDataCounts = 0;
|
||||
|
||||
|
||||
this.condition.moduleIds = this.selectNodeIds;
|
||||
this.condition.projectId = getCurrentProjectID();
|
||||
if (this.currentProtocol != null) {
|
||||
|
@ -544,41 +550,44 @@ export default {
|
|||
_filter(filters, this.condition);
|
||||
this.initTable();
|
||||
},
|
||||
open() {
|
||||
this.$refs.searchBar.open();
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.operate-button > div {
|
||||
.operate-button > div {
|
||||
display: inline-block;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.request-method {
|
||||
.request-method {
|
||||
padding: 0 5px;
|
||||
color: #1E90FF;
|
||||
}
|
||||
}
|
||||
|
||||
.api-el-tag {
|
||||
.api-el-tag {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.search-input {
|
||||
.search-input {
|
||||
float: right;
|
||||
width: 300px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.el-tag {
|
||||
.el-tag {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.ms-select-all >>> th:first-child {
|
||||
.ms-select-all >>> th:first-child {
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.ms-select-all >>> th:nth-child(2) .el-icon-arrow-down {
|
||||
.ms-select-all >>> th:nth-child(2) .el-icon-arrow-down {
|
||||
top: -2px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -6,6 +6,15 @@ export const PRIORITY = [
|
|||
{name: 'P3', id: 'P3'}
|
||||
]
|
||||
|
||||
export const CASE_ORDER = [
|
||||
{label: 'api_test.definition.request.grade_order_asc', name: 'priority', type: 'desc', id: 'grade_order_asc'},
|
||||
{label: 'api_test.definition.request.grade_order_desc', name: 'priority', type: 'asc', id: 'grade_order_desc'},
|
||||
{label: 'api_test.definition.request.create_time_order_asc', name: 'create_time', type: 'asc', id: 'create_time_order_asc'},
|
||||
{label: 'api_test.definition.request.create_time_order_desc', name: 'create_time', type: 'desc', id: 'create_time_order_desc'},
|
||||
{label: 'api_test.definition.request.update_time_order_asc', name: 'update_time', type: 'asc', id: 'update_time_order_asc'},
|
||||
{label: 'api_test.definition.request.update_time_order_desc', name: 'update_time', type: 'desc', id: 'update_time_order_desc'}
|
||||
]
|
||||
|
||||
export const OPTIONS = [
|
||||
{value: 'HTTP', name: 'HTTP'},
|
||||
{value: 'TCP', name: 'TCP'},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<span class="adv-search-bar">
|
||||
<el-link type="primary" @click="open">{{$t('commons.adv_search.title')}}</el-link>
|
||||
<el-link type="primary" @click="open" v-if="showLink">{{$t('commons.adv_search.title')}}</el-link>
|
||||
<el-dialog :title="$t('commons.adv_search.combine')" :visible.sync="visible" custom-class="adv-dialog"
|
||||
:append-to-body="true">
|
||||
<div>
|
||||
|
@ -28,6 +28,10 @@
|
|||
name: "MsTableAdvSearchBar",
|
||||
props: {
|
||||
condition: Object,
|
||||
showLink: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -115,6 +115,101 @@ export const STATUS = {
|
|||
}
|
||||
}
|
||||
|
||||
export const API_STATUS = {
|
||||
key: "status",
|
||||
name: 'MsTableSearchSelect',
|
||||
label: 'commons.status',
|
||||
operator: {
|
||||
options: [OPERATORS.IN, OPERATORS.NOT_IN]
|
||||
},
|
||||
options: [
|
||||
{value: 'Prepare', label: '未开始'},
|
||||
{value: 'Underway', label: '进行中'},
|
||||
{value: 'Completed', label: '已完成'}
|
||||
],
|
||||
props: { // 尾部控件的props,一般为element ui控件的props
|
||||
multiple: true
|
||||
}
|
||||
}
|
||||
export const API_CASE_PRIORITY = {
|
||||
key: "priority",
|
||||
name: 'MsTableSearchSelect',
|
||||
label: 'test_track.case.priority',
|
||||
operator: {
|
||||
options: [OPERATORS.IN, OPERATORS.NOT_IN]
|
||||
},
|
||||
options: [
|
||||
{value: 'P0', label: 'P0'},
|
||||
{value: 'P1', label: 'P1'},
|
||||
{value: 'P2', label: 'P2'},
|
||||
{value: 'P3', label: 'P3'}
|
||||
],
|
||||
props: { // 尾部控件的props,一般为element ui控件的props
|
||||
multiple: true
|
||||
}
|
||||
}
|
||||
export const API_CASE_RESULT = {
|
||||
key: "status",
|
||||
name: 'MsTableSearchSelect',
|
||||
label: 'test_track.plan_view.execute_result',
|
||||
operator: {
|
||||
options: [OPERATORS.IN, OPERATORS.NOT_IN]
|
||||
},
|
||||
options: [
|
||||
{value: 'success', label: 'api_test.automation.success'},
|
||||
{value: 'error', label: 'api_test.automation.fail'}
|
||||
],
|
||||
props: { // 尾部控件的props,一般为element ui控件的props
|
||||
multiple: true
|
||||
}
|
||||
}
|
||||
|
||||
export const API_METHOD = {
|
||||
key: "method",
|
||||
name: 'MsTableSearchSelect',
|
||||
label: 'api_test.definition.api_type',
|
||||
operator: {
|
||||
options: [OPERATORS.IN, OPERATORS.NOT_IN]
|
||||
},
|
||||
options: [
|
||||
{value: 'GET', label: 'GET'},
|
||||
{value: 'POST', label: 'POST'},
|
||||
{value: 'PUT', label: 'PUT'},
|
||||
{value: 'PATCH', label: 'PATCH'},
|
||||
{value: 'DELETE', label: 'DELETE'},
|
||||
{value: 'OPTIONS', label: 'OPTIONS'},
|
||||
{value: 'HEAD', label: 'HEAD'},
|
||||
{value: 'CONNECT', label: 'CONNECT'},
|
||||
{value: 'DUBBO', label: 'DUBBO'},
|
||||
{value: 'dubbo://', label: 'dubbo://'},
|
||||
{value: 'SQL', label: 'SQL'},
|
||||
{value: 'TCP', label: 'TCP'}
|
||||
],
|
||||
props: { // 尾部控件的props,一般为element ui控件的props
|
||||
multiple: true
|
||||
}
|
||||
}
|
||||
|
||||
export const API_PATH = {
|
||||
key: "path", // 返回结果Map的key
|
||||
name: 'MsTableSearchInput', // Vue控件名称
|
||||
label: 'api_test.definition.api_path', // 显示名称
|
||||
operator: { // 运算符设置
|
||||
value: OPERATORS.LIKE.value, // 如果未设置value初始值,则value初始值为options[0]
|
||||
options: [OPERATORS.LIKE, OPERATORS.NOT_LIKE] // 运算符候选项
|
||||
},
|
||||
}
|
||||
|
||||
export const API_TAGS = {
|
||||
key: "tags", // 返回结果Map的key
|
||||
name: 'MsTableSearchInput', // Vue控件名称
|
||||
label: 'commons.tag', // 显示名称
|
||||
operator: { // 运算符设置
|
||||
value: OPERATORS.LIKE.value, // 如果未设置value初始值,则value初始值为options[0]
|
||||
options: [OPERATORS.LIKE, OPERATORS.NOT_LIKE] // 运算符候选项
|
||||
},
|
||||
}
|
||||
|
||||
export const CREATOR = {
|
||||
key: "creator",
|
||||
name: 'MsTableSearchSelect',
|
||||
|
@ -311,10 +406,14 @@ export const TEST_PLAN_STATUS = {
|
|||
}
|
||||
};
|
||||
|
||||
export const TEST_CONFIGS = [NAME, UPDATE_TIME, PROJECT_NAME, CREATE_TIME, STATUS, CREATOR];
|
||||
export const TEST_CONFIGS = [NAME, UPDATE_TIME, CREATE_TIME, STATUS, CREATOR];
|
||||
|
||||
export const REPORT_CONFIGS = [NAME, TEST_NAME, PROJECT_NAME, CREATE_TIME, STATUS, CREATOR, TRIGGER_MODE];
|
||||
export const REPORT_CONFIGS = [NAME, TEST_NAME, CREATE_TIME, STATUS, CREATOR, TRIGGER_MODE];
|
||||
|
||||
export const TEST_CASE_CONFIGS = [NAME, MODULE, PRIORITY, CREATE_TIME, TYPE, UPDATE_TIME, METHOD, CREATOR, EXECUTOR];
|
||||
export const TEST_CASE_CONFIGS = [NAME, API_TAGS, MODULE, PRIORITY, CREATE_TIME, TYPE, UPDATE_TIME, METHOD, CREATOR, EXECUTOR];
|
||||
|
||||
export const TEST_PLAN_CONFIGS = [NAME, UPDATE_TIME, PROJECT_NAME, CREATE_TIME, PRINCIPAL, TEST_PLAN_STATUS, STAGE];
|
||||
export const TEST_PLAN_CONFIGS = [NAME, UPDATE_TIME, CREATE_TIME, PRINCIPAL, TEST_PLAN_STATUS, STAGE];
|
||||
|
||||
export const API_DEFINITION_CONFIGS = [NAME, API_METHOD, API_PATH, API_STATUS, API_TAGS, UPDATE_TIME, CREATE_TIME, CREATOR];
|
||||
|
||||
export const API_CASE_CONFIGS = [NAME, API_CASE_PRIORITY, API_TAGS, API_CASE_RESULT, UPDATE_TIME, CREATE_TIME, CREATOR];
|
||||
|
|
|
@ -499,6 +499,7 @@ export default {
|
|||
} else {
|
||||
this.maxUsers = '0';
|
||||
this.avgThroughput = '0';
|
||||
this.avgTransactions = '0';
|
||||
this.errors = '0';
|
||||
this.avgResponseTime = '0';
|
||||
this.responseTime90 = '0';
|
||||
|
|
|
@ -27,6 +27,9 @@
|
|||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="userName"
|
||||
sortable="custom"
|
||||
:filters="userFilters"
|
||||
column-key="user_id"
|
||||
:label="$t('load_test.user_name')"
|
||||
width="150"
|
||||
show-overflow-tooltip>
|
||||
|
@ -80,11 +83,11 @@ import MsContainer from "../../common/components/MsContainer";
|
|||
import MsMainContainer from "../../common/components/MsMainContainer";
|
||||
import MsPerformanceTestStatus from "./PerformanceTestStatus";
|
||||
import MsTableOperators from "../../common/components/MsTableOperators";
|
||||
import {_filter, _sort} from "@/common/js/utils";
|
||||
import {_filter, _sort, getCurrentProjectID} from "@/common/js/utils";
|
||||
import MsTableHeader from "../../common/components/MsTableHeader";
|
||||
import {TEST_CONFIGS} from "../../common/components/search/search-components";
|
||||
import {LIST_CHANGE, PerformanceEvent} from "@/business/components/common/head/ListEvent";
|
||||
import {getCurrentProjectID} from "../../../../common/js/utils";
|
||||
import {WORKSPACE_ID} from "@/common/js/constants";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
@ -131,7 +134,8 @@ export default {
|
|||
{text: 'Reporting', value: 'Reporting'},
|
||||
{text: 'Completed', value: 'Completed'},
|
||||
{text: 'Error', value: 'Error'}
|
||||
]
|
||||
],
|
||||
userFilters: [],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -143,8 +147,17 @@ export default {
|
|||
created: function () {
|
||||
this.projectId = this.$route.params.projectId;
|
||||
this.initTableData();
|
||||
this.getMaintainerOptions();
|
||||
},
|
||||
methods: {
|
||||
getMaintainerOptions() {
|
||||
let workspaceId = localStorage.getItem(WORKSPACE_ID);
|
||||
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
|
||||
this.userFilters = response.data.map(u => {
|
||||
return {text: u.name, value: u.id}
|
||||
});
|
||||
});
|
||||
},
|
||||
initTableData() {
|
||||
if (this.projectId !== 'all') {
|
||||
this.condition.projectId = this.projectId;
|
||||
|
|
|
@ -48,14 +48,14 @@
|
|||
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
sortable
|
||||
prop="updateTime"
|
||||
:label="$t('commons.update_time')">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column-->
|
||||
<!-- sortable-->
|
||||
<!-- prop="updateTime"-->
|
||||
<!-- :label="$t('commons.update_time')">-->
|
||||
<!-- <template v-slot:default="scope">-->
|
||||
<!-- <span>{{ scope.row.updateTime | timestampFormatDate }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column
|
||||
prop="status"
|
||||
column-key="status"
|
||||
|
@ -67,7 +67,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="caseStatus"
|
||||
label="执行状态">
|
||||
:label="$t('test_track.plan.load_case.execution_status')">
|
||||
<template v-slot:default="{row}">
|
||||
<el-tag size="mini" type="danger" v-if="row.caseStatus === 'error'">
|
||||
{{ row.caseStatus }}
|
||||
|
@ -79,11 +79,11 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="报告"
|
||||
:label="$t('test_track.plan.load_case.report')"
|
||||
show-overflow-tooltip>
|
||||
<template v-slot:default="scope">
|
||||
<div v-loading="loading === scope.row.id">
|
||||
<el-link type="info" @click="getReport(scope.row)" v-if="scope.row.loadReportId">查看报告</el-link>
|
||||
<el-link type="info" @click="getReport(scope.row)" v-if="scope.row.loadReportId">{{ $t('test_track.plan.load_case.view_report') }}</el-link>
|
||||
<span v-else> - </span>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -141,10 +141,10 @@ export default {
|
|||
// name: "批量编辑用例", handleClick: this.handleBatchEdit
|
||||
// },
|
||||
{
|
||||
name: "批量取消关联", handleClick: this.handleDeleteBatch
|
||||
name: this.$t('test_track.plan.load_case.unlink_in_bulk'), handleClick: this.handleDeleteBatch
|
||||
},
|
||||
{
|
||||
name: "批量执行用例", handleClick: this.handleRunBatch
|
||||
name: this.$t('test_track.plan.load_case.batch_exec_cases'), handleClick: this.handleRunBatch
|
||||
}
|
||||
],
|
||||
statusFilters: [
|
||||
|
@ -200,7 +200,6 @@ export default {
|
|||
if (arr.length > 0) {
|
||||
this.initTable();
|
||||
} else {
|
||||
setTimeout(this.initTable, 3000);
|
||||
clearInterval(this.refreshScheduler);
|
||||
}
|
||||
}, 4000);
|
||||
|
@ -263,7 +262,7 @@ export default {
|
|||
}).then(() => {
|
||||
this.$notify({
|
||||
title: loadCase.caseName,
|
||||
message: '正在执行....',
|
||||
message: this.$t('test_track.plan.load_case.exec'),
|
||||
type: 'success'
|
||||
});
|
||||
this.initTable();
|
||||
|
@ -274,7 +273,7 @@ export default {
|
|||
});
|
||||
this.$notify.error({
|
||||
title: loadCase.caseName,
|
||||
message: '用例执行错误,请单独调试该用例!'
|
||||
message: this.$t('test_track.plan.load_case.error')
|
||||
});
|
||||
})
|
||||
},
|
||||
|
@ -310,7 +309,7 @@ export default {
|
|||
if (exist) {
|
||||
this.$refs.loadCaseReport.drawer = true;
|
||||
} else {
|
||||
this.$warning("报告不存在");
|
||||
this.$warning(this.$t('test_track.plan.load_case.report_not_found'));
|
||||
// this.initTable();
|
||||
}
|
||||
})
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 010ad7a5f072a5e9d368c756a2473bbd20781433
|
||||
Subproject commit 7d43154a7c19732407a8e9ace8a7d1ea13c91f36
|
|
@ -517,6 +517,12 @@ export default {
|
|||
},
|
||||
request: {
|
||||
grade_info: "Filter by rank",
|
||||
grade_order_asc: "from high to low by use case level",
|
||||
grade_order_desc: "from high to low by use case level,",
|
||||
create_time_order_asc: "by creation time from front to back",
|
||||
create_time_order_desc: "from back to front by creation time,",
|
||||
update_time_order_asc: "by update time from front to back",
|
||||
update_time_order_desc: "from back to front by update time,",
|
||||
run_env: "Operating environment",
|
||||
select_case: "Search use cases",
|
||||
case: "Case",
|
||||
|
@ -1100,6 +1106,16 @@ export default {
|
|||
plan_delete_confirm: "All use cases under this plan will be deleted,confirm delete test plan: ",
|
||||
plan_delete_tip: "The test plan is under way, please confirm and delete it!",
|
||||
plan_delete: "Delete test plan",
|
||||
load_case: {
|
||||
execution_status: "Execution status",
|
||||
report: "report",
|
||||
view_report: "View report",
|
||||
unlink_in_bulk: "Unlink in bulk",
|
||||
batch_exec_cases: "Batch execution use cases",
|
||||
exec: "Executing....",
|
||||
error: "Use case execution error, please debug this use case separately!",
|
||||
report_not_found: "Report does not exist",
|
||||
}
|
||||
},
|
||||
review: {
|
||||
test_review: "Test Review",
|
||||
|
|
|
@ -515,6 +515,12 @@ export default {
|
|||
},
|
||||
request: {
|
||||
grade_info: "按等级筛选",
|
||||
grade_order_asc: "按用例等级从高到低",
|
||||
grade_order_desc: "按用例等级从高到低",
|
||||
create_time_order_asc: "按创建时间从前到后",
|
||||
create_time_order_desc: "按创建时间从后到前",
|
||||
update_time_order_asc: "按更新时间从前到后",
|
||||
update_time_order_desc: "按更新时间从后到前",
|
||||
run_env: "运行环境",
|
||||
select_case: "搜索用例",
|
||||
case: "用例",
|
||||
|
@ -1101,6 +1107,16 @@ export default {
|
|||
plan_delete_confirm: "将删除该测试计划下所有用例,确认删除测试计划: ",
|
||||
plan_delete_tip: "该测试计划正在进行中,请确认再删除!",
|
||||
plan_delete: "删除计划",
|
||||
load_case: {
|
||||
execution_status: "执行状态",
|
||||
report: "报告",
|
||||
view_report: "查看报告",
|
||||
unlink_in_bulk: "批量取消关联",
|
||||
batch_exec_cases: "批量执行用例",
|
||||
exec: "正在执行....",
|
||||
error: "用例执行错误,请单独调试该用例!",
|
||||
report_not_found: "报告不存在",
|
||||
}
|
||||
},
|
||||
review: {
|
||||
test_review: "用例评审",
|
||||
|
|
|
@ -515,6 +515,12 @@ export default {
|
|||
},
|
||||
request: {
|
||||
grade_info: "按等級篩選",
|
||||
grade_order_asc: "按用例等級從高到低",
|
||||
grade_order_desc: "按用例等級從高到低",
|
||||
create_time_order_asc: "按創建時間從前到後",
|
||||
create_time_order_desc: "按創建時間從後到前",
|
||||
update_time_order_asc: "按更新時間從前到後",
|
||||
update_time_order_desc: "按更新時間從後到前",
|
||||
run_env: "運行環境",
|
||||
select_case: "搜索用例",
|
||||
case: "用例",
|
||||
|
@ -1101,6 +1107,16 @@ export default {
|
|||
plan_delete_confirm: "將刪除該測試計劃下所有用例,確認刪除測試計劃: ",
|
||||
plan_delete_tip: "該測試計劃正在進行中,請確認再刪除!",
|
||||
plan_delete: "刪除計劃",
|
||||
load_case: {
|
||||
execution_status: "執行狀態",
|
||||
report: "報告",
|
||||
view_report: "查看報告",
|
||||
unlink_in_bulk: "批量取消關聯",
|
||||
batch_exec_cases: "批量執行用例",
|
||||
exec: "正在執行....",
|
||||
error: "用例執行錯誤,請單獨調試該用例!",
|
||||
report_not_found: "報告不存在",
|
||||
}
|
||||
},
|
||||
review: {
|
||||
test_review: "用例評審",
|
||||
|
|
Loading…
Reference in New Issue