From 2dd7c7093f3adbb2f94fd089ab8e640a07a33997 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Wed, 15 Mar 2023 15:58:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=AD=97=E6=AE=B5=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1024252 --user=宋昌昌 【测试跟踪】自定义字段非必填是,显示的“暂无”,字号和颜色不对 https://www.tapd.cn/55049933/s/1350587 --- .../db/migration/V125__2.0.0_ddl__release.sql | 6 -- .../case/components/BaseEditItemComponent.vue | 60 +++++++++++-------- 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/system-setting/backend/src/main/resources/db/migration/V125__2.0.0_ddl__release.sql b/system-setting/backend/src/main/resources/db/migration/V125__2.0.0_ddl__release.sql index b7b371d0ef..0cfd09d686 100644 --- a/system-setting/backend/src/main/resources/db/migration/V125__2.0.0_ddl__release.sql +++ b/system-setting/backend/src/main/resources/db/migration/V125__2.0.0_ddl__release.sql @@ -215,12 +215,6 @@ CREATE TABLE IF NOT EXISTS `file_attachment_metadata` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci; - --- --- V129_2-0-0_test_case_report_api_base_count -ALTER TABLE `test_plan_report_content` - ADD COLUMN `api_base_count` LONGTEXT COMMENT 'request (JSON format)'; - -- -- V1_2-0-0_load_test_remember_environment ALTER TABLE `load_test` diff --git a/test-track/frontend/src/business/case/components/BaseEditItemComponent.vue b/test-track/frontend/src/business/case/components/BaseEditItemComponent.vue index 4ba5f66154..a556c9a47c 100644 --- a/test-track/frontend/src/business/case/components/BaseEditItemComponent.vue +++ b/test-track/frontend/src/business/case/components/BaseEditItemComponent.vue @@ -110,7 +110,7 @@
@@ -143,6 +143,7 @@ export default { selfEditable: false, hoverEditable: false, memberOptions: [], + isCustomNone: false }; }, props: { @@ -176,19 +177,7 @@ export default { edit() { return this.editable; }, - }, - mounted() { - if ( - this.contentObject.content && - this.contentObject.content.type && - (this.contentObject.content.type === "member" || - this.contentObject.content.type === "multipleMember") - ) { - this.getMemberOptions(); - } - }, - methods: { - getCustomComponentType() { + getCustomComponentClass() { let type = "select"; let curType = this.contentObject.content.type || ""; //select @@ -211,11 +200,23 @@ export default { type = "select"; break; } - if (this.getCustomText() === this.$t("case.none")) { + if (this.isCustomNone) { type = type + ' custom-empty'; } return type; - }, + } + }, + mounted() { + if ( + this.contentObject.content && + this.contentObject.content.type && + (this.contentObject.content.type === "member" || + this.contentObject.content.type === "multipleMember") + ) { + this.getMemberOptions(); + } + }, + methods: { getMemberOptions() { getProjectMemberOption().then((r) => { let tempMemberOptions = r.data || []; @@ -256,7 +257,10 @@ export default { ? this.contentObject.content.value : this.contentObject.content.defaultValue; if(!tempValue || Array.isArray(tempValue) && tempValue.length <= 0){ + this.isCustomNone = true; return this.$t("case.none"); + } else { + this.isCustomNone = false; } if (Array.isArray(tempValue) && tempValue.length > 0) { let arr = []; @@ -286,16 +290,24 @@ export default { this.contentObject.content.type === "input" || this.contentObject.content.type === "richText" ) { - return this.contentObject.content.defaultValue === "" || - this.contentObject.content.defaultValue == null - ? this.$t("case.none") - : this.contentObject.content.defaultValue; + if (this.contentObject.content.defaultValue === "" || + this.contentObject.content.defaultValue == null) { + this.isCustomNone = true; + return this.$t("case.none"); + } else { + this.isCustomNone = false; + return this.contentObject.content.defaultValue; + } } - return this.contentObject.content.defaultValue === "" || - this.contentObject.content.defaultValue == null - ? this.$t("case.none") - : this.contentObject.content.defaultValue; + if (this.contentObject.content.defaultValue === "" || + this.contentObject.content.defaultValue == null) { + this.isCustomNone = true; + return this.$t("case.none"); + } else { + this.isCustomNone = false; + return this.contentObject.content.defaultValue; + } }, getStoryPlatform() { let demandOptions = this.contentObject.content.demandOptions || [];