| | |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyField from "../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE } from '@/config/setting'; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import UserListAside from "./UserListAside"; |
| | | import RolesField from './RolesField'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | '& .RaDatagrid-row': { |
| | | cursor: 'auto' |
| | | }, |
| | | '& .column-name': { |
| | | '& .column-username': { |
| | | maxWidth: '10em', |
| | | overflow: 'hidden', |
| | | textOverflow: 'ellipsis', |
| | | whiteSpace: 'nowrap', |
| | | }, |
| | | '& .column-nickname': { |
| | | maxWidth: '10em', |
| | | overflow: 'hidden', |
| | | textOverflow: 'ellipsis', |
| | | whiteSpace: 'nowrap', |
| | | }, |
| | | '& .column-deptId': { |
| | | maxWidth: '10em', |
| | | overflow: 'hidden', |
| | | textOverflow: 'ellipsis', |
| | | whiteSpace: 'nowrap', |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | }, |
| | | '& .column-statusBool': { |
| | | maxWidth: 60 |
| | | }, |
| | | })); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | // <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | <TextInput source="username" label="table.field.user.username" />, |
| | | <TextInput source="password" label="table.field.user.password" />, |
| | | <TextInput source="nickname" label="table.field.user.nickname" />, |
| | | <TextInput source="avatar" label="table.field.user.avatar" />, |
| | | <TextInput source="code" label="table.field.user.code" />, |
| | | <SelectInput source="sex" label="table.field.user.sex" |
| | | choices={[ |
| | |
| | | />, |
| | | <TextInput source="phone" label="table.field.user.phone" />, |
| | | <TextInput source="email" label="table.field.user.email" />, |
| | | <SelectInput source="emailVerified" label="table.field.user.emailVerified" |
| | | choices={[ |
| | | { id: 0, name: '否' }, |
| | | { id: 1, name: '是' }, |
| | | ]} |
| | | />, |
| | | <ReferenceInput source="deptId" reference="dept"> |
| | | <AutocompleteInput label="table.field.user.deptId" optionText="name" /> |
| | | </ReferenceInput>, |
| | | // <ReferenceInput source="deptId" label="table.field.user.deptId" reference="dept"> |
| | | // <AutocompleteInput label="table.field.user.deptId" optionText="name" filterToQuery={(val) => ({ name: val })} /> |
| | | // </ReferenceInput>, |
| | | <TextInput source="realName" label="table.field.user.realName" />, |
| | | <TextInput source="idCard" label="table.field.user.idCard" />, |
| | | <TextInput source="birthday" label="table.field.user.birthday" />, |
| | | <TextInput source="introduction" label="table.field.user.introduction" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | |
| | | }} |
| | | title={"menu.user"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={[]} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={25} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | aside={<UserListAside />} |
| | | > |
| | | <StyledDatagrid |
| | |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <UserPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'birthday', 'updateTime', 'createTime', 'memo']} |
| | | omit={['id', 'email', 'idCard', 'birthday', 'realName', 'updateTime', 'createTime', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="username" label="table.field.user.username" /> |
| | | <ReferenceField source="deptId" label="table.field.user.deptId" reference="dept" link={false} sortable={false}> |
| | | <TextField source="name" /> |
| | | </ReferenceField> |
| | | <TextField source="nickname" label="table.field.user.nickname" /> |
| | | <TextField source="code" label="table.field.user.code" /> |
| | | <TextField source="sex$" label="table.field.user.sex" sortable={false} /> |
| | | <TextField source="phone" label="table.field.user.phone" /> |
| | | <TextField source="email" label="table.field.user.email" /> |
| | | <ReferenceField source="deptId" label="table.field.user.deptId" reference="dept" link={false}> |
| | | <TextField source="name" /> |
| | | </ReferenceField> |
| | | <TextField source="realName" label="table.field.user.realName" /> |
| | | <TextField source="idCard" label="table.field.user.idCard" /> |
| | | <TextField source="birthday" label="table.field.user.birthday" /> |
| | | |
| | | <RolesField source="roles" label="table.field.user.role" sortable={false} /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |