@@ -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 } = 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 ;
@@ -72,9 +72,10 @@ const Panel: FC<IPanelProps> = (props: IPanelProps) => {
72
72
getContainer = { false }
73
73
rootClassName = "custom-node-panel"
74
74
open = { true }
75
- width = { nodeSetting ?. nodeConfigPanelWidth || configPanelWidth || 400 } // 改为配置的width 节点的width > 全局的width> 默认 400
75
+ width = { nodeConfigPanelWidth || configPanelWidth || 400 } // 改为配置的width 节点的width > 全局的width> 默认 400
76
76
mask = { false }
77
77
onClose = { onClose }
78
+ headerStyle = { { paddingBottom : '12px' } }
78
79
title = {
79
80
< >
80
81
< div className = "title-box" >
@@ -93,8 +94,7 @@ const Panel: FC<IPanelProps> = (props: IPanelProps) => {
93
94
) : (
94
95
< Input
95
96
style = { { width : '100%' } }
96
- // defaultValue={data?.title || nodeSetting?.title}
97
- value = { titleVal } // || nodeSetting?.title
97
+ value = { titleVal }
98
98
onChange = { e => {
99
99
setTitleVal ( e . target . value ) ;
100
100
handleNodeValueChange ( { title : e . target . value } ) ;
@@ -119,23 +119,23 @@ const Panel: FC<IPanelProps> = (props: IPanelProps) => {
119
119
</ Space >
120
120
</ div >
121
121
</ div >
122
- < div className = "desc-box" >
123
- { isDisabled ? (
124
- description
125
- ) : (
126
- < Input . TextArea
127
- placeholder = "添加描述..."
128
- autoSize = { { minRows : 1 } }
129
- value = { descVal }
130
- // value={data?.desc }
131
- // defaultValue={description}
132
- onChange = { e => {
133
- setDescVal ( e . target . value ) ;
134
- handleNodeValueChange ( { desc : e . target . value } ) ;
135
- } }
136
- />
137
- ) }
138
- </ div >
122
+ { ! hideDesc && (
123
+ < div className = "desc-box" >
124
+ { isDisabled ? (
125
+ description
126
+ ) : (
127
+ < Input . TextArea
128
+ placeholder = "添加描述..."
129
+ autoSize = { { minRows : 1 } }
130
+ value = { descVal }
131
+ onChange = { e => {
132
+ setDescVal ( e . target . value ) ;
133
+ handleNodeValueChange ( { desc : e . target . value } ) ;
134
+ } }
135
+ />
136
+ ) }
137
+ </ div >
138
+ ) }
139
139
</ >
140
140
}
141
141
>
0 commit comments