样式优化
This commit is contained in:
parent
10097e70a7
commit
99c421864b
|
|
@ -153,3 +153,19 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.createRoom {
|
||||
>div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 14px;
|
||||
|
||||
>span {
|
||||
color: white;
|
||||
flex-shrink: 0;
|
||||
font-size: 14px;
|
||||
text-align: right;
|
||||
width: 70px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -345,79 +345,91 @@ const Index: React.FC = () => {
|
|||
</div>
|
||||
<Modal title={isCreateRoom ? '新建会议室' : '修改会议信息'} open={createRoomModal} footer={null} closable={false} centered width={'400px'}>
|
||||
<div>
|
||||
<div>
|
||||
{isCreateRoom ? <Input
|
||||
placeholder="请输入房间号"
|
||||
style={{ marginBottom: '14px' }}
|
||||
className={styles.letterSpacing}
|
||||
showCount
|
||||
maxLength={8}
|
||||
value={createRoomFrom.roomNum}
|
||||
onChange={(e) => {
|
||||
const regex = /^[0-9]*$/;
|
||||
if (regex.test(e.target.value)) {
|
||||
setCreateRoomFrom({
|
||||
...createRoomFrom,
|
||||
roomNum: e.target.value
|
||||
})
|
||||
}
|
||||
}}
|
||||
suffix={
|
||||
<span
|
||||
style={{ color: '#47D3D0', cursor: 'pointer' }}
|
||||
onClick={() => {
|
||||
function generateTimestampWithRandom(): string {
|
||||
const timestamp = new Date().getTime();
|
||||
const lastSixDigits = timestamp.toString().slice(-6);
|
||||
const randomTwoDigits = ('0' + Math.floor(Math.random() * 100)).slice(-2);
|
||||
return lastSixDigits + randomTwoDigits;
|
||||
}
|
||||
<div className={styles.createRoom}>
|
||||
{isCreateRoom ? <div>
|
||||
<span>房间号:</span>
|
||||
<Input
|
||||
placeholder="请输入房间号"
|
||||
style={{ flexGrow: 1 }}
|
||||
className={styles.letterSpacing}
|
||||
showCount
|
||||
maxLength={8}
|
||||
value={createRoomFrom.roomNum}
|
||||
onChange={(e) => {
|
||||
const regex = /^[0-9]*$/;
|
||||
if (regex.test(e.target.value)) {
|
||||
setCreateRoomFrom({
|
||||
...createRoomFrom,
|
||||
roomNum: generateTimestampWithRandom(),
|
||||
roomNum: e.target.value
|
||||
})
|
||||
}}
|
||||
>获取随机房间号
|
||||
</span>
|
||||
}
|
||||
/> : null}
|
||||
<Input.TextArea
|
||||
placeholder="请输入房间名字"
|
||||
style={{ marginBottom: '14px' }}
|
||||
showCount
|
||||
maxLength={30}
|
||||
value={createRoomFrom.roomName}
|
||||
onChange={(e) => {
|
||||
setCreateRoomFrom({
|
||||
...createRoomFrom,
|
||||
roomName: e.target.value
|
||||
})
|
||||
}}
|
||||
autoSize />
|
||||
<Input
|
||||
placeholder="请输入届"
|
||||
style={{ marginBottom: '14px' }}
|
||||
value={createRoomFrom.year}
|
||||
onChange={(e) => {
|
||||
const regex = /^[0-9]*$/;
|
||||
if (regex.test(e.target.value)) {
|
||||
}
|
||||
}}
|
||||
suffix={
|
||||
<span
|
||||
style={{ color: '#47D3D0', cursor: 'pointer' }}
|
||||
onClick={() => {
|
||||
function generateTimestampWithRandom(): string {
|
||||
const timestamp = new Date().getTime();
|
||||
const lastSixDigits = timestamp.toString().slice(-6);
|
||||
const randomTwoDigits = ('0' + Math.floor(Math.random() * 100)).slice(-2);
|
||||
return lastSixDigits + randomTwoDigits;
|
||||
}
|
||||
setCreateRoomFrom({
|
||||
...createRoomFrom,
|
||||
roomNum: generateTimestampWithRandom(),
|
||||
})
|
||||
}}
|
||||
>获取随机房间号
|
||||
</span>
|
||||
}
|
||||
/>
|
||||
</div> : null}
|
||||
<div>
|
||||
<span>房间名字:</span>
|
||||
<Input.TextArea
|
||||
placeholder="请输入房间名字"
|
||||
style={{ flexGrow: 1 }}
|
||||
showCount
|
||||
maxLength={30}
|
||||
value={createRoomFrom.roomName}
|
||||
onChange={(e) => {
|
||||
setCreateRoomFrom({
|
||||
...createRoomFrom,
|
||||
year: e.target.value
|
||||
roomName: e.target.value
|
||||
})
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<Select
|
||||
placeholder='请选择学科'
|
||||
style={{ width: '100%', marginBottom: '14px' }}
|
||||
options={subjectList}
|
||||
value={createRoomFrom.subject} onChange={(e) => {
|
||||
setCreateRoomFrom({
|
||||
...createRoomFrom,
|
||||
subject: e
|
||||
})
|
||||
}} />
|
||||
}}
|
||||
autoSize />
|
||||
</div>
|
||||
<div>
|
||||
<span>届:</span>
|
||||
<Input
|
||||
placeholder="请输入届"
|
||||
style={{ flexGrow: 1 }}
|
||||
value={createRoomFrom.year}
|
||||
onChange={(e) => {
|
||||
const regex = /^[0-9]*$/;
|
||||
if (regex.test(e.target.value)) {
|
||||
setCreateRoomFrom({
|
||||
...createRoomFrom,
|
||||
year: e.target.value
|
||||
})
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<span>学科:</span>
|
||||
<Select
|
||||
placeholder='请选择学科'
|
||||
style={{ flexGrow: 1 }}
|
||||
options={subjectList}
|
||||
value={createRoomFrom.subject} onChange={(e) => {
|
||||
setCreateRoomFrom({
|
||||
...createRoomFrom,
|
||||
subject: e
|
||||
})
|
||||
}} />
|
||||
</div>
|
||||
</div>
|
||||
<div style={{
|
||||
display: 'flex', justifyContent: 'center'
|
||||
|
|
|
|||
Loading…
Reference in New Issue