Compare commits

..

3 Commits

Author SHA1 Message Date
yangqiang cb20942024 Merge pull request '新建会议室&新增用户优化' (#21) from yj into master
Reviewed-on: #21
2024-10-12 17:21:20 +08:00
yj 99c421864b 样式优化 2024-10-12 17:07:22 +08:00
yj 10097e70a7 新建会议室&新增用户优化 2024-10-12 16:47:55 +08:00
3 changed files with 106 additions and 84 deletions

View File

@ -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;
}
}
}

View File

@ -27,12 +27,12 @@ const Index: React.FC = () => {
}) })
const [createRoomModal, setCreateRoomModal] = useState(false) const [createRoomModal, setCreateRoomModal] = useState(false)
const [timeSelectModal, setTimeSelectModal] = useState(false) const [timeSelectModal, setTimeSelectModal] = useState(false)
const [createRoomFrom, setCreateRoomFrom] = useState<{ id: string, roomName: string, roomNum: string, subject: string, year: string }>({ const [createRoomFrom, setCreateRoomFrom] = useState<{ id: string, roomName: string, roomNum: string, subject: number, year: string }>({
id: "", id: "",
roomName: "", roomName: "",
roomNum: "", roomNum: "",
subject: "", subject: 0,
year: "" year: "0"
}) })
const joinSettingRef = useRef<any>(); const joinSettingRef = useRef<any>();
const stupWizardRef = useRef<any>(); const stupWizardRef = useRef<any>();
@ -185,8 +185,8 @@ const Index: React.FC = () => {
setCreateRoomFrom({ setCreateRoomFrom({
roomName: "", roomName: "",
roomNum: "", roomNum: "",
subject: "", subject: 0,
year: "", year: "0",
id: "", id: "",
}) })
getSubDpList() getSubDpList()
@ -345,10 +345,12 @@ const Index: React.FC = () => {
</div> </div>
<Modal title={isCreateRoom ? '新建会议室' : '修改会议信息'} open={createRoomModal} footer={null} closable={false} centered width={'400px'}> <Modal title={isCreateRoom ? '新建会议室' : '修改会议信息'} open={createRoomModal} footer={null} closable={false} centered width={'400px'}>
<div> <div>
<div> <div className={styles.createRoom}>
{isCreateRoom ? <Input {isCreateRoom ? <div>
<span></span>
<Input
placeholder="请输入房间号" placeholder="请输入房间号"
style={{ marginBottom: '14px' }} style={{ flexGrow: 1 }}
className={styles.letterSpacing} className={styles.letterSpacing}
showCount showCount
maxLength={8} maxLength={8}
@ -380,10 +382,13 @@ const Index: React.FC = () => {
> >
</span> </span>
} }
/> : null} />
</div> : null}
<div>
<span></span>
<Input.TextArea <Input.TextArea
placeholder="请输入房间名字" placeholder="请输入房间名字"
style={{ marginBottom: '14px' }} style={{ flexGrow: 1 }}
showCount showCount
maxLength={30} maxLength={30}
value={createRoomFrom.roomName} value={createRoomFrom.roomName}
@ -394,9 +399,12 @@ const Index: React.FC = () => {
}) })
}} }}
autoSize /> autoSize />
</div>
<div>
<span></span>
<Input <Input
placeholder="请输入届" placeholder="请输入届"
style={{ marginBottom: '14px' }} style={{ flexGrow: 1 }}
value={createRoomFrom.year} value={createRoomFrom.year}
onChange={(e) => { onChange={(e) => {
const regex = /^[0-9]*$/; const regex = /^[0-9]*$/;
@ -408,17 +416,21 @@ const Index: React.FC = () => {
} }
}} }}
/> />
</div>
<div>
<span></span>
<Select <Select
placeholder='请选择学科' placeholder='请选择学科'
style={{ width: '100%', marginBottom: '14px' }} style={{ flexGrow: 1 }}
options={subjectList} options={subjectList}
value={createRoomFrom.subject === "" ? null : createRoomFrom.subject} onChange={(e) => { value={createRoomFrom.subject} onChange={(e) => {
setCreateRoomFrom({ setCreateRoomFrom({
...createRoomFrom, ...createRoomFrom,
subject: e subject: e
}) })
}} /> }} />
</div> </div>
</div>
<div style={{ <div style={{
display: 'flex', justifyContent: 'center' display: 'flex', justifyContent: 'center'
}}> }}>
@ -433,9 +445,6 @@ const Index: React.FC = () => {
if (!createRoomFrom.year) { if (!createRoomFrom.year) {
return message.error('请输入届!') return message.error('请输入届!')
} }
if (createRoomFrom.subject === "") {
return message.error('请选择学科!')
}
if (isCreateRoom) { if (isCreateRoom) {
isGetCheckoutRoomNum(createRoomFrom.roomNum, (bool: boolean) => { isGetCheckoutRoomNum(createRoomFrom.roomNum, (bool: boolean) => {
if (bool) { if (bool) {

View File

@ -31,8 +31,8 @@ const User: React.FC = () => {
RoleId: null, RoleId: null,
Pwd: "", Pwd: "",
UserName: "", UserName: "",
subject: null, subject: 0,
year: "", year: '0',
}) })
const [changeUserPawModal, setChangeUserPawModal] = useState(false) const [changeUserPawModal, setChangeUserPawModal] = useState(false)
const [changeImportModal, setChangeImportModal] = useState(false) const [changeImportModal, setChangeImportModal] = useState(false)
@ -151,8 +151,8 @@ const User: React.FC = () => {
RoleId: null, RoleId: null,
Pwd: "", Pwd: "",
UserName: "", UserName: "",
subject: null, subject: 0,
year: "", year: '0',
}) })
setAddUserModal(true) setAddUserModal(true)
} }
@ -181,8 +181,8 @@ const User: React.FC = () => {
RoleId: null, RoleId: null,
Pwd: "", Pwd: "",
UserName: "", UserName: "",
subject: null, subject: 0,
year: "", year: '0',
}) })
setAddUserModal(true) setAddUserModal(true)
} }
@ -426,9 +426,6 @@ const User: React.FC = () => {
if (!addUserFrom.year) { if (!addUserFrom.year) {
return message.error('请输入届!') return message.error('请输入届!')
} }
if (addUserFrom.subject === null) {
return message.error('请选择学科!')
}
if (isCreateUser === 'add') { if (isCreateUser === 'add') {
await PostUser({ await PostUser({
...addUserFrom, ...addUserFrom,