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 @@