| | |
| | | confirm: 'confirm', |
| | | cancel: "cancel", |
| | | delete: 'Delete', |
| | | copy: 'copy', |
| | | query: "Query", |
| | | bulkExport: "Bulk Export", |
| | | continue: 'Continue Receipt', |
| | |
| | | name: "物料分组名称", |
| | | code: "物料分组编码", |
| | | parentId: "上级名称", |
| | | parCode: "上级编码", |
| | | parCode: "物料路径编码", |
| | | }, |
| | | warehouse: { |
| | | name: "仓库名称", |
| | |
| | | confirmSelect: '确认选择', |
| | | cancel: "取消", |
| | | delete: '删除', |
| | | copy: '复制', |
| | | query: "查询", |
| | | top: "置顶", |
| | | resort: "排序", |
| | |
| | | import DictionaryArraySelect from "../../components/DictionaryArraySelect"; |
| | | |
| | | const BasStationCreate = (props) => { |
| | | const { open, setOpen } = props; |
| | | const { open, setOpen , copyRecord = null, onClose} = props; |
| | | |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | | if (typeof onClose === 'function') {onClose();} |
| | | } |
| | | }; |
| | | |
| | |
| | | return ( |
| | | <> |
| | | <CreateBase |
| | | record={{}} |
| | | key={open ? (copyRecord ? 'copy' : 'new') : 'closed'} |
| | | record={copyRecord || {}} |
| | | transform={(data) => { |
| | | return data; |
| | | }} |
| | |
| | | DeleteButton, |
| | | |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { Box, Typography, Card, Stack, Button } from '@mui/material'; |
| | | import ContentCopyIcon from '@mui/icons-material/ContentCopy'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import BasStationCreate from "./BasStationCreate"; |
| | | import BasStationPanel from "./BasStationPanel"; |
| | |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | width: 220 |
| | | }, |
| | | })); |
| | | |
| | |
| | | resettable |
| | | />, |
| | | ] |
| | | |
| | | const CopyButton = ({ setCopyRecord, setCreateDialog }) => { |
| | | const record = useRecordContext(); |
| | | const translate = useTranslate(); |
| | | if (!record) return null; |
| | | return ( |
| | | <Button |
| | | size="small" |
| | | startIcon={<ContentCopyIcon fontSize="small" />} |
| | | sx={{ padding: '1px', fontSize: '.75rem', minWidth: 'auto' }} |
| | | onClick={(e) => { |
| | | e.stopPropagation(); |
| | | const { id, createTime, updateTime, createBy, updateBy, createBy$, updateBy$, ...rest } = record; |
| | | const copied = { ...rest }; |
| | | if (record.areaIds) copied.areaIds = [...(Array.isArray(record.areaIds) ? record.areaIds : [])]; |
| | | if (record.containerTypes) copied.containerTypes = [...(Array.isArray(record.containerTypes) ? record.containerTypes : [])]; |
| | | setCopyRecord(copied); |
| | | setCreateDialog(true); |
| | | }} |
| | | > |
| | | {translate('toolbar.copy')} |
| | | </Button> |
| | | ); |
| | | }; |
| | | const BasStationList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [areaFieldDialog, setAreaFieldDialog] = useState(false); |
| | | const [areaFieldDialog2, setAreaFieldDialog2] = useState(false); |
| | | const [copyRecord, setCopyRecord] = useState(null); |
| | | return ( |
| | | <Box display="flex"> |
| | | <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"> |
| | | <CopyButton setCopyRecord={setCopyRecord} setCreateDialog={setCreateDialog} /> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | |
| | | <BasStationCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | copyRecord={copyRecord} |
| | | onClose={() => setCopyRecord(null)} |
| | | /> |
| | | |
| | | <PageDrawer |
| | |
| | | minWidth: 80, |
| | | }, |
| | | { |
| | | id: 'parCode', |
| | | label: 'table.field.matnrGroup.parCode', |
| | | minWidth: 100, |
| | | }, |
| | | { |
| | | id: 'name', |
| | | label: 'table.field.matnrGroup.name', |
| | | Width: 100, |
| | | }, |
| | | // { |
| | | // id: 'parCode', |
| | | // label: 'table.field.matnrGroup.parCode', |
| | | // minWidth: 100, |
| | | // } |
| | | } |
| | | ]; |
| | | |
| | | const getIconComponent = (iconStr) => { |
| | |
| | | configProperties.getTokenExpireTime(), configProperties.getTokenKey()); |
| | | userLoginService.saveAsync(user.getId(), accessToken, UserLogin.TYPE_LOGIN, user.getTenantId(), null, request); |
| | | Tenant tenant = tenantService.getById(user.getTenantId()); |
| | | user = userService.fillRoleIdsForResponse(user); |
| | | return R.ok("Sign In Success").add(new LoginResult(accessToken, user, tenant.getName())); |
| | | } |
| | | |
| | |
| | | |
| | | User setUserAuthInfo(User user); |
| | | |
| | | /** |
| | | * 为返回给前端的 User 填充 roleIds,只查一次库,避免各处重复写且 @JsonIgnore 导致前端拿不到 |
| | | */ |
| | | User fillRoleIdsForResponse(User user); |
| | | |
| | | boolean comparePassword(String dbPassword, String inputPassword); |
| | | |
| | | String encodePassword(String password); |
| | |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.common.domain.PageResult; |
| | | import com.vincent.rsf.server.system.entity.Role; |
| | | import com.vincent.rsf.server.system.entity.User; |
| | | import com.vincent.rsf.server.system.mapper.UserMapper; |
| | | import com.vincent.rsf.server.system.service.RoleMenuService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service("userService") |
| | | public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public User fillRoleIdsForResponse(User user) { |
| | | if (user == null || user.getId() == null) { |
| | | return user; |
| | | } |
| | | List<Role> roles = userRoleService.listByUserId(user.getId()); |
| | | user.setRoleIds(roles.stream().map(Role::getId).toArray(Long[]::new)); |
| | | return user; |
| | | } |
| | | |
| | | @Override |
| | | public boolean comparePassword(String dbPassword, String inputPassword) { |
| | | return bCryptPasswordEncoder.matches(inputPassword, dbPassword); |
| | | } |