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: { methods: {
initData(){ initData(){
// //
if(this.data.length > 0){ if(this.data && this.data.length > 0){
this.data[0].showBatchTip = true; this.data[0].showBatchTip = true;
} }
}, },

View File

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

View File

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

View File

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