Browse Source

#13 feat: example里加上github地址

master
i5ting 4 years ago
parent
commit
dc51d9da95
  1. 124
      example/mock/db.json
  2. 2
      example/src/pages/index.tsx
  3. 4
      packages/core/src/mods/header/index.tsx

124
example/mock/db.json

@ -2,8 +2,8 @@
"default": [ "default": [
{ {
"position": { "position": {
"x": 420, "x": 450,
"y": 90 "y": 50
}, },
"size": { "size": {
"width": 80, "width": 80,
@ -92,8 +92,8 @@
}, },
{ {
"position": { "position": {
"x": 86, "x": 56,
"y": 70 "y": 30
}, },
"size": { "size": {
"width": 80, "width": 80,
@ -184,7 +184,7 @@
{ {
"position": { "position": {
"x": 246, "x": 246,
"y": 90 "y": 50
}, },
"size": { "size": {
"width": 80, "width": 80,
@ -284,7 +284,7 @@
"group": "bottom", "group": "bottom",
"attrs": { "attrs": {
"text": { "text": {
"text": "" "text": ""
} }
} }
}, },
@ -331,6 +331,118 @@
} }
} }
] ]
},
{
"position": {
"x": 246,
"y": 270
},
"size": {
"width": 80,
"height": 40
},
"shape": "imove-behavior",
"data": {
"label": "处理",
"configSchema": "{\n \n}",
"configData": {},
"dependencies": "{\n \n}",
"code": "export default async function(ctx) {\n \n}"
},
"ports": {
"groups": {
"top": {
"position": "top",
"attrs": {
"circle": {
"r": 3,
"magnet": true,
"stroke": "#666",
"strokeWidth": 1,
"fill": "#fff"
}
}
},
"right": {
"position": "right",
"attrs": {
"circle": {
"r": 3,
"magnet": true,
"stroke": "#666",
"strokeWidth": 1,
"fill": "#fff"
}
}
},
"bottom": {
"position": "bottom",
"attrs": {
"circle": {
"r": 3,
"magnet": true,
"stroke": "#666",
"strokeWidth": 1,
"fill": "#fff"
}
}
},
"left": {
"position": "left",
"attrs": {
"circle": {
"r": 3,
"magnet": true,
"stroke": "#666",
"strokeWidth": 1,
"fill": "#fff"
}
}
}
},
"items": [
{
"id": "top",
"group": "top"
},
{
"id": "right",
"group": "right"
},
{
"id": "bottom",
"group": "bottom"
},
{
"id": "left",
"group": "left"
}
]
},
"id": "c538d496-eeaa-4e95-9752-2a5d0c168e13",
"zIndex": 6
},
{
"shape": "edge",
"id": "4ffa7a28-a339-4686-81d8-20be9d62de14",
"source": {
"cell": "a6da6684-96c8-4595-bec6-a94122b61e30",
"port": "bottom"
},
"target": {
"cell": "c538d496-eeaa-4e95-9752-2a5d0c168e13",
"port": "top"
},
"zIndex": 7,
"labels": [
{
"attrs": {
"label": {
"text": "否"
}
}
}
]
} }
] ]
} }

2
example/src/pages/index.tsx

@ -1,5 +1,5 @@
import * as React from 'react'; import * as React from 'react';
import IMove from '@imove/core'; import IMove from '../../../packages/core/dist/core.esm.js';
const onSave = (data: { nodes: any; edges: any }): void => { const onSave = (data: { nodes: any; edges: any }): void => {
console.log(data); console.log(data);

4
packages/core/src/mods/header/index.tsx

@ -15,7 +15,9 @@ const Header: React.FC<IProps> = (props) => {
const { flowChart } = props; const { flowChart } = props;
return ( return (
<div className={styles.container}> <div className={styles.container}>
<span className={styles.titleText}>iMove</span> <a href="https://github.com/imgcook/imove">
<span className={styles.titleText}>iMove</span>
</a>
<div className={styles.widgets}> <div className={styles.widgets}>
<Export flowChart={flowChart} /> <Export flowChart={flowChart} />
<ImportDSL flowChart={flowChart} /> <ImportDSL flowChart={flowChart} />

Loading…
Cancel
Save