refactor(系统设置): 修改工作空间名称校验

--story=1010451 --user=李玉号 优化工作空间命名提示描述
https://www.tapd.cn/55049933/s/1307418
This commit is contained in:
shiziyuan9527 2022-11-29 14:26:49 +08:00 committed by lyh
parent 7d08e84f97
commit 0bccd31714
5 changed files with 9 additions and 9 deletions

View File

@ -218,6 +218,10 @@ public class WorkspaceService {
MSException.throwException(Translator.get("workspace_name_is_null"));
}
if (workspace.getName().length() > 100) {
MSException.throwException(Translator.get("workspace_name_exceeds_length_limit"));
}
WorkspaceExample example = new WorkspaceExample();
WorkspaceExample.Criteria criteria = example.createCriteria();
criteria.andNameEqualTo(workspace.getName());

View File

@ -1,3 +1,4 @@
error_lang_invalid=Invalid language parameter, new
read_permission_file_fail=Failed to read permission file!
platform_plugin_not_exit=Platform docking function has been plug-in, please download the corresponding version of the plug-in:
workspace_name_exceeds_length_limit=Workspace name exceeds length limit

View File

@ -1,3 +1,4 @@
error_lang_invalid=语言参数错误, 新
read_permission_file_fail=读取权限文件失败!
platform_plugin_not_exit=平台对接功能已插件化,请下载对应版本的插件:
workspace_name_exceeds_length_limit=工作空间名称超出长度限制

View File

@ -1,3 +1,4 @@
error_lang_invalid=語言參數錯誤,新
read_permission_file_fail=讀取權限文件失敗!
platform_plugin_not_exit=平臺對接功能已插件化,請下載對應版本的插件:
workspace_name_exceeds_length_limit=工作空間名稱超出長度限制

View File

@ -49,7 +49,7 @@
width="30%" @close="close" v-loading="workspaceAddLoading">
<el-form :model="form" :rules="rules" ref="form" label-position="right" label-width="100px" size="small">
<el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="form.name" autocomplete="off" class="form-input"/>
<el-input v-model="form.name" autocomplete="off" class="form-input" show-word-limit maxlength="100"/>
</el-form-item>
<el-form-item :label="$t('commons.description')" prop="description">
<el-input type="textarea" v-model="form.description" class="form-input"></el-input>
@ -245,14 +245,7 @@ export default {
form: {},
rules: {
name: [
{required: true, message: this.$t('workspace.input_name'), trigger: 'blur'},
{min: 2, max: 25, message: this.$t('commons.input_limit', [2, 25]), trigger: 'blur'},
{
required: true,
pattern: /^(?!-)(?!.*?-$)[a-zA-Z0-9\u4e00-\u9fa5-]+$/,
message: this.$t('workspace.special_characters_are_not_supported'),
trigger: 'blur'
}
{required: true, message: this.$t('workspace.input_name'), trigger: 'blur'}
],
description: [
{max: 50, message: this.$t('commons.input_limit', [0, 50]), trigger: 'blur'}