From 397254ded24abfdbd18c7488c008424c32fe22e5 Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Wed, 18 Oct 2023 14:36:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=92=8C=E7=BC=96=E8=BE=91=E5=8D=95=E4=B8=AA?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E7=9A=84=E6=A0=87=E7=AD=BE=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E9=95=BF=E5=BA=A6=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1032091 --user=陈建星 【测试跟踪】github#27123,【测试跟踪-功能用例】批量编辑标签时,当标签长度输入过长时会提示错误信息,但是单个用例编辑标签时可以正常保存。 https://www.tapd.cn/55049933/s/1427723 --- .../definition/components/case/MsInputEllipsisTag.vue | 2 +- .../sdk-parent/frontend/src/components/MsInputTag.vue | 8 ++++++-- .../frontend/src/components/new-ui/MsInputTag.vue | 4 ++++ framework/sdk-parent/frontend/src/i18n/lang/en-US.js | 2 +- framework/sdk-parent/frontend/src/i18n/lang/zh-CN.js | 2 +- framework/sdk-parent/frontend/src/i18n/lang/zh-TW.js | 2 +- .../frontend/src/business/case/components/BatchEdit.vue | 1 + 7 files changed, 15 insertions(+), 6 deletions(-) diff --git a/api-test/frontend/src/business/definition/components/case/MsInputEllipsisTag.vue b/api-test/frontend/src/business/definition/components/case/MsInputEllipsisTag.vue index 8521c61994..f70ef054b7 100644 --- a/api-test/frontend/src/business/definition/components/case/MsInputEllipsisTag.vue +++ b/api-test/frontend/src/business/definition/components/case/MsInputEllipsisTag.vue @@ -151,7 +151,7 @@ export default { tag = tag.trim(); if (tag && !this.innerTags.includes(tag)) { if (tag.length > 15) { - this.$error(this.$t('commons.tag_length_tip')); + this.$error(this.$t('commons.tag_length_tip', [15])); return false; } this.innerTags.push(tag); diff --git a/framework/sdk-parent/frontend/src/components/MsInputTag.vue b/framework/sdk-parent/frontend/src/components/MsInputTag.vue index f6c937e281..fcacd63341 100644 --- a/framework/sdk-parent/frontend/src/components/MsInputTag.vue +++ b/framework/sdk-parent/frontend/src/components/MsInputTag.vue @@ -66,6 +66,10 @@ export default { type: String, default: "tags", }, + maxLength: { + type: Number, + default: 15, + }, }, created() { if (!this.currentScenario[this.prop]) { @@ -138,8 +142,8 @@ export default { addTag(tag) { tag = tag.trim(); if (tag && !this.innerTags.includes(tag)) { - if (tag.length > 15) { - this.$error(this.$t("commons.tag_length_tip")); + if (tag.length > this.maxLength) { + this.$error(this.$t("commons.tag_length_tip", [this.maxLength])); return false; } this.innerTags.push(tag); diff --git a/framework/sdk-parent/frontend/src/components/new-ui/MsInputTag.vue b/framework/sdk-parent/frontend/src/components/new-ui/MsInputTag.vue index 3daf42b602..6229420ceb 100644 --- a/framework/sdk-parent/frontend/src/components/new-ui/MsInputTag.vue +++ b/framework/sdk-parent/frontend/src/components/new-ui/MsInputTag.vue @@ -121,6 +121,10 @@ export default { }, addTag(tag) { tag = tag.trim() + if (tag.length > 50) { + this.$error(this.$t("commons.tag_length_tip", [50])); + return false; + } if (tag && !this.innerTags.includes(tag)) { this.innerTags.push(tag) return true diff --git a/framework/sdk-parent/frontend/src/i18n/lang/en-US.js b/framework/sdk-parent/frontend/src/i18n/lang/en-US.js index d8b55e716c..6f66e67da9 100644 --- a/framework/sdk-parent/frontend/src/i18n/lang/en-US.js +++ b/framework/sdk-parent/frontend/src/i18n/lang/en-US.js @@ -394,7 +394,7 @@ const message = { }, image: "Image", tag: "Tag", - tag_length_tip: "The length of the tag cannot exceed 15 characters", + tag_length_tip: "The length of the tag cannot exceed {0} characters", append_tag: "Append Tag", append_tag_tip: "Checked: add a new label; unchecked: overwrite the original label;", diff --git a/framework/sdk-parent/frontend/src/i18n/lang/zh-CN.js b/framework/sdk-parent/frontend/src/i18n/lang/zh-CN.js index 14afebfbbf..e98fa5087f 100644 --- a/framework/sdk-parent/frontend/src/i18n/lang/zh-CN.js +++ b/framework/sdk-parent/frontend/src/i18n/lang/zh-CN.js @@ -387,7 +387,7 @@ const message = { }, image: "镜像", tag: "标签", - tag_length_tip: "标签长度不能超过15个字符", + tag_length_tip: "标签长度不能超过{0}个字符", append_tag: "追加标签", append_tag_tip: "勾选:新增标签;不勾选:覆盖原有标签;", module: { diff --git a/framework/sdk-parent/frontend/src/i18n/lang/zh-TW.js b/framework/sdk-parent/frontend/src/i18n/lang/zh-TW.js index fb38c2d66c..2d971490ad 100644 --- a/framework/sdk-parent/frontend/src/i18n/lang/zh-TW.js +++ b/framework/sdk-parent/frontend/src/i18n/lang/zh-TW.js @@ -388,7 +388,7 @@ const message = { image: "鏡像", tag: "標簽", append_tag: "追加標籤", - tag_length_tip: "標籤長度不能超過15個字符", + tag_length_tip: "標籤長度不能超過{0}個字符", append_tag_tip: "勾選:新增標籤;不勾選:覆蓋原有標籤;", module: { select_module: "選擇模塊", diff --git a/test-track/frontend/src/business/case/components/BatchEdit.vue b/test-track/frontend/src/business/case/components/BatchEdit.vue index 88acf183a2..b0ed42dfd0 100644 --- a/test-track/frontend/src/business/case/components/BatchEdit.vue +++ b/test-track/frontend/src/business/case/components/BatchEdit.vue @@ -84,6 +84,7 @@