#
luxiaotao1123
2024-09-09 eed62f6123e98ddfcbd2b42e153d87b49ccf6a37
#
4个文件已修改
1个文件已添加
59 ■■■■ 已修改文件
zy-acs-flow/src/i18n/en.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/i18n/zh.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/user/RolesField.jsx 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/user/UserList.jsx 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/system/controller/UserController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/i18n/en.js
@@ -144,6 +144,7 @@
                idCard: "idCard",
                birthday: "birthday",
                introduction: "introduction",
                role: "role",
            },
            operationRecord: {
                namespace: "namespace",
zy-acs-flow/src/i18n/zh.js
@@ -144,6 +144,7 @@
                idCard: "身份证",
                birthday: "生日",
                introduction: "简介",
                role: "角色",
            },
            operationRecord: {
                namespace: "命名空间",
zy-acs-flow/src/page/user/RolesField.jsx
New file
@@ -0,0 +1,29 @@
import * as React from 'react';
import { Stack, Chip } from '@mui/material';
import { useTranslate, useRecordContext } from 'react-admin';
const RolesField = () => {
    const translate = useTranslate();
    const record = useRecordContext();
    React.useEffect(() => {
        console.log();
    }, [record]);
    return (
        <Stack direction="row" gap={1} flexWrap="wrap">
            {record.roles?.map((item, idx) => {
                if (item) {
                    return <Chip
                        size="small"
                        key={item.id}
                        label={item.name}
                    />;
                }
            })}
        </Stack>
    )
}
export default RolesField;
zy-acs-flow/src/page/user/UserList.jsx
@@ -43,6 +43,7 @@
import { PAGE_DRAWER_WIDTH, OPERATE_MODE } 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': {
@@ -56,17 +57,22 @@
    '& .opt': {
        width: 200
    },
    '& .column-deptId': {
        maxWidth: 80
    },
    '& .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={[
@@ -121,7 +127,7 @@
                }}
                title={"menu.user"}
                empty={<EmptyData onClick={() => { setCreateDialog(true) }} />}
                filters={[]}
                filters={filters}
                sort={{ field: "create_time", order: "desc" }}
                actions={(
                    <TopToolbar>
@@ -140,22 +146,22 @@
                    rowClick={(id, resource, record) => false}
                    expand={() => <UserPanel />}
                    expandSingle={true}
                    omit={['id', 'birthday', 'updateTime', 'createTime', 'memo']}
                    omit={['id', 'email', 'idCard', 'birthday', '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}>
                        <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" />
                    <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} />
zy-acs-manager/src/main/java/com/zy/acs/manager/system/controller/UserController.java
@@ -39,7 +39,11 @@
    public R page(@RequestBody Map<String, Object> map) {
        BaseParam baseParam = buildParam(map, BaseParam.class);
        PageParam<User, BaseParam> pageParam = new PageParam<>(baseParam, User.class);
        return R.ok().add(userService.page(pageParam, pageParam.buildWrapper(true, wrapper -> wrapper.orderByAsc("create_time"))));
        PageParam<User, BaseParam> page = userService.page(pageParam, pageParam.buildWrapper(true, wrapper -> wrapper.orderByAsc("create_time")));
        for (User record : page.getRecords()) {
            record.setRoles(userRoleService.listByUserId(record.getId()));
        }
        return R.ok().add(page);
    }
    @PreAuthorize("hasAuthority('system:user:list')")