|
@@ -8,6 +8,7 @@ import { CloseOne, SmilingFaceWithSquintingEyes } from '@icon-park/react'
|
|
|
import { MinusCircleOutlined, DownOutlined } from '@ant-design/icons'
|
|
import { MinusCircleOutlined, DownOutlined } from '@ant-design/icons'
|
|
|
|
|
|
|
|
const Step = ({ id, statusId, groupStatus = [] }) => {
|
|
const Step = ({ id, statusId, groupStatus = [] }) => {
|
|
|
|
|
+ console.log(groupStatus)
|
|
|
const dispatch = useDispatch()
|
|
const dispatch = useDispatch()
|
|
|
const { run: tryChangeStatus } = useRequest(params => changeGroupStatus(params), {
|
|
const { run: tryChangeStatus } = useRequest(params => changeGroupStatus(params), {
|
|
|
manual: true,
|
|
manual: true,
|
|
@@ -40,9 +41,12 @@ const Step = ({ id, statusId, groupStatus = [] }) => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
const op = useMemo(() => {
|
|
const op = useMemo(() => {
|
|
|
- const mainItems = groupStatus.filter(item => !item.endProcess).sort((a, b) => a.sort - b.sort)
|
|
|
|
|
- const otherItems = groupStatus.filter(item => item.endProcess).sort((a, b) => a.sort - b.sort)
|
|
|
|
|
- const selectedItemIdx = mainItems.findIndex(item => item.selected)
|
|
|
|
|
|
|
+ const mainItems = groupStatus.filter(item => !item.endProcess)
|
|
|
|
|
+ const otherItems = groupStatus.filter(item => item.endProcess)
|
|
|
|
|
+ const selectedItemIdx = mainItems.reduce((prev, curr, idx) => {
|
|
|
|
|
+ if (curr.selected) return idx
|
|
|
|
|
+ return prev
|
|
|
|
|
+ }, -1)
|
|
|
const endItemIdx = otherItems.findIndex(item => item.id === statusId)
|
|
const endItemIdx = otherItems.findIndex(item => item.id === statusId)
|
|
|
const isSelected = mainItems.findIndex(item => item.selected) !== -1
|
|
const isSelected = mainItems.findIndex(item => item.selected) !== -1
|
|
|
const isEnd = otherItems.findIndex(item => item.id === statusId) !== -1
|
|
const isEnd = otherItems.findIndex(item => item.id === statusId) !== -1
|
|
@@ -78,7 +82,7 @@ const Step = ({ id, statusId, groupStatus = [] }) => {
|
|
|
</Menu>
|
|
</Menu>
|
|
|
)
|
|
)
|
|
|
return (
|
|
return (
|
|
|
- <div className={['busi-state', styles.businessStep].join(' ')}>
|
|
|
|
|
|
|
+ <div className={['busi-state', 'mb-4', styles.businessStep].join(' ')}>
|
|
|
{op.mainItems.map((item, idx) => (
|
|
{op.mainItems.map((item, idx) => (
|
|
|
<Tooltip
|
|
<Tooltip
|
|
|
placement="bottom"
|
|
placement="bottom"
|