医疗AI数智立体化体系V2.0泛化多模块编程操作手册--架构师版(下)
3.1.2 拖拽式编辑器(React + JointJS)
import React, { useEffect } from 'react';
import { dia } from '@joint/core';const WorkflowDesigner = () => {useEffect(() => {const graph = new dia.Graph();const paper = new dia.Paper({el: document.getElementById('paper'),model: graph,interactive: true,gridSize: 10});// 创建可拖拽的医疗节点const createNode = (type, x, y) => {return new joint.shapes.standard.Rectangle({position: { x, y },size: { width: 100, heig