Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 18 additions & 9 deletions framework/elsa/fit-elsa-react/src/components/base/jadeNode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,17 @@ export const jadeNode = (id, x, y, width, height, parent, drawer) => {

// 从当前节点开始启动递归
explorePreShapesRecursive(self.id);
const systemEnv = self.page.getShapeById(VIRTUAL_CONTEXT_NODE.id);
systemEnv.runnable = true;
preNodeInfos.push({
id: systemEnv.id,
name: systemEnv.text,
node: systemEnv,
runnable: true,
observableList: self.page.getObservableList(systemEnv.id),
});
if (self.isAllowReferenceSystemEnv()) {
const systemEnv = self.page.getShapeById(VIRTUAL_CONTEXT_NODE.id);
systemEnv.runnable = true;
preNodeInfos.push({
id: systemEnv.id,
name: systemEnv.text,
node: systemEnv,
runnable: true,
observableList: self.page.getObservableList(systemEnv.id),
});
}
preNodeInfos.shift();
return preNodeInfos;
};
Expand Down Expand Up @@ -367,6 +369,13 @@ export const jadeNode = (id, x, y, width, height, parent, drawer) => {
return self.page.getEvents().filter(l => l.fromShape === self.id && l.runnable);
};

/**
* 允许引用系统上下文节点.
*/
self.isAllowReferenceSystemEnv = () => {
return true;
};

/**
* 校验节点状态是否正常.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import {jadeNode} from "@/components/base/jadeNode.jsx";
import "./style.css";
import {codeComponent} from "@/components/code/codeComponent.jsx";
import {SECTION_TYPE} from "@/common/Consts.js";
import {codeNodeDrawer} from "@/components/code/CodeNodeDrawer.jsx";
import {jadeNode} from '@/components/base/jadeNode.jsx';
import './style.css';
import {codeComponent} from '@/components/code/codeComponent.jsx';
import {SECTION_TYPE} from '@/common/Consts.js';
import {codeNodeDrawer} from '@/components/code/CodeNodeDrawer.jsx';

/**
* 代码节点shape
Expand All @@ -18,7 +18,6 @@ import {codeNodeDrawer} from "@/components/code/CodeNodeDrawer.jsx";
export const codeNodeState = (id, x, y, width, height, parent, drawer) => {
const self = jadeNode(id, x, y, width, height, parent, drawer ? drawer : codeNodeDrawer);
self.type = "codeNodeState";
self.width = 360;
self.componentName = "codeComponent";
self.text = "代码节点"
self.width = 368;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import {useState} from 'react';
import {Button, Collapse, Popover} from 'antd';
import {DeleteOutlined, PlusOutlined, QuestionCircleOutlined} from '@ant-design/icons';
import {PlusOutlined, QuestionCircleOutlined} from '@ant-design/icons';
import {StartInputForm} from './StartInputForm.jsx';
import './style.css';
import {useConfigContext, useDispatch, useShapeContext} from '@/components/DefaultRoot.jsx';
Expand All @@ -16,6 +16,7 @@ import PropTypes from 'prop-types';
import {Trans, useTranslation} from 'react-i18next';
import {AppConfiguration} from '@/components/start/AppConfiguration.jsx';
import {JadeCollapse} from '@/components/common/JadeCollapse.jsx';
import IconTrashBin from '../asserts/icon-delete-trash-bin.svg?react'; // 导入背景图片

const {Panel} = Collapse;

Expand Down Expand Up @@ -87,7 +88,7 @@ export default function StartFormWrapper({data, shapeStatus}) {
type="text"
className="icon-button start-node-delete-icon-button"
onClick={() => handleDelete(item.id)}>
<DeleteOutlined/>
<IconTrashBin/>
</Button>
</>);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) 2025 Huawei Technologies Co., Ltd. All rights reserved.
* This file is a part of the ModelEngine Project.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import {v4 as uuidv4} from 'uuid';
import {DATA_TYPES, FROM_TYPE} from '@/common/Consts.js';

export const createDefaultVariable = () => ({
id: uuidv4(),
type: DATA_TYPES.OBJECT,
from: FROM_TYPE.EXPAND,
value: [{
id: uuidv4(),
name: 'key',
type: DATA_TYPES.ARRAY,
dataType: '',
from: FROM_TYPE.INPUT,
value: [],
referenceNode: '',
referenceId: '',
referenceKey: '',
}, {
id: uuidv4(),
name: 'value',
type: '',
from: FROM_TYPE.REFERENCE,
value: '',
referenceNode: '',
referenceId: '',
referenceKey: '',
}],
});
Loading