fix(脑图): 脑图节点文本修改问题修复
This commit is contained in:
parent
e65069f90b
commit
ec43b88870
|
@ -265,6 +265,13 @@
|
|||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.activeCase.name,
|
||||
() => {
|
||||
baseInfoForm.value.name = props.activeCase.name;
|
||||
}
|
||||
);
|
||||
|
||||
defineExpose({
|
||||
makeParams,
|
||||
});
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
single-tag
|
||||
tag-enable
|
||||
sequence-enable
|
||||
@content-change="handleContentChange"
|
||||
@content-change="handleMinderNodeContentChange"
|
||||
@node-select="handleNodeSelect"
|
||||
@action="handleAction"
|
||||
@before-exec-command="handleBeforeExecCommand"
|
||||
|
@ -272,6 +272,17 @@
|
|||
});
|
||||
const activeExtraKey = ref<'baseInfo' | 'attachment' | 'comments' | 'bug'>('baseInfo');
|
||||
|
||||
function handleMinderNodeContentChange(node?: MinderJsonNode) {
|
||||
if (extraVisible.value) {
|
||||
// 已打开用例详情抽屉,更改用例节点文本时同步更新抽屉内的用例名称
|
||||
activeCase.value = {
|
||||
...activeCase.value,
|
||||
name: node?.data?.text || window.minder.getNodeById(activeCase.value.id)?.data?.text || '',
|
||||
};
|
||||
}
|
||||
handleContentChange(node);
|
||||
}
|
||||
|
||||
const fileList = ref<MsFileItem[]>([]);
|
||||
const checkUpdateFileIds = ref<string[]>([]);
|
||||
|
||||
|
|
|
@ -933,6 +933,7 @@
|
|||
node.data = {
|
||||
...node.data,
|
||||
...cloneDeep(configForm.value),
|
||||
text: node.data.text, // 避免因为此时脑图节点文本被修改而配置表单内的文本还是旧的
|
||||
};
|
||||
}
|
||||
configFormValidResult = true;
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
* @author: techird
|
||||
* @copyright: Baidu FEX, 2014
|
||||
*/
|
||||
import type { MinderJsonNode, MinderJsonNodeData } from '../../props';
|
||||
import Debug from '../tool/debug';
|
||||
import { isDisableNode, markChangeNode } from '../tool/utils';
|
||||
|
||||
|
@ -299,10 +300,10 @@ function InputRuntime(this: any) {
|
|||
* @Editor: Naixor
|
||||
* @Date: 2015.9.16
|
||||
*/
|
||||
const commitInputNode = (node: any, text: string) => {
|
||||
const commitInputNode = (node: MinderJsonNode, text: string) => {
|
||||
try {
|
||||
this.minder.decodeData('text', text).then((json: any) => {
|
||||
function importText(nodeT: any, jsonT: any, minder: any) {
|
||||
this.minder.decodeData('text', text).then((json: MinderJsonNodeData) => {
|
||||
function importText(nodeT: MinderJsonNode, jsonT: MinderJsonNodeData, minder: any) {
|
||||
const { data } = jsonT;
|
||||
nodeT.setText(data.text || '');
|
||||
const childrenTreeData = jsonT.children || [];
|
||||
|
@ -314,8 +315,13 @@ function InputRuntime(this: any) {
|
|||
}
|
||||
importText(node, json, this.minder);
|
||||
this.minder.fire('contentchange');
|
||||
this.minder.getRoot().renderTree();
|
||||
this.minder.layout(300);
|
||||
if (node.parent) {
|
||||
node.parent.renderTree();
|
||||
node.parent.layout();
|
||||
} else {
|
||||
this.minder.getRoot().renderTree();
|
||||
this.minder.layout(300);
|
||||
}
|
||||
});
|
||||
} catch (e: any) {
|
||||
this.minder.fire('contentchange');
|
||||
|
|
Loading…
Reference in New Issue