fix(功能用例): 脑图用例详情保存回显问题

This commit is contained in:
guoyuqi 2024-06-26 20:13:07 +08:00 committed by 刘瑞斌
parent d95a034f46
commit e5a1488710
1 changed files with 11 additions and 1 deletions

View File

@ -179,7 +179,17 @@
const selectedNode: MinderJsonNode = window.minder.getSelectedNode(); const selectedNode: MinderJsonNode = window.minder.getSelectedNode();
const priority = (formItem.value.find((item) => item.title === 'Case Priority' || item.title === '用例等级') const priority = (formItem.value.find((item) => item.title === 'Case Priority' || item.title === '用例等级')
?.value || 'P0') as string; ?.value || 'P0') as string;
const priorityNumber = Number(priority.match(/\d+/)?.[0]) || 0;
const selectedNodePriorityNumber = selectedNode?.data?.priority ? selectedNode?.data?.priority : 0;
const realPriorityNumber = selectedNodePriorityNumber > 0 ? selectedNodePriorityNumber - 1 : 0;
const priorityNumber = Number(priority.match(/\d+/)?.[0]) || realPriorityNumber || 0;
formItem.value.forEach((item) => {
formRules.value.forEach((rule) => {
if (item.field === rule.name) {
rule.value = item.value;
}
});
});
if (selectedNode?.data) { if (selectedNode?.data) {
selectedNode.data = { selectedNode.data = {
...selectedNode.data, ...selectedNode.data,