feat: 脑图缺陷支持编辑
This commit is contained in:
parent
59f61557e3
commit
224eeb945f
|
@ -45,7 +45,7 @@
|
|||
not exists (
|
||||
select id
|
||||
from custom_field cf_child
|
||||
where cf_child.name = cf.name and cf_child.global != 1 and cf_child.workspace_id = #{request.workspaceId}
|
||||
where cf_child.name = cf.name and cf_child.scene = cf.scene and cf_child.global != 1 and cf_child.workspace_id = #{request.workspaceId}
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
@ -57,11 +57,16 @@ public class IssuesController {
|
|||
issuesService.updateIssues(issuesRequest);
|
||||
}
|
||||
|
||||
@GetMapping("/get/{id}")
|
||||
@GetMapping("/get/case/{id}")
|
||||
public List<IssuesDao> getIssues(@PathVariable String id) {
|
||||
return issuesService.getIssues(id);
|
||||
}
|
||||
|
||||
@GetMapping("/get/{id}")
|
||||
public IssuesWithBLOBs getIssue(@PathVariable String id) {
|
||||
return issuesService.getIssue(id);
|
||||
}
|
||||
|
||||
@GetMapping("/plan/get/{planId}")
|
||||
public List<IssuesDao> getIssuesByPlanoId(@PathVariable String planId) {
|
||||
return issuesService.getIssuesByPlanoId(planId);
|
||||
|
|
|
@ -161,6 +161,7 @@ public abstract class AbstractIssuePlatform implements IssuesPlatform {
|
|||
}
|
||||
|
||||
protected void handleTestCaseIssues(IssuesUpdateRequest issuesRequest) {
|
||||
if (!issuesRequest.isWithCaseId()) return;
|
||||
String issuesId = issuesRequest.getId();
|
||||
if (StringUtils.isNotBlank(issuesRequest.getTestCaseId())) {
|
||||
insertTestCaseIssues(issuesId, issuesRequest.getTestCaseId());
|
||||
|
|
|
@ -12,6 +12,8 @@ public class IssuesUpdateRequest extends IssuesWithBLOBs {
|
|||
private String content;
|
||||
private String testCaseId;
|
||||
private String workspaceId;
|
||||
// 带caseId的更新, 默认更新是同时保存用例的关联关系,脑图保存缺陷,不带caseId
|
||||
private boolean withCaseId = true;
|
||||
|
||||
private List<String> tapdUsers;
|
||||
/**
|
||||
|
|
|
@ -176,6 +176,10 @@ public class IssuesService {
|
|||
return getIssuesByProjectIdOrCaseId(issueRequest);
|
||||
}
|
||||
|
||||
public IssuesWithBLOBs getIssue(String id) {
|
||||
return issuesMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public List<IssuesDao> getIssuesByProjectIdOrCaseId(IssuesRequest issueRequest) {
|
||||
List<IssuesDao> issues;
|
||||
if (StringUtils.isNotBlank(issueRequest.getProjectId())) {
|
||||
|
|
|
@ -39,6 +39,7 @@ import {getTestCasesForMinder, getMinderExtraNode} from "@/network/testCase";
|
|||
import {addIssueHotBox, getSelectedNodeData, handleIssueAdd, handleIssueBatch} from "./minderUtils";
|
||||
import IssueRelateList from "@/business/components/track/case/components/IssueRelateList";
|
||||
import TestPlanIssueEdit from "@/business/components/track/case/components/TestPlanIssueEdit";
|
||||
import {getIssuesById} from "@/network/Issue";
|
||||
export default {
|
||||
name: "TestCaseMinder",
|
||||
components: {TestPlanIssueEdit, IssueRelateList, MsModuleMinder},
|
||||
|
@ -107,11 +108,17 @@ name: "TestCaseMinder",
|
|||
let minder = window.minder;
|
||||
let selectNodes = minder.getSelectedNodes();
|
||||
let isNotDisableNode = false;
|
||||
// 如果鼠标双击了非模块的节点,表示已经编辑
|
||||
selectNodes.forEach(node => {
|
||||
// 如果鼠标双击了非模块的节点,表示已经编辑
|
||||
if (!node.data.disable) {
|
||||
isNotDisableNode = true;
|
||||
}
|
||||
if (node.data.type === 'issue') {
|
||||
getIssuesById(node.data.id, (data) => {
|
||||
data.customFields = JSON.parse(data.customFields);
|
||||
this.$refs.issueEdit.open(data);
|
||||
});
|
||||
}
|
||||
});
|
||||
if (isNotDisableNode) {
|
||||
this.setIsChange(true);
|
||||
|
|
|
@ -23,12 +23,13 @@
|
|||
import MsModuleMinder from "@/business/components/common/components/MsModuleMinder";
|
||||
import {
|
||||
handleExpandToLevel, listenBeforeExecCommand, listenNodeSelected, loadSelectNodes,
|
||||
tagBatch, getSelectedNodeData, handleIssueAdd, handleIssueBatch
|
||||
tagBatch, getSelectedNodeData, handleIssueAdd, handleIssueBatch, listenDblclick
|
||||
} from "@/business/components/track/common/minder/minderUtils";
|
||||
import {getPlanCasesForMinder} from "@/network/testCase";
|
||||
import IssueRelateList from "@/business/components/track/case/components/IssueRelateList";
|
||||
import TestPlanIssueEdit from "@/business/components/track/case/components/TestPlanIssueEdit";
|
||||
import {addIssueHotBox} from "./minderUtils";
|
||||
import {getIssuesById} from "@/network/Issue";
|
||||
export default {
|
||||
name: "TestPlanMinder",
|
||||
components: {MsModuleMinder, TestPlanIssueEdit, IssueRelateList},
|
||||
|
@ -76,9 +77,9 @@ name: "TestPlanMinder",
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
handleAfterMount() {
|
||||
handleAfterMount: function () {
|
||||
listenNodeSelected(() => {
|
||||
loadSelectNodes(this.getParam(), getPlanCasesForMinder, this.setParamCallback);
|
||||
loadSelectNodes(this.getParam(), getPlanCasesForMinder, this.setParamCallback);
|
||||
});
|
||||
listenBeforeExecCommand((even) => {
|
||||
if (even.commandName === 'expandtolevel') {
|
||||
|
@ -87,6 +88,16 @@ name: "TestPlanMinder",
|
|||
}
|
||||
});
|
||||
|
||||
listenDblclick(() => {
|
||||
let data = getSelectedNodeData();
|
||||
if (data.type === 'issue') {
|
||||
getIssuesById(data.id, (data) => {
|
||||
data.customFields = JSON.parse(data.customFields);
|
||||
this.$refs.issueEdit.open(data);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
tagBatch([...this.tags, this.$t('test_track.plan.plan_status_prepare')]);
|
||||
|
||||
addIssueHotBox(this);
|
||||
|
|
|
@ -108,17 +108,25 @@ export function handleTestCaseAdd(pid, data) {
|
|||
});
|
||||
}
|
||||
|
||||
export function appendIssueChildNode(pNode, issue) {
|
||||
let data = getNodeData('缺陷ID:' + issue.num, null, true, 'issue');
|
||||
data.id = issue.id;
|
||||
appendChildNode(pNode, data);
|
||||
}
|
||||
|
||||
export function handleIssueAdd(data) {
|
||||
let pNode = getSelectedNode();
|
||||
appendChildNode(pNode, getNodeData('缺陷ID:' + data.num, null, true));
|
||||
if (data && data.id) {
|
||||
let pNode = getSelectedNode();
|
||||
appendIssueChildNode(pNode, data);
|
||||
expandNode(pNode);
|
||||
pNode.render();
|
||||
}
|
||||
}
|
||||
|
||||
export function handleIssueBatch(issues) {
|
||||
let pNode = getSelectedNode();
|
||||
issues.forEach(item => {
|
||||
appendChildNode(pNode, getNodeData('缺陷ID:' + item.num, null, true));
|
||||
appendIssueChildNode(pNode, item);
|
||||
});
|
||||
expandNode(pNode);
|
||||
pNode.render();
|
||||
|
@ -241,12 +249,12 @@ export function appendCase(parent, item, isDisable, setParamCallback) {
|
|||
|
||||
if (item.issueList && item.issueList.length > 0) {
|
||||
item.issueList.forEach(issue => {
|
||||
appendChildNode(caseNode, getNodeData('缺陷ID:' + issue.num, null, true));
|
||||
appendIssueChildNode(caseNode, issue);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getNodeData(text, resource, isDisable) {
|
||||
function getNodeData(text, resource, isDisable, type) {
|
||||
if (text) {
|
||||
let data = {
|
||||
text: text,
|
||||
|
@ -255,6 +263,9 @@ function getNodeData(text, resource, isDisable) {
|
|||
if (isDisable) {
|
||||
data.disable = true;
|
||||
}
|
||||
if (type) {
|
||||
data.type = type;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -275,7 +275,9 @@ export default {
|
|||
buildCustomFields(this.form, param, this.issueTemplate);
|
||||
if (this.isPlan) {
|
||||
param.testCaseIds = [this.caseId];
|
||||
param.withCaseId = false;
|
||||
} else {
|
||||
param.withCaseId = true;
|
||||
param.testCaseIds = Array.from(this.testCaseContainIds);
|
||||
}
|
||||
if (this.planId) {
|
||||
|
|
|
@ -26,13 +26,17 @@ export function getIssues(page) {
|
|||
|
||||
export function getIssuesByCaseId(caseId, page) {
|
||||
if (caseId) {
|
||||
return get('issues/get/' + caseId, (response) => {
|
||||
return get('issues/get/case/' + caseId, (response) => {
|
||||
page.data = response.data;
|
||||
buildIssues(page);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function getIssuesById(id, callback) {
|
||||
return id ? baseGet('/issues/get/' + id, callback) : {};
|
||||
}
|
||||
|
||||
export function getIssuesByPlanId(planId, callback) {
|
||||
return planId ? baseGet('/issues/plan/get/' + planId, callback) : {};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue