| | |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 260 |
| | | width: 450 |
| | | }, |
| | | })); |
| | | |
| | |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <TextInput source="name" label="table.field.role.name" />, |
| | | <TextInput source="code" label="table.field.role.code" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | const [menuIds, setMenuIds] = useState([]); |
| | | |
| | | const [authType,setAuthType] = useState(0) |
| | | |
| | | const assign = (record) => { |
| | | request('/role/scope/list', { |
| | |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <ScopeButton sx={{ padding: '1px', fontSize: '.75rem' }} assign={assign} /> |
| | | <ScopeButton sx={{ padding: '1px', fontSize: '.75rem' }} assign={assign} auType={0} setAuthType={setAuthType} label="网页权限 " /> |
| | | <ScopeButton sx={{ padding: '1px', fontSize: '.75rem' }} assign={assign} auType={1} setAuthType={setAuthType} label="PDA权限 " /> |
| | | <ScopeButton sx={{ padding: '1px', fontSize: '.75rem' }} assign={assign} auType={2} setAuthType={setAuthType} label="仓库权限 " /> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | |
| | | closeCallback={() => { |
| | | setMenuIds([]); |
| | | }} |
| | | authType = {authType} |
| | | /> |
| | | </PageDrawer> |
| | | </Box> |
| | |
| | | |
| | | const ScopeButton = (props) => { |
| | | const record = useRecordContext(); |
| | | const { assign, ...rest } = props; |
| | | const { assign, auType, setAuthType, label, ...rest } = props; |
| | | return ( |
| | | <Button |
| | | variant="text" |
| | | color="primary" |
| | | startIcon={<AssignmentIndIcon />} |
| | | label="common.action.scope" |
| | | label={label} |
| | | onClick={(event) => { |
| | | setAuthType(auType); |
| | | event.stopPropagation(); |
| | | assign(record); |
| | | }} |