fix(工作台): 测试计划关联功能用例页面,异常的用例标签数据导致页面崩溃

--bug=1021958 --user=陈建星 【测试跟踪】测试计划-关联功能用例-关联页面卡死 https://www.tapd.cn/55049933/s/1327266
This commit is contained in:
chenjianxing 2023-01-12 16:26:36 +08:00 committed by jianxing
parent 1d0dc3c6c0
commit 068f4f4a12
4 changed files with 7 additions and 12 deletions

View File

@ -16,6 +16,7 @@ import {getPageDate, getPageInfo} from "metersphere-frontend/src/utils/tableUtil
import {TEST_PLAN_RELEVANCE_FUNC_CONFIGS} from "metersphere-frontend/src/components/search/search-components";
import FunctionalRelevance from "@/business/plan/view/comonents/functional/FunctionalRelevance";
import {addTestCaseRelationship, getTestCaseNodesByCaseFilter, testCaseRelationshipRelateList} from "@/api/testCase";
import {parseTag} from "@/business/utils/sdk-utils";
export default {
name: "RelationshipFunctionalRelevance",
@ -86,10 +87,7 @@ export default {
.then(response => {
getPageDate(response, this.page);
let data = this.page.data;
data.forEach(item => {
item.checked = false;
item.tags = JSON.parse(item.tags);
});
parseTag(data);
})
},
getTreeNodes(vueObj) {

View File

@ -114,7 +114,7 @@ import {
} from "metersphere-frontend/src/components/search/search-components";
import MsSearch from "metersphere-frontend/src/components/search/MsSearch";
import ApiListContainer from "@/business/plan/view/comonents/api/ApiListContainer";
import {buildBatchParam, hasLicense, isProjectVersionEnable} from "@/business/utils/sdk-utils";
import {buildBatchParam, hasLicense, isProjectVersionEnable, parseTag} from "@/business/utils/sdk-utils";
import PriorityTableItem from "@/business/common/tableItems/planview/PriorityTableItem";
import {apiDefinitionGet} from "@/api/remote/api/api-definition";
import {testPlanApiCaseRelevanceList} from "@/api/remote/plan/test-plan-api-case";
@ -246,11 +246,7 @@ export default {
this.loading = false;
this.total = response.data.itemCount;
this.tableData = response.data.listObject;
this.tableData.forEach(item => {
if (item.tags && item.tags.length > 0) {
item.tags = JSON.parse(item.tags);
}
});
parseTag(this.tableData);
});
},
clear() {

View File

@ -18,6 +18,7 @@ import FunctionalRelevance from "@/business/plan/view/comonents/functional/Funct
import {testPlanRelevance} from "@/api/remote/plan/test-plan";
import {testCaseRelateList} from "@/api/testCase";
import {testCaseNodeListPlanRelate} from "@/api/test-case-node";
import {parseTag} from "@/business/utils/sdk-utils";
export default {
name: "TestPlanFunctionalRelevance",
@ -88,9 +89,9 @@ export default {
this.page.loading = false;
getPageDate(response, this.page);
let data = this.page.data;
parseTag(this.page.data);
data.forEach(item => {
item.checked = false;
item.tags = JSON.parse(item.tags);
});
});
},

View File

@ -1,5 +1,5 @@
export {operationConfirm, removeGoBackListener, handleCtrlSEvent, byteToSize, resizeTextarea,
getTypeByFileName, strMapToObj, getUUID, windowPrint} from "metersphere-frontend/src/utils";
getTypeByFileName, strMapToObj, getUUID, windowPrint, parseTag} from "metersphere-frontend/src/utils";
export {parseCustomFilesForList, getCustomFieldFilter, buildBatchParam} from "metersphere-frontend/src/utils/tableUtils";
export {sortCustomFields, parseCustomField, buildCustomFields} from "metersphere-frontend/src/utils/custom_field";
export {getCurrentProjectID, getCurrentWorkspaceId, getCurrentUser, setCurrentProjectID} from "metersphere-frontend/src/utils/token";