generated from arvinxx/npm-template
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jiangchu
committed
Sep 20, 2023
1 parent
4c1ba5f
commit 9a33fb6
Showing
7 changed files
with
174 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
import { ProFlow, ProFlowNode } from '@ant-design/pro-flow'; | ||
import { createStyles } from 'antd-style'; | ||
import { memo } from 'react'; | ||
|
||
const useStyles = createStyles(({ css }) => ({ | ||
container: css` | ||
width: 100%; | ||
height: 600px; | ||
`, | ||
})); | ||
|
||
const nodes: ProFlowNode[] = [ | ||
{ | ||
id: 'a1', | ||
data: { | ||
title: 'XXX数据源', | ||
describe: 'cksadjfnf', | ||
logo: 'https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*jWDsQ5GTmHMAAAAAAAAAAAAADvuvAQ/original', | ||
}, | ||
}, | ||
{ | ||
id: 'a2', | ||
data: { | ||
title: 'XXX_API', | ||
logo: 'https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*kgyiRKi04eUAAAAAAAAAAAAADvuvAQ/original', | ||
describe: 'XXX_XXX_XXX_API', | ||
}, | ||
}, | ||
{ | ||
id: 'b1', | ||
data: { | ||
title: 'XXX_API', | ||
logo: 'https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*kgyiRKi04eUAAAAAAAAAAAAADvuvAQ/original', | ||
describe: 'XXX_XXX_XXX_API', | ||
}, | ||
}, | ||
{ | ||
id: 'a3', | ||
data: { | ||
title: 'XXXX产品', | ||
logo: 'https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*ezaYT4wYRBwAAAAAAAAAAAAADvuvAQ/original', | ||
describe: '2031030213014', | ||
}, | ||
}, | ||
{ | ||
id: 'a4', | ||
group: true, | ||
data: [ | ||
{ | ||
id: 'a5', | ||
data: { | ||
title: 'XXX数据源', | ||
describe: 'cksadjfnf', | ||
logo: 'https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*jWDsQ5GTmHMAAAAAAAAAAAAADvuvAQ/original', | ||
}, | ||
}, | ||
{ | ||
id: 'a6', | ||
data: { | ||
title: 'XXX_API', | ||
logo: 'https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*kgyiRKi04eUAAAAAAAAAAAAADvuvAQ/original', | ||
describe: 'XXX_XXX_XXX_API', | ||
}, | ||
}, | ||
{ | ||
id: 'a7', | ||
data: { | ||
title: 'XXXX产品', | ||
logo: 'https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*ezaYT4wYRBwAAAAAAAAAAAAADvuvAQ/original', | ||
describe: '2031030213014', | ||
}, | ||
}, | ||
{ | ||
id: 'a8', | ||
data: { | ||
title: 'XXX数据源', | ||
describe: 'cksadjfnf', | ||
logo: 'https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*jWDsQ5GTmHMAAAAAAAAAAAAADvuvAQ/original', | ||
}, | ||
}, | ||
{ | ||
id: 'a9', | ||
data: { | ||
title: 'XXX_API', | ||
logo: 'https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*kgyiRKi04eUAAAAAAAAAAAAADvuvAQ/original', | ||
describe: 'XXX_XXX_XXX_API', | ||
}, | ||
}, | ||
{ | ||
id: 'a10', | ||
data: { | ||
title: 'XXXX产品', | ||
logo: 'https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*ezaYT4wYRBwAAAAAAAAAAAAADvuvAQ/original', | ||
describe: '2031030213014', | ||
}, | ||
}, | ||
{ | ||
id: 'a11', | ||
data: { | ||
title: 'XXXX产品', | ||
logo: 'https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*ezaYT4wYRBwAAAAAAAAAAAAADvuvAQ/original', | ||
describe: '2031030213014', | ||
}, | ||
}, | ||
], | ||
}, | ||
]; | ||
|
||
const edges = [ | ||
{ | ||
id: 'a1-a2', | ||
source: 'a1', | ||
target: 'a2', | ||
}, | ||
{ | ||
id: 'a1-b1', | ||
source: 'a1', | ||
target: 'b1', | ||
}, | ||
{ | ||
id: 'a2-a3', | ||
source: 'a2', | ||
target: 'a3', | ||
}, | ||
{ | ||
id: 'a3-a4', | ||
source: 'a3', | ||
target: 'a4', | ||
}, | ||
]; | ||
|
||
const Demos = memo(() => { | ||
const { styles } = useStyles(); | ||
return ( | ||
<div className={styles.container}> | ||
<ProFlow nodes={nodes} edges={edges} /> | ||
</div> | ||
); | ||
}); | ||
|
||
export default Demos; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
group: 线段组件 | ||
title: RadiusEdge 圆角线段 | ||
description: | ||
--- | ||
|
||
## 圆角线段 | ||
|
||
<code src="./demos/index.tsx"></code> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export enum NodeSelect { | ||
SELECT = 'SELECT', | ||
DANGER = 'DANGER', | ||
WARNING = 'WARNING', | ||
DEFAULT = 'DEFAULT', | ||
} | ||
export interface ProFlowNode { | ||
id: string; | ||
group?: boolean; | ||
select?: NodeSelect; | ||
data: ProFlowNodeData | ProFlowNode[]; | ||
} | ||
|
||
export interface ProFlowNodeData { | ||
title: string; | ||
describe: string; | ||
logo: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters