feat: 参考原型图 ui优化提交 企业端-企业中心 相关的页面

This commit is contained in:
zhanjunhao
2026-11-06 20:19:43 +08:00
parent d4495eb703
commit 84803192ba
147 changed files with 9816 additions and 8768 deletions
+45 -60
View File
@@ -33,13 +33,13 @@ import {
RefreshCw,
UserPlus,
Upload as UploadIcon,
KeyRound,
IdCard,
} from 'lucide-react';
import { API } from '../../helpers/api';
import { showError, collectPagedItems } from '../../helpers';
import OrgPageHeader from './components/OrgPageHeader';
import OrgPanel from './components/OrgPanel';
import { OrgListCard, OrgRowActions } from './components/OrgListCard';
import OrgModal from './components/OrgModal';
import DeptTreeSelect from './components/DeptTreeSelect';
import {
@@ -383,16 +383,15 @@ const OrgMemberAccounts = ({
},
{
title: t('操作'),
width: 300,
width: 260,
render: (_, r) => {
const managed = r.created_by_org_id === r.organization_id;
const canReset = managed || isSuperAdmin;
return (
<div className='flex items-center gap-2'>
<OrgRowActions>
{deptEnabled && (
<Button
size='small'
theme='light'
type='link'
onClick={() => {
setDeptAssignFor(r);
setDeptAssignVal(r.department_id || 0);
@@ -413,22 +412,11 @@ const OrgMemberAccounts = ({
}
onConfirm={() => resetPassword(r)}
>
<Button
size='small'
theme='light'
icon={<KeyRound size={14} />}
>
{t('重置密码')}
</Button>
<Button type='link'>{t('重置密码')}</Button>
</Popconfirm>
) : (
<Tooltip content={t('个人平台账号,请由本人通过找回密码修改')}>
<Button
size='small'
theme='light'
disabled
icon={<KeyRound size={14} />}
>
<Button type='link' disabled>
{t('重置密码')}
</Button>
</Tooltip>
@@ -441,25 +429,32 @@ const OrgMemberAccounts = ({
)}
onConfirm={() => offboard(r.id)}
>
<Button size='small' theme='light' type='danger'>
<Button type='link' danger>
{t('离职回收')}
</Button>
</Popconfirm>
)}
</div>
</OrgRowActions>
);
},
},
];
// 原型员工列表工具区:刷新 / 新建员工(主按钮)/ CSV 导入;回调不变
const actions = (
<>
<Button theme='light' icon={<RefreshCw size={14} />} onClick={fetchAll}>
<Button icon={<RefreshCw size={16} />} onClick={fetchAll}>
{t('刷新')}
</Button>
<Button
theme='light'
icon={<UploadIcon size={14} />}
theme='solid'
icon={<UserPlus size={16} />}
onClick={() => setCreateVisible(true)}
>
{t('创建员工账号')}
</Button>
<Button
icon={<UploadIcon size={16} />}
onClick={() => {
setImportResult(null);
setImportFile(null);
@@ -468,38 +463,12 @@ const OrgMemberAccounts = ({
>
{t('CSV 导入')}
</Button>
<Button
theme='solid'
icon={<UserPlus size={14} />}
onClick={() => setCreateVisible(true)}
>
{t('创建员工账号')}
</Button>
</>
);
return (
<div className={embedded ? 'space-y-4' : 'uc-page'}>
{embedded ? (
<div className='flex items-start justify-between gap-3 flex-wrap rounded-2xl border border-dashed border-brand/25 bg-brand/5 p-4 dark:border-brand/25 dark:bg-brand/10'>
<div className='flex items-start gap-3'>
<span className='inline-flex h-10 w-10 items-center justify-center rounded-2xl bg-white text-brand-deep shadow-sm dark:bg-white/10 dark:text-brand-from'>
<IdCard size={18} />
</span>
<div>
<div className='font-semibold text-gray-950 dark:text-white'>
{t('员工账号')}
</div>
<Text type='tertiary' size='small'>
{t('集中管理员工登录、批量导入、重置密码与离职回收')}
</Text>
</div>
</div>
<div className='flex items-center gap-2 flex-wrap justify-end'>
{actions}
</div>
</div>
) : (
<div className={embedded ? 'oc-member-accounts' : 'uc-page'}>
{!embedded && (
<OrgPageHeader
icon={IdCard}
title={t('员工账号')}
@@ -518,15 +487,31 @@ const OrgMemberAccounts = ({
)}
/>
)}
<OrgPanel padding='p-2'>
<Table
columns={columns}
dataSource={members}
loading={loading}
pagination={{ pageSize: 15, showSizeChanger: false }}
rowKey='id'
/>
</OrgPanel>
{embedded ? (
<OrgListCard title={t('员工账号')} tools={actions}>
<Table
columns={columns}
dataSource={members}
loading={loading}
pagination={{
pageSize: 15,
showSizeChanger: false,
showTotal: (n) => t('共 {{total}} 条', { total: n }),
}}
rowKey='id'
/>
</OrgListCard>
) : (
<OrgPanel padding='p-2'>
<Table
columns={columns}
dataSource={members}
loading={loading}
pagination={{ pageSize: 15, showSizeChanger: false }}
rowKey='id'
/>
</OrgPanel>
)}
{/* 创建账号 */}
<OrgModal