@@ -39,9 +39,9 @@ const Panel: FC<IPanelProps> = (props: IPanelProps) => {
39
39
const isDisabled = [ 'Input' , 'Output' ] . includes ( nodeType ) || disabled ;
40
40
const [ descVal , setDescVal ] = useState ( data ?. desc ) ;
41
41
const [ titleVal , setTitleVal ] = useState ( data ?. title || nodeSetting ?. title ) ;
42
+ const { hideDesc, nodeConfigPanelWidth, iconSvg } = nodeSetting ;
42
43
43
44
// const description = getDescription(nodeType, props.description);
44
-
45
45
const handleNodeValueChange = debounce ( ( data : any ) => {
46
46
const newNodes = produce ( nodes , draft => {
47
47
let node = null ;
@@ -69,31 +69,36 @@ const Panel: FC<IPanelProps> = (props: IPanelProps) => {
69
69
70
70
return (
71
71
< Drawer
72
+ getContainer = { false }
72
73
rootClassName = "custom-node-panel"
73
74
open = { true }
74
- width = { nodeSetting ?. nodeConfigPanelWidth || configPanelWidth || 400 } // 改为配置的width 节点的width > 全局的width> 默认 400
75
+ width = { nodeConfigPanelWidth || configPanelWidth || 400 } // 改为配置的width 节点的width > 全局的width> 默认 400
75
76
mask = { false }
76
77
onClose = { onClose }
78
+ headerStyle = { { paddingBottom : '12px' } }
77
79
title = {
78
80
< >
79
81
< div className = "title-box" >
80
82
< div style = { { display : 'flex' , alignItems : 'center' , flex : 1 } } >
81
83
< span
82
84
className = "icon-box"
83
- style = { { background : nodeSetting ?. icon ?. bgColor } }
85
+ style = { { background : nodeSetting ?. icon ?. bgColor || '#F79009' } }
84
86
>
85
- < Icon
86
- style = { { fontSize : 14 , color : '#fff' } }
87
- type = { nodeSetting ?. icon ?. type }
88
- />
87
+ { iconSvg ? (
88
+ iconSvg
89
+ ) : (
90
+ < Icon
91
+ style = { { fontSize : 14 , color : '#fff' } }
92
+ type = { nodeSetting ?. icon ?. type }
93
+ />
94
+ ) }
89
95
</ span >
90
96
{ isDisabled ? (
91
97
< span style = { { marginLeft : '11px' } } > { nodeSetting ?. title } </ span >
92
98
) : (
93
99
< Input
94
100
style = { { width : '100%' } }
95
- // defaultValue={data?.title || nodeSetting?.title}
96
- value = { titleVal } // || nodeSetting?.title
101
+ value = { titleVal }
97
102
onChange = { e => {
98
103
setTitleVal ( e . target . value ) ;
99
104
handleNodeValueChange ( { title : e . target . value } ) ;
@@ -118,23 +123,23 @@ const Panel: FC<IPanelProps> = (props: IPanelProps) => {
118
123
</ Space >
119
124
</ div >
120
125
</ div >
121
- < div className = "desc-box" >
122
- { isDisabled ? (
123
- description
124
- ) : (
125
- < Input . TextArea
126
- placeholder = "添加描述..."
127
- autoSize = { { minRows : 1 } }
128
- value = { descVal }
129
- // value={data?.desc }
130
- // defaultValue={description}
131
- onChange = { e => {
132
- setDescVal ( e . target . value ) ;
133
- handleNodeValueChange ( { desc : e . target . value } ) ;
134
- } }
135
- />
136
- ) }
137
- </ div >
126
+ { ! hideDesc && (
127
+ < div className = "desc-box" >
128
+ { isDisabled ? (
129
+ description
130
+ ) : (
131
+ < Input . TextArea
132
+ placeholder = "添加描述..."
133
+ autoSize = { { minRows : 1 } }
134
+ value = { descVal }
135
+ onChange = { e => {
136
+ setDescVal ( e . target . value ) ;
137
+ handleNodeValueChange ( { desc : e . target . value } ) ;
138
+ } }
139
+ />
140
+ ) }
141
+ </ div >
142
+ ) }
138
143
</ >
139
144
}
140
145
>
0 commit comments