feat: 更新会议管理逻辑和界面
- 重构 `Meetings.tsx` 中的 `canManageRealtimeMeeting` 为 `canManageMeeting`,并更新相关调用 - 在会议卡片中添加创建人信息,并优化会议时间显示 - 增加权限检查,确保只有会议创建人或管理员可以编辑参会人dev_na
parent
e6580beaa8
commit
5aefcf8d7d
|
|
@ -84,7 +84,7 @@ const shouldPollMeetingCard = (item: MeetingVO) =>
|
|||
|| item.realtimeSessionStatus === 'ACTIVE'
|
||||
|| isPausedRealtimeSessionStatus(item.realtimeSessionStatus);
|
||||
|
||||
const canManageRealtimeMeeting = (meeting: MeetingVO) => {
|
||||
const canManageMeeting = (meeting: MeetingVO) => {
|
||||
try {
|
||||
const profileStr = sessionStorage.getItem('userProfile');
|
||||
if (!profileStr) {
|
||||
|
|
@ -97,6 +97,8 @@ const canManageRealtimeMeeting = (meeting: MeetingVO) => {
|
|||
}
|
||||
};
|
||||
|
||||
const canManageRealtimeMeeting = (meeting: MeetingVO) => canManageMeeting(meeting);
|
||||
|
||||
const applyRealtimeSessionStatus = (item: MeetingVO, sessionStatus?: RealtimeMeetingSessionStatus): MeetingVO => {
|
||||
if (!sessionStatus) {
|
||||
return item;
|
||||
|
|
@ -203,6 +205,7 @@ const MeetingCardItem: React.FC<{ item: MeetingVO, config: any, fetchData: () =>
|
|||
<Card hoverable onClick={() => onOpenMeeting(item)} className="meeting-card" style={{ borderRadius: 16, border: '1px solid var(--app-border-color)', background: 'var(--app-bg-card)', backdropFilter: 'blur(16px)', height: '220px', position: 'relative', boxShadow: 'var(--app-shadow)', transition: 'all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1)' }} styles={{ body: { padding: 0, display: 'flex', flexDirection: 'row', height: '100%' } }}>
|
||||
<div className={isProcessing ? 'status-bar-active' : ''} style={{ width: 6, height: '100%', backgroundColor: config.color, borderRadius: '16px 0 0 16px', flexShrink: 0 }}></div>
|
||||
<div style={{ flex: 1, padding: '20px 24px', position: 'relative', display: 'flex', flexDirection: 'column', minWidth: 0 }}>
|
||||
{canManageMeeting(item) && (
|
||||
<div className="card-actions" style={{ position: 'absolute', top: 16, right: 16, zIndex: 10, background: 'var(--app-bg-card)', borderRadius: 8, padding: '4px' }} onClick={e => e.stopPropagation()}>
|
||||
<Space size={8}>
|
||||
<Tooltip title="编辑参会人"><div className="icon-btn edit"><EditOutlined onClick={() => onEditParticipants(item)} /></div></Tooltip>
|
||||
|
|
@ -217,6 +220,7 @@ const MeetingCardItem: React.FC<{ item: MeetingVO, config: any, fetchData: () =>
|
|||
</Popconfirm>
|
||||
</Space>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div style={{ flex: 1, display: 'flex', flexDirection: 'column', minWidth: 0 }}>
|
||||
<div style={{ marginBottom: 12, paddingRight: 80 }}>
|
||||
|
|
@ -226,7 +230,10 @@ const MeetingCardItem: React.FC<{ item: MeetingVO, config: any, fetchData: () =>
|
|||
<Text strong style={{ fontSize: 16, color: '#262626', lineHeight: '22px' }} ellipsis={{ tooltip: item.title }}>{item.title}</Text>
|
||||
</div>
|
||||
<Space direction="vertical" size={10} style={{ width: '100%', minWidth: 0 }}>
|
||||
<div style={{ fontSize: '13px', color: '#8c8c8c', display: 'flex', alignItems: 'center' }}><CalendarOutlined style={{ marginRight: 10, flexShrink: 0 }} /><span style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{dayjs(item.meetingTime).format('YYYY-MM-DD HH:mm')}</span></div>
|
||||
<div style={{ fontSize: '13px', color: '#8c8c8c', display: 'flex', alignItems: 'center', gap: 16 }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', minWidth: 0, flexShrink: 1 }}><CalendarOutlined style={{ marginRight: 6, flexShrink: 0 }} /><span style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{dayjs(item.meetingTime).format('YYYY-MM-DD HH:mm')}</span></div>
|
||||
<div style={{ display: 'flex', alignItems: 'center', minWidth: 0, flexShrink: 1 }}><UserOutlined style={{ marginRight: 6, flexShrink: 0 }} /><span style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{item.creatorName || '未知'}</span></div>
|
||||
</div>
|
||||
{isProcessing ? (
|
||||
<div style={{
|
||||
fontSize: '12px',
|
||||
|
|
@ -455,6 +462,10 @@ const Meetings: React.FC = () => {
|
|||
};
|
||||
|
||||
const openEditParticipants = (meeting: MeetingVO) => {
|
||||
if (!canManageMeeting(meeting)) {
|
||||
message.warning('只有会议创建人或管理员可以修改参会人');
|
||||
return;
|
||||
}
|
||||
setEditingMeeting(meeting);
|
||||
participantsEditForm.setFieldsValue({
|
||||
participantIds: meeting.participantIds || []
|
||||
|
|
@ -517,6 +528,13 @@ const Meetings: React.FC = () => {
|
|||
width: 180,
|
||||
render: (text: string) => dayjs(text).format('YYYY-MM-DD HH:mm')
|
||||
},
|
||||
{
|
||||
title: '创建人',
|
||||
dataIndex: 'creatorName',
|
||||
key: 'creatorName',
|
||||
width: 120,
|
||||
render: (text: string) => <Text type="secondary" ellipsis>{text || '未知'}</Text>
|
||||
},
|
||||
{
|
||||
title: '参会人',
|
||||
dataIndex: 'participants',
|
||||
|
|
@ -529,7 +547,7 @@ const Meetings: React.FC = () => {
|
|||
title: '操作',
|
||||
key: 'action',
|
||||
width: 160,
|
||||
render: (_: any, record: MeetingVO) => (
|
||||
render: (_: any, record: MeetingVO) => canManageMeeting(record) ? (
|
||||
<Space size="middle">
|
||||
<Button type="link" size="small" onClick={(e) => { e.stopPropagation(); openEditParticipants(record); }}>编辑</Button>
|
||||
<Popconfirm
|
||||
|
|
@ -542,7 +560,7 @@ const Meetings: React.FC = () => {
|
|||
<Button type="link" danger size="small" onClick={(e) => e.stopPropagation()}>删除</Button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
)
|
||||
) : <Text type="secondary">-</Text>
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue