feat(web): 增加任务和流程图CRUD
This commit is contained in:
52
service-web/client/src/components/flow/node/CodeNode.tsx
Normal file
52
service-web/client/src/components/flow/node/CodeNode.tsx
Normal file
@@ -0,0 +1,52 @@
|
||||
import type {NodeProps} from '@xyflow/react'
|
||||
import AmisNode, {inputsFormColumns, outputsFormColumns} from './AmisNode.tsx'
|
||||
import React from 'react'
|
||||
|
||||
const CodeNode = (props: NodeProps) => AmisNode({
|
||||
nodeProps: props,
|
||||
type: 'normal',
|
||||
defaultNodeName: '代码执行',
|
||||
defaultNodeDescription: '执行自定义的处理代码',
|
||||
columnSchema: [
|
||||
...inputsFormColumns(),
|
||||
{
|
||||
type: 'divider',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
name: 'type',
|
||||
label: '代码类型',
|
||||
required: true,
|
||||
options: [
|
||||
{
|
||||
value: 'javascript',
|
||||
label: 'JavaScript',
|
||||
},
|
||||
{
|
||||
value: 'python',
|
||||
label: 'Python',
|
||||
},
|
||||
{
|
||||
value: 'lua',
|
||||
label: 'Lua',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'editor',
|
||||
required: true,
|
||||
label: '代码内容',
|
||||
name: 'content',
|
||||
language: '${type}',
|
||||
options: {
|
||||
wordWrap: 'bounded',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'divider',
|
||||
},
|
||||
...outputsFormColumns(true, true, {result: {type: 'string'}}),
|
||||
],
|
||||
})
|
||||
|
||||
export default React.memo(CodeNode)
|
||||
Reference in New Issue
Block a user