This commit is contained in:
zhandouxiaojiji committed 2020-12-02 13:06:18 +08:00
1 parent d87cba3622
commit 242a960634
3 files changed
+41 -26

No files matched your search

+12 -9
View File
@@ -27,6 +27,7 @@ interface NodePanelProps {
model: BehaviorNodeModel;
settings: Settings;
updateNode: (id: string, forceUpdate: boolean) => void;
pushUndoStack: () => void;
}
interface NodePanelState {}
@@ -67,20 +68,12 @@ export default class NodePanel extends React.Component<NodePanelProps> {
onFinish = (values: any) => {
console.log("Success:", values);
const { updateNode, model, settings } = this.props;
const { updateNode, pushUndoStack, model, settings } = this.props;
const conf = settings.getNodeConf(values.name);
if (!conf) {
notification.warn({ message: `节点${values.name}未定义` });
return;
}
var forceUpdate = false;
if (model.name != values.name) {
model.name = values.name;
forceUpdate = true;
}
model.desc = values.desc;
model.debug = values.debug;
var args: any = {};
if (values.customArgs) {
try {
@@ -91,6 +84,16 @@ export default class NodePanel extends React.Component<NodePanelProps> {
}
}
pushUndoStack();
var forceUpdate = false;
if (model.name != values.name) {
model.name = values.name;
forceUpdate = true;
}
model.desc = values.desc;
model.debug = values.debug;
if (conf.args) {
conf.args.forEach((e) => {
const k = "args." + e.name;