fix(测试跟踪): 【测试跟踪】github#26207,创建缺陷页面关联用例列表显示异常

--bug=1028840 --user=白奇 【测试跟踪】github#26207,创建缺陷页面关联用例列表显示异常 https://www.tapd.cn/55049933/s/1420643
This commit is contained in:
baiqi 2023-09-25 15:17:49 +08:00 committed by fit2-zhao
parent 50b4b64121
commit 7a1d5a8e5c
2 changed files with 24 additions and 9 deletions

View File

@ -197,10 +197,7 @@
:label="$t('test_track.review_view.relevance_case')" :label="$t('test_track.review_view.relevance_case')"
name="relateTestCase" name="relateTestCase"
> >
<el-form-item <el-form-item style="margin-left: -80px">
v-if="!isCaseEdit && tabActiveName === 'relateTestCase'"
style="margin-left: -80px"
>
<test-case-issue-list <test-case-issue-list
:issues-id="form.id" :issues-id="form.id"
ref="testCaseIssueList" ref="testCaseIssueList"
@ -340,18 +337,28 @@
import TemplateComponentEditHeader from "@/business/plan/view/comonents/report/TemplateComponentEditHeader"; import TemplateComponentEditHeader from "@/business/plan/view/comonents/report/TemplateComponentEditHeader";
import MsFormDivider from "metersphere-frontend/src/components/MsFormDivider"; import MsFormDivider from "metersphere-frontend/src/components/MsFormDivider";
import FormRichTextItem from "metersphere-frontend/src/components/FormRichTextItem"; import FormRichTextItem from "metersphere-frontend/src/components/FormRichTextItem";
import {buildCustomFields, parseCustomFieldForId,} from "metersphere-frontend/src/utils/custom_field"; import {
buildCustomFields,
parseCustomFieldForId,
} from "metersphere-frontend/src/utils/custom_field";
import CustomFiledComponent from "metersphere-frontend/src/components/template/CustomFiledComponent"; import CustomFiledComponent from "metersphere-frontend/src/components/template/CustomFiledComponent";
import TestCaseIssueList from "@/business/issue/TestCaseIssueList"; import TestCaseIssueList from "@/business/issue/TestCaseIssueList";
import IssueEditDetail from "@/business/issue/IssueEditDetail"; import IssueEditDetail from "@/business/issue/IssueEditDetail";
import {byteToSize, getTypeByFileName, getUUID,} from "metersphere-frontend/src/utils"; import {
byteToSize,
getTypeByFileName,
getUUID,
} from "metersphere-frontend/src/utils";
import { import {
getCurrentProjectID, getCurrentProjectID,
getCurrentUser, getCurrentUser,
getCurrentUserId, getCurrentUserId,
getCurrentWorkspaceId, getCurrentWorkspaceId,
} from "metersphere-frontend/src/utils/token"; } from "metersphere-frontend/src/utils/token";
import {hasLicense, hasPermission,} from "metersphere-frontend/src/utils/permission"; import {
hasLicense,
hasPermission,
} from "metersphere-frontend/src/utils/permission";
import { import {
enableThirdPartTemplate, enableThirdPartTemplate,
getComments, getComments,
@ -376,7 +383,7 @@ import CustomFiledFormItem from "metersphere-frontend/src/components/form/Custom
import MsMarkDownText from "metersphere-frontend/src/components/MsMarkDownText"; import MsMarkDownText from "metersphere-frontend/src/components/MsMarkDownText";
import IssueComment from "@/business/issue/IssueComment"; import IssueComment from "@/business/issue/IssueComment";
import ReviewCommentItem from "@/business/review/commom/ReviewCommentItem"; import ReviewCommentItem from "@/business/review/commom/ReviewCommentItem";
import {TokenKey} from "metersphere-frontend/src/utils/constants"; import { TokenKey } from "metersphere-frontend/src/utils/constants";
import TestCaseAttachment from "@/business/case/components/TestCaseAttachment"; import TestCaseAttachment from "@/business/case/components/TestCaseAttachment";
import axios from "axios"; import axios from "axios";
import MsFileMetadataList from "metersphere-frontend/src/components/environment/commons/variable/QuoteFileList"; import MsFileMetadataList from "metersphere-frontend/src/components/environment/commons/variable/QuoteFileList";
@ -533,6 +540,8 @@ export default {
if (this.type === "edit" && this.issueId) { if (this.type === "edit" && this.issueId) {
this.getFileMetaData(this.issueId); this.getFileMetaData(this.issueId);
} }
} else if (this.tabActiveName === "relateTestCase") {
this.$refs.testCaseIssueList.initTableData();
} }
}, },
}, },

View File

@ -55,7 +55,7 @@ import MsTableColumn from "metersphere-frontend/src/components/table/MsTableColu
import PriorityTableItem from "@/business/common/tableItems/planview/PriorityTableItem"; import PriorityTableItem from "@/business/common/tableItems/planview/PriorityTableItem";
import TypeTableItem from "@/business/common/tableItems/planview/TypeTableItem"; import TypeTableItem from "@/business/common/tableItems/planview/TypeTableItem";
import TestCaseRelateList from "@/business/issue/TestCaseRelateList"; import TestCaseRelateList from "@/business/issue/TestCaseRelateList";
import {getTestCaseIssueList} from "@/api/testCase"; import { getTestCaseIssueList } from "@/api/testCase";
export default { export default {
name: "TestCaseIssueList", name: "TestCaseIssueList",
@ -83,6 +83,7 @@ export default {
exec: this.handleDelete, exec: this.handleDelete,
}, },
], ],
cacheAddRows: [], //
}; };
}, },
props: { props: {
@ -103,6 +104,7 @@ export default {
this.testCaseContainIds.delete(item.id); this.testCaseContainIds.delete(item.id);
this.tableData.splice(index, 1); this.tableData.splice(index, 1);
this.deleteIds.add(item.id); this.deleteIds.add(item.id);
this.cacheAddRows.splice(index, 1);
}, },
clear() { clear() {
this.addIds.clear(); this.addIds.clear();
@ -121,6 +123,9 @@ export default {
this.testCaseContainIds.add(item.id); this.testCaseContainIds.add(item.id);
}); });
this.$refs.table.reloadTable(); this.$refs.table.reloadTable();
if (this.cacheAddRows.length > 0) {
this.tableData.push(...this.cacheAddRows);
}
this.result.loading = false; this.result.loading = false;
}); });
} }
@ -138,6 +143,7 @@ export default {
this.addIds.add(i.id); this.addIds.add(i.id);
}); });
this.tableData.push(...selectData); this.tableData.push(...selectData);
this.cacheAddRows.push(...selectData);
}, },
}, },
}; };