From 5b633804b2ce74a8b877621f9f537e37a0c23a41 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Fri, 29 Mar 2024 14:25:14 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E5=AD=97=E6=AE=B5=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E5=8F=8A=E9=83=A8=E5=88=86=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/domain/CustomFieldOption.java | 4 +- .../domain/CustomFieldOptionExample.java | 20 +++--- .../system/mapper/CustomFieldOptionMapper.xml | 18 ++--- .../3.0.0/ddl/V3.0.0_11__system_setting.sql | 2 +- .../migration/3.0.0/dml/V3.0.0_11_1__data.sql | 32 ++++----- .../ProjectCustomFieldControllerTests.java | 4 +- .../dto/request/DefaultBugCustomField.java | 10 +-- .../request/DefaultFunctionalCustomField.java | 10 +-- .../sdk/request/CustomFieldOptionRequest.java | 2 +- .../base/BaseCustomFieldTestService.java | 2 +- ...rganizationCustomFieldControllerTests.java | 4 +- .../SystemProjectControllerTests.java | 4 +- .../components/tripartite.vue | 67 +++++++++++++------ frontend/src/views/bug-management/index.vue | 2 +- .../components/recycleCaseTable.vue | 1 - .../projectAndPermission/member/index.vue | 7 +- .../setting/organization/member/index.vue | 1 - .../template/components/editFieldDrawer.vue | 5 +- .../src/views/setting/system/user/index.vue | 1 - .../setting/system/usergroup/locale/en-US.ts | 2 +- .../setting/system/usergroup/locale/zh-CN.ts | 2 +- 21 files changed, 109 insertions(+), 91 deletions(-) diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/CustomFieldOption.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/CustomFieldOption.java index 843277b45b..96118c184a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/CustomFieldOption.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/CustomFieldOption.java @@ -35,7 +35,7 @@ public class CustomFieldOption implements Serializable { @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "{custom_field_option.pos.not_blank}", groups = {Created.class}) - private Long pos; + private Integer pos; private static final long serialVersionUID = 1L; @@ -44,7 +44,7 @@ public class CustomFieldOption implements Serializable { value("value", "value", "VARCHAR", true), text("text", "text", "VARCHAR", true), internal("internal", "internal", "BIT", false), - pos("pos", "pos", "BIGINT", false); + pos("pos", "pos", "INTEGER", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/CustomFieldOptionExample.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/CustomFieldOptionExample.java index 8bda91df5e..bc6c437fb5 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/CustomFieldOptionExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/CustomFieldOptionExample.java @@ -384,52 +384,52 @@ public class CustomFieldOptionExample { return (Criteria) this; } - public Criteria andPosEqualTo(Long value) { + public Criteria andPosEqualTo(Integer value) { addCriterion("pos =", value, "pos"); return (Criteria) this; } - public Criteria andPosNotEqualTo(Long value) { + public Criteria andPosNotEqualTo(Integer value) { addCriterion("pos <>", value, "pos"); return (Criteria) this; } - public Criteria andPosGreaterThan(Long value) { + public Criteria andPosGreaterThan(Integer value) { addCriterion("pos >", value, "pos"); return (Criteria) this; } - public Criteria andPosGreaterThanOrEqualTo(Long value) { + public Criteria andPosGreaterThanOrEqualTo(Integer value) { addCriterion("pos >=", value, "pos"); return (Criteria) this; } - public Criteria andPosLessThan(Long value) { + public Criteria andPosLessThan(Integer value) { addCriterion("pos <", value, "pos"); return (Criteria) this; } - public Criteria andPosLessThanOrEqualTo(Long value) { + public Criteria andPosLessThanOrEqualTo(Integer value) { addCriterion("pos <=", value, "pos"); return (Criteria) this; } - public Criteria andPosIn(List values) { + public Criteria andPosIn(List values) { addCriterion("pos in", values, "pos"); return (Criteria) this; } - public Criteria andPosNotIn(List values) { + public Criteria andPosNotIn(List values) { addCriterion("pos not in", values, "pos"); return (Criteria) this; } - public Criteria andPosBetween(Long value1, Long value2) { + public Criteria andPosBetween(Integer value1, Integer value2) { addCriterion("pos between", value1, value2, "pos"); return (Criteria) this; } - public Criteria andPosNotBetween(Long value1, Long value2) { + public Criteria andPosNotBetween(Integer value1, Integer value2) { addCriterion("pos not between", value1, value2, "pos"); return (Criteria) this; } diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/CustomFieldOptionMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/CustomFieldOptionMapper.xml index 440f626712..eaa4a04610 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/CustomFieldOptionMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/CustomFieldOptionMapper.xml @@ -6,7 +6,7 @@ - + @@ -105,7 +105,7 @@ insert into custom_field_option (field_id, `value`, `text`, internal, pos) values (#{fieldId,jdbcType=VARCHAR}, #{value,jdbcType=VARCHAR}, #{text,jdbcType=VARCHAR}, - #{internal,jdbcType=BIT}, #{pos,jdbcType=BIGINT}) + #{internal,jdbcType=BIT}, #{pos,jdbcType=INTEGER}) insert into custom_field_option @@ -140,7 +140,7 @@ #{internal,jdbcType=BIT}, - #{pos,jdbcType=BIGINT}, + #{pos,jdbcType=INTEGER}, @@ -166,7 +166,7 @@ internal = #{record.internal,jdbcType=BIT}, - pos = #{record.pos,jdbcType=BIGINT}, + pos = #{record.pos,jdbcType=INTEGER}, @@ -179,7 +179,7 @@ `value` = #{record.value,jdbcType=VARCHAR}, `text` = #{record.text,jdbcType=VARCHAR}, internal = #{record.internal,jdbcType=BIT}, - pos = #{record.pos,jdbcType=BIGINT} + pos = #{record.pos,jdbcType=INTEGER} @@ -194,7 +194,7 @@ internal = #{internal,jdbcType=BIT}, - pos = #{pos,jdbcType=BIGINT}, + pos = #{pos,jdbcType=INTEGER}, where field_id = #{fieldId,jdbcType=VARCHAR} @@ -204,7 +204,7 @@ update custom_field_option set `text` = #{text,jdbcType=VARCHAR}, internal = #{internal,jdbcType=BIT}, - pos = #{pos,jdbcType=BIGINT} + pos = #{pos,jdbcType=INTEGER} where field_id = #{fieldId,jdbcType=VARCHAR} and `value` = #{value,jdbcType=VARCHAR} @@ -214,7 +214,7 @@ values (#{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}) @@ -240,7 +240,7 @@ #{item.internal,jdbcType=BIT} - #{item.pos,jdbcType=BIGINT} + #{item.pos,jdbcType=INTEGER} ) diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_11__system_setting.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_11__system_setting.sql index 71ccec21ad..4f30a2ce5b 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_11__system_setting.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_11__system_setting.sql @@ -373,7 +373,7 @@ CREATE TABLE IF NOT EXISTS custom_field_option( `value` VARCHAR(50) NOT NULL COMMENT '选项值' , `text` VARCHAR(255) NOT NULL 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) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/dml/V3.0.0_11_1__data.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/dml/V3.0.0_11_1__data.sql index 287c9a658b..daed201b1a 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/dml/V3.0.0_11_1__data.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/dml/V3.0.0_11_1__data.sql @@ -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 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'), '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'), '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'), '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'), '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, 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, 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, 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_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, 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, 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, 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, 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, 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, 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, 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'); @@ -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_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'), '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'), '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'), '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'), '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, 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, 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, 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_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, 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, 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, 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, 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, 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, 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, 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')); diff --git a/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectCustomFieldControllerTests.java b/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectCustomFieldControllerTests.java index 724c8a4dce..5235d2ed43 100644 --- a/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectCustomFieldControllerTests.java +++ b/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectCustomFieldControllerTests.java @@ -92,7 +92,7 @@ public class ProjectCustomFieldControllerTests extends BaseTest { CustomFieldOptionRequest customFieldOptionRequest = new CustomFieldOptionRequest(); customFieldOptionRequest.setValue("1111"); customFieldOptionRequest.setText("test"); - customFieldOptionRequest.setPos(5000L); + customFieldOptionRequest.setPos(1); request.setEnableOptionKey(true); List optionRequests = Arrays.asList(customFieldOptionRequest); request.setOptions(optionRequests); @@ -166,7 +166,7 @@ public class ProjectCustomFieldControllerTests extends BaseTest { CustomFieldOptionRequest customFieldOptionRequest = new CustomFieldOptionRequest(); customFieldOptionRequest.setValue("11112"); customFieldOptionRequest.setText("test1"); - customFieldOptionRequest.setPos(5000L); + customFieldOptionRequest.setPos(1); List optionRequests = Arrays.asList(customFieldOptionRequest); request.setOptions(optionRequests); this.requestPostWithOk(DEFAULT_UPDATE, request); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/request/DefaultBugCustomField.java b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/request/DefaultBugCustomField.java index fdb7376c6d..c458f2366b 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/request/DefaultBugCustomField.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/request/DefaultBugCustomField.java @@ -18,10 +18,10 @@ public enum DefaultBugCustomField { */ DEGREE("bug_degree", CustomFieldType.SELECT, Arrays.asList( - getNewOption(IDGenerator.nextStr(), "提示", 5000L), - getNewOption(IDGenerator.nextStr(), "一般", 10000L), - getNewOption(IDGenerator.nextStr(), "严重", 15000L), - getNewOption(IDGenerator.nextStr(), "致命", 20000L) + getNewOption(IDGenerator.nextStr(), "提示", 1), + getNewOption(IDGenerator.nextStr(), "一般", 2), + getNewOption(IDGenerator.nextStr(), "严重", 3), + getNewOption(IDGenerator.nextStr(), "致命", 4) ) ); @@ -47,7 +47,7 @@ public enum DefaultBugCustomField { 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.setValue(value); customFieldOption.setText(text); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/request/DefaultFunctionalCustomField.java b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/request/DefaultFunctionalCustomField.java index c8ef9ad200..47a5dd53ed 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/request/DefaultFunctionalCustomField.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/request/DefaultFunctionalCustomField.java @@ -14,10 +14,10 @@ public enum DefaultFunctionalCustomField { PRIORITY("functional_priority", CustomFieldType.SELECT, Arrays.asList( - getNewOption("P0", "P0", 5000L), - getNewOption("P1", "P1", 10000L), - getNewOption("P2", "P2", 15000L), - getNewOption("P3", "P3", 20000L) + getNewOption("P0", "P0", 1), + getNewOption("P1", "P1", 2), + getNewOption("P2", "P2", 3), + getNewOption("P3", "P3", 4) ) ); @@ -43,7 +43,7 @@ public enum DefaultFunctionalCustomField { 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.setValue(value); customFieldOption.setText(text); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/CustomFieldOptionRequest.java b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/CustomFieldOptionRequest.java index d94b0e7f5b..b1f033495b 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/CustomFieldOptionRequest.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/CustomFieldOptionRequest.java @@ -22,5 +22,5 @@ public class CustomFieldOptionRequest { @Schema(title = "选项值顺序", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "{custom_field_option.pos.not_blank}", groups = {Created.class}) - private Long pos; + private Integer pos; } diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/base/BaseCustomFieldTestService.java b/backend/services/system-setting/src/test/java/io/metersphere/system/base/BaseCustomFieldTestService.java index 629e42afa7..f42ccc9547 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/base/BaseCustomFieldTestService.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/base/BaseCustomFieldTestService.java @@ -48,7 +48,7 @@ public class BaseCustomFieldTestService { CustomFieldOptionRequest customFieldOptionRequest = new CustomFieldOptionRequest(); customFieldOptionRequest.setValue(OPTION_VALUE); customFieldOptionRequest.setText("test"); - customFieldOptionRequest.setPos(5000L); + customFieldOptionRequest.setPos(1); List optionRequests = Arrays.asList(customFieldOptionRequest); CustomField customField = new CustomField(); customField.setType(customFieldType.name()); diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationCustomFieldControllerTests.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationCustomFieldControllerTests.java index 52327f1910..2cc35c6770 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationCustomFieldControllerTests.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationCustomFieldControllerTests.java @@ -95,7 +95,7 @@ public class OrganizationCustomFieldControllerTests extends BaseTest { CustomFieldOptionRequest customFieldOptionRequest = new CustomFieldOptionRequest(); customFieldOptionRequest.setValue("1111"); customFieldOptionRequest.setText("test"); - customFieldOptionRequest.setPos(5000L); + customFieldOptionRequest.setPos(1); List optionRequests = Arrays.asList(customFieldOptionRequest); request.setOptions(optionRequests); @@ -173,7 +173,7 @@ public class OrganizationCustomFieldControllerTests extends BaseTest { CustomFieldOptionRequest customFieldOptionRequest = new CustomFieldOptionRequest(); customFieldOptionRequest.setValue("11112"); customFieldOptionRequest.setText("test1"); - customFieldOptionRequest.setPos(5000L); + customFieldOptionRequest.setPos(1); List optionRequests = Arrays.asList(customFieldOptionRequest); request.setOptions(optionRequests); this.requestPostWithOk(DEFAULT_UPDATE, request); diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemProjectControllerTests.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemProjectControllerTests.java index 5f2036a3b1..06deccc038 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemProjectControllerTests.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemProjectControllerTests.java @@ -561,11 +561,11 @@ public class SystemProjectControllerTests extends BaseTest { CustomFieldOptionRequest customFieldOptionRequest1 = new CustomFieldOptionRequest(); customFieldOptionRequest1.setValue("1"); customFieldOptionRequest1.setText("test1"); - customFieldOptionRequest1.setPos(5000L); + customFieldOptionRequest1.setPos(1); CustomFieldOptionRequest customFieldOptionRequest2 = new CustomFieldOptionRequest(); customFieldOptionRequest2.setValue("2"); customFieldOptionRequest2.setText("test2"); - customFieldOptionRequest2.setPos(10000L); + customFieldOptionRequest2.setPos(2); customField.setCreateUser("admin"); List optionRequests = Arrays.asList(customFieldOptionRequest1, customFieldOptionRequest2); organizationCustomFieldService.add(customField, optionRequests); diff --git a/frontend/src/components/business/ms-personal-drawer/components/tripartite.vue b/frontend/src/components/business/ms-personal-drawer/components/tripartite.vue index b3bf7941da..a2272c29bd 100644 --- a/frontend/src/components/business/ms-personal-drawer/components/tripartite.vue +++ b/frontend/src/components/business/ms-personal-drawer/components/tripartite.vue @@ -21,7 +21,13 @@ size="16" /> - + {{ tagMap[config.status].text }} @@ -59,19 +65,32 @@ interface TagMapItem { type: TagType; text: string; + style: Record; } const tagMap: Record = { 0: { type: 'default', text: t('ms.personal.unValid'), + style: { + backgroundColor: '', + color: '', + }, }, 1: { type: 'success', text: t('ms.personal.validPass'), + style: { + backgroundColor: 'rgb(var(--success-2))', + color: 'rgb(var(--success-6))', + }, }, 2: { type: 'danger', 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) { - try { - config.validateLoading = true; - const configForms: Record = {}; - 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, - }); - Message.success(t('ms.personal.validPass')); - config.status = 1; - } catch (error) { - // eslint-disable-next-line no-console - console.log(error); - config.status = 2; - } finally { - config.validateLoading = false; - } + config.formModel.validate(async (valid: any) => { + if (valid === true) { + try { + config.validateLoading = true; + const configForms: Record = {}; + 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, + }); + Message.success(t('ms.personal.validPass')); + config.status = 1; + } catch (error) { + // eslint-disable-next-line no-console + console.log(error); + config.status = 2; + } finally { + config.validateLoading = false; + } + } + }); } async function handleOrgChange() { diff --git a/frontend/src/views/bug-management/index.vue b/frontend/src/views/bug-management/index.vue index 22d50bb6de..aeb5b392da 100644 --- a/frontend/src/views/bug-management/index.vue +++ b/frontend/src/views/bug-management/index.vue @@ -2,7 +2,7 @@ diff --git a/frontend/src/views/setting/organization/member/index.vue b/frontend/src/views/setting/organization/member/index.vue index 7a13754f4d..e90bd302d4 100644 --- a/frontend/src/views/setting/organization/member/index.vue +++ b/frontend/src/views/setting/organization/member/index.vue @@ -242,7 +242,6 @@ selectable: hasAnyPermission(['ORGANIZATION_MEMBER:READ+ADD', 'ORGANIZATION_MEMBER:READ+UPDATE']), heightUsed: 288, showSetting: true, - showJumpMethod: true, size: 'default', }, (record) => { diff --git a/frontend/src/views/setting/organization/template/components/editFieldDrawer.vue b/frontend/src/views/setting/organization/template/components/editFieldDrawer.vue index b495fee33c..aa6a0c7529 100644 --- a/frontend/src/views/setting/organization/template/components/editFieldDrawer.vue +++ b/frontend/src/views/setting/organization/template/components/editFieldDrawer.vue @@ -335,7 +335,7 @@ drawerLoading.value = true; fieldDefaultValues.value = [...list]; if (showOptionsSelect.value) { - let startPos = 5000; + let startPos = 1; fieldForm.value.options = (batchFormRef.value?.getFormResult() || []).map((item: any) => { const currentItem: FieldOptions = { text: item.text, @@ -345,11 +345,10 @@ if (item.fieldId) { currentItem.fieldId = item.fieldId; } - startPos += 5000; + startPos += 1; return currentItem; }); } - console.log(fieldForm.value.options); await cb(); } catch (error) { // eslint-disable-next-line no-console diff --git a/frontend/src/views/setting/system/user/index.vue b/frontend/src/views/setting/system/user/index.vue index a4098423d7..e1f14bf636 100644 --- a/frontend/src/views/setting/system/user/index.vue +++ b/frontend/src/views/setting/system/user/index.vue @@ -389,7 +389,6 @@ columns, selectable: !!hasAnyPermission(['SYSTEM_USER:READ+ADD', 'SYSTEM_USER:READ+UPDATE', 'SYSTEM_USER:READ+DELETE']), showSetting: true, - showJumpMethod: true, heightUsed: 288, }, (record) => ({ diff --git a/frontend/src/views/setting/system/usergroup/locale/en-US.ts b/frontend/src/views/setting/system/usergroup/locale/en-US.ts index 293d42cba4..b1539dbe65 100644 --- a/frontend/src/views/setting/system/usergroup/locale/en-US.ts +++ b/frontend/src/views/setting/system/usergroup/locale/en-US.ts @@ -58,7 +58,7 @@ export default { project: 'Project', organization: 'Organization', save: 'Save', - reset: 'Restore default', + reset: 'Undo', name: 'Name', email: 'Email', operation: 'Operation', diff --git a/frontend/src/views/setting/system/usergroup/locale/zh-CN.ts b/frontend/src/views/setting/system/usergroup/locale/zh-CN.ts index bf320c31b9..3a0f7c3847 100644 --- a/frontend/src/views/setting/system/usergroup/locale/zh-CN.ts +++ b/frontend/src/views/setting/system/usergroup/locale/zh-CN.ts @@ -57,7 +57,7 @@ export default { project: '项目', organization: '组织', save: '保存', - reset: '恢复默认', + reset: '撤销修改', name: '姓名', email: '邮箱', operation: '操作',