refactor(项目管理): 优化字段选项排序及部分页面展示问题
This commit is contained in:
parent
46e3a37a77
commit
5b633804b2
|
@ -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 = "`";
|
||||
|
||||
|
|
|
@ -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<Long> values) {
|
||||
public Criteria andPosIn(List<Integer> values) {
|
||||
addCriterion("pos in", values, "pos");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPosNotIn(List<Long> values) {
|
||||
public Criteria andPosNotIn(List<Integer> 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;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<id column="value" jdbcType="VARCHAR" property="value" />
|
||||
<result column="text" jdbcType="VARCHAR" property="text" />
|
||||
<result column="internal" jdbcType="BIT" property="internal" />
|
||||
<result column="pos" jdbcType="BIGINT" property="pos" />
|
||||
<result column="pos" jdbcType="INTEGER" property="pos" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
|
@ -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>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.system.domain.CustomFieldOption">
|
||||
insert into custom_field_option
|
||||
|
@ -140,7 +140,7 @@
|
|||
#{internal,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="pos != null">
|
||||
#{pos,jdbcType=BIGINT},
|
||||
#{pos,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
@ -166,7 +166,7 @@
|
|||
internal = #{record.internal,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="record.pos != null">
|
||||
pos = #{record.pos,jdbcType=BIGINT},
|
||||
pos = #{record.pos,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
|
@ -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}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
|
@ -194,7 +194,7 @@
|
|||
internal = #{internal,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="pos != null">
|
||||
pos = #{pos,jdbcType=BIGINT},
|
||||
pos = #{pos,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
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}
|
||||
</update>
|
||||
|
@ -214,7 +214,7 @@
|
|||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{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>
|
||||
</insert>
|
||||
<insert id="batchInsertSelective" parameterType="map">
|
||||
|
@ -240,7 +240,7 @@
|
|||
#{item.internal,jdbcType=BIT}
|
||||
</if>
|
||||
<if test="'pos'.toString() == column.value">
|
||||
#{item.pos,jdbcType=BIGINT}
|
||||
#{item.pos,jdbcType=INTEGER}
|
||||
</if>
|
||||
</foreach>
|
||||
)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'));
|
||||
|
|
|
@ -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<CustomFieldOptionRequest> 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<CustomFieldOptionRequest> optionRequests = Arrays.asList(customFieldOptionRequest);
|
||||
request.setOptions(optionRequests);
|
||||
this.requestPostWithOk(DEFAULT_UPDATE, request);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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<CustomFieldOptionRequest> optionRequests = Arrays.asList(customFieldOptionRequest);
|
||||
CustomField customField = new CustomField();
|
||||
customField.setType(customFieldType.name());
|
||||
|
|
|
@ -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<CustomFieldOptionRequest> 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<CustomFieldOptionRequest> optionRequests = Arrays.asList(customFieldOptionRequest);
|
||||
request.setOptions(optionRequests);
|
||||
this.requestPostWithOk(DEFAULT_UPDATE, request);
|
||||
|
|
|
@ -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<CustomFieldOptionRequest> optionRequests = Arrays.asList(customFieldOptionRequest1, customFieldOptionRequest2);
|
||||
organizationCustomFieldService.add(customField, optionRequests);
|
||||
|
|
|
@ -21,7 +21,13 @@
|
|||
size="16"
|
||||
/>
|
||||
</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 }}
|
||||
</MsTag>
|
||||
</div>
|
||||
|
@ -59,19 +65,32 @@
|
|||
interface TagMapItem {
|
||||
type: TagType;
|
||||
text: string;
|
||||
style: Record<string, any>;
|
||||
}
|
||||
const tagMap: Record<Status, TagMapItem> = {
|
||||
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<string, any> = {};
|
||||
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<string, any> = {};
|
||||
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() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<MsCard simple>
|
||||
<MsAdvanceFilter
|
||||
v-model:keyword="keyword"
|
||||
:search-placeholder="t('caseManagement.featureCase.searchByIdAndName')"
|
||||
:search-placeholder="t('caseManagement.featureCase.searchByNameAndId')"
|
||||
:filter-config-list="filterConfigList"
|
||||
:row-count="filterRowCount"
|
||||
@keyword-search="fetchData"
|
||||
|
|
|
@ -336,7 +336,6 @@
|
|||
scroll: { x: scrollWidth.value },
|
||||
selectable: true,
|
||||
showSetting: true,
|
||||
showJumpMethod: true,
|
||||
heightUsed: 380,
|
||||
enableDrag: true,
|
||||
},
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
/**
|
||||
* @description 项目管理-项目与权限-成员
|
||||
*/
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { isEqual } from 'lodash-es';
|
||||
|
||||
|
@ -115,7 +115,7 @@
|
|||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useModal from '@/hooks/useModal';
|
||||
import { useAppStore, useTableStore } from '@/store';
|
||||
import { characterLimit, formatPhoneNumber, sleep } from '@/utils';
|
||||
import { characterLimit, formatPhoneNumber } from '@/utils';
|
||||
import { hasAnyPermission } from '@/utils/permission';
|
||||
|
||||
import type {
|
||||
|
@ -205,7 +205,6 @@
|
|||
selectable: !!hasAnyPermission(['PROJECT_USER:READ+DELETE', 'ORGANIZATION_MEMBER:READ+UPDATE']),
|
||||
showSetting: true,
|
||||
heightUsed: 288,
|
||||
showJumpMethod: true,
|
||||
scroll: {
|
||||
x: 1200,
|
||||
},
|
||||
|
@ -399,7 +398,7 @@
|
|||
initData();
|
||||
});
|
||||
|
||||
tableStore.initColumn(TableKeyEnum.PROJECT_MEMBER, columns, 'drawer');
|
||||
await tableStore.initColumn(TableKeyEnum.PROJECT_MEMBER, columns, 'drawer');
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
|
|
|
@ -242,7 +242,6 @@
|
|||
selectable: hasAnyPermission(['ORGANIZATION_MEMBER:READ+ADD', 'ORGANIZATION_MEMBER:READ+UPDATE']),
|
||||
heightUsed: 288,
|
||||
showSetting: true,
|
||||
showJumpMethod: true,
|
||||
size: 'default',
|
||||
},
|
||||
(record) => {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) => ({
|
||||
|
|
|
@ -58,7 +58,7 @@ export default {
|
|||
project: 'Project',
|
||||
organization: 'Organization',
|
||||
save: 'Save',
|
||||
reset: 'Restore default',
|
||||
reset: 'Undo',
|
||||
name: 'Name',
|
||||
email: 'Email',
|
||||
operation: 'Operation',
|
||||
|
|
|
@ -57,7 +57,7 @@ export default {
|
|||
project: '项目',
|
||||
organization: '组织',
|
||||
save: '保存',
|
||||
reset: '恢复默认',
|
||||
reset: '撤销修改',
|
||||
name: '姓名',
|
||||
email: '邮箱',
|
||||
operation: '操作',
|
||||
|
|
Loading…
Reference in New Issue