|
@@ -24,8 +24,6 @@ const FlowDrawer = () => {
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (nodeID && visible) {
|
|
|
- console.log(flowState.flowData.get(nodeID))
|
|
|
-
|
|
|
const defaultConfig = flowState.flowData.get(nodeID) || {
|
|
|
approvalWay: ApprovalWay.ACCOUNT,
|
|
|
accounts: []
|
|
@@ -50,6 +48,7 @@ const FlowDrawer = () => {
|
|
|
}
|
|
|
return false
|
|
|
}, [state.approvalWay, state.accounts])
|
|
|
+
|
|
|
const handleCancel = () => dispatch({ type: Actions.CLOSE_MODAL })
|
|
|
|
|
|
const plainOptions = [{ label: '指定用户', value: ApprovalWay.ACCOUNT }]
|
|
@@ -60,11 +59,9 @@ const FlowDrawer = () => {
|
|
|
setState({ ...state, approvalWay: target.value })
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
const handleOnOk = async () => {
|
|
|
const { approvalWay, accounts } = state
|
|
|
- // if (!state.accounts.length) {
|
|
|
- // return message.error('请添加用户后再进行操作')
|
|
|
- // }
|
|
|
if (!accounts.every(item => item.institutionID && item.ID)) {
|
|
|
setState({
|
|
|
...state,
|
|
@@ -124,6 +121,10 @@ const FlowDrawer = () => {
|
|
|
}
|
|
|
|
|
|
const saveCardData = (targetID, formData) => {
|
|
|
+ const validityIDs =
|
|
|
+ formData.ID && formData.institutionID
|
|
|
+ ? state.validityIDs.filter(ID => ID !== targetID)
|
|
|
+ : state.validityIDs
|
|
|
setState({
|
|
|
...state,
|
|
|
accounts: state.accounts.map(item => {
|
|
@@ -132,7 +133,8 @@ const FlowDrawer = () => {
|
|
|
return newItem
|
|
|
}
|
|
|
return item
|
|
|
- })
|
|
|
+ }),
|
|
|
+ validityIDs
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -179,7 +181,11 @@ const FlowDrawer = () => {
|
|
|
footer={
|
|
|
<div className="flex justify-end">
|
|
|
<Button onClick={handleCancel}>取消</Button>
|
|
|
- <Button className="ml-8px" type="primary" onClick={handleOnOk}>
|
|
|
+ <Button
|
|
|
+ className="ml-8px"
|
|
|
+ type="primary"
|
|
|
+ disabled={!state.accounts.length}
|
|
|
+ onClick={handleOnOk}>
|
|
|
确认
|
|
|
</Button>
|
|
|
</div>
|