refactor(web): 优化流程节点的定义和实现

This commit is contained in:
v-zhangjc9
2025-07-10 12:08:13 +08:00
parent 898e20d5d7
commit 5e763637da
10 changed files with 467 additions and 513 deletions

View File

@@ -1,40 +1,20 @@
import {amisRender, commonInfo} from '../util/amis.tsx'
import {useState} from 'react'
import FlowEditor, {type GraphData} from '../components/flow/FlowEditor.tsx'
function Test() {
const [graphData] = useState<GraphData>({
nodes: [],
edges: [],
data: {},
})
return (
<div>
{amisRender(
{
debug: commonInfo.debug,
type: 'form',
canAccessSuperData: false,
actions: [
{
type: 'reset',
label: '重置',
},
{
type: 'submit',
label: '提交',
},
],
body: [
{
type: 'input-file',
required: true,
name: 'files',
label: '数据文件',
autoUpload: false,
drag: true,
multiple: true,
accept: '*',
maxSize: 104857600,
receiver: `${commonInfo.baseAiUrl}/upload`,
useChunk: false,
},
],
},
)}
<div className="h-screen">
<FlowEditor
inputSchema={{}}
graphData={graphData}
onGraphDataChange={data => console.log(data)}
/>
</div>
)
}