|
@@ -1,5 +1,5 @@
|
|
|
import { useState, useEffect, useContext, useMemo } from 'react'
|
|
|
-import { Button, Drawer, Radio, Tabs, Tooltip } from 'antd'
|
|
|
+import { Button, Drawer, message, Radio, Tabs, Tooltip } from 'antd'
|
|
|
import { Actions, FlowContext } from '../../context'
|
|
|
import type { RadioChangeEvent } from 'antd'
|
|
|
import { ApprovalWay, ConfigureType, ParticipantMode } from '../../enum'
|
|
@@ -18,7 +18,8 @@ const FlowDrawer = () => {
|
|
|
const [state, setState] = useState({
|
|
|
institutionList: [],
|
|
|
approvalWay: ApprovalWay.ACCOUNT,
|
|
|
- accounts: []
|
|
|
+ accounts: [],
|
|
|
+ validityIDs: []
|
|
|
})
|
|
|
|
|
|
useEffect(() => {
|
|
@@ -61,6 +62,21 @@ const FlowDrawer = () => {
|
|
|
}
|
|
|
const handleOnOk = async () => {
|
|
|
const { approvalWay, accounts } = state
|
|
|
+ if (!accounts.every(item => item.institutionID && item.ID)) {
|
|
|
+ setState({
|
|
|
+ ...state,
|
|
|
+ validityIDs: accounts.reduce((prev, curr) => {
|
|
|
+ if (!curr.institutionID || !curr.ID) {
|
|
|
+ prev.push(curr.uid)
|
|
|
+ }
|
|
|
+ return prev
|
|
|
+ }, [])
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // if (!validate(accounts)) {
|
|
|
+ // return message.error('当前流程信息配置不完整,请检查!')
|
|
|
+ // }
|
|
|
const payload = {
|
|
|
id: nodeID,
|
|
|
node: {
|
|
@@ -128,7 +144,8 @@ const FlowDrawer = () => {
|
|
|
<div
|
|
|
className={[
|
|
|
'shadow-base border rounded-md flex flex-col justify-between px-4 py-2 mt-6',
|
|
|
- styles.participantCard
|
|
|
+ styles.participantCard,
|
|
|
+ state.validityIDs.includes(participant.uid) ? 'border-red-500' : ''
|
|
|
].join(' ')}
|
|
|
key={participant.uid}>
|
|
|
<div className="flex flex-row justify-between">
|