|
|
@ -23,7 +23,7 @@ interface IBasicData { |
|
|
|
} |
|
|
|
|
|
|
|
const Basic: React.FC<IProps> = (props) => { |
|
|
|
const { selectedCell } = props; |
|
|
|
const { selectedCell, flowChart } = props; |
|
|
|
const [data, setData] = useState<IBasicData>(selectedCell.getData()); |
|
|
|
const { label, trigger, dependencies, configSchema } = data || {}; |
|
|
|
|
|
|
@ -31,6 +31,13 @@ const Basic: React.FC<IProps> = (props) => { |
|
|
|
useEffect(() => { |
|
|
|
setData(selectedCell.getData()); |
|
|
|
}, [selectedCell]); |
|
|
|
useEffect(() => { |
|
|
|
const handler = () => setData(selectedCell.getData()); |
|
|
|
flowChart.on('settingBar.basicPanel:forceUpdate', handler); |
|
|
|
return () => { |
|
|
|
flowChart.off('settingBar.basicPanel:forceUpdate', handler); |
|
|
|
}; |
|
|
|
}, [selectedCell]); |
|
|
|
|
|
|
|
// events
|
|
|
|
const batchUpdate = (newData: { [key: string]: any }): void => { |
|
|
|