refactor(项目管理): 优化字段选项排序及部分页面展示问题

This commit is contained in:
song-cc-rock 2024-03-29 14:25:14 +08:00 committed by Craftsman
parent 46e3a37a77
commit 5b633804b2
21 changed files with 109 additions and 91 deletions

View File

@ -35,7 +35,7 @@ public class CustomFieldOption implements Serializable {
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{custom_field_option.pos.not_blank}", groups = {Created.class}) @NotNull(message = "{custom_field_option.pos.not_blank}", groups = {Created.class})
private Long pos; private Integer pos;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -44,7 +44,7 @@ public class CustomFieldOption implements Serializable {
value("value", "value", "VARCHAR", true), value("value", "value", "VARCHAR", true),
text("text", "text", "VARCHAR", true), text("text", "text", "VARCHAR", true),
internal("internal", "internal", "BIT", false), internal("internal", "internal", "BIT", false),
pos("pos", "pos", "BIGINT", false); pos("pos", "pos", "INTEGER", false);
private static final String BEGINNING_DELIMITER = "`"; private static final String BEGINNING_DELIMITER = "`";

View File

@ -384,52 +384,52 @@ public class CustomFieldOptionExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosEqualTo(Long value) { public Criteria andPosEqualTo(Integer value) {
addCriterion("pos =", value, "pos"); addCriterion("pos =", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosNotEqualTo(Long value) { public Criteria andPosNotEqualTo(Integer value) {
addCriterion("pos <>", value, "pos"); addCriterion("pos <>", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosGreaterThan(Long value) { public Criteria andPosGreaterThan(Integer value) {
addCriterion("pos >", value, "pos"); addCriterion("pos >", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosGreaterThanOrEqualTo(Long value) { public Criteria andPosGreaterThanOrEqualTo(Integer value) {
addCriterion("pos >=", value, "pos"); addCriterion("pos >=", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosLessThan(Long value) { public Criteria andPosLessThan(Integer value) {
addCriterion("pos <", value, "pos"); addCriterion("pos <", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosLessThanOrEqualTo(Long value) { public Criteria andPosLessThanOrEqualTo(Integer value) {
addCriterion("pos <=", value, "pos"); addCriterion("pos <=", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosIn(List<Long> values) { public Criteria andPosIn(List<Integer> values) {
addCriterion("pos in", values, "pos"); addCriterion("pos in", values, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosNotIn(List<Long> values) { public Criteria andPosNotIn(List<Integer> values) {
addCriterion("pos not in", values, "pos"); addCriterion("pos not in", values, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosBetween(Long value1, Long value2) { public Criteria andPosBetween(Integer value1, Integer value2) {
addCriterion("pos between", value1, value2, "pos"); addCriterion("pos between", value1, value2, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosNotBetween(Long value1, Long value2) { public Criteria andPosNotBetween(Integer value1, Integer value2) {
addCriterion("pos not between", value1, value2, "pos"); addCriterion("pos not between", value1, value2, "pos");
return (Criteria) this; return (Criteria) this;
} }

View File

@ -6,7 +6,7 @@
<id column="value" jdbcType="VARCHAR" property="value" /> <id column="value" jdbcType="VARCHAR" property="value" />
<result column="text" jdbcType="VARCHAR" property="text" /> <result column="text" jdbcType="VARCHAR" property="text" />
<result column="internal" jdbcType="BIT" property="internal" /> <result column="internal" jdbcType="BIT" property="internal" />
<result column="pos" jdbcType="BIGINT" property="pos" /> <result column="pos" jdbcType="INTEGER" property="pos" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -105,7 +105,7 @@
insert into custom_field_option (field_id, `value`, `text`, insert into custom_field_option (field_id, `value`, `text`,
internal, pos) internal, pos)
values (#{fieldId,jdbcType=VARCHAR}, #{value,jdbcType=VARCHAR}, #{text,jdbcType=VARCHAR}, values (#{fieldId,jdbcType=VARCHAR}, #{value,jdbcType=VARCHAR}, #{text,jdbcType=VARCHAR},
#{internal,jdbcType=BIT}, #{pos,jdbcType=BIGINT}) #{internal,jdbcType=BIT}, #{pos,jdbcType=INTEGER})
</insert> </insert>
<insert id="insertSelective" parameterType="io.metersphere.system.domain.CustomFieldOption"> <insert id="insertSelective" parameterType="io.metersphere.system.domain.CustomFieldOption">
insert into custom_field_option insert into custom_field_option
@ -140,7 +140,7 @@
#{internal,jdbcType=BIT}, #{internal,jdbcType=BIT},
</if> </if>
<if test="pos != null"> <if test="pos != null">
#{pos,jdbcType=BIGINT}, #{pos,jdbcType=INTEGER},
</if> </if>
</trim> </trim>
</insert> </insert>
@ -166,7 +166,7 @@
internal = #{record.internal,jdbcType=BIT}, internal = #{record.internal,jdbcType=BIT},
</if> </if>
<if test="record.pos != null"> <if test="record.pos != null">
pos = #{record.pos,jdbcType=BIGINT}, pos = #{record.pos,jdbcType=INTEGER},
</if> </if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
@ -179,7 +179,7 @@
`value` = #{record.value,jdbcType=VARCHAR}, `value` = #{record.value,jdbcType=VARCHAR},
`text` = #{record.text,jdbcType=VARCHAR}, `text` = #{record.text,jdbcType=VARCHAR},
internal = #{record.internal,jdbcType=BIT}, internal = #{record.internal,jdbcType=BIT},
pos = #{record.pos,jdbcType=BIGINT} pos = #{record.pos,jdbcType=INTEGER}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -194,7 +194,7 @@
internal = #{internal,jdbcType=BIT}, internal = #{internal,jdbcType=BIT},
</if> </if>
<if test="pos != null"> <if test="pos != null">
pos = #{pos,jdbcType=BIGINT}, pos = #{pos,jdbcType=INTEGER},
</if> </if>
</set> </set>
where field_id = #{fieldId,jdbcType=VARCHAR} where field_id = #{fieldId,jdbcType=VARCHAR}
@ -204,7 +204,7 @@
update custom_field_option update custom_field_option
set `text` = #{text,jdbcType=VARCHAR}, set `text` = #{text,jdbcType=VARCHAR},
internal = #{internal,jdbcType=BIT}, internal = #{internal,jdbcType=BIT},
pos = #{pos,jdbcType=BIGINT} pos = #{pos,jdbcType=INTEGER}
where field_id = #{fieldId,jdbcType=VARCHAR} where field_id = #{fieldId,jdbcType=VARCHAR}
and `value` = #{value,jdbcType=VARCHAR} and `value` = #{value,jdbcType=VARCHAR}
</update> </update>
@ -214,7 +214,7 @@
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.fieldId,jdbcType=VARCHAR}, #{item.value,jdbcType=VARCHAR}, #{item.text,jdbcType=VARCHAR}, (#{item.fieldId,jdbcType=VARCHAR}, #{item.value,jdbcType=VARCHAR}, #{item.text,jdbcType=VARCHAR},
#{item.internal,jdbcType=BIT}, #{item.pos,jdbcType=BIGINT}) #{item.internal,jdbcType=BIT}, #{item.pos,jdbcType=INTEGER})
</foreach> </foreach>
</insert> </insert>
<insert id="batchInsertSelective" parameterType="map"> <insert id="batchInsertSelective" parameterType="map">
@ -240,7 +240,7 @@
#{item.internal,jdbcType=BIT} #{item.internal,jdbcType=BIT}
</if> </if>
<if test="'pos'.toString() == column.value"> <if test="'pos'.toString() == column.value">
#{item.pos,jdbcType=BIGINT} #{item.pos,jdbcType=INTEGER}
</if> </if>
</foreach> </foreach>
) )

View File

@ -373,7 +373,7 @@ CREATE TABLE IF NOT EXISTS custom_field_option(
`value` VARCHAR(50) NOT NULL COMMENT '选项值' , `value` VARCHAR(50) NOT NULL COMMENT '选项值' ,
`text` VARCHAR(255) NOT NULL COMMENT '选项值名称' , `text` VARCHAR(255) NOT NULL COMMENT '选项值名称' ,
`internal` BIT NOT NULL DEFAULT 0 COMMENT '是否内置' , `internal` BIT NOT NULL DEFAULT 0 COMMENT '是否内置' ,
`pos` BIGINT NOT NULL COMMENT '自定义排序,间隔5000' , `pos` INT NOT NULL COMMENT '自定义排序,间隔1' ,
PRIMARY KEY (field_id,value) PRIMARY KEY (field_id,value)
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4

View File

@ -274,17 +274,17 @@ INSERT INTO test_resource_pool_blob (id, configuration) VALUES ((select id from
INSERT INTO project_test_resource_pool (project_id, test_resource_pool_id) VALUES ('100001100001', (SELECT id FROM test_resource_pool WHERE name = '默认资源池')); INSERT INTO project_test_resource_pool (project_id, test_resource_pool_id) VALUES ('100001100001', (SELECT id FROM test_resource_pool WHERE name = '默认资源池'));
-- 初始化组织功能用例字段 -- 初始化组织功能用例字段
INSERT INTO custom_field(id, name, scene, `type`, remark, internal, scope_type, create_time, update_time, create_user, scope_id) VALUES(UUID_SHORT(), 'functional_priority', 'FUNCTIONAL', 'SELECT', '', 1, 'ORGANIZATION', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', '100001'); INSERT INTO custom_field(id, name, scene, `type`, remark, internal, scope_type, create_time, update_time, create_user, scope_id) VALUES(UUID_SHORT(), 'functional_priority', 'FUNCTIONAL', 'SELECT', '', 1, 'ORGANIZATION', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', '100001');
INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'functional_priority'), 'P0', 'P0', 1, 5000); INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'functional_priority'), 'P0', 'P0', 1, 1);
INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'functional_priority'), 'P1', 'P1', 1, 10000); INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'functional_priority'), 'P1', 'P1', 1, 2);
INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'functional_priority'), 'P2', 'P2', 1, 15000); INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'functional_priority'), 'P2', 'P2', 1, 3);
INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'functional_priority'), 'P3', 'P3', 1, 20000); INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'functional_priority'), 'P3', 'P3', 1, 4);
-- 初始化组织缺陷严重程度 -- 初始化组织缺陷严重程度
INSERT INTO custom_field(id, name, scene, `type`, remark, internal, scope_type, create_time, update_time, create_user, scope_id) VALUES(UUID_SHORT(), 'bug_degree', 'BUG', 'SELECT', '', 1, 'ORGANIZATION', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', '100001'); INSERT INTO custom_field(id, name, scene, `type`, remark, internal, scope_type, create_time, update_time, create_user, scope_id) VALUES(UUID_SHORT(), 'bug_degree', 'BUG', 'SELECT', '', 1, 'ORGANIZATION', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', '100001');
INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'bug_degree'), UUID_SHORT(), '提示', 1, 5000); INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'bug_degree'), UUID_SHORT(), '提示', 1, 1);
INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'bug_degree'), UUID_SHORT(), '一般', 1, 10000); INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'bug_degree'), UUID_SHORT(), '一般', 1, 2);
INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'bug_degree'), UUID_SHORT(), '严重', 1, 15000); INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'bug_degree'), UUID_SHORT(), '严重', 1, 3);
INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'bug_degree'), UUID_SHORT(), '致命', 1, 20000); INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'bug_degree'), UUID_SHORT(), '致命', 1, 4);
-- 初始化组织功能用例默认模板, 缺陷默认模板 -- 初始化组织功能用例默认模板, 缺陷默认模板
INSERT INTO template (id,name,remark,internal,update_time,create_time,create_user,scope_type,scope_id,enable_third_part, scene) VALUES (UUID_SHORT(), 'functional_default', '', 1, UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', 'ORGANIZATION', '100001', 0, 'FUNCTIONAL'); INSERT INTO template (id,name,remark,internal,update_time,create_time,create_user,scope_type,scope_id,enable_third_part, scene) VALUES (UUID_SHORT(), 'functional_default', '', 1, UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', 'ORGANIZATION', '100001', 0, 'FUNCTIONAL');
@ -299,17 +299,17 @@ INSERT INTO project_version (id, project_id, name, description, status, latest,
-- 初始化项目功能用例字段 -- 初始化项目功能用例字段
INSERT INTO custom_field(id, name, scene, `type`, remark, internal, scope_type, create_time, update_time, create_user, scope_id, ref_id) VALUES(UUID_SHORT(), 'functional_priority', 'FUNCTIONAL', 'SELECT', '', 1, 'PROJECT', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', '100001100001', (SELECT id FROM (SELECT * FROM custom_field) t where name = 'functional_priority')); INSERT INTO custom_field(id, name, scene, `type`, remark, internal, scope_type, create_time, update_time, create_user, scope_id, ref_id) VALUES(UUID_SHORT(), 'functional_priority', 'FUNCTIONAL', 'SELECT', '', 1, 'PROJECT', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', '100001100001', (SELECT id FROM (SELECT * FROM custom_field) t where name = 'functional_priority'));
INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'functional_priority' and scope_id = '100001100001'), 'P0', 'P0', 1, 5000); INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'functional_priority' and scope_id = '100001100001'), 'P0', 'P0', 1, 1);
INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'functional_priority' and scope_id = '100001100001'), 'P1', 'P1', 1, 10000); INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'functional_priority' and scope_id = '100001100001'), 'P1', 'P1', 1, 2);
INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'functional_priority' and scope_id = '100001100001'), 'P2', 'P2', 1, 15000); INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'functional_priority' and scope_id = '100001100001'), 'P2', 'P2', 1, 3);
INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'functional_priority' and scope_id = '100001100001'), 'P3', 'P3', 1, 20000); INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'functional_priority' and scope_id = '100001100001'), 'P3', 'P3', 1, 4);
-- 初始化项目缺陷严重程度 -- 初始化项目缺陷严重程度
INSERT INTO custom_field(id, name, scene, `type`, remark, internal, scope_type, create_time, update_time, create_user, scope_id, ref_id) VALUES(UUID_SHORT(), 'bug_degree', 'BUG', 'SELECT', '', 1, 'PROJECT', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', '100001100001', (SELECT id FROM (SELECT * FROM custom_field) t where name = 'bug_degree')); INSERT INTO custom_field(id, name, scene, `type`, remark, internal, scope_type, create_time, update_time, create_user, scope_id, ref_id) VALUES(UUID_SHORT(), 'bug_degree', 'BUG', 'SELECT', '', 1, 'PROJECT', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', '100001100001', (SELECT id FROM (SELECT * FROM custom_field) t where name = 'bug_degree'));
INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'bug_degree' and scope_id = '100001100001'), UUID_SHORT(), '提示', 1, 5000); INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'bug_degree' and scope_id = '100001100001'), UUID_SHORT(), '提示', 1, 1);
INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'bug_degree' and scope_id = '100001100001'), UUID_SHORT(), '一般', 1, 10000); INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'bug_degree' and scope_id = '100001100001'), UUID_SHORT(), '一般', 1, 2);
INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'bug_degree' and scope_id = '100001100001'), UUID_SHORT(), '严重', 1, 15000); INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'bug_degree' and scope_id = '100001100001'), UUID_SHORT(), '严重', 1, 3);
INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'bug_degree' and scope_id = '100001100001'), UUID_SHORT(), '致命', 1, 20000); INSERT INTO custom_field_option (field_id,value,`text`,internal, pos) VALUES ((select id from custom_field where name = 'bug_degree' and scope_id = '100001100001'), UUID_SHORT(), '致命', 1, 4);
-- 初始化项目功能用例默认模板, 缺陷默认模板 -- 初始化项目功能用例默认模板, 缺陷默认模板
INSERT INTO template (id,name,remark,internal,update_time,create_time,create_user,scope_type,scope_id,enable_third_part, scene, ref_id) VALUES (UUID_SHORT(), 'functional_default', '', 1, UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', 'PROJECT', '100001100001', 0, 'FUNCTIONAL', (SELECT id FROM (SELECT * FROM template) t where name = 'functional_default')); INSERT INTO template (id,name,remark,internal,update_time,create_time,create_user,scope_type,scope_id,enable_third_part, scene, ref_id) VALUES (UUID_SHORT(), 'functional_default', '', 1, UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', 'PROJECT', '100001100001', 0, 'FUNCTIONAL', (SELECT id FROM (SELECT * FROM template) t where name = 'functional_default'));

View File

@ -92,7 +92,7 @@ public class ProjectCustomFieldControllerTests extends BaseTest {
CustomFieldOptionRequest customFieldOptionRequest = new CustomFieldOptionRequest(); CustomFieldOptionRequest customFieldOptionRequest = new CustomFieldOptionRequest();
customFieldOptionRequest.setValue("1111"); customFieldOptionRequest.setValue("1111");
customFieldOptionRequest.setText("test"); customFieldOptionRequest.setText("test");
customFieldOptionRequest.setPos(5000L); customFieldOptionRequest.setPos(1);
request.setEnableOptionKey(true); request.setEnableOptionKey(true);
List<CustomFieldOptionRequest> optionRequests = Arrays.asList(customFieldOptionRequest); List<CustomFieldOptionRequest> optionRequests = Arrays.asList(customFieldOptionRequest);
request.setOptions(optionRequests); request.setOptions(optionRequests);
@ -166,7 +166,7 @@ public class ProjectCustomFieldControllerTests extends BaseTest {
CustomFieldOptionRequest customFieldOptionRequest = new CustomFieldOptionRequest(); CustomFieldOptionRequest customFieldOptionRequest = new CustomFieldOptionRequest();
customFieldOptionRequest.setValue("11112"); customFieldOptionRequest.setValue("11112");
customFieldOptionRequest.setText("test1"); customFieldOptionRequest.setText("test1");
customFieldOptionRequest.setPos(5000L); customFieldOptionRequest.setPos(1);
List<CustomFieldOptionRequest> optionRequests = Arrays.asList(customFieldOptionRequest); List<CustomFieldOptionRequest> optionRequests = Arrays.asList(customFieldOptionRequest);
request.setOptions(optionRequests); request.setOptions(optionRequests);
this.requestPostWithOk(DEFAULT_UPDATE, request); this.requestPostWithOk(DEFAULT_UPDATE, request);

View File

@ -18,10 +18,10 @@ public enum DefaultBugCustomField {
*/ */
DEGREE("bug_degree", CustomFieldType.SELECT, DEGREE("bug_degree", CustomFieldType.SELECT,
Arrays.asList( Arrays.asList(
getNewOption(IDGenerator.nextStr(), "提示", 5000L), getNewOption(IDGenerator.nextStr(), "提示", 1),
getNewOption(IDGenerator.nextStr(), "一般", 10000L), getNewOption(IDGenerator.nextStr(), "一般", 2),
getNewOption(IDGenerator.nextStr(), "严重", 15000L), getNewOption(IDGenerator.nextStr(), "严重", 3),
getNewOption(IDGenerator.nextStr(), "致命", 20000L) getNewOption(IDGenerator.nextStr(), "致命", 4)
) )
); );
@ -47,7 +47,7 @@ public enum DefaultBugCustomField {
return options; return options;
} }
private static CustomFieldOption getNewOption(String value, String text, Long pos) { private static CustomFieldOption getNewOption(String value, String text, Integer pos) {
CustomFieldOption customFieldOption = new CustomFieldOption(); CustomFieldOption customFieldOption = new CustomFieldOption();
customFieldOption.setValue(value); customFieldOption.setValue(value);
customFieldOption.setText(text); customFieldOption.setText(text);

View File

@ -14,10 +14,10 @@ public enum DefaultFunctionalCustomField {
PRIORITY("functional_priority", CustomFieldType.SELECT, PRIORITY("functional_priority", CustomFieldType.SELECT,
Arrays.asList( Arrays.asList(
getNewOption("P0", "P0", 5000L), getNewOption("P0", "P0", 1),
getNewOption("P1", "P1", 10000L), getNewOption("P1", "P1", 2),
getNewOption("P2", "P2", 15000L), getNewOption("P2", "P2", 3),
getNewOption("P3", "P3", 20000L) getNewOption("P3", "P3", 4)
) )
); );
@ -43,7 +43,7 @@ public enum DefaultFunctionalCustomField {
return options; return options;
} }
private static CustomFieldOption getNewOption(String value, String text, Long pos) { private static CustomFieldOption getNewOption(String value, String text, Integer pos) {
CustomFieldOption customFieldOption = new CustomFieldOption(); CustomFieldOption customFieldOption = new CustomFieldOption();
customFieldOption.setValue(value); customFieldOption.setValue(value);
customFieldOption.setText(text); customFieldOption.setText(text);

View File

@ -22,5 +22,5 @@ public class CustomFieldOptionRequest {
@Schema(title = "选项值顺序", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "选项值顺序", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{custom_field_option.pos.not_blank}", groups = {Created.class}) @NotNull(message = "{custom_field_option.pos.not_blank}", groups = {Created.class})
private Long pos; private Integer pos;
} }

View File

@ -48,7 +48,7 @@ public class BaseCustomFieldTestService {
CustomFieldOptionRequest customFieldOptionRequest = new CustomFieldOptionRequest(); CustomFieldOptionRequest customFieldOptionRequest = new CustomFieldOptionRequest();
customFieldOptionRequest.setValue(OPTION_VALUE); customFieldOptionRequest.setValue(OPTION_VALUE);
customFieldOptionRequest.setText("test"); customFieldOptionRequest.setText("test");
customFieldOptionRequest.setPos(5000L); customFieldOptionRequest.setPos(1);
List<CustomFieldOptionRequest> optionRequests = Arrays.asList(customFieldOptionRequest); List<CustomFieldOptionRequest> optionRequests = Arrays.asList(customFieldOptionRequest);
CustomField customField = new CustomField(); CustomField customField = new CustomField();
customField.setType(customFieldType.name()); customField.setType(customFieldType.name());

View File

@ -95,7 +95,7 @@ public class OrganizationCustomFieldControllerTests extends BaseTest {
CustomFieldOptionRequest customFieldOptionRequest = new CustomFieldOptionRequest(); CustomFieldOptionRequest customFieldOptionRequest = new CustomFieldOptionRequest();
customFieldOptionRequest.setValue("1111"); customFieldOptionRequest.setValue("1111");
customFieldOptionRequest.setText("test"); customFieldOptionRequest.setText("test");
customFieldOptionRequest.setPos(5000L); customFieldOptionRequest.setPos(1);
List<CustomFieldOptionRequest> optionRequests = Arrays.asList(customFieldOptionRequest); List<CustomFieldOptionRequest> optionRequests = Arrays.asList(customFieldOptionRequest);
request.setOptions(optionRequests); request.setOptions(optionRequests);
@ -173,7 +173,7 @@ public class OrganizationCustomFieldControllerTests extends BaseTest {
CustomFieldOptionRequest customFieldOptionRequest = new CustomFieldOptionRequest(); CustomFieldOptionRequest customFieldOptionRequest = new CustomFieldOptionRequest();
customFieldOptionRequest.setValue("11112"); customFieldOptionRequest.setValue("11112");
customFieldOptionRequest.setText("test1"); customFieldOptionRequest.setText("test1");
customFieldOptionRequest.setPos(5000L); customFieldOptionRequest.setPos(1);
List<CustomFieldOptionRequest> optionRequests = Arrays.asList(customFieldOptionRequest); List<CustomFieldOptionRequest> optionRequests = Arrays.asList(customFieldOptionRequest);
request.setOptions(optionRequests); request.setOptions(optionRequests);
this.requestPostWithOk(DEFAULT_UPDATE, request); this.requestPostWithOk(DEFAULT_UPDATE, request);

View File

@ -561,11 +561,11 @@ public class SystemProjectControllerTests extends BaseTest {
CustomFieldOptionRequest customFieldOptionRequest1 = new CustomFieldOptionRequest(); CustomFieldOptionRequest customFieldOptionRequest1 = new CustomFieldOptionRequest();
customFieldOptionRequest1.setValue("1"); customFieldOptionRequest1.setValue("1");
customFieldOptionRequest1.setText("test1"); customFieldOptionRequest1.setText("test1");
customFieldOptionRequest1.setPos(5000L); customFieldOptionRequest1.setPos(1);
CustomFieldOptionRequest customFieldOptionRequest2 = new CustomFieldOptionRequest(); CustomFieldOptionRequest customFieldOptionRequest2 = new CustomFieldOptionRequest();
customFieldOptionRequest2.setValue("2"); customFieldOptionRequest2.setValue("2");
customFieldOptionRequest2.setText("test2"); customFieldOptionRequest2.setText("test2");
customFieldOptionRequest2.setPos(10000L); customFieldOptionRequest2.setPos(2);
customField.setCreateUser("admin"); customField.setCreateUser("admin");
List<CustomFieldOptionRequest> optionRequests = Arrays.asList(customFieldOptionRequest1, customFieldOptionRequest2); List<CustomFieldOptionRequest> optionRequests = Arrays.asList(customFieldOptionRequest1, customFieldOptionRequest2);
organizationCustomFieldService.add(customField, optionRequests); organizationCustomFieldService.add(customField, optionRequests);

View File

@ -21,7 +21,13 @@
size="16" size="16"
/> />
</a-tooltip> </a-tooltip>
<MsTag theme="light" :type="tagMap[config.status].type" size="small" class="px-[4px]"> <MsTag
theme="light"
:type="tagMap[config.status].type"
:self-style="tagMap[config.status].style"
size="small"
class="px-[4px]"
>
{{ tagMap[config.status].text }} {{ tagMap[config.status].text }}
</MsTag> </MsTag>
</div> </div>
@ -59,19 +65,32 @@
interface TagMapItem { interface TagMapItem {
type: TagType; type: TagType;
text: string; text: string;
style: Record<string, any>;
} }
const tagMap: Record<Status, TagMapItem> = { const tagMap: Record<Status, TagMapItem> = {
0: { 0: {
type: 'default', type: 'default',
text: t('ms.personal.unValid'), text: t('ms.personal.unValid'),
style: {
backgroundColor: '',
color: '',
},
}, },
1: { 1: {
type: 'success', type: 'success',
text: t('ms.personal.validPass'), text: t('ms.personal.validPass'),
style: {
backgroundColor: 'rgb(var(--success-2))',
color: 'rgb(var(--success-6))',
},
}, },
2: { 2: {
type: 'danger', type: 'danger',
text: t('ms.personal.validFail'), text: t('ms.personal.validFail'),
style: {
backgroundColor: 'rgb(var(--danger-2))',
color: 'rgb(var(--danger-6))',
},
}, },
}; };
@ -164,27 +183,31 @@
} }
async function validate(config: any) { async function validate(config: any) {
try { config.formModel.validate(async (valid: any) => {
config.validateLoading = true; if (valid === true) {
const configForms: Record<string, any> = {}; try {
Object.keys(dynamicForm.value).forEach((key) => { config.validateLoading = true;
configForms[key] = { const configForms: Record<string, any> = {};
...dynamicForm.value[key].formModel.form, Object.keys(dynamicForm.value).forEach((key) => {
}; configForms[key] = {
}); ...dynamicForm.value[key].formModel.form,
await validatePlatform(config.key, currentOrg.value, config.formModel.form); };
await savePlatform({ });
[currentOrg.value]: configForms, await validatePlatform(config.key, currentOrg.value, config.formModel.form);
}); await savePlatform({
Message.success(t('ms.personal.validPass')); [currentOrg.value]: configForms,
config.status = 1; });
} catch (error) { Message.success(t('ms.personal.validPass'));
// eslint-disable-next-line no-console config.status = 1;
console.log(error); } catch (error) {
config.status = 2; // eslint-disable-next-line no-console
} finally { console.log(error);
config.validateLoading = false; config.status = 2;
} } finally {
config.validateLoading = false;
}
}
});
} }
async function handleOrgChange() { async function handleOrgChange() {

View File

@ -2,7 +2,7 @@
<MsCard simple> <MsCard simple>
<MsAdvanceFilter <MsAdvanceFilter
v-model:keyword="keyword" v-model:keyword="keyword"
:search-placeholder="t('caseManagement.featureCase.searchByIdAndName')" :search-placeholder="t('caseManagement.featureCase.searchByNameAndId')"
:filter-config-list="filterConfigList" :filter-config-list="filterConfigList"
:row-count="filterRowCount" :row-count="filterRowCount"
@keyword-search="fetchData" @keyword-search="fetchData"

View File

@ -336,7 +336,6 @@
scroll: { x: scrollWidth.value }, scroll: { x: scrollWidth.value },
selectable: true, selectable: true,
showSetting: true, showSetting: true,
showJumpMethod: true,
heightUsed: 380, heightUsed: 380,
enableDrag: true, enableDrag: true,
}, },

View File

@ -92,7 +92,7 @@
/** /**
* @description 项目管理-项目与权限-成员 * @description 项目管理-项目与权限-成员
*/ */
import { onMounted, ref } from 'vue'; import { ref } from 'vue';
import { Message } from '@arco-design/web-vue'; import { Message } from '@arco-design/web-vue';
import { isEqual } from 'lodash-es'; import { isEqual } from 'lodash-es';
@ -115,7 +115,7 @@
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import useModal from '@/hooks/useModal'; import useModal from '@/hooks/useModal';
import { useAppStore, useTableStore } from '@/store'; import { useAppStore, useTableStore } from '@/store';
import { characterLimit, formatPhoneNumber, sleep } from '@/utils'; import { characterLimit, formatPhoneNumber } from '@/utils';
import { hasAnyPermission } from '@/utils/permission'; import { hasAnyPermission } from '@/utils/permission';
import type { import type {
@ -205,7 +205,6 @@
selectable: !!hasAnyPermission(['PROJECT_USER:READ+DELETE', 'ORGANIZATION_MEMBER:READ+UPDATE']), selectable: !!hasAnyPermission(['PROJECT_USER:READ+DELETE', 'ORGANIZATION_MEMBER:READ+UPDATE']),
showSetting: true, showSetting: true,
heightUsed: 288, heightUsed: 288,
showJumpMethod: true,
scroll: { scroll: {
x: 1200, x: 1200,
}, },
@ -399,7 +398,7 @@
initData(); initData();
}); });
tableStore.initColumn(TableKeyEnum.PROJECT_MEMBER, columns, 'drawer'); await tableStore.initColumn(TableKeyEnum.PROJECT_MEMBER, columns, 'drawer');
</script> </script>
<style scoped></style> <style scoped></style>

View File

@ -242,7 +242,6 @@
selectable: hasAnyPermission(['ORGANIZATION_MEMBER:READ+ADD', 'ORGANIZATION_MEMBER:READ+UPDATE']), selectable: hasAnyPermission(['ORGANIZATION_MEMBER:READ+ADD', 'ORGANIZATION_MEMBER:READ+UPDATE']),
heightUsed: 288, heightUsed: 288,
showSetting: true, showSetting: true,
showJumpMethod: true,
size: 'default', size: 'default',
}, },
(record) => { (record) => {

View File

@ -335,7 +335,7 @@
drawerLoading.value = true; drawerLoading.value = true;
fieldDefaultValues.value = [...list]; fieldDefaultValues.value = [...list];
if (showOptionsSelect.value) { if (showOptionsSelect.value) {
let startPos = 5000; let startPos = 1;
fieldForm.value.options = (batchFormRef.value?.getFormResult() || []).map((item: any) => { fieldForm.value.options = (batchFormRef.value?.getFormResult() || []).map((item: any) => {
const currentItem: FieldOptions = { const currentItem: FieldOptions = {
text: item.text, text: item.text,
@ -345,11 +345,10 @@
if (item.fieldId) { if (item.fieldId) {
currentItem.fieldId = item.fieldId; currentItem.fieldId = item.fieldId;
} }
startPos += 5000; startPos += 1;
return currentItem; return currentItem;
}); });
} }
console.log(fieldForm.value.options);
await cb(); await cb();
} catch (error) { } catch (error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console

View File

@ -389,7 +389,6 @@
columns, columns,
selectable: !!hasAnyPermission(['SYSTEM_USER:READ+ADD', 'SYSTEM_USER:READ+UPDATE', 'SYSTEM_USER:READ+DELETE']), selectable: !!hasAnyPermission(['SYSTEM_USER:READ+ADD', 'SYSTEM_USER:READ+UPDATE', 'SYSTEM_USER:READ+DELETE']),
showSetting: true, showSetting: true,
showJumpMethod: true,
heightUsed: 288, heightUsed: 288,
}, },
(record) => ({ (record) => ({

View File

@ -58,7 +58,7 @@ export default {
project: 'Project', project: 'Project',
organization: 'Organization', organization: 'Organization',
save: 'Save', save: 'Save',
reset: 'Restore default', reset: 'Undo',
name: 'Name', name: 'Name',
email: 'Email', email: 'Email',
operation: 'Operation', operation: 'Operation',

View File

@ -57,7 +57,7 @@ export default {
project: '项目', project: '项目',
organization: '组织', organization: '组织',
save: '保存', save: '保存',
reset: '恢复默认', reset: '撤销修改',
name: '姓名', name: '姓名',
email: '邮箱', email: '邮箱',
operation: '操作', operation: '操作',