fix(缺陷管理): 标题超过长度提示问题

https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001038797
This commit is contained in:
song-cc-rock 2024-04-19 17:03:39 +08:00 committed by 刘瑞斌
parent 91f46cc6ad
commit b9c4180bb4
9 changed files with 13 additions and 10 deletions

View File

@ -24,7 +24,7 @@ public class Bug implements Serializable {
@Schema(description = "缺陷标题", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "缺陷标题", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{bug.title.not_blank}", groups = {Created.class}) @NotBlank(message = "{bug.title.not_blank}", groups = {Created.class})
@Size(min = 1, max = 300, message = "{bug.title.length_range}", groups = {Created.class, Updated.class}) @Size(min = 1, max = 255, message = "{bug.title.length_range}", groups = {Created.class, Updated.class})
private String title; private String title;
@Schema(description = "处理人集合;预留字段, 后续工作台统计可能需要") @Schema(description = "处理人集合;预留字段, 后续工作台统计可能需要")

View File

@ -4,7 +4,7 @@ SET SESSION innodb_lock_wait_timeout = 7200;
CREATE TABLE IF NOT EXISTS bug( CREATE TABLE IF NOT EXISTS bug(
`id` VARCHAR(50) NOT NULL COMMENT 'ID' , `id` VARCHAR(50) NOT NULL COMMENT 'ID' ,
`num` INT NOT NULL COMMENT '业务ID' , `num` INT NOT NULL COMMENT '业务ID' ,
`title` VARCHAR(300) NOT NULL COMMENT '缺陷标题' , `title` VARCHAR(255) NOT NULL COMMENT '缺陷标题' ,
`handle_users` VARCHAR(1000) COMMENT '处理人集合;预留字段, 后续工作台统计可能需要' , `handle_users` VARCHAR(1000) COMMENT '处理人集合;预留字段, 后续工作台统计可能需要' ,
`handle_user` VARCHAR(50) NOT NULL COMMENT '处理人' , `handle_user` VARCHAR(50) NOT NULL COMMENT '处理人' ,
`create_user` VARCHAR(50) NOT NULL COMMENT '创建人' , `create_user` VARCHAR(50) NOT NULL COMMENT '创建人' ,

View File

@ -2,7 +2,7 @@
bug.id.not_blank=ID不能为空 bug.id.not_blank=ID不能为空
bug.id.length_range=ID长度必须在1-50之间 bug.id.length_range=ID长度必须在1-50之间
bug.title.not_blank=缺陷标题不能为空 bug.title.not_blank=缺陷标题不能为空
bug.title.length_range=缺陷标题长度必须在1-50之间 bug.title.length_range=缺陷标题长度必须在1-255之间
bug.assign_user.not_blank=指派人不能为空 bug.assign_user.not_blank=指派人不能为空
bug.assign_user.length_range=指派人长度必须在1-50之间 bug.assign_user.length_range=指派人长度必须在1-50之间
bug.create_user.not_blank=创建人不能为空 bug.create_user.not_blank=创建人不能为空

View File

@ -2,7 +2,7 @@
bug.id.not_blank=id cannot be empty bug.id.not_blank=id cannot be empty
bug.id.length_range=id length must be between 1-50 bug.id.length_range=id length must be between 1-50
bug.title.not_blank=title cannot be empty bug.title.not_blank=title cannot be empty
bug.title.length_range=title length must be between 1-50 bug.title.length_range=title length must be between 1-255
bug.assign_user.not_blank=assignUser cannot be empty bug.assign_user.not_blank=assignUser cannot be empty
bug.assign_user.length_range=assignUser length must be between 1-50 bug.assign_user.length_range=assignUser length must be between 1-50
bug.create_user.not_blank=createUser cannot be empty bug.create_user.not_blank=createUser cannot be empty

View File

@ -2,7 +2,7 @@
bug.id.not_blank=ID不能为空 bug.id.not_blank=ID不能为空
bug.id.length_range=ID长度必须在1-50之间 bug.id.length_range=ID长度必须在1-50之间
bug.title.not_blank=缺陷标题不能为空 bug.title.not_blank=缺陷标题不能为空
bug.title.length_range=缺陷标题长度必须在1-50之间 bug.title.length_range=缺陷标题长度必须在1-255之间
bug.assign_user.not_blank=指派人不能为空 bug.assign_user.not_blank=指派人不能为空
bug.assign_user.length_range=指派人长度必须在1-50之间 bug.assign_user.length_range=指派人长度必须在1-50之间
bug.create_user.not_blank=创建人不能为空 bug.create_user.not_blank=创建人不能为空

View File

@ -2,7 +2,7 @@
bug.id.not_blank=ID不能為空 bug.id.not_blank=ID不能為空
bug.id.length_range=ID長度必須在1-50之間 bug.id.length_range=ID長度必須在1-50之間
bug.title.not_blank=缺陷标题不能為空 bug.title.not_blank=缺陷标题不能為空
bug.title.length_range=缺陷标题長度必須在1-50之間 bug.title.length_range=缺陷标题長度必須在1-255之間
bug.assign_user.not_blank=指派人不能為空 bug.assign_user.not_blank=指派人不能為空
bug.assign_user.length_range=指派人長度必須在1-50之間 bug.assign_user.length_range=指派人長度必須在1-50之間
bug.create_user.not_blank=创建人不能為空 bug.create_user.not_blank=创建人不能為空

View File

@ -24,7 +24,7 @@ public class BugEditRequest implements Serializable {
private String id; private String id;
@Schema(description = "缺陷标题") @Schema(description = "缺陷标题")
@Size(min = 1, max = 300, message = "{bug.title.length_range}", groups = {Created.class, Updated.class}) @Size(min = 1, max = 255, message = "{bug.title.length_range}", groups = {Created.class, Updated.class})
private String title; private String title;
@Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)

View File

@ -21,7 +21,7 @@ public class BugDetailDTO {
private Integer num; private Integer num;
@Schema(description = "缺陷标题") @Schema(description = "缺陷标题")
@Size(min = 1, max = 300, message = "{bug.title.length_range}", groups = {Created.class, Updated.class}) @Size(min = 1, max = 255, message = "{bug.title.length_range}", groups = {Created.class, Updated.class})
private String title; private String title;
@Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)

View File

@ -9,7 +9,9 @@
<template #title> <template #title>
<div class="flex flex-row items-center"> <div class="flex flex-row items-center">
<icon-exclamation-circle-fill class="text-[16px] text-[rgb(var(--danger-6))]" /> <icon-exclamation-circle-fill class="text-[16px] text-[rgb(var(--danger-6))]" />
<div class="ml-[8px]">{{ t('bugManagement.detail.deleteTitle', { name: props.name }) }}</div> <div class="one-line-text ml-[8px]">{{
t('bugManagement.detail.deleteTitle', { name: characterLimit(props.name) })
}}</div>
</div> </div>
</template> </template>
<div class="form"> <div class="form">
@ -30,7 +32,7 @@
}, },
]" ]"
> >
<a-input :placeholder="t('bugManagement.edit.pleaseInputBugName')" v-model:model-value="form.name" /> <a-input v-model:model-value="form.name" :placeholder="t('bugManagement.edit.pleaseInputBugName')" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</div> </div>
@ -50,6 +52,7 @@
import { type FormInstance, Message, type ValidatedError } from '@arco-design/web-vue'; import { type FormInstance, Message, type ValidatedError } from '@arco-design/web-vue';
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import { characterLimit } from '@/utils';
const { t } = useI18n(); const { t } = useI18n();
const props = defineProps<{ const props = defineProps<{