From bb79f40f1b6f7ac03e14a74db66b90f2f46d2551 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Mon, 20 Feb 2023 21:23:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E7=94=A8=E4=BE=8B=E9=9C=80=E6=B1=82=E6=9C=AA?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1023432 --user=陈建星 【测试跟踪】功能用例-公共用例库列表-操作-查看-详情页点击复制进入创建用例页面-关系需求未显示 https://www.tapd.cn/55049933/s/1338979 --- .../frontend/src/styles/business/main.css | 9 +++ .../case/components/case/CaseBaseInfo.vue | 67 ++++++++++--------- 2 files changed, 44 insertions(+), 32 deletions(-) diff --git a/framework/sdk-parent/frontend/src/styles/business/main.css b/framework/sdk-parent/frontend/src/styles/business/main.css index 13b5be5287..725785a1aa 100644 --- a/framework/sdk-parent/frontend/src/styles/business/main.css +++ b/framework/sdk-parent/frontend/src/styles/business/main.css @@ -335,3 +335,12 @@ textarea { .el-message-box { margin-bottom: 20%; } + + +/* 超出文本显示... */ +.text-ellipsis { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + -o-text-overflow:ellipsis; +} 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 329c8a7922..b06c9aa08b 100644 --- a/test-track/frontend/src/business/case/components/case/CaseBaseInfo.vue +++ b/test-track/frontend/src/business/case/components/case/CaseBaseInfo.vue @@ -233,7 +233,7 @@
{{ $t("test_track.case.other") }}
-
{{ handleDemandOptionLabel(data) }}
+
{{ handleDemandOptionLabel(data) }}
@@ -253,7 +253,7 @@ -
+
{{ $t("test_track.case.demand_name_id") }} @@ -339,9 +339,6 @@ import CustomFiledFormRow from "./CaseCustomFiledFormRow"; import { useStore } from "@/store"; import BaseEditItemComponent from "../BaseEditItemComponent"; import { issueDemandList } from "@/api/issue"; -import { - getCurrentProjectID, -} from "metersphere-frontend/src/utils/token"; export default { name: "CaseBaseInfo", components: { @@ -359,6 +356,13 @@ export default { this.form.demandId = null; } }, + 'form.demandId'() { + this.buildDemandOptions(); + }, + projectId() { + this.getDemandOptions(); + this.getVersionOptions(); + } }, data() { return { @@ -438,6 +442,7 @@ export default { demandLabel: "", demandOptions: [], versionFilters: [], + demandList: [], }; }, props: { @@ -455,11 +460,9 @@ export default { testCaseTemplate: Object, defaultOpen: String, versionEnable: Boolean, + projectId: String, }, computed: { - projectId() { - return getCurrentProjectID(); - }, isCustomNum() { return useStore().currentProjectIsCustomNum; }, @@ -515,16 +518,13 @@ export default { } return ""; }, - validateAllForm(callback) { - callback( - this.editable ? true : this.validateForm() && this.validateCustomForm() - ); - }, getVersionOptions() { if (hasLicense()) { - getProjectVersions(getCurrentProjectID()).then( - (r) => (this.versionFilters = r.data) - ); + if (this.projectId) { + getProjectVersions(this.projectId).then( + (r) => (this.versionFilters = r.data) + ); + } } }, changeVersion(data) { @@ -589,11 +589,6 @@ export default { }, validateForm() { let isValidate = true; - // this.$refs["caseFrom"].validate((valid) => { - // if (!valid) { - // isValidate = false; - // } - // }); this.$refs["baseCaseFrom"].validate((valid) => { if (!valid) { isValidate = false; @@ -626,17 +621,24 @@ export default { getDemandOptions() { this.result = { loading: true }; this.demandLabel = ""; - issueDemandList(this.projectId) - .then((r) => { - this.demandOptions = []; - if (r.data && r.data.length > 0) { - this.buildDemandCascaderOptions(r.data, this.demandOptions, []); - } - this.addOtherOption(); - }) - .catch(() => { - this.addOtherOption(); - }); + if (this.projectId) { + issueDemandList(this.projectId) + .then((r) => { + this.demandOptions = []; + this.demandList = r.data; + this.buildDemandOptions(); + }) + .catch(() => { + this.addOtherOption(); + }); + } + }, + buildDemandOptions() { + this.demandOptions = []; + if (this.demandList.length > 0) { + this.addOtherOption(); + this.buildDemandCascaderOptions(this.demandList, this.demandOptions, []); + } }, addOtherOption() { this.demandOptions.unshift({ @@ -714,6 +716,7 @@ export default { .story-label { line-height: 22px; color: #1f2329; + max-width: 300px; } } .selectHover {