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 {