@@ -14,25 +14,32 @@ import { match, P } from 'ts-pattern';
1414type TAddPlugins = Partial < {
1515 nodeCardValue : string [ ] ;
1616 execution_node : string ;
17- value ?: Record < string , Array < string > > ;
18- onChange ?: ( value : Record < string , Array < string > > ) => void ;
17+ value ?: Record <
18+ string ,
19+ {
20+ ids : Array < any > ;
21+ isAll : boolean ;
22+ }
23+ > ;
24+ onChange ?: ( value : TAddPlugins [ 'value' ] ) => void ;
1925} > ;
2026
2127const AddPlugins : FC < TAddPlugins > = memo (
2228 ( { nodeCardValue, execution_node, value, onChange } ) => {
29+ const [ page ] = WizardTable . usePage ( ) ;
30+
2331 const [ open , setOpen ] = useSafeState ( false ) ;
32+ const [ tableHeaderCount , setTableHeaderCount ] = useSafeState ( {
33+ total : 0 ,
34+ checkRow : 0 ,
35+ } ) ;
36+
2437 const groupsList = useRef <
2538 {
2639 label : string | number ;
2740 value : string | number ;
2841 } [ ]
2942 > ( [ ] ) ;
30- const [ tableHeaderCount , setTableHeaderCount ] = useSafeState ( {
31- total : 0 ,
32- checkRow : 0 ,
33- } ) ;
34-
35- const [ page ] = WizardTable . usePage ( ) ;
3643
3744 // 判断 设置插件 禁用状态
3845 const isDisabled = match ( [ execution_node , nodeCardValue ] )
@@ -136,7 +143,8 @@ const AddPlugins: FC<TAddPlugins> = memo(
136143 < div className = "color-[#B4BBCA] text-xs font-normal flex items-center gap-2" >
137144 < div > Total</ div >
138145 < div className = "color-[#4A94F8]" >
139- { value ?. ScriptName . length ?? 0 }
146+ { value ?. ScriptName ?. ids
147+ . length ?? 0 }
140148 </ div >
141149 |< div > Selected</ div >
142150 < div className = "color-[#4A94F8]" >
@@ -176,8 +184,8 @@ const AddPlugins: FC<TAddPlugins> = memo(
176184 disabled = { isDisabled }
177185 >
178186 < PlusOutlined /> { ' ' }
179- { value ?. ScriptName && value ?. ScriptName . length > 0
180- ? `已添加${ value . ScriptName . length } 个插件`
187+ { value ?. ScriptName && value ?. ScriptName ?. ids . length > 0
188+ ? `已添加${ value . ScriptName ?. ids . length } 个插件`
181189 : '添加插件' }
182190 </ Button >
183191 </ Popover >
0 commit comments