From ed6860eb957a837a5ea335892ee122e280d0bc20 Mon Sep 17 00:00:00 2001 From: Dong Xia Date: Tue, 21 Feb 2023 07:10:27 +0000 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E9=AA=8C=E8=AF=81=E5=8A=9F=E8=83=BD=E5=87=BD?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Dong Xia --- src/pages/repository/source/index.vue | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/pages/repository/source/index.vue b/src/pages/repository/source/index.vue index 41f9f7b..f9cbead 100644 --- a/src/pages/repository/source/index.vue +++ b/src/pages/repository/source/index.vue @@ -146,5 +146,29 @@ export default { SourceSetting, ResultList }, + data() { + const validator = (rule, value, callback) => { + const val = value.trim() + switch (rule.field) { + case 'planName': + if (val.length === 0) { + new Error(callback('请输入模板名称')) + } else if (val.length > 10) { + new Error(callback('模板名称长度不能超过10位')) + } else { + callback() + } + break + case 'annotation': + if (val.length > 50) { + new Error(callback('注释长度不能超过50位')) + } else { + callback() + } + break + default:callback() + } + } + } } \ No newline at end of file -- Gitee