fix(测试跟踪): 脑图无法查看缺陷

--bug=1018770 --user=陈建星 【测试跟踪】测试计划/测试用例-脑图-双击缺陷名称无法跳转 https://www.tapd.cn/55049933/s/1275192
This commit is contained in:
chenjianxing 2022-10-24 20:20:23 +08:00 committed by jianxing
parent f67014da61
commit c9c8ee8f0c
3 changed files with 22 additions and 15 deletions

View File

@ -90,13 +90,19 @@ export function getIssuesById(id) {
return id ? get('/issues/get/' + id) : {}; return id ? get('/issues/get/' + id) : {};
} }
export function getIssuesListById(id, projectId, workspaceId) { export function getIssuesForMinder(id, projectId, workspaceId) {
let condition = { let condition = {
id: id, id: id,
projectId: projectId, projectId: projectId,
workspaceId: workspaceId workspaceId: workspaceId
}; };
return post('issues/list/' + 1 + '/' + 10, condition); return new Promise(resolve => {
post('issues/list/' + 1 + '/' + 10, condition)
.then((r) => {
parseCustomFilesForList(r.data.listObject);
resolve({data: r.data.listObject[0]});
});
});
} }
export function getIssuesByPlanId(planId) { export function getIssuesByPlanId(planId) {

View File

@ -72,10 +72,10 @@ import {setPriorityView} from "vue-minder-editor-plus/src/script/tool/utils";
import IsChangeConfirm from "metersphere-frontend/src/components/IsChangeConfirm"; import IsChangeConfirm from "metersphere-frontend/src/components/IsChangeConfirm";
import MsModuleMinder from "@/business/common/minder/MsModuleMinder"; import MsModuleMinder from "@/business/common/minder/MsModuleMinder";
const {getIssuesListById} = require("@/api/issue");
import {useStore} from "@/store" import {useStore} from "@/store"
import {mapState} from "pinia"; import {mapState} from "pinia";
import {getCurrentWorkspaceId} from "@/business/utils/sdk-utils"; import {getCurrentWorkspaceId} from "@/business/utils/sdk-utils";
import {getIssuesForMinder} from "@/api/issue";
export default { export default {
@ -204,10 +204,11 @@ export default {
isNotDisableNode = true; isNotDisableNode = true;
} }
if (node.data.type === 'issue') { if (node.data.type === 'issue') {
getIssuesListById(node.data.id, this.projectId, this.workspaceId, (data) => { getIssuesForMinder(node.data.id, this.projectId, this.workspaceId)
data.customFields = JSON.parse(data.customFields); .then((r) => {
this.$refs.issueEdit.open(data); let data = r.data;
}); this.$refs.issueEdit.open(data);
})
} }
}); });
if (isNotDisableNode) { if (isNotDisableNode) {

View File

@ -36,8 +36,6 @@
<script> <script>
import {setPriorityView} from "vue-minder-editor-plus/src/script/tool/utils"; import {setPriorityView} from "vue-minder-editor-plus/src/script/tool/utils";
const {getCurrentWorkspaceId} = require("metersphere-frontend/src/utils");
const {getIssuesListById} = require("@/api/issue");
import { import {
handleExpandToLevel, listenBeforeExecCommand, listenNodeSelected, loadSelectNodes, handleExpandToLevel, listenBeforeExecCommand, listenNodeSelected, loadSelectNodes,
tagBatch, getSelectedNodeData, handleIssueAdd, handleIssueBatch, listenDblclick, handleMinderIssueDelete tagBatch, getSelectedNodeData, handleIssueAdd, handleIssueBatch, listenDblclick, handleMinderIssueDelete
@ -49,7 +47,8 @@ import {addIssueHotBox} from "./minderUtils";
import MsModuleMinder from "@/business/common/minder/MsModuleMinder"; import MsModuleMinder from "@/business/common/minder/MsModuleMinder";
import {useStore} from "@/store"; import {useStore} from "@/store";
import {testPlanCaseMinderEdit} from "@/api/remote/plan/test-plan-case"; import {testPlanCaseMinderEdit} from "@/api/remote/plan/test-plan-case";
import {hasPermission} from "@/business/utils/sdk-utils"; import {getCurrentWorkspaceId, hasPermission} from "@/business/utils/sdk-utils";
import {getIssuesForMinder} from "@/api/issue";
export default { export default {
name: "TestPlanMinder", name: "TestPlanMinder",
@ -87,7 +86,7 @@ export default {
workspaceId() { workspaceId() {
return getCurrentWorkspaceId(); return getCurrentWorkspaceId();
}, },
disableMinder() { disableMinder() {
if (this.planStatus === 'Archived' || !hasPermission('PROJECT_TRACK_PLAN:READ+RUN')) { if (this.planStatus === 'Archived' || !hasPermission('PROJECT_TRACK_PLAN:READ+RUN')) {
return true return true
} else { } else {
@ -137,10 +136,11 @@ export default {
listenDblclick(() => { listenDblclick(() => {
let data = getSelectedNodeData(); let data = getSelectedNodeData();
if (data.type === 'issue') { if (data.type === 'issue') {
getIssuesListById(data.id, this.projectId, this.workspaceId, (data) => { getIssuesForMinder(data.id, this.projectId, this.workspaceId)
data.customFields = JSON.parse(data.customFields); .then((r) => {
this.$refs.issueEdit.open(data); let data = r.data;
}); this.$refs.issueEdit.open(data);
});
} }
}); });