From f59169f68ebaf8e5b98bbcb96491d48af744bfeb Mon Sep 17 00:00:00 2001 From: "nathan.liu" Date: Fri, 17 Feb 2023 21:25:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=84=E8=AE=BA=E6=A1=86=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=8F=8A=E7=94=A8=E4=BE=8B=E5=90=8D=E7=A7=B0=E8=BF=87=E9=95=BF?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1023174 --user=刘瑶 【测试跟踪】功能用例-编辑-评论-点击输入框-默认提示信息和原型不符 https://www.tapd.cn/55049933/s/1337577 --bug=1023171 --user=刘瑶 【测试跟踪】功能用例-编辑用例页面-用例名称过长-显示问题 https://www.tapd.cn/55049933/s/1337578 --- .../case/components/BaseEditItemComponent.vue | 76 ++++++++++++++++--- .../business/case/components/TestCaseEdit.vue | 8 ++ .../case/components/case/CaseBaseInfo.vue | 26 ++++++- .../case/components/case/CaseCommentEdit.vue | 1 + test-track/frontend/src/i18n/lang/en-US.js | 1 + test-track/frontend/src/i18n/lang/zh-CN.js | 1 + test-track/frontend/src/i18n/lang/zh-TW.js | 1 + 7 files changed, 100 insertions(+), 14 deletions(-) diff --git a/test-track/frontend/src/business/case/components/BaseEditItemComponent.vue b/test-track/frontend/src/business/case/components/BaseEditItemComponent.vue index 4b0bbbe6d6..adb6b09f50 100644 --- a/test-track/frontend/src/business/case/components/BaseEditItemComponent.vue +++ b/test-track/frontend/src/business/case/components/BaseEditItemComponent.vue @@ -205,6 +205,13 @@ export default { }); }, getTranslateOption(item) { + if (Array.isArray(item)) { + let arr = []; + item.forEach((v) => { + arr.push(v.system ? this.$t(v.text) : v.text); + }); + return arr.join(" "); + } return item.system ? this.$t(item.text) : item.text; }, getCustomText() { @@ -216,15 +223,34 @@ export default { ) { options = this.memberOptions; } - if (options.length > 0) { - let option = options.find((item) => { - if (this.contentObject.content.value) { - return item.value == this.contentObject.content.value; - } - return item.value == this.contentObject.content.defaultValue; - }); - if (option) { - return this.getTranslateOption(option); + if (options && options.length > 0) { + let tempValue = this.contentObject.content.value && this.contentObject.content.value.length > 0 + ? this.contentObject.content.value + : this.contentObject.content.defaultValue; + if(!tempValue || Array.isArray(tempValue) && tempValue.length <= 0){ + return this.$t("case.none"); + } + if (Array.isArray(tempValue) && tempValue.length > 0) { + let arr = []; + tempValue.forEach((v) => { + let temp = options.find((o) => { + return o.value == v; + }); + if(temp){ + if(Array.isArray(temp)){ + arr.push(...temp); + } + else{ + arr.push(temp); + } + } + }); + return this.getTranslateOption(arr); + } else { + let temp = options.find((o) => { + return o.value == tempValue; + }); + return this.getTranslateOption(temp); } } @@ -237,7 +263,11 @@ export default { ? this.$t("case.none") : this.contentObject.content.defaultValue; } - return ""; + + return this.contentObject.content.defaultValue === "" || + this.contentObject.content.defaultValue == null + ? this.$t("case.none") + : this.contentObject.content.defaultValue; }, getStoryPlatform() { let demandOptions = this.contentObject.content.demandOptions || []; @@ -246,7 +276,7 @@ export default { return item.value === this.contentObject.content.demandId; }); if (demand) { - return demand.platform; + return this.handleDemandOptionPlatform(demand); } } return ""; @@ -261,11 +291,33 @@ export default { if (demand.value === "other") { return this.$t("test_track.case.other"); } - return demand.label; + return this.handleDemandOptionLabel(demand); } } return ""; }, + handleDemandOptionPlatform(data) { + if (data.platform) { + return data.platform; + } + if (data.label) { + let arr = data.label.split(": "); + if (arr && arr.length > 1) { + return arr[0]; + } + } + return ""; + }, + handleDemandOptionLabel(data) { + if (data.label) { + let arr = data.label.split(": "); + if (arr && arr.length > 1) { + return arr[1]; + } + return data.label; + } + return ""; + }, clickContent() { if (this.contentClickEvent) { this.selfEditable = true; diff --git a/test-track/frontend/src/business/case/components/TestCaseEdit.vue b/test-track/frontend/src/business/case/components/TestCaseEdit.vue index 258dc0fb06..b06eac76e6 100644 --- a/test-track/frontend/src/business/case/components/TestCaseEdit.vue +++ b/test-track/frontend/src/business/case/components/TestCaseEdit.vue @@ -1661,6 +1661,14 @@ export default { margin-left: px2rem(8); margin-right: px2rem(8); cursor: pointer; + max-width: 800px; + /* 文本不会换行显示 */ + white-space: nowrap; + /* 超出盒子部分隐藏 */ + overflow: hidden; + /* 文本超出的部分打点显示 */ + text-overflow: ellipsis; + } .case-name-hover:hover { cursor: pointer; diff --git a/test-track/frontend/src/business/case/components/case/CaseBaseInfo.vue b/test-track/frontend/src/business/case/components/case/CaseBaseInfo.vue index 26e38842fa..3e8c4f13b9 100644 --- a/test-track/frontend/src/business/case/components/case/CaseBaseInfo.vue +++ b/test-track/frontend/src/business/case/components/case/CaseBaseInfo.vue @@ -227,11 +227,11 @@ > @@ -490,6 +490,28 @@ export default { this.getVersionOptions(); }, methods: { + handleDemandOptionPlatform(data){ + if(data.platform){ + return data.platform + } + if(data.label){ + let arr = data.label.split(": ") + if(arr && arr.length > 1){ + return arr[0]; + } + } + return ""; + }, + handleDemandOptionLabel(data){ + if(data.label){ + let arr = data.label.split(": ") + if(arr && arr.length > 1){ + return arr[1]; + } + return data.label; + } + return ""; + }, validateAllForm(callback) { callback( this.editable ? true : this.validateForm() && this.validateCustomForm() diff --git a/test-track/frontend/src/business/case/components/case/CaseCommentEdit.vue b/test-track/frontend/src/business/case/components/case/CaseCommentEdit.vue index 48db4e66e2..9442608ce5 100644 --- a/test-track/frontend/src/business/case/components/case/CaseCommentEdit.vue +++ b/test-track/frontend/src/business/case/components/case/CaseCommentEdit.vue @@ -15,6 +15,7 @@ class="remark-item" :data="tempFormData" :default-open="richTextDefaultOpen" + :placeholder="$t('case.enter_comments_and_click_send')" prop="richText" />
diff --git a/test-track/frontend/src/i18n/lang/en-US.js b/test-track/frontend/src/i18n/lang/en-US.js index a3c3fa2b6b..721bcccb60 100644 --- a/test-track/frontend/src/i18n/lang/en-US.js +++ b/test-track/frontend/src/i18n/lang/en-US.js @@ -143,6 +143,7 @@ const message = { compare_with_the_latest_version: "Compare with the latest version", view_the_latest_version: "View the latest version", version_id_cannot_be_empty: "Version id cannot be empty", + enter_comments_and_click_send: "Enter comments and click Send", }, attachment: { preview: "Preview", diff --git a/test-track/frontend/src/i18n/lang/zh-CN.js b/test-track/frontend/src/i18n/lang/zh-CN.js index d0444717e9..7c59bfcae7 100644 --- a/test-track/frontend/src/i18n/lang/zh-CN.js +++ b/test-track/frontend/src/i18n/lang/zh-CN.js @@ -143,6 +143,7 @@ const message = { compare_with_the_latest_version: "与最新版本比较", view_the_latest_version: "查看最新版本", version_id_cannot_be_empty: "版本号不能为空", + enter_comments_and_click_send: "输入评论,点击发送", }, attachment: { preview: "预览", diff --git a/test-track/frontend/src/i18n/lang/zh-TW.js b/test-track/frontend/src/i18n/lang/zh-TW.js index 16ac28458b..43abce3c13 100644 --- a/test-track/frontend/src/i18n/lang/zh-TW.js +++ b/test-track/frontend/src/i18n/lang/zh-TW.js @@ -143,6 +143,7 @@ const message = { compare_with_the_latest_version: "與最新版本比較", view_the_latest_version: "查看最新版本", version_id_cannot_be_empty: "版本號不能為空", + enter_comments_and_click_send: "輸入評論,點擊發送", }, attachment: { preview: "預覽",