diff --git a/frontend/packages/flow-pc/flow-pc-design/src/components/design-editor/node-components/scripts/components/advanced-script-editor.tsx b/frontend/packages/flow-pc/flow-pc-design/src/components/design-editor/node-components/scripts/components/advanced-script-editor.tsx new file mode 100644 index 00000000..de687c35 --- /dev/null +++ b/frontend/packages/flow-pc/flow-pc-design/src/components/design-editor/node-components/scripts/components/advanced-script-editor.tsx @@ -0,0 +1,87 @@ +import {ScriptType,GroovyVariableMapping} from '@/components/design-editor/typings/script'; +import {Button, Input, Space} from 'antd'; +import React from "react"; +import {GroovyScriptContent} from "@/components/design-editor/node-components/scripts/components/groovy-script-modal"; +import { + NodeTitleGroovyConvertor +} from "@/components/design-editor/node-components/scripts/services/convertor/node-title"; +import { DeleteOutlined } from "@ant-design/icons"; +import { + GroovyScriptConverterContext +} from "@/components/design-editor/node-components/scripts/services/convertor/utils"; + +const {TextArea} = Input; + +interface ScriptEditorProps { + /** 脚本类型 */ + type: ScriptType; + /** 当前脚本内容 */ + script: string; + /** 变量映射列表 */ + variables: GroovyVariableMapping[]; + /** 脚本变更回调 */ + onChange: (script: string) => void; + /** 是否只读 */ + readonly?: boolean; +} + +/** + * 高级脚本编辑器组件 + * 支持自由编辑 Groovy 脚本 + */ +export const ScriptEditor:React.FC = (props: ScriptEditorProps)=> { + const {script, onChange, readonly = false, variables} = props; + + const handleChange = (value: string) => { + if (!readonly) { + onChange(value); + } + }; + + return ( +