|
@@ -24,7 +24,8 @@ const PermSelect: React.FC<PermSelectProps> = ({ dataType, onConfirm }) => {
|
|
|
const { initialState: { permData } = { permData: {} } } = useModel('@@initialState')
|
|
const { initialState: { permData } = { permData: {} } } = useModel('@@initialState')
|
|
|
const { toggleModal, setModalProps } = useModal()
|
|
const { toggleModal, setModalProps } = useModal()
|
|
|
const options = [...(permData[dataType] || [])]
|
|
const options = [...(permData[dataType] || [])]
|
|
|
- const [defaultValue, defaultStaffIds] = getPermAuthCache(dataType)
|
|
|
|
|
|
|
+ const [defaultValue, defaultStaffIds, permAuthCache] = getPermAuthCache(dataType)
|
|
|
|
|
+
|
|
|
const [state, setState] = useState({
|
|
const [state, setState] = useState({
|
|
|
currKey: defaultValue,
|
|
currKey: defaultValue,
|
|
|
staffIds: defaultStaffIds,
|
|
staffIds: defaultStaffIds,
|
|
@@ -37,7 +38,7 @@ const PermSelect: React.FC<PermSelectProps> = ({ dataType, onConfirm }) => {
|
|
|
width: '60vw',
|
|
width: '60vw',
|
|
|
modalRender: () => (
|
|
modalRender: () => (
|
|
|
<CustomPerm
|
|
<CustomPerm
|
|
|
- defaultValues={state.staffIds}
|
|
|
|
|
|
|
+ defaultValues={state.staffIds || []}
|
|
|
onConfirm={({ staffIds, dataPermission }) => {
|
|
onConfirm={({ staffIds, dataPermission }) => {
|
|
|
setState({ ...state, staffIds, currKey: e })
|
|
setState({ ...state, staffIds, currKey: e })
|
|
|
onConfirm({ staffIds, dataPermission })
|
|
onConfirm({ staffIds, dataPermission })
|