🐞 fix(#1000663#25#26#27): 修复销售统计页面的样式问题

This commit is contained in:
xuan
2022-11-11 11:43:29 +08:00
parent 851902873b
commit 45c656e0ed
14 changed files with 299 additions and 77 deletions
+44
View File
@@ -0,0 +1,44 @@
import React, { FC, MutableRefObject } from "react"
import SelectSaleType from "../SelectSaleType"
import SelectTimePicker from "../SelectTimePicker"
import SelectMarketingDepartment from '../SelectMarketingDepartment'
interface PropsType {
children?: React.ReactNode
}
const GroupItem = [
SelectMarketingDepartment.name,
SelectSaleType.name,
SelectTimePicker.name
]
const SelectGroup: FC<PropsType> = (props: PropsType) => {
const {children} = props
function handleChange(children,childEle) {
return function (value: any){
childEle.props.onChange(value)
children.forEach((child)=>{
child.ref?.current.closePopup()
})
}
}
function handleCloseOverlay(children) {
return function (){
children.forEach((child)=>{
child.ref?.current.closePopup()
})
}
}
const renderChildren = () => {
return React.Children.map(children, (child) => {
const childEle = child as React.FunctionComponentElement<any>
return React.cloneElement(childEle, {onChange: handleChange(children,childEle), onCloseOverlay: handleCloseOverlay(children)})
})
}
return <>{renderChildren()}</>
}
export default SelectGroup