fix: 初始化自定义表头

This commit is contained in:
wenyann 2021-03-25 01:45:56 +08:00
parent 73e9824c5f
commit 6c1daf4620
22 changed files with 674 additions and 94 deletions

View File

@ -0,0 +1,14 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class SystemHeader implements Serializable {
private String type;
private String props;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,340 @@
package io.metersphere.base.domain;
import java.util.ArrayList;
import java.util.List;
public class SystemHeaderExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public SystemHeaderExample() {
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 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 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 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);
}
}
}

View File

@ -0,0 +1,31 @@
package io.metersphere.base.mapper;
import io.metersphere.base.domain.SystemHeader;
import io.metersphere.base.domain.SystemHeaderExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SystemHeaderMapper {
long countByExample(SystemHeaderExample example);
int deleteByExample(SystemHeaderExample example);
int deleteByPrimaryKey(String type);
int insert(SystemHeader record);
int insertSelective(SystemHeader record);
List<SystemHeader> selectByExample(SystemHeaderExample example);
SystemHeader selectByPrimaryKey(String type);
int updateByExampleSelective(@Param("record") SystemHeader record, @Param("example") SystemHeaderExample example);
int updateByExample(@Param("record") SystemHeader record, @Param("example") SystemHeaderExample example);
int updateByPrimaryKeySelective(SystemHeader record);
int updateByPrimaryKey(SystemHeader record);
}

View File

@ -0,0 +1,169 @@
<?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.SystemHeaderMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.SystemHeader">
<id column="type" jdbcType="VARCHAR" property="type"/>
<result column="props" jdbcType="VARCHAR" property="props"/>
</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">
`type`, props
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.SystemHeaderExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from system_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 system_header
where `type` = #{type,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete
from system_header
where `type` = #{type,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.SystemHeaderExample">
delete from system_header
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.SystemHeader">
insert into system_header (`type`, props)
values (#{type,jdbcType=VARCHAR}, #{props,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.SystemHeader">
insert into system_header
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="type != null">
`type`,
</if>
<if test="props != null">
props,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="props != null">
#{props,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.SystemHeaderExample"
resultType="java.lang.Long">
select count(*) from system_header
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update system_header
<set>
<if test="record.type != null">
`type` = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.props != null">
props = #{record.props,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
update system_header
set `type` = #{record.type,jdbcType=VARCHAR},
props = #{record.props,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.SystemHeader">
update system_header
<set>
<if test="props != null">
props = #{props,jdbcType=VARCHAR},
</if>
</set>
where `type` = #{type,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.SystemHeader">
update system_header
set props = #{props,jdbcType=VARCHAR}
where `type` = #{type,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -1,5 +1,6 @@
package io.metersphere.controller;
import io.metersphere.base.domain.SystemHeader;
import io.metersphere.base.domain.SystemParameter;
import io.metersphere.base.domain.UserHeader;
import io.metersphere.commons.constants.ParamConstants;
@ -51,13 +52,18 @@ public class SystemParameterController {
}
@GetMapping("/base/info")
public BaseSystemConfigDTO getBaseInfo () {
public BaseSystemConfigDTO getBaseInfo() {
return SystemParameterService.getBaseInfo();
}
@PostMapping("/system/header")
public SystemHeader getHeader(@RequestBody SystemHeader systemHeader) {
return SystemParameterService.getHeader(systemHeader.getType());
}
@PostMapping("/save/base")
@RequiresRoles(value = {RoleConstants.ADMIN})
public void saveBaseInfo (@RequestBody List<SystemParameter> systemParameter) {
public void saveBaseInfo(@RequestBody List<SystemParameter> systemParameter) {
SystemParameterService.saveBaseInfo(systemParameter);
}

View File

@ -1,9 +1,7 @@
package io.metersphere.service;
import io.metersphere.base.domain.SystemParameter;
import io.metersphere.base.domain.SystemParameterExample;
import io.metersphere.base.domain.UserHeader;
import io.metersphere.base.domain.UserHeaderExample;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.SystemHeaderMapper;
import io.metersphere.base.mapper.SystemParameterMapper;
import io.metersphere.base.mapper.UserHeaderMapper;
import io.metersphere.base.mapper.ext.ExtSystemParameterMapper;
@ -42,6 +40,8 @@ public class SystemParameterService {
private SystemParameterMapper systemParameterMapper;
@Resource
private ExtSystemParameterMapper extSystemParameterMapper;
@Resource
private SystemHeaderMapper systemHeaderMapper;
public String searchEmail() {
return extSystemParameterMapper.email();
@ -257,6 +257,11 @@ public class SystemParameterService {
example.clear();
}
//默认表头
public SystemHeader getHeader(String type) {
return systemHeaderMapper.selectByPrimaryKey(type);
}
public UserHeader queryUserHeader(HeaderRequest headerRequest) {
UserHeaderExample example = new UserHeaderExample();
example.createCriteria().andUserIdEqualTo(headerRequest.getUserId()).andTypeEqualTo(headerRequest.getType());

View File

@ -194,8 +194,55 @@ alter table test_case
modify test_id varchar(2000) null;
-- update history data
update test_case set review_status = 'Prepare' where review_status is null;
update test_case
set review_status = 'Prepare'
where review_status is null;
-- test_case_node update name
alter table test_case_node
modify name varchar(100) NOT NULL COMMENT 'Node name';
-- system_header
create table system_header
(
type varchar(150) null,
props varchar(1000) null
);
-- init system_header
insert into system_header (type, props)
values ('api_scenario_list',
'[{"id":"num","label":"ID"},{"id":"name","label":"场景名称"},{"id":"level","label":"用例等级"},{"id":"status","label":"当前状态"},{"id":"tags","label":"标签"},{"id":"userId","label":"创建人"},{"id":"updateTime","label":"最后更新时间"},{"id":"stepTotal","label":"步骤数"},{"id":"lastResult","label":"最后结果"},{"id":"passRate","label":"通过率"}]');
insert into system_header (type, props)
values ('test_plan_function_test_case',
'[{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"priority","label":"用例等级"},{"id":"type","label":"类型"},{"id":"tags","label":"标签"},{"id":"method","label":"测试方式"},{"id":"nodePath","label":"所属模块"},{"id":"projectName","label":"所属项目"},{"id":"issuesContent","label":"缺陷"},{"id":"executorName","label":"执行人"},{"id":"status","label":"执行结果"},{"id":"updateTime","label":"更新时间"},{"id":"maintainer","label":"责任人"}]');
insert into system_header (type, props)
values ('test_case_review_case_list',
'[{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"priority","label":"用例等级"},{"id":"type","label":"类型"},{"id":"method","label":"测试方式"},{"id":"nodePath","label":"所属模块"},{"id":"projectName","label":"所属项目"},{"id":"reviewerName","label":"评审人"},{"id":"reviewStatus","label":"评审状态"},{"id":"updateTime","label":"更新时间"}]');
insert into system_header (type, props)
values ('test_plan_load_case',
'[{"id":"num","label":"ID"},{"id":"caseName","label":"名称"},{"id":"projectName","label":"所属项目"},{"id":"userName","label":"创建人"},{"id":"createTime","label":"创建时间"},{"id":"status","label":"状态"},{"id":"caseStatus","label":"执行状态"},{"id":"loadReportId","label":"查看报告"}]');
insert into system_header (type, props)
values ('api_case_list',
'[{"id":"num","label":"ID"},{"id":"name","label":"用例名称"},{"id":"priority","label":"用例等级"},{"id":"path","label":"路径"},{"id":"tags","label":"标签"},{"id":"createUser","label":"创建人"},{"id":"updateTime","label":"最后更新时间"}]');
insert into system_header (type, props)
values ('api_list',
'[{"id":"num","label":"ID"},{"id":"name","label":"接口名称"},{"id":"method","label":"请求类型"},{"id":"userName","label":"负责人"},{"id":"path","label":"路径"},{"id":"tags","label":"标签"},{"id":"updateTime","label":"最后更新时间"},{"id":"caseTotal","label":"用例数"},{"id":"caseStatus","label":"用例状态"},{"id":"casePassingRate","label":"用例通过率"}]');
insert into system_header (type, props)
values ('test_case_review_list',
'[{"id":"name","label":"评审名称"},{"id":"reviewer","label":"评审人"},{"id":"projectName","label":"所属项目"},{"id":"creatorName","label":"发起人"},{"id":"status","label":"当前状态"},{"id":"createTime","label":"创建时间"},{"id":"endTime","label":"截止时间"},{"id":"tags","label":"标签"}]');
insert into system_header (type, props)
values ('test_plan_api_case',
'[{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"priority","label":"用例等级"},{"id":"path","label":"路径"},{"id":"createUser","label":"创建人"},{"id":"custom","label":"最后更新时间"},{"id":"tags","label":"标签"},{"id":"execResult","label":"执行状态"}]');
insert into system_header (type, props)
values ('test_plan_list',
'[{"id":"name","label":"名称"},{"id":"userName","label":"负责人"},{"id":"status","label":"当前状态"},{"id":"stage","label":"测试阶段"},{"id":"testRate","label":"测试进度"},{"id":"projectName","label":"所属项目"},{"id":"plannedStartTime","label":"计划开始"},{"id":"plannedEndTime","label":"计划结束"},{"id":"actualStartTime","label":"实际开始"},{"id":"actualEndTime","label":"实际结束"},{"id":"tags","label":"标签"},{"id":"executionTimes","label":"执行次数"},{"id":"passRate","label":"通过率"}]');
insert into system_header (type, props)
values ('test_case_list',
'[{"id":"tags","label":"标签"},{"id":"nodePath","label":"所属模块"},{"id":"updateTime","label":"更新时间"},{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"priority","label":"用例等级"},{"id":"reviewStatus","label":"评审状态"}]');
insert into system_header (type, props)
values ('test_case_list',
'[{"id":"tags","label":"标签"},{"id":"nodePath","label":"所属模块"},{"id":"updateTime","label":"更新时间"},{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"priority","label":"用例等级"},{"id":"reviewStatus","label":"评审状态"}]');
insert into system_header (type, props)
values ('test_plan_scenario_case',
'[{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"level","label":"用例等级"},{"id":"tagNames","label":"标签"},{"id":"userId","label":"创建人"},{"id":"updateTime","label":"最后更新时间"},{"id":"stepTotal","label":"通过"},{"id":"lastResult","label":"失败"},{"id":"passRate","label":"通过率"}]');

View File

@ -72,11 +72,12 @@
<!--<table tableName="api_scenario_report"/>-->
<!--<table tableName="test_case_review"/>-->
<!--<table tableName="test_case"/>-->
<table tableName="test_case_review_api_case"/>
<!--<table tableName="test_case_review_api_case"/>
<table tableName="test_case_review_load"/>
<table tableName="test_case_review_scenario"/>
<table tableName="test_plan"/>
<table tableName="test_case_test"/>
<table tableName="test_case_test"/>-->
<table tableName="system_header"></table>
</context>
</generatorConfiguration>

View File

@ -179,7 +179,7 @@
import {PROJECT_NAME} from "../../../../../common/js/constants";
import EnvironmentSelect from "../../definition/components/environment/EnvironmentSelect";
import BatchMove from "../../../track/case/components/BatchMove";
import {_sort, getLabel} from "@/common/js/tableUtils";
import {_sort, getLabel, getSystemLabel} from "@/common/js/tableUtils";
import {Api_Scenario_List} from "@/business/components/common/model/JsonData";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import {
@ -249,7 +249,7 @@
result: {},
type: API_SCENARIO_LIST,
headerItems: Api_Scenario_List,
tableLabel: Api_Scenario_List,
tableLabel: [],
screenHeight: document.documentElement.clientHeight - 280,//,
condition: {
components: API_SCENARIO_CONFIGS
@ -343,6 +343,8 @@
this.condition.filters = {status: ["Prepare", "Underway", "Completed"]};
this.search();
this.getPrincipalOptions([]);
getSystemLabel(this, this.type)
},
watch: {
selectNodeIds() {

View File

@ -154,7 +154,7 @@ import {parseEnvironment} from "@/business/components/api/test/model/Environment
import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover";
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, getLabel,} from "@/common/js/tableUtils";
import {_filter, _handleSelect, _handleSelectAll, _sort, getLabel, getSystemLabel,} from "@/common/js/tableUtils";
import {API_CASE_LIST} from "@/common/js/constants";
import {Api_Case_List} from "@/business/components/common/model/JsonData";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
@ -186,7 +186,7 @@ export default {
return {
type: API_CASE_LIST,
headerItems: Api_Case_List,
tableLabel: Api_Case_List,
tableLabel: [],
condition: {
components: API_CASE_CONFIGS
},
@ -260,7 +260,7 @@ export default {
},
created: function () {
this.initTable();
getSystemLabel(this, this.type)
this.$nextTick(() => {
this.$refs.caseTable.bodyWrapper.scrollTop = 5
})

View File

@ -235,7 +235,7 @@
import {
_handleSelect,
_handleSelectAll, buildBatchParam, getLabel,
getSelectDataCounts, initCondition,
getSelectDataCounts, getSystemLabel, initCondition,
setUnSelectIds, toggleAllSelection
} from "@/common/js/tableUtils";
import {_filter, _sort} from "@/common/js/tableUtils";
@ -271,7 +271,7 @@
return {
type: API_LIST,
headerItems: Api_List,
tableLabel: Api_List,
tableLabel: [],
condition: {
components: API_DEFINITION_CONFIGS
},
@ -381,6 +381,7 @@
this.condition.filters = {status: ["Prepare", "Underway", "Completed"]};
}
this.initTable();
getSystemLabel(this, this.type)
this.getMaintainerOptions();
},
watch: {

View File

@ -52,7 +52,6 @@ export default {
this.defaultCheckedKeys.push(i.id)
}
)
this.fieldSelected = items;
},
saveHeader() {
let param = {

View File

@ -5,17 +5,10 @@ export const Track_Test_Case = [
{id: 'num', label: i18n.t('commons.id')},
{id: 'name', label: i18n.t('commons.name')},
{id: 'priority', label: i18n.t('test_track.case.priority')},
/*
{id: 'type', label: i18n.t('test_track.case.type')},
*/
/*
{id: 'method', label: i18n.t('test_track.case.method')},
*/
{id: 'reviewStatus', label: i18n.t('test_track.case.status')},
{id: 'tags', label: i18n.t('commons.tag')},
{id: 'nodePath', label: i18n.t('test_track.case.module')},
{id: 'updateTime', label: i18n.t('commons.update_time')},
{id: 'status', label: i18n.t('commons.status')}
]
//用例评审-测试用例
export const Test_Case_Review = [
@ -70,7 +63,7 @@ export const Api_Case_List = [
//接口自动化-场景列表
export const Api_Scenario_List = [
{id: 'num', label: "ID"},
{id: 'name', label: i18n.t('test_track.case.name')},
{id: 'name', label: i18n.t('api_report.scenario_name')},
{id: 'level', label: i18n.t('api_test.automation.case_level')},
{id: 'status', label: i18n.t('test_track.plan.plan_status')},
{id: 'tags', label: i18n.t('commons.tag')},

View File

@ -48,19 +48,6 @@
show-overflow-tooltip
:key="index"
>
<!-- <template v-slot:default="scope">
&lt;!&ndash;<div @mouseover="showDetail(scope.row)">
<p>{{ scope.row.name }}</p>
</div>&ndash;&gt;
<el-popover
placement="right-end"
:title="$t('test_track.case.view_case')"
trigger="hover"
>
<test-case-detail v-if="currentCaseId === scope.row.id" :test-case-id="currentCaseId"/>
<span slot="reference">{{ scope.row.name }}</span>
</el-popover>
</template>-->
</el-table-column>
<el-table-column
v-if="item.id == 'priority'"
@ -75,32 +62,6 @@
<priority-table-item :value="scope.row.priority"/>
</template>
</el-table-column>
<!-- <el-table-column
v-if="item.id == 'type'"
prop="type"
:filters="typeFilters"
column-key="type"
:label="$t('test_track.case.type')"
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.id=='method'"
prop="method"
column-key="method"
:filters="methodFilters"
min-width="100px"
:label="$t('test_track.case.method')"
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.id=='reviewStatus'"
:filters="reviewStatusFilters"
@ -114,20 +75,6 @@
</span>
</template>
</el-table-column>
<el-table-column
v-if="item.id=='status'"
:filters="statusFilters"
column-key="status"
min-width="100px"
:label="$t('commons.status')"
:key="index">
<template v-slot:default="scope">
<span class="el-dropdown-link">
<plan-status-table-item :value="scope.row.status"></plan-status-table-item>
</span>
</template>
</el-table-column>
<el-table-column v-if="item.id=='tags'" prop="tags" :label="$t('commons.tag')" :key="index">
<template v-slot:default="scope">
<ms-tag v-for="(itemName,index) in scope.row.tags" :key="index" type="success" effect="plain"
@ -215,7 +162,7 @@ import {
_handleSelect,
_handleSelectAll,
_sort, buildBatchParam, getLabel,
getSelectDataCounts, initCondition,
getSelectDataCounts, getSystemLabel, initCondition,
setUnSelectIds,
toggleAllSelection
} from "@/common/js/tableUtils";
@ -257,7 +204,7 @@ export default {
return {
type: TEST_CASE_LIST,
headerItems: Track_Test_Case,
tableLabel: Track_Test_Case,
tableLabel: [],
result: {},
deletePath: "/test/case/delete",
condition: {
@ -363,6 +310,7 @@ export default {
this.condition.filters = {status: ["Prepare", "Pass", "UnPass"]};
}
this.initTableData();
getSystemLabel(this, this.type)
},
activated() {
if (this.trashEnable) {

View File

@ -225,7 +225,7 @@ import MsDeleteConfirm from "../../../common/components/MsDeleteConfirm";
import {TEST_PLAN_CONFIGS} from "../../../common/components/search/search-components";
import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent";
import MsScheduleMaintain from "@/business/components/api/automation/schedule/ScheduleMaintain"
import {_filter, _sort, getLabel} from "@/common/js/tableUtils";
import {_filter, _sort, getLabel, getSystemLabel} from "@/common/js/tableUtils";
import {TEST_PLAN_LIST} from "@/common/js/constants";
import {Test_Plan_List} from "@/business/components/common/model/JsonData";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
@ -251,7 +251,7 @@ export default {
return {
type: TEST_PLAN_LIST,
headerItems: Test_Plan_List,
tableLabel: Test_Plan_List,
tableLabel: [],
result: {},
enableDeleteTip: false,
queryPath: "/test/plan/list",
@ -291,6 +291,7 @@ export default {
}
this.isTestManagerOrTestUser = checkoutTestManagerOrTestUser();
this.initTableData();
getSystemLabel(this, this.type)
},
methods: {
calPassRate(scope) {

View File

@ -161,7 +161,7 @@ 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 {TEST_PLAN_API_CASE, WORKSPACE_ID} from "@/common/js/constants";
import {_filter, _sort, getLabel} from "@/common/js/tableUtils";
import {_filter, _sort, getLabel, getSystemLabel} from "@/common/js/tableUtils";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import {Test_Plan_Api_Case} from "@/business/components/common/model/JsonData";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
@ -192,7 +192,7 @@ export default {
return {
type: TEST_PLAN_API_CASE,
headerItems: Test_Plan_Api_Case,
tableLabel: Test_Plan_Api_Case,
tableLabel: [],
condition: {},
selectCase: {},
result: {},
@ -268,6 +268,8 @@ export default {
created: function () {
this.getMaintainerOptions();
this.initTable();
getSystemLabel(this, this.type)
},
activated() {
this.status = 'default'

View File

@ -109,7 +109,7 @@ import MsTableMoreBtn from "../../../../../api/automation/scenario/TableMoreBtn"
import MsScenarioExtendButtons from "@/business/components/api/automation/scenario/ScenarioExtendBtns";
import MsTestPlanList from "../../../../../api/automation/scenario/testplan/TestPlanList";
import TestPlanScenarioListHeader from "./TestPlanScenarioListHeader";
import {_handleSelect, _handleSelectAll, getLabel} from "../../../../../../../common/js/tableUtils";
import {_handleSelect, _handleSelectAll, getLabel, getSystemLabel} 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";
@ -148,7 +148,7 @@ export default {
return {
type: TEST_PLAN_SCENARIO_CASE,
headerItems: Test_Plan_Scenario_Case,
tableLabel: Test_Plan_Scenario_Case,
tableLabel: [],
loading: false,
condition: {},
currentScenario: {},
@ -188,6 +188,8 @@ export default {
},
created() {
this.search();
getSystemLabel(this, this.type)
},
watch: {
selectNodeIds() {

View File

@ -296,7 +296,7 @@ import BatchEdit from "../../../../case/components/BatchEdit";
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, getLabel} from "@/common/js/tableUtils";
import {_filter, _sort, getLabel, getSystemLabel} from "@/common/js/tableUtils";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import {Test_Plan_Function_Test_Case} from "@/business/components/common/model/JsonData";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
@ -321,7 +321,7 @@ export default {
return {
type: TEST_PLAN_FUNCTION_TEST_CASE,
headerItems: Test_Plan_Function_Test_Case,
tableLabel: Test_Plan_Function_Test_Case,
tableLabel: [],
result: {},
deletePath: "/test/case/delete",
condition: {
@ -424,6 +424,9 @@ export default {
beforeDestroy() {
hub.$off("openFailureTestCase");
},
created() {
getSystemLabel(this, this.type)
},
methods: {
customHeader() {
getLabel(this, TEST_PLAN_FUNCTION_TEST_CASE);

View File

@ -131,7 +131,7 @@ import MsTablePagination from "@/business/components/common/pagination/TablePagi
import MsPerformanceTestStatus from "@/business/components/performance/test/PerformanceTestStatus";
import MsTableOperatorButton from "@/business/components/common/components/MsTableOperatorButton";
import LoadCaseReport from "@/business/components/track/plan/view/comonents/load/LoadCaseReport";
import {_filter, _sort, getLabel} from "@/common/js/tableUtils";
import {_filter, _sort, getLabel, getSystemLabel} 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";
@ -154,7 +154,7 @@ export default {
return {
type: TEST_PLAN_LOAD_CASE,
headerItems: Test_Plan_Load_Case,
tableLabel: Test_Plan_Load_Case,
tableLabel: [],
condition: {},
result: {},
tableData: [],
@ -198,6 +198,8 @@ export default {
created() {
this.initTable();
this.refreshStatus();
getSystemLabel(this, this.type)
},
watch: {
selectProjectId() {

View File

@ -122,7 +122,7 @@ import {
checkoutTestManagerOrTestUser,
getCurrentWorkspaceId
} from "../../../../../common/js/utils";
import {_filter, _sort, getLabel} from "@/common/js/tableUtils";
import {_filter, _sort, getLabel, getSystemLabel} 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";
@ -149,7 +149,7 @@ export default {
return {
type: TEST_CASE_REVIEW_LIST,
headerItems: Test_Case_Review,
tableLabel: Test_Case_Review,
tableLabel: [],
result: {},
condition: {},
tableData: [],
@ -174,6 +174,8 @@ export default {
created() {
this.isTestManagerOrTestUser = checkoutTestManagerOrTestUser();
this.initTableData();
getSystemLabel(this, this.type)
},
computed: {
projectId() {

View File

@ -202,7 +202,7 @@ import {
} from "../../../../../../common/js/constants";
import TestReviewTestCaseEdit from "./TestReviewTestCaseEdit";
import ReviewStatus from "@/business/components/track/case/components/ReviewStatus";
import {_filter, _sort, getLabel} from "@/common/js/tableUtils";
import {_filter, _sort, getLabel, getSystemLabel} 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";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
@ -221,7 +221,7 @@ export default {
return {
type: TEST_CASE_REVIEW_CASE_LIST,
headerItems: Test_Case_Review_Case_List,
tableLabel: Test_Case_Review_Case_List,
tableLabel: [],
result: {},
condition: {},
tableData: [],
@ -296,6 +296,9 @@ export default {
this.refreshTableAndReview();
this.isTestManagerOrTestUser = checkoutTestManagerOrTestUser();
},
created() {
getSystemLabel(this, this.type)
},
methods: {
customHeader() {
this.$refs.headerCustom.open(this.tableLabel)

View File

@ -117,6 +117,15 @@ export function getLabel(vueObj, type) {
}
})
}
export function getSystemLabel(vueObj, type) {
let param = {}
param.type=type
vueObj.result = vueObj.$post('/system/system/header',param, response => {
if (response.data != null) {
vueObj.tableLabel = eval(response.data.props);
}
})
}
export function buildBatchParam(vueObj) {