fix: 自定义表头
This commit is contained in:
parent
8e4ce8a197
commit
245b46dc19
|
@ -0,0 +1,17 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UserHeader implements Serializable {
|
||||
private String id;
|
||||
|
||||
private String userId;
|
||||
|
||||
private String props;
|
||||
|
||||
private String type;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
|
@ -0,0 +1,480 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class UserHeaderExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public UserHeaderExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(String value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(String value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(String value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(String value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
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<String> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(String value1, String value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(String value1, String value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIsNull() {
|
||||
addCriterion("user_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIsNotNull() {
|
||||
addCriterion("user_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdEqualTo(String value) {
|
||||
addCriterion("user_id =", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotEqualTo(String value) {
|
||||
addCriterion("user_id <>", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdGreaterThan(String value) {
|
||||
addCriterion("user_id >", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("user_id >=", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLessThan(String value) {
|
||||
addCriterion("user_id <", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("user_id <=", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLike(String value) {
|
||||
addCriterion("user_id like", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotLike(String value) {
|
||||
addCriterion("user_id not like", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIn(List<String> values) {
|
||||
addCriterion("user_id in", values, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotIn(List<String> values) {
|
||||
addCriterion("user_id not in", values, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdBetween(String value1, String value2) {
|
||||
addCriterion("user_id between", value1, value2, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotBetween(String value1, String value2) {
|
||||
addCriterion("user_id not between", value1, value2, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPropsIsNull() {
|
||||
addCriterion("props is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPropsIsNotNull() {
|
||||
addCriterion("props is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPropsEqualTo(String value) {
|
||||
addCriterion("props =", value, "props");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPropsNotEqualTo(String value) {
|
||||
addCriterion("props <>", value, "props");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPropsGreaterThan(String value) {
|
||||
addCriterion("props >", value, "props");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPropsGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("props >=", value, "props");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPropsLessThan(String value) {
|
||||
addCriterion("props <", value, "props");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPropsLessThanOrEqualTo(String value) {
|
||||
addCriterion("props <=", value, "props");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPropsLike(String value) {
|
||||
addCriterion("props like", value, "props");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPropsNotLike(String value) {
|
||||
addCriterion("props not like", value, "props");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPropsIn(List<String> values) {
|
||||
addCriterion("props in", values, "props");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPropsNotIn(List<String> values) {
|
||||
addCriterion("props not in", values, "props");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPropsBetween(String value1, String value2) {
|
||||
addCriterion("props between", value1, value2, "props");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPropsNotBetween(String value1, String value2) {
|
||||
addCriterion("props not between", value1, value2, "props");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIsNull() {
|
||||
addCriterion("`type` is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIsNotNull() {
|
||||
addCriterion("`type` is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeEqualTo(String value) {
|
||||
addCriterion("`type` =", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotEqualTo(String value) {
|
||||
addCriterion("`type` <>", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeGreaterThan(String value) {
|
||||
addCriterion("`type` >", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("`type` >=", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLessThan(String value) {
|
||||
addCriterion("`type` <", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLessThanOrEqualTo(String value) {
|
||||
addCriterion("`type` <=", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLike(String value) {
|
||||
addCriterion("`type` like", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotLike(String value) {
|
||||
addCriterion("`type` not like", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIn(List<String> values) {
|
||||
addCriterion("`type` in", values, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotIn(List<String> values) {
|
||||
addCriterion("`type` not in", values, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeBetween(String value1, String value2) {
|
||||
addCriterion("`type` between", value1, value2, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotBetween(String value1, String value2) {
|
||||
addCriterion("`type` not between", value1, value2, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package io.metersphere.base.mapper;
|
||||
|
||||
import io.metersphere.base.domain.UserHeader;
|
||||
import io.metersphere.base.domain.UserHeaderExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface UserHeaderMapper {
|
||||
long countByExample(UserHeaderExample example);
|
||||
|
||||
int deleteByExample(UserHeaderExample example);
|
||||
|
||||
int deleteByPrimaryKey(String id);
|
||||
|
||||
int insert(UserHeader record);
|
||||
|
||||
int insertSelective(UserHeader record);
|
||||
|
||||
List<UserHeader> selectByExample(UserHeaderExample example);
|
||||
|
||||
UserHeader selectByPrimaryKey(String id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") UserHeader record, @Param("example") UserHeaderExample example);
|
||||
|
||||
int updateByExample(@Param("record") UserHeader record, @Param("example") UserHeaderExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(UserHeader record);
|
||||
|
||||
int updateByPrimaryKey(UserHeader record);
|
||||
}
|
|
@ -0,0 +1,196 @@
|
|||
<?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.UserHeaderMapper">
|
||||
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.UserHeader">
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="props" jdbcType="VARCHAR" property="props" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, props, `type`
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="io.metersphere.base.domain.UserHeaderExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from user_header
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user_header
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from user_header
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.UserHeaderExample">
|
||||
delete from user_header
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="io.metersphere.base.domain.UserHeader">
|
||||
insert into user_header (id, user_id, props,
|
||||
`type`)
|
||||
values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{props,jdbcType=VARCHAR},
|
||||
#{type,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.UserHeader">
|
||||
insert into user_header
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="props != null">
|
||||
props,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type`,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="props != null">
|
||||
#{props,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="io.metersphere.base.domain.UserHeaderExample" resultType="java.lang.Long">
|
||||
select count(*) from user_header
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update user_header
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.props != null">
|
||||
props = #{record.props,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
`type` = #{record.type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update user_header
|
||||
set id = #{record.id,jdbcType=VARCHAR},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
props = #{record.props,jdbcType=VARCHAR},
|
||||
`type` = #{record.type,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.UserHeader">
|
||||
update user_header
|
||||
<set>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="props != null">
|
||||
props = #{props,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type` = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.UserHeader">
|
||||
update user_header
|
||||
set user_id = #{userId,jdbcType=VARCHAR},
|
||||
props = #{props,jdbcType=VARCHAR},
|
||||
`type` = #{type,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
|
@ -27,70 +27,74 @@
|
|||
<show-more-btn :is-show="isSelect(scope.row)" :buttons="buttons" :size="selectDataCounts"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="num" label="ID"
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
<el-table-column v-if="item.prop == 'num'" prop="num" label="ID"
|
||||
sortable="custom"
|
||||
min-width="120px"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip :key="index">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip content="编辑">
|
||||
<a style="cursor:pointer" @click="edit(scope.row)"> {{ scope.row.num }} </a>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name"
|
||||
<el-table-column v-if="item.prop == 'name'" prop="name"
|
||||
sortable="custom"
|
||||
:label="$t('api_test.automation.scenario_name')"
|
||||
show-overflow-tooltip
|
||||
min-width="120px"/>
|
||||
<el-table-column prop="level"
|
||||
min-width="120px"
|
||||
:key="index"
|
||||
/>
|
||||
<el-table-column v-if="item.prop == 'level'" prop="level"
|
||||
sortable="custom"
|
||||
column-key="level"
|
||||
:filters="levelFilters"
|
||||
min-width="120px"
|
||||
|
||||
:label="$t('api_test.automation.case_level')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip :key="index">
|
||||
<template v-slot:default="scope">
|
||||
<priority-table-item :value="scope.row.level"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" :label="$t('test_track.plan.plan_status')"
|
||||
<el-table-column v-if="item.prop == 'status'" prop="status" :label="$t('test_track.plan.plan_status')"
|
||||
sortable="custom"
|
||||
column-key="status"
|
||||
:filters="statusFilters"
|
||||
|
||||
show-overflow-tooltip min-width="120px">
|
||||
show-overflow-tooltip min-width="120px" :key="index">
|
||||
<template v-slot:default="scope">
|
||||
<plan-status-table-item :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="tags" min-width="120px"
|
||||
:label="$t('api_test.automation.tag')">
|
||||
<el-table-column v-if="item.prop == 'tags'" prop="tags" min-width="120px"
|
||||
:label="$t('api_test.automation.tag')" :key="index">
|
||||
<template v-slot:default="scope">
|
||||
<div v-for="(itemName,index) in scope.row.tags" :key="index">
|
||||
<ms-tag type="success" effect="plain" :content="itemName"/>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userId" min-width="120px"
|
||||
<el-table-column v-if="item.prop == 'userId'" prop="userId" min-width="120px"
|
||||
:label="$t('api_test.automation.creator')"
|
||||
:filters="userFilters"
|
||||
column-key="user_id"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="updateTime" :label="$t('api_test.automation.update_time')" sortable="custom" min-width="180px"
|
||||
>
|
||||
show-overflow-tooltip
|
||||
:key="index"/>
|
||||
<el-table-column v-if="item.prop == 'updateTime'" prop="updateTime"
|
||||
:label="$t('api_test.automation.update_time')" sortable="custom" min-width="180px"
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stepTotal" :label="$t('api_test.automation.step')" min-width="80px"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="lastResult" :label="$t('api_test.automation.last_result')"
|
||||
<el-table-column v-if="item.prop == 'stepTotal'" prop="stepTotal" :label="$t('api_test.automation.step')"
|
||||
min-width="80px"
|
||||
show-overflow-tooltip :key="index"/>
|
||||
<el-table-column v-if="item.prop == 'lastResult'" prop="lastResult"
|
||||
:label="$t('api_test.automation.last_result')"
|
||||
:filters="resultFilters"
|
||||
|
||||
sortable="custom" column-key="last_result" min-width="120px">
|
||||
sortable="custom" column-key="last_result" min-width="120px" :key="index">
|
||||
<template v-slot:default="{row}">
|
||||
<el-link type="success" @click="showReport(row)" v-if="row.lastResult === 'Success'">
|
||||
{{ $t('api_test.automation.success') }}
|
||||
|
@ -100,19 +104,29 @@
|
|||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="passRate" :label="$t('api_test.automation.passing_rate')"
|
||||
<el-table-column v-if="item.prop == 'passRate'" prop="passRate"
|
||||
:label="$t('api_test.automation.passing_rate')"
|
||||
min-width="120px"
|
||||
|
||||
show-overflow-tooltip/>
|
||||
show-overflow-tooltip :key="index"/>
|
||||
</template>
|
||||
<el-table-column fixed="right" :label="$t('commons.operating')" width="190px" v-if="!referenced">
|
||||
<template slot="header">
|
||||
<span>{{ $t('commons.operating') }}
|
||||
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
|
||||
</span>
|
||||
</template>
|
||||
<template v-slot:default="{row}">
|
||||
<div v-if="trashEnable">
|
||||
<ms-table-operator-button :tip="$t('commons.reduction')" icon="el-icon-refresh-left" @exec="reductionApi(row)" v-tester/>
|
||||
<ms-table-operator-button :tip="$t('api_test.automation.remove')" icon="el-icon-delete" @exec="remove(row)" type="danger" v-tester/>
|
||||
<ms-table-operator-button :tip="$t('commons.reduction')" icon="el-icon-refresh-left"
|
||||
@exec="reductionApi(row)" v-tester/>
|
||||
<ms-table-operator-button :tip="$t('api_test.automation.remove')" icon="el-icon-delete"
|
||||
@exec="remove(row)" type="danger" v-tester/>
|
||||
</div>
|
||||
<div v-else>
|
||||
<ms-table-operator-button :tip="$t('api_test.automation.edit')" icon="el-icon-edit" @exec="edit(row)" v-tester/>
|
||||
<ms-table-operator-button class="run-button" :is-tester-permission="true" :tip="$t('api_test.automation.execute')"
|
||||
<ms-table-operator-button :tip="$t('api_test.automation.edit')" icon="el-icon-edit" @exec="edit(row)"
|
||||
v-tester/>
|
||||
<ms-table-operator-button class="run-button" :is-tester-permission="true"
|
||||
:tip="$t('api_test.automation.execute')"
|
||||
icon="el-icon-video-play"
|
||||
@exec="execute(row)" v-tester/>
|
||||
<ms-table-operator-button :tip="$t('api_test.automation.copy')" icon="el-icon-document-copy" type=""
|
||||
|
@ -123,6 +137,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<header-custom ref="headerCustom" :initTableData="search" :optionalFields=headerItems :type=type></header-custom>
|
||||
<ms-table-pagination :change="search" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||
:total="total"/>
|
||||
<div>
|
||||
|
@ -155,7 +170,7 @@ 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 {getCurrentProjectID, getUUID} from "@/common/js/utils";
|
||||
import {getCurrentProjectID, getCurrentUser, getUUID} from "@/common/js/utils";
|
||||
import MsApiReportDetail from "../report/ApiReportDetail";
|
||||
import MsTableMoreBtn from "./TableMoreBtn";
|
||||
import MsScenarioExtendButtons from "@/business/components/api/automation/scenario/ScenarioExtendBtns";
|
||||
|
@ -166,14 +181,17 @@ import MsTableOperatorButton from "@/business/components/common/components/MsTab
|
|||
import PriorityTableItem from "../../../track/common/tableItems/planview/PriorityTableItem";
|
||||
import PlanStatusTableItem from "../../../track/common/tableItems/plan/PlanStatusTableItem";
|
||||
import BatchEdit from "../../../track/case/components/BatchEdit";
|
||||
import {WORKSPACE_ID} from "../../../../../common/js/constants";
|
||||
import {API_SCENARIO_LIST, TEST_CASE_LIST, TEST_PLAN_LIST, WORKSPACE_ID} from "../../../../../common/js/constants";
|
||||
import EnvironmentSelect from "../../definition/components/environment/EnvironmentSelect";
|
||||
import BatchMove from "../../../track/case/components/BatchMove";
|
||||
import {_filter, _sort} from "@/common/js/tableUtils";
|
||||
import {Api_Scenario_List, Track_Test_Case} from "@/business/components/common/model/JsonData";
|
||||
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
|
||||
|
||||
export default {
|
||||
name: "MsApiScenarioList",
|
||||
components: {
|
||||
HeaderCustom,
|
||||
BatchMove,
|
||||
EnvironmentSelect,
|
||||
BatchEdit,
|
||||
|
@ -215,6 +233,9 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
type: API_SCENARIO_LIST,
|
||||
headerItems: Api_Scenario_List,
|
||||
tableLabel: Api_Scenario_List,
|
||||
loading: false,
|
||||
screenHeight: document.documentElement.clientHeight - 280,//屏幕高度,
|
||||
condition: {
|
||||
|
@ -326,11 +347,15 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
selectByParam() {
|
||||
this.changeSelectDataRangeAll();
|
||||
this.search();
|
||||
},
|
||||
search() {
|
||||
this.getLabel()
|
||||
this.condition.moduleIds = this.selectNodeIds;
|
||||
if (this.trashEnable) {
|
||||
this.condition.filters = {status: ["Trash"]};
|
||||
|
@ -380,6 +405,24 @@ export default {
|
|||
});
|
||||
}
|
||||
},
|
||||
getLabel() {
|
||||
let param = {}
|
||||
param.userId = getCurrentUser().id;
|
||||
param.type = API_SCENARIO_LIST
|
||||
this.result = this.$post('/system/header/info', param, response => {
|
||||
if (response.data != null) {
|
||||
let arry = eval(response.data.props);
|
||||
let obj = {};
|
||||
for (let key in arry) {
|
||||
obj[key] = arry[key];
|
||||
}
|
||||
let newObj = Object.keys(obj).map(val => ({
|
||||
prop: obj[val]
|
||||
}))
|
||||
this.tableLabel = newObj
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCommand(cmd) {
|
||||
let table = this.$refs.scenarioTable;
|
||||
switch (cmd) {
|
||||
|
|
|
@ -31,8 +31,9 @@
|
|||
<show-more-btn :is-show="scope.row.showMore" :buttons="buttons" :size="selectDataCounts"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="num" label="ID" min-width="120px" show-overflow-tooltip>
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
<el-table-column v-if="item.prop == 'num'" prop="num" label="ID" min-width="120px" show-overflow-tooltip
|
||||
:key="index">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip content="编辑">
|
||||
<a style="cursor:pointer" @click="handleTestCase(scope.row)"> {{ scope.row.num }} </a>
|
||||
|
@ -40,30 +41,34 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="name" min-width="160px" :label="$t('test_track.case.name')" show-overflow-tooltip/>
|
||||
<el-table-column v-if="item.prop == 'name'" prop="name" min-width="160px" :label="$t('test_track.case.name')"
|
||||
show-overflow-tooltip :key="index"/>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop == 'priority'"
|
||||
prop="priority"
|
||||
:filters="priorityFilters"
|
||||
column-key="priority"
|
||||
min-width="120px"
|
||||
|
||||
:label="$t('test_track.case.priority')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<priority-table-item :value="scope.row.priority"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop == 'custom'"
|
||||
sortable="custom"
|
||||
prop="path"
|
||||
min-width="180px"
|
||||
:label="$t('api_test.definition.api_path')"
|
||||
show-overflow-tooltip
|
||||
:key="index"/>
|
||||
|
||||
show-overflow-tooltip/>
|
||||
|
||||
<el-table-column prop="tags" min-width="120px" :label="$t('commons.tag')">
|
||||
<el-table-column v-if="item.prop=='tags'" prop="tags" min-width="120px" :label="$t('commons.tag')"
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<div v-for="(itemName,index) in scope.row.tags" :key="index">
|
||||
<ms-tag type="success" effect="plain" :content="itemName"/>
|
||||
|
@ -72,31 +77,43 @@
|
|||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop=='createUser'"
|
||||
prop="createUser"
|
||||
:label="'创建人'"
|
||||
|
||||
show-overflow-tooltip/>
|
||||
show-overflow-tooltip
|
||||
:key="index"/>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop=='custom'"
|
||||
sortable="custom"
|
||||
min-width="160"
|
||||
:label="$t('api_test.definition.api_last_time')"
|
||||
|
||||
prop="updateTime">
|
||||
prop="updateTime"
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column fixed="right" v-if="!isReadOnly" :label="$t('commons.operating')" min-width="130" align="center">
|
||||
</template>
|
||||
<el-table-column fixed="right" v-if="!isReadOnly" :label="$t('commons.operating')" min-width="130"
|
||||
align="center">
|
||||
<template slot="header">
|
||||
<span>{{ $t('commons.operating') }}
|
||||
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
|
||||
</span>
|
||||
</template>
|
||||
<template v-slot:default="scope">
|
||||
<ms-table-operator-button :tip="$t('commons.edit')" icon="el-icon-edit" @exec="handleTestCase(scope.row)" v-tester/>
|
||||
<ms-table-operator-button :tip="$t('commons.delete')" icon="el-icon-delete" @exec="handleDelete(scope.row)" type="danger" v-tester/>
|
||||
<ms-api-case-table-extend-btns @showCaseRef="showCaseRef" @showEnvironment="showEnvironment" @createPerformance="createPerformance" :row="scope.row" v-tester/>
|
||||
<ms-table-operator-button :tip="$t('commons.edit')" icon="el-icon-edit" @exec="handleTestCase(scope.row)"
|
||||
v-tester/>
|
||||
<ms-table-operator-button :tip="$t('commons.delete')" icon="el-icon-delete" @exec="handleDelete(scope.row)"
|
||||
type="danger" v-tester/>
|
||||
<ms-api-case-table-extend-btns @showCaseRef="showCaseRef" @showEnvironment="showEnvironment"
|
||||
@createPerformance="createPerformance" :row="scope.row" v-tester/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<header-custom ref="headerCustom" :initTableData="initTable" :optionalFields=headerItems
|
||||
:type=type></header-custom>
|
||||
<ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||
:total="total"/>
|
||||
</api-list-container>
|
||||
|
@ -129,7 +146,7 @@ import ShowMoreBtn from "../../../../track/case/components/ShowMoreBtn";
|
|||
import MsBatchEdit from "../basis/BatchEdit";
|
||||
import {API_METHOD_COLOUR, CASE_PRIORITY, DUBBO_METHOD, REQ_METHOD, SQL_METHOD, TCP_METHOD} from "../../model/JsonData";
|
||||
|
||||
import {getBodyUploadFiles, getCurrentProjectID} from "@/common/js/utils";
|
||||
import {getBodyUploadFiles, getCurrentProjectID, getCurrentUser} from "@/common/js/utils";
|
||||
import ApiListContainer from "./ApiListContainer";
|
||||
import PriorityTableItem from "../../../../track/common/tableItems/planview/PriorityTableItem";
|
||||
import MsApiCaseTableExtendBtns from "../reference/ApiCaseTableExtendBtns";
|
||||
|
@ -142,10 +159,14 @@ import MsTableHeaderSelectPopover from "@/business/components/common/components/
|
|||
import MsTableAdvSearchBar from "@/business/components/common/components/search/MsTableAdvSearchBar";
|
||||
import {API_CASE_CONFIGS} from "@/business/components/common/components/search/search-components";
|
||||
import {_filter, _handleSelect, _handleSelectAll, _sort,} from "@/common/js/tableUtils";
|
||||
import {API_CASE_LIST, TEST_CASE_LIST} from "@/common/js/constants";
|
||||
import {Api_Case_List, Track_Test_Case} from "@/business/components/common/model/JsonData";
|
||||
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
|
||||
|
||||
export default {
|
||||
name: "ApiCaseSimpleList",
|
||||
components: {
|
||||
HeaderCustom,
|
||||
MsTableHeaderSelectPopover,
|
||||
MsSetEnvironment,
|
||||
ApiCaseList,
|
||||
|
@ -166,6 +187,9 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
type: API_CASE_LIST,
|
||||
headerItems: Api_Case_List,
|
||||
tableLabel: Api_Case_List,
|
||||
condition: {
|
||||
components: API_CASE_CONFIGS
|
||||
},
|
||||
|
@ -267,10 +291,14 @@ export default {
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
isApiListEnableChange(data) {
|
||||
this.$emit('isApiListEnableChange', data);
|
||||
},
|
||||
initTable() {
|
||||
this.getLabel()
|
||||
this.selectRows = new Set();
|
||||
this.condition.status = "";
|
||||
this.condition.moduleIds = this.selectNodeIds;
|
||||
|
@ -314,6 +342,24 @@ export default {
|
|||
});
|
||||
}
|
||||
},
|
||||
getLabel() {
|
||||
let param = {}
|
||||
param.userId = getCurrentUser().id;
|
||||
param.type = API_CASE_LIST
|
||||
this.result = this.$post('/system/header/info', param, response => {
|
||||
if (response.data != null) {
|
||||
let arry = eval(response.data.props);
|
||||
let obj = {};
|
||||
for (let key in arry) {
|
||||
obj[key] = arry[key];
|
||||
}
|
||||
let newObj = Object.keys(obj).map(val => ({
|
||||
prop: obj[val]
|
||||
}))
|
||||
this.tableLabel = newObj
|
||||
}
|
||||
})
|
||||
},
|
||||
open() {
|
||||
this.$refs.searchBar.open();
|
||||
},
|
||||
|
|
|
@ -32,28 +32,38 @@
|
|||
<show-more-btn :is-show="scope.row.showMore" :buttons="buttons" :size="selectDataCounts"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="num" label="ID" show-overflow-tooltip
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
<el-table-column
|
||||
v-if="item.prop == 'num'"
|
||||
prop="num"
|
||||
label="ID"
|
||||
show-overflow-tooltip
|
||||
min-width="80px"
|
||||
|
||||
sortable="custom">
|
||||
sortable="custom"
|
||||
:key="index">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip content="编辑">
|
||||
<a style="cursor:pointer" @click="editApi(scope.row)"> {{ scope.row.num }} </a>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" :label="$t('api_test.definition.api_name')"
|
||||
show-overflow-tooltip
|
||||
|
||||
sortable="custom" min-width="120px"/>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'name'"
|
||||
prop="name"
|
||||
:label="$t('api_test.definition.api_name')"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
min-width="120px"
|
||||
:key="index"/>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'status'"
|
||||
prop="status"
|
||||
column-key="status"
|
||||
sortable="custom"
|
||||
:filters="statusFilters"
|
||||
|
||||
:label="$t('api_test.definition.api_status')" min-width="120px">
|
||||
:label="$t('api_test.definition.api_status')"
|
||||
min-width="120px"
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<span class="el-dropdown-link">
|
||||
<api-status :value="scope.row.status"/>
|
||||
|
@ -62,13 +72,14 @@
|
|||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop == 'method'"
|
||||
prop="method"
|
||||
sortable="custom"
|
||||
column-key="method"
|
||||
:filters="methodFilters"
|
||||
|
||||
:label="$t('api_test.definition.api_type')"
|
||||
show-overflow-tooltip min-width="120px">
|
||||
show-overflow-tooltip min-width="120px"
|
||||
:key="index">
|
||||
<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)}"
|
||||
|
@ -79,22 +90,30 @@
|
|||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop == 'userName'"
|
||||
prop="userName"
|
||||
sortable="custom"
|
||||
:filters="userFilters"
|
||||
column-key="user_id"
|
||||
|
||||
:label="$t('api_test.definition.api_principal')"
|
||||
show-overflow-tooltip min-width="100px"/>
|
||||
show-overflow-tooltip
|
||||
min-width="100px"
|
||||
:key="index"/>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop == 'path'"
|
||||
prop="path"
|
||||
min-width="120px"
|
||||
|
||||
:label="$t('api_test.definition.api_path')"
|
||||
show-overflow-tooltip/>
|
||||
show-overflow-tooltip
|
||||
:key="index"/>
|
||||
|
||||
<el-table-column prop="tags" :label="$t('commons.tag')" min-width="80px"
|
||||
<el-table-column
|
||||
v-if="item.prop == 'tags'"
|
||||
prop="tags"
|
||||
:label="$t('commons.tag')"
|
||||
min-width="80px"
|
||||
:key="index"
|
||||
>
|
||||
<template v-slot:default="scope">
|
||||
<div v-for="(itemName,index) in scope.row.tags" :key="index">
|
||||
|
@ -104,41 +123,51 @@
|
|||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop == 'updateTime'"
|
||||
width="160"
|
||||
:label="$t('api_test.definition.api_last_time')"
|
||||
sortable="custom"
|
||||
min-width="160px"
|
||||
|
||||
prop="updateTime">
|
||||
prop="updateTime"
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop == 'caseTotal'"
|
||||
prop="caseTotal"
|
||||
min-width="80px"
|
||||
|
||||
:label="$t('api_test.definition.api_case_number')"
|
||||
show-overflow-tooltip/>
|
||||
show-overflow-tooltip
|
||||
:key="index"/>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop == 'caseStatus'"
|
||||
prop="caseStatus"
|
||||
min-width="80px"
|
||||
|
||||
:label="$t('api_test.definition.api_case_status')"
|
||||
show-overflow-tooltip/>
|
||||
show-overflow-tooltip
|
||||
:key="index"/>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop == 'casePassingRate'"
|
||||
prop="casePassingRate"
|
||||
:width="100"
|
||||
min-width="100px"
|
||||
|
||||
:label="$t('api_test.definition.api_case_passing_rate')"
|
||||
show-overflow-tooltip/>
|
||||
show-overflow-tooltip
|
||||
:key="index"/>
|
||||
</template>
|
||||
|
||||
<el-table-column fixed="right" v-if="!isReadOnly" :label="$t('commons.operating')" min-width="130"
|
||||
align="center">
|
||||
<template slot="header">
|
||||
<span>{{ $t('commons.operating') }}
|
||||
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
|
||||
</span>
|
||||
</template>
|
||||
<template v-slot:default="scope">
|
||||
<ms-table-operator-button :tip="$t('commons.reduction')" icon="el-icon-refresh-left"
|
||||
@exec="reductionApi(scope.row)" v-if="trashEnable" v-tester/>
|
||||
|
@ -160,6 +189,8 @@
|
|||
type="danger" v-tester/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<header-custom ref="headerCustom" :initTableData="initTable" :optionalFields=headerItems
|
||||
:type=type></header-custom>
|
||||
</el-table>
|
||||
<ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||
:total="total"/>
|
||||
|
@ -188,8 +219,8 @@ import MsBottomContainer from "../BottomContainer";
|
|||
import ShowMoreBtn from "../../../../track/case/components/ShowMoreBtn";
|
||||
import MsBatchEdit from "../basis/BatchEdit";
|
||||
import {API_METHOD_COLOUR, API_STATUS, DUBBO_METHOD, REQ_METHOD, SQL_METHOD, TCP_METHOD} from "../../model/JsonData";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
import {WORKSPACE_ID} from '@/common/js/constants';
|
||||
import {getCurrentProjectID, getCurrentUser} from "@/common/js/utils";
|
||||
import {API_LIST, TEST_CASE_LIST, WORKSPACE_ID} from '@/common/js/constants';
|
||||
import ApiListContainer from "./ApiListContainer";
|
||||
import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover";
|
||||
import ApiStatus from "@/business/components/api/definition/components/list/ApiStatus";
|
||||
|
@ -198,11 +229,14 @@ import {API_DEFINITION_CONFIGS} from "@/business/components/common/components/se
|
|||
import MsTipButton from "@/business/components/common/components/MsTipButton";
|
||||
import CaseBatchMove from "@/business/components/api/definition/components/basis/BatchMove";
|
||||
import {_filter, _sort} from "@/common/js/tableUtils";
|
||||
import {Api_List, Track_Test_Case} from "@/business/components/common/model/JsonData";
|
||||
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
|
||||
|
||||
|
||||
export default {
|
||||
name: "ApiList",
|
||||
components: {
|
||||
HeaderCustom,
|
||||
CaseBatchMove,
|
||||
ApiStatus,
|
||||
MsTableHeaderSelectPopover,
|
||||
|
@ -223,6 +257,9 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
type: API_LIST,
|
||||
headerItems: Api_List,
|
||||
tableLabel: Api_List,
|
||||
condition: {
|
||||
components: API_DEFINITION_CONFIGS
|
||||
},
|
||||
|
@ -343,6 +380,9 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
handleBatchMove() {
|
||||
this.$refs.testCaseBatchMove.open(this.moduleTree, [], this.moduleOptions);
|
||||
},
|
||||
|
@ -351,6 +391,7 @@ export default {
|
|||
this.$emit('isApiListEnableChange', data);
|
||||
},
|
||||
initTable() {
|
||||
this.getLabel()
|
||||
this.selectRows = new Set();
|
||||
this.selectAll = false;
|
||||
this.unSelection = [];
|
||||
|
@ -399,6 +440,25 @@ export default {
|
|||
});
|
||||
}
|
||||
},
|
||||
getLabel() {
|
||||
let param = {}
|
||||
param.userId = getCurrentUser().id;
|
||||
param.type = API_LIST
|
||||
this.result = this.$post('/system/header/info', param, response => {
|
||||
if (response.data != null) {
|
||||
let arry = eval(response.data.props);
|
||||
let obj = {};
|
||||
for (let key in arry) {
|
||||
obj[key] = arry[key];
|
||||
}
|
||||
let newObj = Object.keys(obj).map(val => ({
|
||||
prop: obj[val]
|
||||
}))
|
||||
this.tableLabel = newObj
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
genProtocalFilter(protocalType) {
|
||||
if (protocalType === "HTTP") {
|
||||
this.methodFilters = [
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
label: 'label'
|
||||
}"
|
||||
:data="optionalField"
|
||||
style="margin-left: 10%"
|
||||
></el-transfer>
|
||||
</template>
|
||||
<template v-slot:footer>
|
||||
|
@ -24,36 +25,46 @@
|
|||
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
|
||||
import {getCurrentUser} from "@/common/js/utils";
|
||||
import {TEST_CASE_LIST} from "@/common/js/constants";
|
||||
import {Track_Test_Case} from "@/business/components/common/model/JsonData";
|
||||
export default {
|
||||
name: "HeaderCustom",
|
||||
components: {MsDialogFooter},
|
||||
data() {
|
||||
return {
|
||||
dialogTableVisible: false,
|
||||
optionalField: [],
|
||||
optionalField: this.optionalFields,
|
||||
value: [],
|
||||
fieldSelected: []
|
||||
}
|
||||
},
|
||||
props: {
|
||||
initTableData: {
|
||||
type: Function,
|
||||
default: null
|
||||
},
|
||||
optionalFields: Array,
|
||||
type: String
|
||||
},
|
||||
methods: {
|
||||
open(items) {
|
||||
console.log(items)
|
||||
this.dialogTableVisible = true
|
||||
this.optionalField = items
|
||||
/*this.optionalField = items*/
|
||||
},
|
||||
saveHeader() {
|
||||
console.log(this.type)
|
||||
let param = {
|
||||
userId: getCurrentUser().id,
|
||||
type:TEST_CASE_LIST,
|
||||
type: this.type,
|
||||
props: JSON.stringify(this.value)
|
||||
}
|
||||
this.$post("/system/save/header", param, response => {
|
||||
this.$success(this.$t("commons.save_success"));
|
||||
this.dialogTableVisible = false
|
||||
this.initTableData()
|
||||
})
|
||||
},
|
||||
close() {
|
||||
|
||||
this.dialogTableVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import i18n from '../../../../i18n/i18n'
|
||||
//自定义默认表头
|
||||
//测试用例
|
||||
export const Track_Test_Case = [
|
||||
{prop: 'num', label: i18n.t('commons.id')},
|
||||
{prop: 'name', label: i18n.t('commons.name')},
|
||||
|
@ -10,6 +11,123 @@ export const Track_Test_Case=[
|
|||
{prop: 'tags', label: i18n.t('commons.tag')},
|
||||
{prop: 'nodePath', label: i18n.t('test_track.case.module')},
|
||||
{prop: 'updateTime', label: i18n.t('commons.update_time')},
|
||||
{prop: 'operating', label: i18n.t('commons.operating')},
|
||||
]
|
||||
//用例评审-测试用例
|
||||
export const Test_Case_Review = [
|
||||
{prop: 'name', label: i18n.t('test_track.review.review_name')},
|
||||
{prop: 'reviewer', label: i18n.t('test_track.review.reviewer')},
|
||||
{prop: 'projectName', label: i18n.t('test_track.review.review_project')},
|
||||
{prop: 'creatorName', label: i18n.t('test_track.review.review_creator')},
|
||||
{prop: 'status', label: i18n.t('test_track.review.review_status')},
|
||||
{prop: 'createTime', label: i18n.t('commons.create_time')},
|
||||
{prop: 'endTime', label: i18n.t('test_track.review.end_time')},
|
||||
]
|
||||
//测试计划-测试用例
|
||||
export const Test_Plan_List = [
|
||||
{prop: 'name', label: i18n.t('commons.name')},
|
||||
{prop: 'userName', label: i18n.t('test_track.plan.plan_principal')},
|
||||
{prop: 'status', label: i18n.t('test_track.plan.plan_status')},
|
||||
{prop: 'stage', label: i18n.t('test_track.plan.plan_stage')},
|
||||
{prop: 'testRate', label: i18n.t('test_track.home.test_rate')},
|
||||
{prop: 'projectName', label: i18n.t('test_track.plan.plan_project')},
|
||||
{prop: 'plannedStartTime', label: i18n.t('test_track.plan.planned_start_time')},
|
||||
{prop: 'plannedEndTime', label: i18n.t('test_track.plan.planned_end_time')},
|
||||
{prop: 'actualStartTime', label: i18n.t('test_track.plan.actual_start_time')},
|
||||
{prop: 'actualEndTime', label: i18n.t('test_track.plan.actual_end_time')},
|
||||
]
|
||||
//接口定义-api列表
|
||||
export const Api_List = [
|
||||
{prop: 'num', label: "ID"},
|
||||
{prop: 'name', label: i18n.t('api_test.definition.api_name')},
|
||||
{prop: 'method', label: i18n.t('api_test.definition.api_type')},
|
||||
{prop: 'userName', label: i18n.t('api_test.definition.api_principal')},
|
||||
{prop: 'path', label: i18n.t('api_test.definition.api_path')},
|
||||
{prop: 'tags', label: i18n.t('commons.tag')},
|
||||
{prop: 'updateTime', label: i18n.t('api_test.definition.api_last_time')},
|
||||
{prop: 'caseTotal', label: i18n.t('api_test.definition.api_case_number')},
|
||||
{prop: 'caseStatus', label: i18n.t('api_test.definition.api_case_status')},
|
||||
{prop: 'casePassingRate', label: i18n.t('api_test.definition.api_case_passing_rate')},
|
||||
]
|
||||
//接口定义-case列表
|
||||
export const Api_Case_List = [
|
||||
{prop: 'num', label: "ID"},
|
||||
{prop: 'name', label: i18n.t('test_track.case.name')},
|
||||
{prop: 'priority', label: i18n.t('test_track.case.priority')},
|
||||
{prop: 'path', label: i18n.t('api_test.definition.api_path')},
|
||||
{prop: 'tags', label: i18n.t('commons.tag')},
|
||||
{prop: 'createUser', label: "创建人"},
|
||||
{prop: 'updateTime', label: i18n.t('api_test.definition.api_last_time')},
|
||||
]
|
||||
//接口自动化-场景列表
|
||||
export const Api_Scenario_List = [
|
||||
{prop: 'num', label: "ID"},
|
||||
{prop: 'name', label: i18n.t('test_track.case.name')},
|
||||
{prop: 'priority', label: i18n.t('test_track.case.priority')},
|
||||
{prop: 'path', label: i18n.t('api_test.definition.api_path')},
|
||||
{prop: 'tags', label: i18n.t('commons.tag')},
|
||||
{prop: 'createUser', label: '创建人'},
|
||||
{prop: 'updateTime', label: i18n.t('api_test.definition.api_last_time')},
|
||||
]
|
||||
//测试评审-测试用例
|
||||
export const Test_Case_Review_Case_List = [
|
||||
{prop: 'num', label: i18n.t('commons.id')},
|
||||
{prop: 'name', label: i18n.t('commons.name')},
|
||||
{prop: 'priority', label: i18n.t('test_track.case.priority')},
|
||||
{prop: 'type', label: i18n.t('test_track.case.type')},
|
||||
{prop: 'method', label: i18n.t('test_track.case.method')},
|
||||
{prop: 'nodePath', label: i18n.t('test_track.case.module')},
|
||||
{prop: 'projectName', label: i18n.t('test_track.review.review_project')},
|
||||
{prop: 'reviewerName', label: i18n.t('test_track.review.reviewer')},
|
||||
{prop: 'reviewStatus', label: i18n.t('test_track.case.status')},
|
||||
{prop: 'updateTime', label: i18n.t('commons.update_time')},
|
||||
]
|
||||
//测试计划-功能用例
|
||||
export const Test_Plan_Function_Test_Case = [
|
||||
{prop: 'num', label: i18n.t('commons.id')},
|
||||
{prop: 'name', label: i18n.t('commons.name')},
|
||||
{prop: 'priority', label: i18n.t('test_track.case.priority')},
|
||||
{prop: 'type', label: i18n.t('test_track.case.type')},
|
||||
{prop: 'tags', label: i18n.t('commons.tag')},
|
||||
{prop: 'method', label: i18n.t('test_track.case.method')},
|
||||
{prop: 'nodePath', label: i18n.t('test_track.case.module')},
|
||||
{prop: 'projectName', label: i18n.t('test_track.review.review_project')},
|
||||
{prop: 'issuesContent', label: i18n.t('test_track.issue.issue')},
|
||||
{prop: 'executorName', label: i18n.t('test_track.plan_view.executor')},
|
||||
{prop: 'status', label: i18n.t('test_track.plan_view.execute_result')},
|
||||
{prop: 'updateTime', label: i18n.t('commons.update_time')},
|
||||
]
|
||||
//测试计划-api用例
|
||||
export const Test_Plan_Api_Case = [
|
||||
{prop: 'num', label: i18n.t('commons.id')},
|
||||
{prop: 'name', label: i18n.t('commons.name')},
|
||||
{prop: 'priority', label: i18n.t('test_track.case.priority')},
|
||||
{prop: 'path', label: i18n.t('api_test.definition.api_path')},
|
||||
{prop: 'createUser', label: '创建人'},
|
||||
{prop: 'custom', label: i18n.t('api_test.definition.api_last_time')},
|
||||
{prop: 'tags', label: i18n.t('commons.tag')},
|
||||
{prop: 'execResult', label: '执行状态'},
|
||||
]
|
||||
//测试计划-性能用例
|
||||
export const Test_Plan_Load_Case = [
|
||||
{prop: 'num', label: i18n.t('commons.id')},
|
||||
{prop: 'caseName', label: i18n.t('commons.name')},
|
||||
{prop: 'projectName', label: i18n.t('load_test.project_name')},
|
||||
{prop: 'userName', label: i18n.t('load_test.user_name')},
|
||||
{prop: 'createTime', label: i18n.t('commons.create_time')},
|
||||
{prop: 'status', label: i18n.t('commons.status')},
|
||||
{prop: 'caseStatus', label: i18n.t('test_track.plan.load_case.execution_status')},
|
||||
{prop: 'loadReportId', label: i18n.t('test_track.plan.load_case.view_report')},
|
||||
]
|
||||
//测试计划-场景用例
|
||||
export const Test_Plan_Scenario_Case = [
|
||||
{prop: 'num', label: i18n.t('commons.id')},
|
||||
{prop: 'name', label: i18n.t('commons.name')},
|
||||
{prop: 'level', label: i18n.t('api_test.automation.case_level')},
|
||||
{prop: 'tagNames', label: i18n.t('api_test.automation.tag')},
|
||||
{prop: 'userId', label: i18n.t('api_test.automation.creator')},
|
||||
{prop: 'updateTime', label: i18n.t('api_test.automation.update_time')},
|
||||
{prop: 'stepTotal', label: i18n.t('api_test.automation.success')},
|
||||
{prop: 'lastResult', label: i18n.t('api_test.automation.fail')},
|
||||
{prop: 'passRate', label: i18n.t('api_test.automation.passing_rate')},
|
||||
]
|
||||
|
||||
|
|
|
@ -162,7 +162,8 @@
|
|||
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="item.prop=='operating'" fixed="right" min-width="150" :key="index">
|
||||
</template>
|
||||
<el-table-column fixed="right" min-width="150">
|
||||
<template slot="header">
|
||||
<span>{{ $t('commons.operating') }}
|
||||
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
|
||||
|
@ -179,8 +180,8 @@
|
|||
</ms-table-operator>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<header-custom ref="headerCustom"></header-custom>
|
||||
<header-custom ref="headerCustom" :initTableData="initTableData" :optionalFields=headerItems
|
||||
:type=type></header-custom>
|
||||
<ms-table-pagination :change="initTableData" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||
:total="total"/>
|
||||
</el-table>
|
||||
|
@ -231,6 +232,7 @@ import {
|
|||
import BatchMove from "./BatchMove";
|
||||
import {Track_Test_Case} from "@/business/components/common/model/JsonData";
|
||||
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
|
||||
import i18n from "@/i18n/i18n";
|
||||
|
||||
export default {
|
||||
name: "TestCaseList",
|
||||
|
@ -259,7 +261,8 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
// 子组件的表头数据
|
||||
type: TEST_CASE_LIST,
|
||||
headerItems: Track_Test_Case,
|
||||
tableLabel: Track_Test_Case,
|
||||
result: {},
|
||||
deletePath: "/test/case/delete",
|
||||
|
@ -384,17 +387,17 @@ export default {
|
|||
param.userId=getCurrentUser().id;
|
||||
param.type=TEST_CASE_LIST
|
||||
this.result=this.$post('/system/header/info',param,response=> {
|
||||
if(response.data){
|
||||
response.data.map((v,i)=>{
|
||||
if(this.tableLabel [i]){
|
||||
this.tableLabel [i].prop=v
|
||||
if (response.data != null) {
|
||||
let arry = eval(response.data.props);
|
||||
let obj = {};
|
||||
for (let key in arry) {
|
||||
obj[key] = arry[key];
|
||||
}
|
||||
})
|
||||
console.log(this.tableLabel)
|
||||
}else{
|
||||
this.tableLabel=Track_Test_Case
|
||||
let newObj = Object.keys(obj).map(val => ({
|
||||
prop: obj[val]
|
||||
}))
|
||||
this.tableLabel = newObj
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
getData() {
|
||||
|
|
|
@ -14,22 +14,29 @@
|
|||
@filter-change="filter"
|
||||
@sort-change="sort"
|
||||
@row-click="intoPlan">
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
<el-table-column
|
||||
v-if="item.prop == 'name'"
|
||||
prop="name"
|
||||
:label="$t('commons.name')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'userName'"
|
||||
prop="userName"
|
||||
:label="$t('test_track.plan.plan_principal')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'status'"
|
||||
prop="status"
|
||||
column-key="status"
|
||||
:filters="statusFilters"
|
||||
:label="$t('test_track.plan.plan_status')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<span @click.stop="clickt = 'stop'">
|
||||
<el-dropdown class="test-case-status" @command="statusChange">
|
||||
|
@ -54,73 +61,95 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'stage'"
|
||||
prop="stage"
|
||||
column-key="stage"
|
||||
:filters="stageFilters"
|
||||
:label="$t('test_track.plan.plan_stage')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<plan-stage-table-item :stage="scope.row.stage"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="projectName"
|
||||
v-if="item.prop == 'testRate'"
|
||||
prop="testRate"
|
||||
:label="$t('test_track.home.test_rate')"
|
||||
min-width="100"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<el-progress :percentage="scope.row.testRate"></el-progress>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
<el-table-colum
|
||||
v-if="item.prop == 'projectName'"
|
||||
prop="projectName"
|
||||
:label="$t('test_track.plan.plan_project')"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
</el-table-colum>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'plannedStartTime'"
|
||||
sortable
|
||||
prop="plannedStartTime"
|
||||
:label="$t('test_track.plan.planned_start_time')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.plannedStartTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'plannedEndTime'"
|
||||
sortable
|
||||
prop="plannedEndTime"
|
||||
:label="$t('test_track.plan.planned_end_time')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.plannedEndTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'actualStartTime'"
|
||||
sortable
|
||||
prop="actualStartTime"
|
||||
:label="$t('test_track.plan.actual_start_time')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.actualStartTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'actualEndTime'"
|
||||
sortable
|
||||
prop="actualEndTime"
|
||||
:label="$t('test_track.plan.actual_end_time')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.actualEndTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column
|
||||
min-width="150"
|
||||
:label="$t('commons.operating')">
|
||||
<template slot="header">
|
||||
<span>{{ $t('commons.operating') }}
|
||||
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
|
||||
</span>
|
||||
</template>
|
||||
<template v-slot:default="scope">
|
||||
<ms-table-operator :is-tester-permission="true" @editClick="handleEdit(scope.row)"
|
||||
@deleteClick="handleDelete(scope.row)">
|
||||
<template v-slot:middle>
|
||||
<ms-table-operator-button :isTesterPermission="true" style="background-color: #85888E;border-color: #85888E" v-if="!scope.row.reportId"
|
||||
<ms-table-operator-button :isTesterPermission="true"
|
||||
style="background-color: #85888E;border-color: #85888E"
|
||||
v-if="!scope.row.reportId"
|
||||
:tip="$t('test_track.plan_view.create_report')" icon="el-icon-s-data"
|
||||
@exec="openTestReportTemplate(scope.row)"/>
|
||||
<ms-table-operator-button v-if="scope.row.reportId"
|
||||
|
@ -128,21 +157,27 @@
|
|||
@exec="openReport(scope.row.id, scope.row.reportId)"/>
|
||||
</template>
|
||||
</ms-table-operator>
|
||||
<ms-table-operator-button style="margin-left: 10px;color:#85888E;border-color: #85888E; border-width: thin;" v-if="!scope.row.scheduleOpen" type="text"
|
||||
<ms-table-operator-button style="margin-left: 10px;color:#85888E;border-color: #85888E; border-width: thin;"
|
||||
v-if="!scope.row.scheduleOpen" type="text"
|
||||
:tip="$t('commons.trigger_mode.schedule')" icon="el-icon-time"
|
||||
@exec="scheduleTask(scope.row)"/>
|
||||
<ms-table-operator-button style="margin-left: 10px;color:#6C317C; border-color: #6C317C; border-width: thin;" v-if="scope.row.scheduleOpen" type="text"
|
||||
<ms-table-operator-button style="margin-left: 10px;color:#6C317C; border-color: #6C317C; border-width: thin;"
|
||||
v-if="scope.row.scheduleOpen" type="text"
|
||||
:tip="$t('commons.trigger_mode.schedule')" icon="el-icon-time"
|
||||
@exec="scheduleTask(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<header-custom ref="headerCustom" :initTableData="initTableData" :optionalFields=headerItems
|
||||
:type=type></header-custom>
|
||||
|
||||
|
||||
<ms-table-pagination :change="initTableData" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||
:total="total"/>
|
||||
<test-report-template-list @openReport="openReport" ref="testReportTemplateList"/>
|
||||
<test-case-report-view @refresh="initTableData" ref="testCaseReportView"/>
|
||||
<ms-delete-confirm :title="$t('test_track.plan.plan_delete')" @delete="_handleDelete" ref="deleteConfirm" :with-tip="enableDeleteTip">
|
||||
<ms-delete-confirm :title="$t('test_track.plan.plan_delete')" @delete="_handleDelete" ref="deleteConfirm"
|
||||
:with-tip="enableDeleteTip">
|
||||
{{ $t('test_track.plan.plan_delete_tip') }}
|
||||
</ms-delete-confirm>
|
||||
<ms-schedule-maintain ref="scheduleMaintain" @refreshTable="initTableData"/>
|
||||
|
@ -158,7 +193,7 @@ import MsTableOperatorButton from "../../../common/components/MsTableOperatorBut
|
|||
import MsTableOperator from "../../../common/components/MsTableOperator";
|
||||
import PlanStatusTableItem from "../../common/tableItems/plan/PlanStatusTableItem";
|
||||
import PlanStageTableItem from "../../common/tableItems/plan/PlanStageTableItem";
|
||||
import {checkoutTestManagerOrTestUser} from "@/common/js/utils";
|
||||
import {checkoutTestManagerOrTestUser, getCurrentUser} from "@/common/js/utils";
|
||||
import TestReportTemplateList from "../view/comonents/TestReportTemplateList";
|
||||
import TestCaseReportView from "../view/comonents/report/TestCaseReportView";
|
||||
import MsDeleteConfirm from "../../../common/components/MsDeleteConfirm";
|
||||
|
@ -167,11 +202,15 @@ import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEve
|
|||
import {getCurrentProjectID} from "../../../../../common/js/utils";
|
||||
import MsScheduleMaintain from "@/business/components/api/automation/schedule/ScheduleMaintain"
|
||||
import {_filter, _sort} from "@/common/js/tableUtils";
|
||||
import {TEST_CASE_LIST, TEST_PLAN_LIST} from "@/common/js/constants";
|
||||
import {Test_Plan_List, Track_Test_Case} from "@/business/components/common/model/JsonData";
|
||||
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
|
||||
|
||||
|
||||
export default {
|
||||
name: "TestPlanList",
|
||||
components: {
|
||||
HeaderCustom,
|
||||
MsDeleteConfirm,
|
||||
TestCaseReportView,
|
||||
TestReportTemplateList,
|
||||
|
@ -182,6 +221,9 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
type: TEST_PLAN_LIST,
|
||||
headerItems: Test_Plan_List,
|
||||
tableLabel: Test_Plan_List,
|
||||
result: {},
|
||||
enableDeleteTip: false,
|
||||
queryPath: "/test/plan/list",
|
||||
|
@ -219,7 +261,11 @@ export default {
|
|||
this.initTableData();
|
||||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
initTableData() {
|
||||
this.getLabel()
|
||||
if (this.planId) {
|
||||
this.condition.planId = this.planId;
|
||||
}
|
||||
|
@ -243,6 +289,24 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
getLabel() {
|
||||
let param = {}
|
||||
param.userId = getCurrentUser().id;
|
||||
param.type = TEST_PLAN_LIST
|
||||
this.result = this.$post('/system/header/info', param, response => {
|
||||
if (response.data != null) {
|
||||
let arry = eval(response.data.props);
|
||||
let obj = {};
|
||||
for (let key in arry) {
|
||||
obj[key] = arry[key];
|
||||
}
|
||||
let newObj = Object.keys(obj).map(val => ({
|
||||
prop: obj[val]
|
||||
}))
|
||||
this.tableLabel = newObj
|
||||
}
|
||||
})
|
||||
},
|
||||
buildPagePath(path) {
|
||||
return path + "/" + this.currentPage + "/" + this.pageSize;
|
||||
},
|
||||
|
|
|
@ -25,46 +25,60 @@
|
|||
<show-more-btn :is-show="scope.row.showMore && !isReadOnly" :buttons="buttons" :size="selectRows.size"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="num" sortable="custom" label="ID" show-overflow-tooltip/>
|
||||
<el-table-column prop="name" sortable="custom" :label="$t('api_test.definition.api_name')" show-overflow-tooltip/>
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
<el-table-column v-if="item.prop == 'num'" prop="num" sortable="custom" label="ID" show-overflow-tooltip
|
||||
:key="index"/>
|
||||
<el-table-column v-if="item.prop == 'name'" prop="name" sortable="custom"
|
||||
:label="$t('api_test.definition.api_name')" show-overflow-tooltip :key="index"/>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop == 'priority'"
|
||||
prop="priority"
|
||||
:filters="priorityFilters"
|
||||
sortable="custom"
|
||||
column-key="priority"
|
||||
:label="$t('test_track.case.priority')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<priority-table-item :value="scope.row.priority"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop == 'path'"
|
||||
prop="path"
|
||||
:label="$t('api_test.definition.api_path')"
|
||||
show-overflow-tooltip/>
|
||||
show-overflow-tooltip
|
||||
:key="index"/>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop == 'createUser'"
|
||||
prop="createUser"
|
||||
column-key="user_id"
|
||||
sortable="custom"
|
||||
:filters="userFilters"
|
||||
:label="'创建人'"
|
||||
show-overflow-tooltip/>
|
||||
show-overflow-tooltip
|
||||
:key="index"/>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop == 'custom'"
|
||||
sortable="custom"
|
||||
width="160"
|
||||
:label="$t('api_test.definition.api_last_time')"
|
||||
prop="updateTime">
|
||||
prop="updateTime"
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="tags" :label="$t('commons.tag')">
|
||||
<el-table-column
|
||||
v-if="item.prop == 'tags'"
|
||||
prop="tags"
|
||||
:label="$t('commons.tag')"
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<div v-for="(itemName,index) in scope.row.tags" :key="index">
|
||||
<ms-tag type="success" effect="plain" :content="itemName"/>
|
||||
|
@ -72,7 +86,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column :label="'执行状态'" min-width="130" align="center">
|
||||
<el-table-column v-if="item.prop == 'execResult'" :label="'执行状态'" min-width="130" align="center" :key="index">
|
||||
<template v-slot:default="scope">
|
||||
<div v-loading="rowLoading === scope.row.id">
|
||||
<el-link type="danger"
|
||||
|
@ -91,10 +105,16 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</template>
|
||||
<el-table-column v-if="!isReadOnly" :label="$t('commons.operating')" align="center">
|
||||
<template slot="header">
|
||||
<span>{{ $t('commons.operating') }}
|
||||
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
|
||||
</span>
|
||||
</template>
|
||||
<template v-slot:default="scope">
|
||||
<ms-table-operator-button class="run-button" :is-tester-permission="true" :tip="$t('api_test.run')" icon="el-icon-video-play"
|
||||
<ms-table-operator-button class="run-button" :is-tester-permission="true" :tip="$t('api_test.run')"
|
||||
icon="el-icon-video-play"
|
||||
@exec="singleRun(scope.row)" v-tester/>
|
||||
<ms-table-operator-button :is-tester-permission="true" :tip="$t('test_track.plan_view.cancel_relevance')"
|
||||
icon="el-icon-unlock" type="danger" @exec="handleDelete(scope.row)" v-tester/>
|
||||
|
@ -102,6 +122,8 @@
|
|||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<header-custom ref="headerCustom" :initTableData="initTable" :optionalFields=headerItems
|
||||
:type=type></header-custom>
|
||||
<ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||
:total="total"/>
|
||||
|
||||
|
@ -129,7 +151,7 @@ import MsBottomContainer from "../../../../../api/definition/components/BottomCo
|
|||
import ShowMoreBtn from "../../../../case/components/ShowMoreBtn";
|
||||
import MsBatchEdit from "../../../../../api/definition/components/basis/BatchEdit";
|
||||
import {API_METHOD_COLOUR, CASE_PRIORITY, RESULT_MAP} from "../../../../../api/definition/model/JsonData";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
import {getCurrentProjectID, getCurrentUser} from "@/common/js/utils";
|
||||
import ApiListContainer from "../../../../../api/definition/components/list/ApiListContainer";
|
||||
import PriorityTableItem from "../../../../common/tableItems/planview/PriorityTableItem";
|
||||
import {getBodyUploadFiles, getUUID} from "../../../../../../../common/js/utils";
|
||||
|
@ -138,13 +160,16 @@ import MsRun from "../../../../../api/definition/components/Run";
|
|||
import TestPlanApiCaseResult from "./TestPlanApiCaseResult";
|
||||
import TestPlan from "../../../../../api/definition/components/jmeter/components/test-plan";
|
||||
import ThreadGroup from "../../../../../api/definition/components/jmeter/components/thread-group";
|
||||
import {WORKSPACE_ID} from "@/common/js/constants";
|
||||
import {TEST_CASE_LIST, TEST_PLAN_API_CASE, WORKSPACE_ID} from "@/common/js/constants";
|
||||
import {_filter, _sort} from "@/common/js/tableUtils";
|
||||
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
|
||||
import {Test_Plan_Api_Case, Track_Test_Case} from "@/business/components/common/model/JsonData";
|
||||
|
||||
|
||||
export default {
|
||||
name: "TestPlanApiCaseList",
|
||||
components: {
|
||||
HeaderCustom,
|
||||
TestPlanApiCaseResult,
|
||||
MsRun,
|
||||
TestPlanCaseListHeader,
|
||||
|
@ -163,6 +188,9 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
type: TEST_PLAN_API_CASE,
|
||||
headerItems: Test_Plan_Api_Case,
|
||||
tableLabel: Test_Plan_Api_Case,
|
||||
condition: {},
|
||||
selectCase: {},
|
||||
result: {},
|
||||
|
@ -263,6 +291,9 @@ export default {
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
getMaintainerOptions() {
|
||||
let workspaceId = localStorage.getItem(WORKSPACE_ID);
|
||||
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
|
||||
|
@ -276,6 +307,7 @@ export default {
|
|||
this.$emit('isApiListEnableChange', data);
|
||||
},
|
||||
initTable() {
|
||||
this.getLabel()
|
||||
this.selectRows = new Set();
|
||||
this.condition.status = "";
|
||||
this.condition.moduleIds = this.selectNodeIds;
|
||||
|
@ -303,6 +335,25 @@ export default {
|
|||
})
|
||||
});
|
||||
},
|
||||
getLabel() {
|
||||
let param = {}
|
||||
param.userId = getCurrentUser().id;
|
||||
param.type = TEST_PLAN_API_CASE
|
||||
this.result = this.$post('/system/header/info', param, response => {
|
||||
if (response.data != null) {
|
||||
|
||||
let arry = eval(response.data.props);
|
||||
let obj = {};
|
||||
for (let key in arry) {
|
||||
obj[key] = arry[key];
|
||||
}
|
||||
let newObj = Object.keys(obj).map(val => ({
|
||||
prop: obj[val]
|
||||
}))
|
||||
this.tableLabel = newObj
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSelect(selection, row) {
|
||||
row.hashTree = [];
|
||||
if (this.selectRows.has(row)) {
|
||||
|
|
|
@ -8,18 +8,24 @@
|
|||
@relevanceCase="$emit('relevanceCase', 'scenario')"/>
|
||||
</template>
|
||||
|
||||
<el-table ref="scenarioTable" border :data="tableData" class="adjust-table" @select-all="handleSelectAll" @select="handleSelect">
|
||||
<el-table ref="scenarioTable" border :data="tableData" class="adjust-table" @select-all="handleSelectAll"
|
||||
@select="handleSelect">
|
||||
<el-table-column type="selection"/>
|
||||
<el-table-column width="40" :resizable="false" align="center">
|
||||
<template v-slot:default="{row}">
|
||||
<show-more-btn :is-show="isSelect(row)" :buttons="buttons" :size="selectRows.length"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="num" label="ID"/>
|
||||
<el-table-column prop="name" :label="$t('api_test.automation.scenario_name')"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="level" :label="$t('api_test.automation.case_level')"
|
||||
show-overflow-tooltip>
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
<el-table-column
|
||||
v-if="item.prop == 'num'"
|
||||
prop="num"
|
||||
label="ID"
|
||||
:key="index"/>
|
||||
<el-table-column v-if="item.prop == 'name'" prop="name" :label="$t('api_test.automation.scenario_name')"
|
||||
show-overflow-tooltip :key="index"/>
|
||||
<el-table-column v-if="item.prop == 'level'" prop="level" :label="$t('api_test.automation.case_level')"
|
||||
show-overflow-tooltip :key="index">
|
||||
<template v-slot:default="scope">
|
||||
<ms-tag v-if="scope.row.level == 'P0'" type="info" effect="plain" content="P0"/>
|
||||
<ms-tag v-if="scope.row.level == 'P1'" type="warning" effect="plain" content="P1"/>
|
||||
|
@ -28,42 +34,61 @@
|
|||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="tagNames" :label="$t('api_test.automation.tag')" width="200px">
|
||||
<el-table-column v-if="item.prop == 'tagNames'" prop="tagNames" :label="$t('api_test.automation.tag')"
|
||||
width="200px" :key="index">
|
||||
<template v-slot:default="scope">
|
||||
<div v-for="(itemName,index) in scope.row.tags" :key="index">
|
||||
<ms-tag type="success" effect="plain" :content="itemName"/>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userId" :label="$t('api_test.automation.creator')" show-overflow-tooltip/>
|
||||
<el-table-column prop="updateTime" :label="$t('api_test.automation.update_time')" width="180">
|
||||
<el-table-column v-if="item.prop == 'userId'" prop="userId" :label="$t('api_test.automation.creator')"
|
||||
show-overflow-tooltip :key="index"/>
|
||||
<el-table-column v-if="item.prop == 'updateTime'" prop="updateTime"
|
||||
:label="$t('api_test.automation.update_time')" width="180" :key="index">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stepTotal" :label="$t('api_test.automation.step')" show-overflow-tooltip/>
|
||||
<el-table-column prop="lastResult" :label="$t('api_test.automation.last_result')">
|
||||
<el-table-column v-if="item.prop == 'stepTotal'" prop="stepTotal" :label="$t('api_test.automation.step')"
|
||||
show-overflow-tooltip :key="index"/>
|
||||
<el-table-column v-if="item.prop == 'lastResult'" prop="lastResult"
|
||||
:label="$t('api_test.automation.last_result')" :key="index">
|
||||
<template v-slot:default="{row}">
|
||||
<el-link type="success" @click="showReport(row)" v-if="row.lastResult === 'Success'">{{ $t('api_test.automation.success') }}</el-link>
|
||||
<el-link type="danger" @click="showReport(row)" v-if="row.lastResult === 'Fail'">{{ $t('api_test.automation.fail') }}</el-link>
|
||||
<el-link type="success" @click="showReport(row)" v-if="row.lastResult === 'Success'">
|
||||
{{ $t('api_test.automation.success') }}
|
||||
</el-link>
|
||||
<el-link type="danger" @click="showReport(row)" v-if="row.lastResult === 'Fail'">
|
||||
{{ $t('api_test.automation.fail') }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="passRate" :label="$t('api_test.automation.passing_rate')"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column v-if="item.prop == 'passRate'" prop="passRate"
|
||||
:label="$t('api_test.automation.passing_rate')"
|
||||
show-overflow-tooltip :key="index"/>
|
||||
</template>
|
||||
<el-table-column :label="$t('commons.operating')" width="200px" v-if="!referenced">
|
||||
<template slot="header">
|
||||
<span>{{ $t('commons.operating') }}
|
||||
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
|
||||
</span>
|
||||
</template>
|
||||
<template v-slot:default="{row}">
|
||||
<ms-table-operator-button class="run-button" :is-tester-permission="true" :tip="$t('api_test.run')" icon="el-icon-video-play"
|
||||
<ms-table-operator-button class="run-button" :is-tester-permission="true" :tip="$t('api_test.run')"
|
||||
icon="el-icon-video-play"
|
||||
@exec="execute(row)" v-tester/>
|
||||
<ms-table-operator-button :is-tester-permission="true" :tip="$t('test_track.plan_view.cancel_relevance')"
|
||||
icon="el-icon-unlock" type="danger" @exec="remove(row)" v-tester/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<header-custom ref="headerCustom" :initTableData="search" :optionalFields=headerItems :type=type></header-custom>
|
||||
<ms-table-pagination :change="search" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||
:total="total"/>
|
||||
<div>
|
||||
<!-- 执行结果 -->
|
||||
<el-drawer :visible.sync="runVisible" :destroy-on-close="true" direction="ltr" :withHeader="true" :modal="false" size="90%">
|
||||
<el-drawer :visible.sync="runVisible" :destroy-on-close="true" direction="ltr" :withHeader="true" :modal="false"
|
||||
size="90%">
|
||||
<ms-api-report-detail @refresh="search" :infoDb="infoDb" :report-id="reportId" :currentProjectId="projectId"/>
|
||||
</el-drawer>
|
||||
</div>
|
||||
|
@ -77,7 +102,7 @@
|
|||
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 {getUUID, getCurrentProjectID, getCurrentUser} from "@/common/js/utils";
|
||||
import MsApiReportDetail from "../../../../../api/automation/report/ApiReportDetail";
|
||||
import MsTableMoreBtn from "../../../../../api/automation/scenario/TableMoreBtn";
|
||||
import MsScenarioExtendButtons from "@/business/components/api/automation/scenario/ScenarioExtendBtns";
|
||||
|
@ -85,13 +110,25 @@
|
|||
import TestPlanScenarioListHeader from "./TestPlanScenarioListHeader";
|
||||
import {_handleSelect, _handleSelectAll} from "../../../../../../../common/js/tableUtils";
|
||||
import MsTableOperatorButton from "../../../../../common/components/MsTableOperatorButton";
|
||||
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
|
||||
import {TEST_CASE_LIST, TEST_PLAN_SCENARIO_CASE} from "@/common/js/constants";
|
||||
import {Test_Plan_Scenario_Case, Track_Test_Case} from "@/business/components/common/model/JsonData";
|
||||
|
||||
export default {
|
||||
name: "MsTestPlanApiScenarioList",
|
||||
components: {
|
||||
HeaderCustom,
|
||||
MsTableOperatorButton,
|
||||
TestPlanScenarioListHeader,
|
||||
MsTablePagination, MsTableMoreBtn, ShowMoreBtn, MsTableHeader, MsTag, MsApiReportDetail, MsScenarioExtendButtons, MsTestPlanList},
|
||||
MsTablePagination,
|
||||
MsTableMoreBtn,
|
||||
ShowMoreBtn,
|
||||
MsTableHeader,
|
||||
MsTag,
|
||||
MsApiReportDetail,
|
||||
MsScenarioExtendButtons,
|
||||
MsTestPlanList
|
||||
},
|
||||
props: {
|
||||
referenced: {
|
||||
type: Boolean,
|
||||
|
@ -103,6 +140,9 @@
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
type: TEST_PLAN_SCENARIO_CASE,
|
||||
headerItems: Test_Plan_Scenario_Case,
|
||||
tableLabel: Test_Plan_Scenario_Case,
|
||||
loading: false,
|
||||
condition: {},
|
||||
currentScenario: {},
|
||||
|
@ -142,7 +182,11 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
search() {
|
||||
this.getLabel()
|
||||
this.selectRows = new Set();
|
||||
this.loading = true;
|
||||
this.condition.moduleIds = this.selectNodeIds;
|
||||
|
@ -168,6 +212,25 @@
|
|||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getLabel() {
|
||||
let param = {}
|
||||
param.userId = getCurrentUser().id;
|
||||
param.type = TEST_PLAN_SCENARIO_CASE
|
||||
this.result = this.$post('/system/header/info', param, response => {
|
||||
if (response.data != null) {
|
||||
|
||||
let arry = eval(response.data.props);
|
||||
let obj = {};
|
||||
for (let key in arry) {
|
||||
obj[key] = arry[key];
|
||||
}
|
||||
let newObj = Object.keys(obj).map(val => ({
|
||||
prop: obj[val]
|
||||
}))
|
||||
this.tableLabel = newObj
|
||||
}
|
||||
})
|
||||
},
|
||||
reductionApi(row) {
|
||||
row.scenarioDefinition = null;
|
||||
let rows = [row];
|
||||
|
|
|
@ -45,27 +45,31 @@
|
|||
<show-more-btn :is-show="scope.row.showMore" :buttons="buttons" :size="selectRows.size"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
<el-table-column
|
||||
v-if="item.prop == 'num'"
|
||||
prop="num"
|
||||
sortable="custom"
|
||||
:label="$t('commons.id')"
|
||||
min-width="120px"
|
||||
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop=='name'"
|
||||
prop="name"
|
||||
:label="$t('commons.name')"
|
||||
min-width="120px"
|
||||
|
||||
:key="index"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop=='priority'"
|
||||
prop="priority"
|
||||
:filters="priorityFilters"
|
||||
column-key="priority"
|
||||
min-width="100px"
|
||||
|
||||
:key="index"
|
||||
:label="$t('test_track.case.priority')">
|
||||
<template v-slot:default="scope">
|
||||
<priority-table-item :value="scope.row.priority" ref="priority"/>
|
||||
|
@ -73,19 +77,21 @@
|
|||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop=='type'"
|
||||
prop="type"
|
||||
:filters="typeFilters"
|
||||
column-key="type"
|
||||
:label="$t('test_track.case.type')"
|
||||
min-width="80px"
|
||||
|
||||
:key="index"
|
||||
show-overflow-tooltip>
|
||||
<template v-slot:default="scope">
|
||||
<type-table-item :value="scope.row.type"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="tags" :label="$t('commons.tag')" min-width="120px"
|
||||
<el-table-column v-if="item.prop=='tags'" prop="tags" :label="$t('commons.tag')" min-width="120px"
|
||||
:key="index"
|
||||
>
|
||||
<template v-slot:default="scope">
|
||||
<div v-for="(tag, index) in scope.row.showTags" :key="tag + '_' + index">
|
||||
|
@ -95,12 +101,13 @@
|
|||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop=='method'"
|
||||
prop="method"
|
||||
:filters="methodFilters"
|
||||
column-key="method"
|
||||
:label="$t('test_track.case.method')"
|
||||
min-width="100px"
|
||||
|
||||
:key="index"
|
||||
show-overflow-tooltip>
|
||||
<template v-slot:default="scope">
|
||||
<method-table-item :value="scope.row.method"/>
|
||||
|
@ -108,26 +115,29 @@
|
|||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop=='nodePath'"
|
||||
prop="nodePath"
|
||||
:label="$t('test_track.case.module')"
|
||||
min-width="120px"
|
||||
|
||||
:key="index"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop=='projectName'"
|
||||
prop="projectName"
|
||||
:label="$t('test_track.plan.plan_project')"
|
||||
min-width="120px"
|
||||
|
||||
:key="index"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop=='issuesContent'"
|
||||
:label="$t('test_track.issue.issue')"
|
||||
min-width="80px"
|
||||
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<el-popover
|
||||
placement="right"
|
||||
|
@ -157,20 +167,22 @@
|
|||
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop == 'executorName'"
|
||||
prop="executorName"
|
||||
:filters="executorFilters"
|
||||
min-width="100px"
|
||||
|
||||
:key="index"
|
||||
column-key="executor"
|
||||
:label="$t('test_track.plan_view.executor')">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop == 'status'"
|
||||
prop="status"
|
||||
:filters="statusFilters"
|
||||
column-key="status"
|
||||
min-width="100px"
|
||||
|
||||
:key="index"
|
||||
:label="$t('test_track.plan_view.execute_result')">
|
||||
<template v-slot:default="scope">
|
||||
<span @click.stop="clickt = 'stop'">
|
||||
|
@ -200,20 +212,28 @@
|
|||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop == 'updateTime'"
|
||||
|
||||
sortable
|
||||
prop="updateTime"
|
||||
:label="$t('commons.update_time')"
|
||||
min-width="120px"
|
||||
|
||||
:key="index"
|
||||
show-overflow-tooltip>
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
min-width="100"
|
||||
:label="$t('commons.operating')">
|
||||
<template slot="header">
|
||||
<span>{{ $t('commons.operating') }}
|
||||
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
|
||||
</span>
|
||||
</template>
|
||||
<template v-slot:default="scope">
|
||||
<ms-table-operator-button :is-tester-permission="true" :tip="$t('commons.edit')" icon="el-icon-edit"
|
||||
@exec="handleEdit(scope.row)"/>
|
||||
|
@ -222,7 +242,8 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<header-custom ref="headerCustom" :initTableData="initTableData" :optionalFields=headerItems
|
||||
:type=type></header-custom>
|
||||
<ms-table-pagination :change="search" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||
:total="total"/>
|
||||
|
||||
|
@ -249,8 +270,15 @@ import MsTableHeader from '../../../../../common/components/MsTableHeader';
|
|||
import MsTableButton from '../../../../../common/components/MsTableButton';
|
||||
import NodeBreadcrumb from '../../../../common/NodeBreadcrumb';
|
||||
|
||||
import {ROLE_TEST_MANAGER, ROLE_TEST_USER, TokenKey, WORKSPACE_ID} from "@/common/js/constants";
|
||||
import {checkoutTestManagerOrTestUser, hasRoles} from "@/common/js/utils";
|
||||
import {
|
||||
ROLE_TEST_MANAGER,
|
||||
ROLE_TEST_USER,
|
||||
TEST_CASE_LIST,
|
||||
TEST_PLAN_FUNCTION_TEST_CASE,
|
||||
TokenKey,
|
||||
WORKSPACE_ID
|
||||
} from "@/common/js/constants";
|
||||
import {checkoutTestManagerOrTestUser, getCurrentUser, hasRoles} from "@/common/js/utils";
|
||||
import PriorityTableItem from "../../../../common/tableItems/planview/PriorityTableItem";
|
||||
import StatusTableItem from "../../../../common/tableItems/planview/StatusTableItem";
|
||||
import TypeTableItem from "../../../../common/tableItems/planview/TypeTableItem";
|
||||
|
@ -264,11 +292,14 @@ import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
|
|||
import {hub} from "@/business/components/track/plan/event-bus";
|
||||
import MsTag from "@/business/components/common/components/MsTag";
|
||||
import {_filter, _sort} from "@/common/js/tableUtils";
|
||||
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
|
||||
import {Test_Plan_Function_Test_Case} from "@/business/components/common/model/JsonData";
|
||||
|
||||
|
||||
export default {
|
||||
name: "FunctionalTestCaseList",
|
||||
components: {
|
||||
HeaderCustom,
|
||||
FunctionalTestCaseEdit,
|
||||
MsTableOperatorButton,
|
||||
MsTableOperator,
|
||||
|
@ -281,6 +312,9 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
type: TEST_PLAN_FUNCTION_TEST_CASE,
|
||||
headerItems: Test_Plan_Function_Test_Case,
|
||||
tableLabel: Test_Plan_Function_Test_Case,
|
||||
result: {},
|
||||
deletePath: "/test/case/delete",
|
||||
condition: {
|
||||
|
@ -383,7 +417,12 @@ export default {
|
|||
hub.$off("openFailureTestCase");
|
||||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
|
||||
initTableData() {
|
||||
this.getLabel()
|
||||
if (this.planId) {
|
||||
// param.planId = this.planId;
|
||||
this.condition.planId = this.planId;
|
||||
|
@ -428,6 +467,24 @@ export default {
|
|||
});
|
||||
}
|
||||
},
|
||||
getLabel() {
|
||||
let param = {}
|
||||
param.userId = getCurrentUser().id;
|
||||
param.type = TEST_PLAN_FUNCTION_TEST_CASE
|
||||
this.result = this.$post('/system/header/info', param, response => {
|
||||
if (response.data != null) {
|
||||
let arry = eval(response.data.props);
|
||||
let obj = {};
|
||||
for (let key in arry) {
|
||||
obj[key] = arry[key];
|
||||
}
|
||||
let newObj = Object.keys(obj).map(val => ({
|
||||
prop: obj[val]
|
||||
}))
|
||||
this.tableLabel = newObj
|
||||
}
|
||||
})
|
||||
},
|
||||
showDetail(row, event, column) {
|
||||
this.isReadOnly = true;
|
||||
this.$refs.testPlanTestCaseEdit.openTestCaseEdit(row);
|
||||
|
|
|
@ -23,43 +23,55 @@
|
|||
<show-more-btn :is-show="scope.row.showMore && !isReadOnly" :buttons="buttons" :size="selectRows.size"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="num" label="ID" show-overflow-tooltip/>
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
<el-table-column v-if="item.prop == 'num'" prop="num" label="ID" show-overflow-tooltip :key="index"/>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'caseName'"
|
||||
prop="caseName"
|
||||
:label="$t('commons.name')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'projectName'"
|
||||
prop="projectName"
|
||||
:label="$t('load_test.project_name')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'userName'"
|
||||
prop="userName"
|
||||
:label="$t('load_test.user_name')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'createTime'"
|
||||
sortable
|
||||
prop="createTime"
|
||||
:label="$t('commons.create_time')">
|
||||
:label="$t('commons.create_time')"
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'status'"
|
||||
prop="status"
|
||||
column-key="status"
|
||||
:filters="statusFilters"
|
||||
:label="$t('commons.status')">
|
||||
:label="$t('commons.status')"
|
||||
:key="index">
|
||||
<template v-slot:default="{row}">
|
||||
<ms-performance-test-status :row="row"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'caseStatus'"
|
||||
prop="caseStatus"
|
||||
:label="$t('test_track.plan.load_case.execution_status')">
|
||||
:label="$t('test_track.plan.load_case.execution_status')"
|
||||
:key="index">
|
||||
<template v-slot:default="{row}">
|
||||
<el-tag size="mini" type="danger" v-if="row.caseStatus === 'error'">
|
||||
{{ row.caseStatus }}
|
||||
|
@ -74,8 +86,10 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'loadReportId'"
|
||||
:label="$t('test_track.plan.load_case.report')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
<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">
|
||||
|
@ -85,7 +99,13 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column v-if="!isReadOnly" :label="$t('commons.operating')" align="center">
|
||||
<template slot="header">
|
||||
<span>{{ $t('commons.operating') }}
|
||||
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
|
||||
</span>
|
||||
</template>
|
||||
<template v-slot:default="scope">
|
||||
<ms-table-operator-button class="run-button" :is-tester-permission="true" :tip="$t('api_test.run')"
|
||||
icon="el-icon-video-play"
|
||||
|
@ -95,6 +115,8 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<header-custom ref="headerCustom" :initTableData="initTable" :optionalFields=headerItems
|
||||
:type=type></header-custom>
|
||||
<ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||
:total="total"/>
|
||||
</el-card>
|
||||
|
@ -112,10 +134,15 @@ import MsPerformanceTestStatus from "@/business/components/performance/test/Perf
|
|||
import MsTableOperatorButton from "@/business/components/common/components/MsTableOperatorButton";
|
||||
import LoadCaseReport from "@/business/components/track/plan/view/comonents/load/LoadCaseReport";
|
||||
import {_filter, _sort} from "@/common/js/tableUtils";
|
||||
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
|
||||
import {TEST_CASE_LIST, TEST_PLAN_LOAD_CASE} from "@/common/js/constants";
|
||||
import {Test_Plan_Load_Case, Track_Test_Case} from "@/business/components/common/model/JsonData";
|
||||
import {getCurrentUser} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "TestPlanLoadCaseList",
|
||||
components: {
|
||||
HeaderCustom,
|
||||
LoadCaseReport,
|
||||
TestPlanLoadCaseListHeader,
|
||||
ShowMoreBtn,
|
||||
|
@ -125,6 +152,9 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
type: TEST_PLAN_LOAD_CASE,
|
||||
headerItems: Test_Plan_Load_Case,
|
||||
tableLabel: Test_Plan_Load_Case,
|
||||
condition: {},
|
||||
result: {},
|
||||
tableData: [],
|
||||
|
@ -177,7 +207,11 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
initTable() {
|
||||
this.getLabel()
|
||||
this.selectRows = new Set();
|
||||
this.condition.testPlanId = this.planId;
|
||||
if (this.selectProjectId && this.selectProjectId !== 'root') {
|
||||
|
@ -198,6 +232,24 @@ export default {
|
|||
this.tableData = listObject;
|
||||
})
|
||||
},
|
||||
getLabel() {
|
||||
let param = {}
|
||||
param.userId = getCurrentUser().id;
|
||||
param.type = TEST_PLAN_LOAD_CASE
|
||||
this.result = this.$post('/system/header/info', param, response => {
|
||||
if (response.data != null) {
|
||||
let arry = eval(response.data.props);
|
||||
let obj = {};
|
||||
for (let key in arry) {
|
||||
obj[key] = arry[key];
|
||||
}
|
||||
let newObj = Object.keys(obj).map(val => ({
|
||||
prop: obj[val]
|
||||
}))
|
||||
this.tableLabel = newObj
|
||||
}
|
||||
})
|
||||
},
|
||||
refreshStatus() {
|
||||
this.refreshScheduler = setInterval(() => {
|
||||
// 如果有状态不是最终状态则定时查询
|
||||
|
|
|
@ -14,31 +14,44 @@
|
|||
@filter-change="filter"
|
||||
@sort-change="sort"
|
||||
@row-click="intoReview">
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
<el-table-column
|
||||
v-if="item.prop=='name'"
|
||||
prop="name"
|
||||
:label="$t('test_track.review.review_name')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop=='reviewer'"
|
||||
prop="reviewer"
|
||||
:label="$t('test_track.review.reviewer')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop=='projectName'"
|
||||
prop="projectName"
|
||||
:label="$t('test_track.review.review_project')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop=='creatorName'"
|
||||
prop="creatorName"
|
||||
:label="$t('test_track.review.review_creator')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop=='status'"
|
||||
prop="status"
|
||||
column-key="status"
|
||||
:label="$t('test_track.review.review_status')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index"
|
||||
>
|
||||
<template v-slot:default="scope">
|
||||
<span class="el-dropdown-link">
|
||||
<plan-status-table-item :value="scope.row.status"/>
|
||||
|
@ -46,30 +59,43 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop=='createTime'"
|
||||
prop="createTime"
|
||||
:label="$t('commons.create_time')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index"
|
||||
>
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop=='endTime'"
|
||||
prop="endTime"
|
||||
:label="$t('test_track.review.end_time')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.endTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column
|
||||
min-width="100"
|
||||
:label="$t('commons.operating')">
|
||||
<template slot="header">
|
||||
<span>{{ $t('commons.operating') }}
|
||||
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
|
||||
</span>
|
||||
</template>
|
||||
<template v-slot:default="scope">
|
||||
<ms-table-operator :is-tester-permission="true" @editClick="handleEdit(scope.row)"
|
||||
@deleteClick="handleDelete(scope.row)">
|
||||
</ms-table-operator>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<header-custom ref="headerCustom" :initTableData="initTableData" :optionalFields=headerItems
|
||||
:type=type></header-custom>
|
||||
</el-table>
|
||||
|
||||
<ms-table-pagination :change="initTableData" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||
|
@ -89,15 +115,19 @@ import MsCreateBox from "../../../settings/CreateBox";
|
|||
import MsTablePagination from "../../../common/pagination/TablePagination";
|
||||
import {
|
||||
checkoutTestManagerOrTestUser,
|
||||
getCurrentProjectID,
|
||||
getCurrentProjectID, getCurrentUser,
|
||||
getCurrentWorkspaceId
|
||||
} from "../../../../../common/js/utils";
|
||||
import {_filter, _sort} from "@/common/js/tableUtils";
|
||||
import PlanStatusTableItem from "../../common/tableItems/plan/PlanStatusTableItem";
|
||||
import {Test_Case_Review} from "@/business/components/common/model/JsonData";
|
||||
import {TEST_CASE_LIST, TEST_CASE_REVIEW_LIST} from "@/common/js/constants";
|
||||
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
|
||||
|
||||
export default {
|
||||
name: "TestCaseReviewList",
|
||||
components: {
|
||||
HeaderCustom,
|
||||
MsDeleteConfirm,
|
||||
MsTableOperator,
|
||||
MsTableOperatorButton,
|
||||
|
@ -109,6 +139,9 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
type: TEST_CASE_REVIEW_LIST,
|
||||
headerItems: Test_Case_Review,
|
||||
tableLabel: Test_Case_Review,
|
||||
result: {},
|
||||
condition: {},
|
||||
tableData: [],
|
||||
|
@ -135,7 +168,12 @@ export default {
|
|||
this.initTableData();
|
||||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
|
||||
initTableData() {
|
||||
this.getLabel()
|
||||
let lastWorkspaceId = getCurrentWorkspaceId();
|
||||
this.condition.workspaceId = lastWorkspaceId;
|
||||
if (!getCurrentProjectID()) {
|
||||
|
@ -163,6 +201,24 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
getLabel() {
|
||||
let param = {}
|
||||
param.userId = getCurrentUser().id;
|
||||
param.type = TEST_CASE_REVIEW_LIST
|
||||
this.result = this.$post('/system/header/info', param, response => {
|
||||
if (response.data != null) {
|
||||
let arry = eval(response.data.props);
|
||||
let obj = {};
|
||||
for (let key in arry) {
|
||||
obj[key] = arry[key];
|
||||
}
|
||||
let newObj = Object.keys(obj).map(val => ({
|
||||
prop: obj[val]
|
||||
}))
|
||||
this.tableLabel = newObj
|
||||
}
|
||||
})
|
||||
},
|
||||
intoReview(row) {
|
||||
this.$router.push('/track/review/view/' + row.id);
|
||||
},
|
||||
|
|
|
@ -41,72 +41,94 @@
|
|||
<show-more-btn :is-show="scope.row.showMore" :buttons="buttons" :size="selectRows.size"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
<el-table-column
|
||||
v-if="item.prop == 'num'"
|
||||
prop="num"
|
||||
sortable="custom"
|
||||
:label="$t('commons.id')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'name'"
|
||||
prop="name"
|
||||
:label="$t('commons.name')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.prop == 'priority'"
|
||||
prop="priority"
|
||||
:filters="priorityFilters"
|
||||
column-key="priority"
|
||||
:label="$t('test_track.case.priority')">
|
||||
:label="$t('test_track.case.priority')"
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<priority-table-item :value="scope.row.priority" ref="priority"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop == 'type'"
|
||||
prop="type"
|
||||
:filters="typeFilters"
|
||||
column-key="type"
|
||||
:label="$t('test_track.case.type')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<type-table-item :value="scope.row.type"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop=='method'"
|
||||
prop="method"
|
||||
:filters="methodFilters"
|
||||
column-key="method"
|
||||
:label="$t('test_track.case.method')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<method-table-item :value="scope.row.method"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop=='nodePath'"
|
||||
prop="nodePath"
|
||||
:label="$t('test_track.case.module')"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="projectName"
|
||||
:label="$t('test_track.review.review_project')"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="reviewerName"
|
||||
:label="$t('test_track.review.reviewer')"
|
||||
show-overflow-tooltip
|
||||
:key="index"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop=='projectName'"
|
||||
prop="projectName"
|
||||
:label="$t('test_track.review.review_project')"
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop=='reviewerName'"
|
||||
prop="reviewerName"
|
||||
:label="$t('test_track.review.reviewer')"
|
||||
show-overflow-tooltip
|
||||
:key="index"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop=='reviewStatus'"
|
||||
:filters="statusFilters"
|
||||
column-key="status"
|
||||
:label="$t('test_track.review_view.execute_result')">
|
||||
:label="$t('test_track.review_view.execute_result')"
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<span class="el-dropdown-link">
|
||||
<review-status :value="scope.row.reviewStatus"/>
|
||||
|
@ -115,17 +137,26 @@
|
|||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.prop=='updateTime'"
|
||||
sortable
|
||||
prop="updateTime"
|
||||
:label="$t('commons.update_time')"
|
||||
show-overflow-tooltip>
|
||||
show-overflow-tooltip
|
||||
:key="index">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column
|
||||
min-width="100"
|
||||
:label="$t('commons.operating')">
|
||||
:label="$t('commons.operating')"
|
||||
>
|
||||
<template slot="header">
|
||||
<span>{{ $t('commons.operating') }}
|
||||
<i class='el-icon-setting' style="color:#7834c1; margin-left:10px" @click="customHeader"> </i>
|
||||
</span>
|
||||
</template>
|
||||
<template v-slot:default="scope">
|
||||
<ms-table-operator-button :is-tester-permission="true" :tip="$t('commons.edit')" icon="el-icon-edit"
|
||||
@exec="handleEdit(scope.row)"/>
|
||||
|
@ -134,6 +165,8 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<header-custom ref="headerCustom" :initTableData="initTableData" :optionalFields=headerItems
|
||||
:type=type></header-custom>
|
||||
|
||||
<ms-table-pagination :change="search" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||
:total="total"/>
|
||||
|
@ -169,16 +202,24 @@ import MsTableButton from "../../../../common/components/MsTableButton";
|
|||
import ShowMoreBtn from "../../../case/components/ShowMoreBtn";
|
||||
import BatchEdit from "../../../case/components/BatchEdit";
|
||||
import MsTablePagination from '../../../../common/pagination/TablePagination';
|
||||
import {checkoutTestManagerOrTestUser, hasRoles} from "../../../../../../common/js/utils";
|
||||
import {checkoutTestManagerOrTestUser, getCurrentUser, hasRoles} from "../../../../../../common/js/utils";
|
||||
import {TEST_CASE_CONFIGS} from "../../../../common/components/search/search-components";
|
||||
import {ROLE_TEST_MANAGER, ROLE_TEST_USER} from "../../../../../../common/js/constants";
|
||||
import {
|
||||
ROLE_TEST_MANAGER,
|
||||
ROLE_TEST_USER,
|
||||
TEST_CASE_LIST,
|
||||
TEST_CASE_REVIEW_CASE_LIST, TEST_PLAN_LIST
|
||||
} from "../../../../../../common/js/constants";
|
||||
import TestReviewTestCaseEdit from "./TestReviewTestCaseEdit";
|
||||
import ReviewStatus from "@/business/components/track/case/components/ReviewStatus";
|
||||
import {_filter, _sort} from "@/common/js/tableUtils";
|
||||
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
|
||||
import {Test_Case_Review_Case_List, Track_Test_Case} from "@/business/components/common/model/JsonData";
|
||||
|
||||
export default {
|
||||
name: "TestReviewTestCaseList",
|
||||
components: {
|
||||
HeaderCustom,
|
||||
MsTableOperatorButton, MsTableOperator, MethodTableItem, TypeTableItem,
|
||||
StatusTableItem, PriorityTableItem, StatusEdit,
|
||||
ExecutorEdit, MsTipButton, TestReviewTestCaseEdit, MsTableHeader,
|
||||
|
@ -186,6 +227,9 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
type: TEST_CASE_REVIEW_CASE_LIST,
|
||||
headerItems: Test_Case_Review_Case_List,
|
||||
tableLabel: Test_Case_Review_Case_List,
|
||||
result: {},
|
||||
condition: {},
|
||||
tableData: [],
|
||||
|
@ -261,7 +305,11 @@ export default {
|
|||
this.isTestManagerOrTestUser = checkoutTestManagerOrTestUser();
|
||||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
initTableData() {
|
||||
this.getLabel()
|
||||
if (this.reviewId) {
|
||||
this.condition.reviewId = this.reviewId;
|
||||
}
|
||||
|
@ -275,6 +323,24 @@ export default {
|
|||
});
|
||||
}
|
||||
},
|
||||
getLabel() {
|
||||
let param = {}
|
||||
param.userId = getCurrentUser().id;
|
||||
param.type = TEST_CASE_REVIEW_CASE_LIST
|
||||
this.result = this.$post('/system/header/info', param, response => {
|
||||
if (response.data != null) {
|
||||
let arry = eval(response.data.props);
|
||||
let obj = {};
|
||||
for (let key in arry) {
|
||||
obj[key] = arry[key];
|
||||
}
|
||||
let newObj = Object.keys(obj).map(val => ({
|
||||
prop: obj[val]
|
||||
}))
|
||||
this.tableLabel = newObj
|
||||
}
|
||||
})
|
||||
},
|
||||
showDetail(row, event, column) {
|
||||
this.isReadOnly = true;
|
||||
this.$refs.testReviewTestCaseEdit.openTestCaseEdit(row);
|
||||
|
|
|
@ -1,4 +1,15 @@
|
|||
export const TEST_CASE_LIST = 'test_case_list'
|
||||
export const TEST_CASE_REVIEW_LIST = 'test_case_review_list'
|
||||
export const API_LIST = 'api_list'
|
||||
export const API_CASE_LIST = 'api_case_list'
|
||||
export const API_SCENARIO_LIST = 'api_scenario_list'
|
||||
export const TEST_CASE_REVIEW_CASE_LIST = 'test_case_review_case_list'
|
||||
export const TEST_PLAN_LIST = 'test_plan_list'
|
||||
export const TEST_PLAN_FUNCTION_TEST_CASE = 'test_plan_function_test_case'
|
||||
export const TEST_PLAN_API_CASE = 'test_plan_api_case'
|
||||
export const TEST_PLAN_LOAD_CASE = 'test_plan_load_case'
|
||||
export const TEST_PLAN_SCENARIO_CASE = 'test_plan_scenario_case'
|
||||
|
||||
export const TokenKey = 'Admin-Token';
|
||||
export const LicenseKey = 'License';
|
||||
export const DEFAULT_LANGUAGE = 'default_language';
|
||||
|
|
Loading…
Reference in New Issue