优化&bug修复

This commit is contained in:
yj 2025-02-20 15:44:10 +08:00
parent dc9ee39a1e
commit 0fbcb32565
9 changed files with 62 additions and 17 deletions

View File

@ -47,6 +47,10 @@ const UserName = forwardRef((props: any, ref: any) => {
onClick={async () => {
const stateInfo = await JSON.parse(storage.getItem('stateInfo') as string);
if (info.userName) {
if (info.userName.length > 10) {
message.error('用户名称最多10个字')
return
}
PutAlterUname({
nickName: info.userName,
roomNum: stateInfo.channelId,

View File

@ -458,6 +458,9 @@ const User: React.FC = () => {
if (!addUserFrom.UserName && isCreateUser !== 'batch') {
return message.error('请输入用户名称!')
}
if (addUserFrom.UserName.length > 10) {
return message.error('用户名称最多10个字')
}
if (addUserFrom.year === '') {
return message.error('请输入届!')
}

View File

@ -315,6 +315,9 @@ const Login: React.FC = () => {
if (!anonInfo.nickName) {
return message.error('请输入参会昵称!')
}
if (anonInfo.nickName.length > 10) {
return message.error('参会昵称最多10个字')
}
storage.setItem('loading', true)
PostAnonLogin(anonInfo).then(async (res) => {
if (res.code == 200) {

View File

@ -46,6 +46,8 @@
font-size: 14px;
color: #F3F3F5;
margin-left: 4px;
display: flex;
align-items: center;
}
>div {}
@ -77,6 +79,8 @@
>span {
font-size: 14px;
color: #F3F3F5;
display: flex;
align-items: center;
}
>div {

View File

@ -206,19 +206,30 @@ const ChatBigWindow: React.FC = () => {
></Button> : null}
</div> : <div style={{ color: 'white' }}></div>
}>
<div>
<div title={item.userName}>
<div><Avatar name={item.userName} /></div>
{item.uid !== user.uid ?
<span>{item.userName} <span style={{ fontSize: '12px', color: '#ccc', marginLeft: '4px' }}>{dayjs(item.timestamp).format('HH:mm:ss')}</span></span> :
<span> <span style={{ fontSize: '12px', color: '#ccc', marginRight: '4px' }}>{dayjs(item.timestamp).format('HH:mm:ss')} </span>{item.userName}</span>
<span>
<span style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', maxWidth: '150px' }}>{item.userName}</span>
<span style={{ fontSize: '12px', color: '#ccc', marginLeft: '4px' }}>{dayjs(item.timestamp).format('HH:mm:ss')}</span>
</span> :
<span>
<span style={{ fontSize: '12px', color: '#ccc', marginRight: '4px' }}>{dayjs(item.timestamp).format('HH:mm:ss')}</span>
<span style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', maxWidth: '150px' }}>{item.userName}</span>
</span>
}
</div>
</Popover> : <div>
</Popover> : <div title={item.userName}>
<div><Avatar name={item.userName} /></div>
{item.uid !== user.uid ?
<span>{item.userName}<span style={{ fontSize: '12px', color: '#ccc', marginLeft: '4px' }}>{dayjs(item.timestamp).format('HH:mm:ss')}</span></span> :
<span><span style={{ fontSize: '12px', color: '#ccc', marginRight: '4px' }}>{dayjs(item.timestamp).format('HH:mm:ss')} </span>{item.userName}</span>
<span>
<span style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', maxWidth: '150px' }}>{item.userName}</span>
<span style={{ fontSize: '12px', color: '#ccc', marginLeft: '4px' }}>{dayjs(item.timestamp).format('HH:mm:ss')}</span>
</span> :
<span>
<span style={{ fontSize: '12px', color: '#ccc', marginRight: '4px' }}>{dayjs(item.timestamp).format('HH:mm:ss')}</span>
<span style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', maxWidth: '150px' }}>{item.userName}</span>
</span>
}
</div>}
<div>{item.message}</div>

View File

@ -31,7 +31,7 @@
display: flex;
>span:nth-child(1) {
white-space: nowrap;
word-break: break-all;
color: #ff970f;
}

View File

@ -21,7 +21,10 @@ const NoticeWindow: React.FC = () => {
api.open({
message: '',
description: <div>
<span style={{ fontSize: '16px' }}>{noticeItem.uname}</span>
<div style={{ fontSize: '16px' }}>
<div style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }} title={noticeItem.uname}>{noticeItem.uname}</div>
<div></div>
</div>
<div style={{ display: 'flex', justifyContent: 'flex-end' }} className='drag'>
<Button
type="primary"

View File

@ -549,6 +549,8 @@
font-size: 14px;
color: #F3F3F5;
margin-left: 4px;
display: flex;
align-items: center;
}
>div {
@ -660,6 +662,8 @@
font-size: 14px;
color: #F3F3F5;
margin-left: 4px;
display: flex;
align-items: center;
}
}
@ -689,6 +693,8 @@
>span {
font-size: 14px;
color: #F3F3F5;
display: flex;
align-items: center;
}
>div {

View File

@ -2943,7 +2943,7 @@ const Meeting: React.FC = () => {
<div>
<div><Avatar name={item.userName} /></div>
<span>
{item.userName}{item.uid === user.uid ? '(我)' : ''}
<span style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', maxWidth: '80px' }} title={item.userName}>{item.userName}</span>{item.uid === user.uid ? '(我)' : ''}
{role.ID.includes(item.roleId) || item.isRoomManager ?
<span style={{ color: '#02B188', marginLeft: '4px' }}>
{role.ID.includes(item.roleId) ? '管理员' : '发言人'}
@ -3163,19 +3163,30 @@ const Meeting: React.FC = () => {
></Button> : null}
</div> : <div style={{ color: 'white' }}></div>
}>
<div>
<div title={item.userName}>
<div><Avatar name={item.userName} /></div>
{item.uid !== user.uid ?
<span>{item.userName} <span style={{ fontSize: '12px', color: '#ccc', marginLeft: '4px' }}>{dayjs(item.timestamp).format('HH:mm:ss')}</span></span> :
<span> <span style={{ fontSize: '12px', color: '#ccc', marginRight: '4px' }}>{dayjs(item.timestamp).format('HH:mm:ss')} </span>{item.userName}</span>
<span>
<span style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', maxWidth: '150px' }}>{item.userName}</span>
<span style={{ fontSize: '12px', color: '#ccc', marginLeft: '4px' }}>{dayjs(item.timestamp).format('HH:mm:ss')}</span>
</span> :
<span>
<span style={{ fontSize: '12px', color: '#ccc', marginRight: '4px' }}>{dayjs(item.timestamp).format('HH:mm:ss')}</span>
<span style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', maxWidth: '150px' }}>{item.userName}</span>
</span>
}
</div>
</Popover> : <div>
</Popover> : <div title={item.userName}>
<div><Avatar name={item.userName} /></div>
{item.uid !== user.uid ?
<span>{item.userName}<span style={{ fontSize: '12px', color: '#ccc', marginLeft: '4px' }}>{dayjs(item.timestamp).format('HH:mm:ss')}</span></span> :
<span><span style={{ fontSize: '12px', color: '#ccc', marginRight: '4px' }}>{dayjs(item.timestamp).format('HH:mm:ss')} </span>{item.userName}</span>
<span>
<span style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', maxWidth: '150px' }}>{item.userName}</span>
<span style={{ fontSize: '12px', color: '#ccc', marginLeft: '4px' }}>{dayjs(item.timestamp).format('HH:mm:ss')}</span>
</span> :
<span>
<span style={{ fontSize: '12px', color: '#ccc', marginRight: '4px' }}>{dayjs(item.timestamp).format('HH:mm:ss')}</span>
<span style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', maxWidth: '150px' }}>{item.userName}</span>
</span>
}
</div>}
<div>{item.message}</div>