fix(项目设置): 修复自定义模版名称太长保存报错的缺陷

--bug=1016767 --user=王孝刚 【项目设置】新建/编辑自定义模板,名称太长显示错位,描述太长会报错
https://www.tapd.cn/55049933/s/1243259
This commit is contained in:
wxg0103 2022-09-15 16:26:01 +08:00 committed by fit2-zhao
parent 0cac065e28
commit 2c7dcec1bf
14 changed files with 372 additions and 432 deletions

View File

@ -17,11 +17,11 @@ public class CustomFieldTemplate implements Serializable {
private Integer order;
private String defaultValue;
private String customData;
private String key;
private String defaultValue;
private static final long serialVersionUID = 1L;
}
}

View File

@ -504,76 +504,6 @@ public class CustomFieldTemplateExample {
return (Criteria) this;
}
public Criteria andDefaultValueIsNull() {
addCriterion("default_value is null");
return (Criteria) this;
}
public Criteria andDefaultValueIsNotNull() {
addCriterion("default_value is not null");
return (Criteria) this;
}
public Criteria andDefaultValueEqualTo(String value) {
addCriterion("default_value =", value, "defaultValue");
return (Criteria) this;
}
public Criteria andDefaultValueNotEqualTo(String value) {
addCriterion("default_value <>", value, "defaultValue");
return (Criteria) this;
}
public Criteria andDefaultValueGreaterThan(String value) {
addCriterion("default_value >", value, "defaultValue");
return (Criteria) this;
}
public Criteria andDefaultValueGreaterThanOrEqualTo(String value) {
addCriterion("default_value >=", value, "defaultValue");
return (Criteria) this;
}
public Criteria andDefaultValueLessThan(String value) {
addCriterion("default_value <", value, "defaultValue");
return (Criteria) this;
}
public Criteria andDefaultValueLessThanOrEqualTo(String value) {
addCriterion("default_value <=", value, "defaultValue");
return (Criteria) this;
}
public Criteria andDefaultValueLike(String value) {
addCriterion("default_value like", value, "defaultValue");
return (Criteria) this;
}
public Criteria andDefaultValueNotLike(String value) {
addCriterion("default_value not like", value, "defaultValue");
return (Criteria) this;
}
public Criteria andDefaultValueIn(List<String> values) {
addCriterion("default_value in", values, "defaultValue");
return (Criteria) this;
}
public Criteria andDefaultValueNotIn(List<String> values) {
addCriterion("default_value not in", values, "defaultValue");
return (Criteria) this;
}
public Criteria andDefaultValueBetween(String value1, String value2) {
addCriterion("default_value between", value1, value2, "defaultValue");
return (Criteria) this;
}
public Criteria andDefaultValueNotBetween(String value1, String value2) {
addCriterion("default_value not between", value1, value2, "defaultValue");
return (Criteria) this;
}
public Criteria andCustomDataIsNull() {
addCriterion("custom_data is null");
return (Criteria) this;
@ -807,4 +737,4 @@ public class CustomFieldTemplateExample {
this(condition, value, secondValue, null);
}
}
}
}

View File

@ -20,8 +20,6 @@ public class TestCaseTemplate implements Serializable {
private Boolean global;
private String prerequisite;
private Long createTime;
private Long updateTime;

View File

@ -574,76 +574,6 @@ public class TestCaseTemplateExample {
return (Criteria) this;
}
public Criteria andPrerequisiteIsNull() {
addCriterion("prerequisite is null");
return (Criteria) this;
}
public Criteria andPrerequisiteIsNotNull() {
addCriterion("prerequisite is not null");
return (Criteria) this;
}
public Criteria andPrerequisiteEqualTo(String value) {
addCriterion("prerequisite =", value, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteNotEqualTo(String value) {
addCriterion("prerequisite <>", value, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteGreaterThan(String value) {
addCriterion("prerequisite >", value, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteGreaterThanOrEqualTo(String value) {
addCriterion("prerequisite >=", value, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteLessThan(String value) {
addCriterion("prerequisite <", value, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteLessThanOrEqualTo(String value) {
addCriterion("prerequisite <=", value, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteLike(String value) {
addCriterion("prerequisite like", value, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteNotLike(String value) {
addCriterion("prerequisite not like", value, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteIn(List<String> values) {
addCriterion("prerequisite in", values, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteNotIn(List<String> values) {
addCriterion("prerequisite not in", values, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteBetween(String value1, String value2) {
addCriterion("prerequisite between", value1, value2, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteNotBetween(String value1, String value2) {
addCriterion("prerequisite not between", value1, value2, "prerequisite");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;

View File

@ -9,6 +9,8 @@ import lombok.ToString;
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class TestCaseTemplateWithBLOBs extends TestCaseTemplate implements Serializable {
private String prerequisite;
private String stepDescription;
private String expectedResult;

View File

@ -16,15 +16,21 @@ public interface CustomFieldTemplateMapper {
int insertSelective(CustomFieldTemplate record);
List<CustomFieldTemplate> selectByExampleWithBLOBs(CustomFieldTemplateExample example);
List<CustomFieldTemplate> selectByExample(CustomFieldTemplateExample example);
CustomFieldTemplate selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") CustomFieldTemplate record, @Param("example") CustomFieldTemplateExample example);
int updateByExampleWithBLOBs(@Param("record") CustomFieldTemplate record, @Param("example") CustomFieldTemplateExample example);
int updateByExample(@Param("record") CustomFieldTemplate record, @Param("example") CustomFieldTemplateExample example);
int updateByPrimaryKeySelective(CustomFieldTemplate record);
int updateByPrimaryKeyWithBLOBs(CustomFieldTemplate record);
int updateByPrimaryKey(CustomFieldTemplate record);
}

View File

@ -1,26 +1,28 @@
<?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.CustomFieldTemplateMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.CustomFieldTemplate">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="field_id" jdbcType="VARCHAR" property="fieldId" />
<result column="template_id" jdbcType="VARCHAR" property="templateId" />
<result column="scene" jdbcType="VARCHAR" property="scene" />
<result column="required" jdbcType="BIT" property="required" />
<result column="order" jdbcType="INTEGER" property="order" />
<result column="default_value" jdbcType="VARCHAR" property="defaultValue" />
<result column="custom_data" jdbcType="VARCHAR" property="customData" />
<result column="key" jdbcType="VARCHAR" property="key" />
</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}
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.CustomFieldTemplate">
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="field_id" jdbcType="VARCHAR" property="fieldId"/>
<result column="template_id" jdbcType="VARCHAR" property="templateId"/>
<result column="scene" jdbcType="VARCHAR" property="scene"/>
<result column="required" jdbcType="BIT" property="required"/>
<result column="order" jdbcType="INTEGER" property="order"/>
<result column="custom_data" jdbcType="VARCHAR" property="customData"/>
<result column="key" jdbcType="VARCHAR" property="key"/>
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.CustomFieldTemplate">
<result column="default_value" jdbcType="LONGVARCHAR" property="defaultValue"/>
</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}
@ -70,34 +72,58 @@
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, field_id, template_id, scene, required, `order`, default_value, custom_data,
`key`
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.CustomFieldTemplateExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from custom_field_template
<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 custom_field_template
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from custom_field_template
where id = #{id,jdbcType=VARCHAR}
</delete>
<sql id="Base_Column_List">
id
, field_id, template_id, scene, required, `order`, custom_data, `key`
</sql>
<sql id="Blob_Column_List">
default_value
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.CustomFieldTemplateExample"
resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from custom_field_template
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="io.metersphere.base.domain.CustomFieldTemplateExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from custom_field_template
<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="ResultMapWithBLOBs">
select
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from custom_field_template
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete
from custom_field_template
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.CustomFieldTemplateExample">
delete from custom_field_template
<if test="_parameter != null">
@ -105,14 +131,12 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.CustomFieldTemplate">
insert into custom_field_template (id, field_id, template_id,
scene, required, `order`,
default_value, custom_data, `key`
)
values (#{id,jdbcType=VARCHAR}, #{fieldId,jdbcType=VARCHAR}, #{templateId,jdbcType=VARCHAR},
#{scene,jdbcType=VARCHAR}, #{required,jdbcType=BIT}, #{order,jdbcType=INTEGER},
#{defaultValue,jdbcType=VARCHAR}, #{customData,jdbcType=VARCHAR}, #{key,jdbcType=VARCHAR}
)
insert into custom_field_template (id, field_id, template_id,
scene, required, `order`,
custom_data, `key`, default_value)
values (#{id,jdbcType=VARCHAR}, #{fieldId,jdbcType=VARCHAR}, #{templateId,jdbcType=VARCHAR},
#{scene,jdbcType=VARCHAR}, #{required,jdbcType=BIT}, #{order,jdbcType=INTEGER},
#{customData,jdbcType=VARCHAR}, #{key,jdbcType=VARCHAR}, #{defaultValue,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.CustomFieldTemplate">
insert into custom_field_template
@ -130,20 +154,20 @@
scene,
</if>
<if test="required != null">
required,
</if>
<if test="order != null">
`order`,
</if>
<if test="defaultValue != null">
default_value,
</if>
<if test="customData != null">
custom_data,
</if>
<if test="key != null">
`key`,
required,
</if>
<if test="order != null">
`order`,
</if>
<if test="customData != null">
custom_data,
</if>
<if test="key != null">
`key`,
</if>
<if test="defaultValue != null">
default_value,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -159,20 +183,20 @@
#{scene,jdbcType=VARCHAR},
</if>
<if test="required != null">
#{required,jdbcType=BIT},
</if>
<if test="order != null">
#{order,jdbcType=INTEGER},
</if>
<if test="defaultValue != null">
#{defaultValue,jdbcType=VARCHAR},
</if>
<if test="customData != null">
#{customData,jdbcType=VARCHAR},
</if>
<if test="key != null">
#{key,jdbcType=VARCHAR},
#{required,jdbcType=BIT},
</if>
<if test="order != null">
#{order,jdbcType=INTEGER},
</if>
<if test="customData != null">
#{customData,jdbcType=VARCHAR},
</if>
<if test="key != null">
#{key,jdbcType=VARCHAR},
</if>
<if test="defaultValue != null">
#{defaultValue,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.CustomFieldTemplateExample" resultType="java.lang.Long">
@ -197,34 +221,48 @@
scene = #{record.scene,jdbcType=VARCHAR},
</if>
<if test="record.required != null">
required = #{record.required,jdbcType=BIT},
</if>
<if test="record.order != null">
`order` = #{record.order,jdbcType=INTEGER},
</if>
<if test="record.defaultValue != null">
default_value = #{record.defaultValue,jdbcType=VARCHAR},
</if>
<if test="record.customData != null">
custom_data = #{record.customData,jdbcType=VARCHAR},
</if>
<if test="record.key != null">
`key` = #{record.key,jdbcType=VARCHAR},
required = #{record.required,jdbcType=BIT},
</if>
<if test="record.order != null">
`order` = #{record.order,jdbcType=INTEGER},
</if>
<if test="record.customData != null">
custom_data = #{record.customData,jdbcType=VARCHAR},
</if>
<if test="record.key != null">
`key` = #{record.key,jdbcType=VARCHAR},
</if>
<if test="record.defaultValue != null">
default_value = #{record.defaultValue,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
update custom_field_template
set id = #{record.id,jdbcType=VARCHAR},
field_id = #{record.fieldId,jdbcType=VARCHAR},
template_id = #{record.templateId,jdbcType=VARCHAR},
scene = #{record.scene,jdbcType=VARCHAR},
<update id="updateByExampleWithBLOBs" parameterType="map">
update custom_field_template
set id = #{record.id,jdbcType=VARCHAR},
field_id = #{record.fieldId,jdbcType=VARCHAR},
template_id = #{record.templateId,jdbcType=VARCHAR},
scene = #{record.scene,jdbcType=VARCHAR},
required = #{record.required,jdbcType=BIT},
`order` = #{record.order,jdbcType=INTEGER},
custom_data = #{record.customData,jdbcType=VARCHAR},
`key` = #{record.key,jdbcType=VARCHAR},
default_value = #{record.defaultValue,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
update custom_field_template
set id = #{record.id,jdbcType=VARCHAR},
field_id = #{record.fieldId,jdbcType=VARCHAR},
template_id = #{record.templateId,jdbcType=VARCHAR},
scene = #{record.scene,jdbcType=VARCHAR},
required = #{record.required,jdbcType=BIT},
`order` = #{record.order,jdbcType=INTEGER},
default_value = #{record.defaultValue,jdbcType=VARCHAR},
custom_data = #{record.customData,jdbcType=VARCHAR},
`key` = #{record.key,jdbcType=VARCHAR}
<if test="_parameter != null">
@ -244,33 +282,44 @@
scene = #{scene,jdbcType=VARCHAR},
</if>
<if test="required != null">
required = #{required,jdbcType=BIT},
</if>
<if test="order != null">
`order` = #{order,jdbcType=INTEGER},
</if>
<if test="defaultValue != null">
default_value = #{defaultValue,jdbcType=VARCHAR},
</if>
<if test="customData != null">
custom_data = #{customData,jdbcType=VARCHAR},
</if>
<if test="key != null">
`key` = #{key,jdbcType=VARCHAR},
required = #{required,jdbcType=BIT},
</if>
<if test="order != null">
`order` = #{order,jdbcType=INTEGER},
</if>
<if test="customData != null">
custom_data = #{customData,jdbcType=VARCHAR},
</if>
<if test="key != null">
`key` = #{key,jdbcType=VARCHAR},
</if>
<if test="defaultValue != null">
default_value = #{defaultValue,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.CustomFieldTemplate">
update custom_field_template
set field_id = #{fieldId,jdbcType=VARCHAR},
template_id = #{templateId,jdbcType=VARCHAR},
scene = #{scene,jdbcType=VARCHAR},
required = #{required,jdbcType=BIT},
`order` = #{order,jdbcType=INTEGER},
default_value = #{defaultValue,jdbcType=VARCHAR},
custom_data = #{customData,jdbcType=VARCHAR},
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.CustomFieldTemplate">
update custom_field_template
set field_id = #{fieldId,jdbcType=VARCHAR},
template_id = #{templateId,jdbcType=VARCHAR},
scene = #{scene,jdbcType=VARCHAR},
required = #{required,jdbcType=BIT},
`order` = #{order,jdbcType=INTEGER},
custom_data = #{customData,jdbcType=VARCHAR},
`key` = #{key,jdbcType=VARCHAR},
default_value = #{defaultValue,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.CustomFieldTemplate">
update custom_field_template
set field_id = #{fieldId,jdbcType=VARCHAR},
template_id = #{templateId,jdbcType=VARCHAR},
scene = #{scene,jdbcType=VARCHAR},
required = #{required,jdbcType=BIT},
`order` = #{order,jdbcType=INTEGER},
custom_data = #{customData,jdbcType=VARCHAR},
`key` = #{key,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
</mapper>

View File

@ -9,7 +9,6 @@
<result column="case_name" jdbcType="VARCHAR" property="caseName" />
<result column="system" jdbcType="BIT" property="system" />
<result column="global" jdbcType="BIT" property="global" />
<result column="prerequisite" jdbcType="VARCHAR" property="prerequisite" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="step_model" jdbcType="VARCHAR" property="stepModel" />
@ -17,6 +16,7 @@
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestCaseTemplateWithBLOBs">
<result column="prerequisite" jdbcType="LONGVARCHAR" property="prerequisite"/>
<result column="step_description" jdbcType="LONGVARCHAR" property="stepDescription" />
<result column="expected_result" jdbcType="LONGVARCHAR" property="expectedResult" />
<result column="actual_result" jdbcType="LONGVARCHAR" property="actualResult" />
@ -81,11 +81,13 @@
</where>
</sql>
<sql id="Base_Column_List">
id, `name`, `type`, description, case_name, `system`, `global`, prerequisite, create_time,
update_time, step_model, create_user, project_id
id
, `name`, `type`, description, case_name, `system`, `global`, create_time, update_time,
step_model, create_user, project_id
</sql>
<sql id="Blob_Column_List">
step_description, expected_result, actual_result, steps
prerequisite
, step_description, expected_result, actual_result, steps
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.TestCaseTemplateExample" resultMap="ResultMapWithBLOBs">
select
@ -136,18 +138,18 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseTemplateWithBLOBs">
INSERT INTO test_case_template (id, `name`, `type`,
description, case_name, `system`,
`global`, prerequisite, create_time,
update_time, step_model, create_user,
project_id, step_description, expected_result,
actual_result, steps)
VALUES (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{caseName,jdbcType=VARCHAR}, #{system,jdbcType=BIT},
#{global,jdbcType=BIT}, #{prerequisite,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT}, #{stepModel,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR},
#{projectId,jdbcType=VARCHAR}, #{stepDescription,jdbcType=LONGVARCHAR}, #{expectedResult,jdbcType=LONGVARCHAR},
#{actualResult,jdbcType=LONGVARCHAR}, #{steps,jdbcType=LONGVARCHAR})
insert into test_case_template (id, `name`, `type`,
description, case_name, `system`,
`global`, create_time, update_time,
step_model, create_user, project_id,
prerequisite, step_description,
expected_result, actual_result, steps)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{caseName,jdbcType=VARCHAR}, #{system,jdbcType=BIT},
#{global,jdbcType=BIT}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{stepModel,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR},
#{prerequisite,jdbcType=LONGVARCHAR}, #{stepDescription,jdbcType=LONGVARCHAR},
#{expectedResult,jdbcType=LONGVARCHAR}, #{actualResult,jdbcType=LONGVARCHAR}, #{steps,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseTemplateWithBLOBs">
insert into test_case_template
@ -173,9 +175,6 @@
<if test="global != null">
`global`,
</if>
<if test="prerequisite != null">
prerequisite,
</if>
<if test="createTime != null">
create_time,
</if>
@ -191,6 +190,9 @@
<if test="projectId != null">
project_id,
</if>
<if test="prerequisite != null">
prerequisite,
</if>
<if test="stepDescription != null">
step_description,
</if>
@ -226,9 +228,6 @@
<if test="global != null">
#{global,jdbcType=BIT},
</if>
<if test="prerequisite != null">
#{prerequisite,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
@ -244,6 +243,9 @@
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="prerequisite != null">
#{prerequisite,jdbcType=LONGVARCHAR},
</if>
<if test="stepDescription != null">
#{stepDescription,jdbcType=LONGVARCHAR},
</if>
@ -288,9 +290,6 @@
<if test="record.global != null">
`global` = #{record.global,jdbcType=BIT},
</if>
<if test="record.prerequisite != null">
prerequisite = #{record.prerequisite,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
@ -306,6 +305,9 @@
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.prerequisite != null">
prerequisite = #{record.prerequisite,jdbcType=LONGVARCHAR},
</if>
<if test="record.stepDescription != null">
step_description = #{record.stepDescription,jdbcType=LONGVARCHAR},
</if>
@ -327,21 +329,21 @@
update test_case_template
set id = #{record.id,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
case_name = #{record.caseName,jdbcType=VARCHAR},
`system` = #{record.system,jdbcType=BIT},
`global` = #{record.global,jdbcType=BIT},
prerequisite = #{record.prerequisite,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
step_model = #{record.stepModel,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
step_description = #{record.stepDescription,jdbcType=LONGVARCHAR},
expected_result = #{record.expectedResult,jdbcType=LONGVARCHAR},
actual_result = #{record.actualResult,jdbcType=LONGVARCHAR},
steps = #{record.steps,jdbcType=LONGVARCHAR}
`type` = #{record.type,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
case_name = #{record.caseName,jdbcType=VARCHAR},
`system` = #{record.system,jdbcType=BIT},
`global` = #{record.global,jdbcType=BIT},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
step_model = #{record.stepModel,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
prerequisite = #{record.prerequisite,jdbcType=LONGVARCHAR},
step_description = #{record.stepDescription,jdbcType=LONGVARCHAR},
expected_result = #{record.expectedResult,jdbcType=LONGVARCHAR},
actual_result = #{record.actualResult,jdbcType=LONGVARCHAR},
steps = #{record.steps,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -355,7 +357,6 @@
case_name = #{record.caseName,jdbcType=VARCHAR},
`system` = #{record.system,jdbcType=BIT},
`global` = #{record.global,jdbcType=BIT},
prerequisite = #{record.prerequisite,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
step_model = #{record.stepModel,jdbcType=VARCHAR},
@ -386,9 +387,6 @@
<if test="global != null">
`global` = #{global,jdbcType=BIT},
</if>
<if test="prerequisite != null">
prerequisite = #{prerequisite,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
@ -404,6 +402,9 @@
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="prerequisite != null">
prerequisite = #{prerequisite,jdbcType=LONGVARCHAR},
</if>
<if test="stepDescription != null">
step_description = #{stepDescription,jdbcType=LONGVARCHAR},
</if>
@ -421,22 +422,22 @@
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.TestCaseTemplateWithBLOBs">
update test_case_template
set `name` = #{name,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
case_name = #{caseName,jdbcType=VARCHAR},
`system` = #{system,jdbcType=BIT},
`global` = #{global,jdbcType=BIT},
prerequisite = #{prerequisite,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
step_model = #{stepModel,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR},
step_description = #{stepDescription,jdbcType=LONGVARCHAR},
expected_result = #{expectedResult,jdbcType=LONGVARCHAR},
actual_result = #{actualResult,jdbcType=LONGVARCHAR},
steps = #{steps,jdbcType=LONGVARCHAR}
set `name` = #{name,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
case_name = #{caseName,jdbcType=VARCHAR},
`system` = #{system,jdbcType=BIT},
`global` = #{global,jdbcType=BIT},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
step_model = #{stepModel,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR},
prerequisite = #{prerequisite,jdbcType=LONGVARCHAR},
step_description = #{stepDescription,jdbcType=LONGVARCHAR},
expected_result = #{expectedResult,jdbcType=LONGVARCHAR},
actual_result = #{actualResult,jdbcType=LONGVARCHAR},
steps = #{steps,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestCaseTemplate">
@ -447,7 +448,6 @@
case_name = #{caseName,jdbcType=VARCHAR},
`system` = #{system,jdbcType=BIT},
`global` = #{global,jdbcType=BIT},
prerequisite = #{prerequisite,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
step_model = #{stepModel,jdbcType=VARCHAR},

View File

@ -9,16 +9,19 @@
<el-form :model="form" :rules="rules" label-position="right" size="small" ref="form">
<el-form-item :label="$t('custom_field.field_name')" prop="name" :label-width="labelWidth">
<el-input v-if="isSystem" :disabled="isSystem" :value="$t(systemNameMap[form.name])" autocomplete="off"></el-input>
<el-input v-else v-model="form.name" autocomplete="off"></el-input>
<el-input v-if="isSystem" :disabled="isSystem" :value="$t(systemNameMap[form.name])"
autocomplete="off"></el-input>
<el-input v-else v-model="form.name" autocomplete="off" maxlength="64" show-word-limit></el-input>
</el-form-item>
<el-form-item :label="$t('custom_field.field_remark')" prop="remark" :label-width="labelWidth">
<el-input :autosize="{ minRows: 2, maxRows: 4}" type="textarea" v-model="form.remark"></el-input>
<el-input v-model="form.remark" :autosize="{ minRows: 2, maxRows: 4}" maxlength="255" show-word-limit
type="textarea"></el-input>
</el-form-item>
<el-form-item :label="$t('custom_field.scene')" prop="type" :label-width="labelWidth">
<el-select :disabled="isSystem || isTemplateEdit" filterable v-model="form.scene" :placeholder="$t('custom_field.scene')">
<el-select v-model="form.scene" :disabled="isSystem || isTemplateEdit" :placeholder="$t('custom_field.scene')"
filterable>
<el-option
v-for="item in (form.scene === 'PLAN' ? planSceneOptions : sceneOptions)"
:key="item.value"
@ -44,9 +47,9 @@
:label="$t('custom_field.field_option')"
prop="options" :label-width="labelWidth">
<ms-single-handle-drag
:is-kv="form.scene === 'ISSUE'"
:disable="form.name === '用例等级'"
:data="form.options"/>
:data="form.options"
:disable="form.name === '用例等级'"
:is-kv="form.scene === 'ISSUE'"/>
</el-form-item>
</el-form>
@ -88,8 +91,8 @@ export default {
{required: true, message: this.$t('test_track.case.input_name'), trigger: 'blur'},
{max: 64, message: this.$t('test_track.length_less_than') + '64', trigger: 'blur'}
],
scene: [{required: true, trigger: 'change'}],
type: [{required: true, trigger: 'change'}],
scene: [{required: true, trigger: 'change'}],
type: [{required: true, trigger: 'change'}],
},
visible: false,
url: '',
@ -105,7 +108,7 @@ export default {
},
planSceneOptions() {
let tmp = [...CUSTOM_FIELD_SCENE_OPTION];
tmp.push( {value: 'PLAN',text: i18n.t('workstation.table_name.track_plan')});//
tmp.push({value: 'PLAN', text: i18n.t('workstation.table_name.track_plan')});//
return tmp;
},
showOptions() {
@ -164,7 +167,7 @@ export default {
}
Object.assign(param, this.form);
param.projectId = getCurrentProjectID();
if (['select','multipleSelect','radio','checkbox'].indexOf(param.type) > -1) {
if (['select', 'multipleSelect', 'radio', 'checkbox'].indexOf(param.type) > -1) {
if (param.options.length < 1) {
this.$warning(this.$t('custom_field.option_check'));
return;

View File

@ -1,33 +1,34 @@
<template>
<ms-table
v-loading="result.loading"
:enable-selection="false"
:operators="operators"
:data="tableData"
:screen-height="null"
@refresh="refreshTable"
ref="table">
ref="table"
v-loading="result.loading"
:data="tableData"
:enable-selection="false"
:operators="operators"
:screen-height="null"
@refresh="refreshTable">
<ms-table-column
:label="$t('commons.name')"
prop="name">
:label="$t('commons.name')"
prop="name">
<template v-slot="scope">
<span v-if="scope.row.system">
{{$t(systemNameMap[scope.row.name])}}
{{ $t(systemNameMap[scope.row.name]) }}
</span>
<span v-else>
{{scope.row.name}}
{{ scope.row.name }}
</span>
</template>
</ms-table-column>
<ms-table-column
:label="$t('commons.default')"
min-width="200"
prop="type">
:label="$t('commons.default')"
:show-overflow-tooltip="false"
min-width="200" prop="type">
<template v-slot="scope">
<el-scrollbar>
<custom-filed-component class="default-value-item" :data="scope.row" prop="defaultValue" :is-template-edit="true"/>
<custom-filed-component :data="scope.row" :is-template-edit="true" class="default-value-item"
prop="defaultValue"/>
</el-scrollbar>
</template>
</ms-table-column>
@ -35,31 +36,31 @@
<field-custom-data-table-item :scene="scene"/>
<ms-table-column
:label="$t('api_test.definition.document.table_coloum.is_required')"
width="80"
prop="type">
:label="$t('api_test.definition.document.table_coloum.is_required')"
prop="type"
width="80">
<template v-slot="scope">
<el-checkbox v-model="scope.row.required"/>
</template>
</ms-table-column>
<ms-table-column
:label="$t('custom_field.system_field')"
width="80"
prop="system">
:label="$t('custom_field.system_field')"
prop="system"
width="80">
<template v-slot="scope">
<span v-if="scope.row.system">
{{$t('commons.yes')}}
{{ $t('commons.yes') }}
</span>
<span v-else>
{{$t('commons.no')}}
{{ $t('commons.no') }}
</span>
</template>
</ms-table-column>
<ms-table-column
:label="$t('commons.remark')"
prop="remark">
:label="$t('commons.remark')"
prop="remark">
</ms-table-column>
</ms-table>
@ -83,18 +84,18 @@ export default {
data() {
return {
result: {},
operators: [
{
tip: this.$t('commons.delete'), icon: "el-icon-delete", type: "danger",
exec: this.handleDelete,
isDisable: (row) => {
if (row.name === '用例等级') {
return true;
}
return false;
}
}
],
operators: [
{
tip: this.$t('commons.delete'), icon: "el-icon-delete", type: "danger",
exec: this.handleDelete,
isDisable: (row) => {
if (row.name === '用例等级') {
return true;
}
return false;
}
}
],
};
},
props: {
@ -130,21 +131,21 @@ export default {
let condition = {};
condition.ids = customFieldIds;
this.result = this.$post('custom/field/list',
condition, (response) => {
let data = response.data;
data.forEach(item => {
if (item.id) {
this.templateContainIds.add(item.id);
}
item.fieldId = item.id;
item.id = null;
item.options = JSON.parse(item.options);
if (item.type === 'checkbox') {
item.defaultValue = [];
}
condition, (response) => {
let data = response.data;
data.forEach(item => {
if (item.id) {
this.templateContainIds.add(item.id);
}
item.fieldId = item.id;
item.id = null;
item.options = JSON.parse(item.options);
if (item.type === 'checkbox') {
item.defaultValue = [];
}
});
this.tableData.push(...data);
});
this.tableData.push(...data);
});
}
}
};

View File

@ -183,13 +183,16 @@ export default {
.el-select {
width: 100%;
}
.el-date-editor.el-input {
width: 100%;
}
.custom-with >>> .el-input__inner{
.custom-with >>> .el-input__inner {
height: 32px;
}
>>> .el-input--suffix .el-input__inner{
>>> .el-input--suffix .el-input__inner {
height: 32px;
}
</style>

View File

@ -19,13 +19,15 @@
<el-form :model="form" :rules="rules" label-position="right" label-width="80px" size="small" ref="form">
<el-form-item :label="$t('commons.name')" prop="name" :label-width="labelWidth">
<el-input :disabled="isSystem" v-model="form.name" autocomplete="off"></el-input>
<el-input v-model="form.name" :disabled="isSystem" autocomplete="off" maxlength="64"
show-word-limit></el-input>
</el-form-item>
<slot name="base"></slot>
<el-form-item :label="$t('commons.description')" prop="description" :label-width="labelWidth">
<el-input :autosize="{ minRows: 2, maxRows: 4}" type="textarea" v-model="form.description"></el-input>
<el-input v-model="form.description" :autosize="{ minRows: 2, maxRows: 4}" maxlength="255" show-word-limit
type="textarea"></el-input>
</el-form-item>
<ms-form-divider :title="$t('custom_field.template_setting')"/>
@ -33,8 +35,11 @@
<slot></slot>
<el-form-item :label="$t('table.selected_fields')" class="filed-list" :label-width="labelWidth">
<el-button type="primary" @click="relateField">{{$t('custom_field.add_field')}}</el-button>
<el-button type="primary" @click="addField" plain>{{ $t('custom_field.custom_field_setting') }}</el-button>
<el-button type="primary" @click="relateField">{{ $t('custom_field.add_field') }}</el-button>
<el-button plain type="primary" @click="addField">{{
$t('custom_field.custom_field_setting')
}}
</el-button>
</el-form-item>
<el-form-item :label-width="labelWidth">
@ -57,7 +62,8 @@
:scene="scene"
ref="customFieldRelateList"/>
<custom-field-edit :label-width="labelWidth" :scene="scene" @save="handleCustomFieldAdd" ref="customFieldEdit"/>
<custom-field-edit ref="customFieldEdit" :label-width="labelWidth" :scene="scene"
@save="handleCustomFieldAdd"/>
</el-scrollbar>
</el-main>
@ -95,17 +101,17 @@ export default {
};
},
props: {
visible:{
visible: {
type: Boolean,
default() {
return false;
}
},
scene: String,
url:String,
url: String,
rules: Object,
labelWidth: String,
form:{
form: {
type: Object,
default() {
return {};
@ -211,20 +217,20 @@ export default {
scene: this.scene
};
this.result = this.$post('custom/field/default', condition, (response) => {
let data = response.data;
data.forEach(item => {
if (item.id) {
this.templateContainIds.add(item.id);
}
item.fieldId = item.id;
item.id = null;
item.options = JSON.parse(item.options);
if (item.type === 'checkbox') {
item.defaultValue = [];
}
});
this.relateFields.push(...data);
let data = response.data;
data.forEach(item => {
if (item.id) {
this.templateContainIds.add(item.id);
}
item.fieldId = item.id;
item.id = null;
item.options = JSON.parse(item.options);
if (item.type === 'checkbox') {
item.defaultValue = [];
}
});
this.relateFields.push(...data);
});
}
}
};

View File

@ -11,8 +11,11 @@
ref="fieldTemplateEdit">
<template v-slot:base>
<el-form-item :label="$t('api_test.home_page.failed_case_list.table_coloum.case_type')" prop="type" :label-width="labelWidth">
<el-select :disabled="isSystem" filterable v-model="form.type" :placeholder="$t('api_test.home_page.failed_case_list.table_coloum.case_type')">
<el-form-item :label="$t('api_test.home_page.failed_case_list.table_coloum.case_type')" :label-width="labelWidth"
prop="type">
<el-select v-model="form.type" :disabled="isSystem"
:placeholder="$t('api_test.home_page.failed_case_list.table_coloum.case_type')"
filterable>
<el-option
v-for="item in caseTypeOption"
:key="item.value"
@ -25,16 +28,22 @@
<template v-slot:default>
<el-form-item :label="$t('test_track.case.name')" prop="caseName" :label-width="labelWidth">
<el-input v-model="form.caseName" autocomplete="off"></el-input>
<el-input v-model="form.caseName" autocomplete="off" maxlength="64" show-word-limit></el-input>
</el-form-item>
<form-rich-text-item :label-width="labelWidth" :title="$t('test_track.case.prerequisite')" :data="form" prop="prerequisite"/>
<form-rich-text-item :data="form" :label-width="labelWidth" :title="$t('test_track.case.prerequisite')"
prop="prerequisite"/>
<step-change-item :form="form"/>
<test-case-step-item :label-width="labelWidth" v-if="form.stepModel === 'STEP'" :form="form"/>
<form-rich-text-item :label-width="labelWidth" v-if="form.stepModel === 'TEXT'" :title="$t('test_track.case.step_desc')" :data="form" prop="stepDescription"/>
<form-rich-text-item :label-width="labelWidth" v-if="form.stepModel === 'TEXT'" :title="$t('test_track.case.expected_results')" :data="form" prop="expectedResult"/>
<form-rich-text-item :label-width="labelWidth" v-if="form.stepModel === 'TEXT'" :title="$t('test_track.plan_view.actual_result')" :data="form" prop="actualResult"/>
<form-rich-text-item v-if="form.stepModel === 'TEXT'" :data="form"
:label-width="labelWidth" :title="$t('test_track.case.step_desc')" prop="stepDescription"/>
<form-rich-text-item v-if="form.stepModel === 'TEXT'" :data="form"
:label-width="labelWidth" :title="$t('test_track.case.expected_results')"
prop="expectedResult"/>
<form-rich-text-item v-if="form.stepModel === 'TEXT'" :data="form"
:label-width="labelWidth" :title="$t('test_track.plan_view.actual_result')"
prop="actualResult"/>
</template>
</field-template-edit>
@ -91,7 +100,7 @@ export default {
{required: true, message: this.$t('test_track.case.input_name'), trigger: 'blur'},
{max: 64, message: this.$t('test_track.length_less_than') + '64', trigger: 'blur'}
],
type: [{required: true, trigger: 'change'}],
type: [{required: true, trigger: 'change'}],
},
result: {},
url: '',

View File

@ -1,11 +1,14 @@
<template>
<el-row type="flex" class="head-bar">
<el-col :span="12">
<el-col :span="18">
<span class="title">{{ template[prop] }}</span>
</el-col>
<el-col :span="12" class="head-right">
<el-col :span="6" class="head-right">
<el-button plain size="mini" @click="handleCancel">{{ $t('test_track.return') }}</el-button>
<el-button v-prevent-re-click type="primary" size="mini" @click="handleSave">{{ $t('test_track.save') }}</el-button>
<el-button v-prevent-re-click size="mini" type="primary" @click="handleSave">{{
$t('test_track.save')
}}
</el-button>
</el-col>
</el-row>