fix(测试跟踪): 复制功能用例点击关联缺陷报错

--bug=1010182 --user=陈建星 [测试跟踪]github#10365点击关联缺陷报错 https://www.tapd.cn/55049933/s/1102940
This commit is contained in:
chenjianxing 2022-02-10 20:12:40 +08:00 committed by john1298308460
parent c3c42fa1d4
commit 24d153ca90
4 changed files with 12 additions and 8 deletions

View File

@ -254,7 +254,7 @@ export default {
methods: {
initData(){
//
if(this.data.length > 0){
if(this.data && this.data.length > 0){
this.data[0].showBatchTip = true;
}
},

View File

@ -114,6 +114,7 @@
<ms-form-divider :title="$t('test_track.case.other_info')"/>
<test-case-edit-other-info :read-only="readOnly" :project-id="projectIds" :form="form"
:is-copy="currentTestCaseInfo.isCopy"
:label-width="formLabelWidth" :case-id="form.id" :version-enable="versionEnable"
ref="otherInfo"/>

View File

@ -29,6 +29,7 @@
<test-case-issue-relate
v-if="tabActiveName === 'bug'"
:plan-id="planId"
:is-copy="isCopy"
:read-only="readOnly && !(isTestPlan)"
:case-id="caseId" ref="issue"/>
</el-tab-pane>
@ -90,7 +91,7 @@ export default {
DependenciesList,
TestCaseTestRelate,
FormRichTextItem, TestCaseIssueRelate, TestCaseAttachment, MsRichText, TestCaseRichText},
props: ['form', 'labelWidth', 'caseId', 'readOnly', 'projectId', 'isTestPlan', 'planId', 'versionEnable'],
props: ['form', 'labelWidth', 'caseId', 'readOnly', 'projectId', 'isTestPlan', 'planId', 'versionEnable', 'isCopy'],
data() {
return {
result: {},

View File

@ -124,7 +124,7 @@ export default {
issueRelateVisible: false
}
},
props: ['caseId', 'readOnly','planId'],
props: ['caseId', 'readOnly','planId', 'isCopy'],
computed: {
issueStatusMap() {
return ISSUE_STATUS_MAP;
@ -171,20 +171,22 @@ export default {
return getCustomFieldValue(row, field, this.members);
},
getIssues() {
if (!this.isCopy) {
let result = getIssuesByCaseId(this.caseId, this.page);
if (result) {
this.page.result = result;
}
}
},
addIssue() {
if (!this.caseId) {
if (!this.caseId || this.isCopy) {
this.$warning(this.$t('api_test.automation.save_case_info'));
return;
}
this.$refs.issueEdit.open();
},
relateIssue() {
if (!this.caseId) {
if (!this.caseId || this.isCopy) {
this.$warning(this.$t('api_test.automation.save_case_info'));
return;
}