Compare commits

..

No commits in common. "cb209420246e7f0940739af9076587877ec2992c" and "d0cb13c5e39e80c9dbc47364da7f15a0a9a1f4e1" have entirely different histories.

3 changed files with 83 additions and 105 deletions

View File

@ -153,19 +153,3 @@
} }
} }
} }
.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: number, year: string }>({ const [createRoomFrom, setCreateRoomFrom] = useState<{ id: string, roomName: string, roomNum: string, subject: string, year: string }>({
id: "", id: "",
roomName: "", roomName: "",
roomNum: "", roomNum: "",
subject: 0, subject: "",
year: "0" year: ""
}) })
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: 0, subject: "",
year: "0", year: "",
id: "", id: "",
}) })
getSubDpList() getSubDpList()
@ -345,12 +345,10 @@ 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 className={styles.createRoom}> <div>
{isCreateRoom ? <div> {isCreateRoom ? <Input
<span></span>
<Input
placeholder="请输入房间号" placeholder="请输入房间号"
style={{ flexGrow: 1 }} style={{ marginBottom: '14px' }}
className={styles.letterSpacing} className={styles.letterSpacing}
showCount showCount
maxLength={8} maxLength={8}
@ -382,13 +380,10 @@ const Index: React.FC = () => {
> >
</span> </span>
} }
/> /> : null}
</div> : null}
<div>
<span></span>
<Input.TextArea <Input.TextArea
placeholder="请输入房间名字" placeholder="请输入房间名字"
style={{ flexGrow: 1 }} style={{ marginBottom: '14px' }}
showCount showCount
maxLength={30} maxLength={30}
value={createRoomFrom.roomName} value={createRoomFrom.roomName}
@ -399,12 +394,9 @@ const Index: React.FC = () => {
}) })
}} }}
autoSize /> autoSize />
</div>
<div>
<span></span>
<Input <Input
placeholder="请输入届" placeholder="请输入届"
style={{ flexGrow: 1 }} style={{ marginBottom: '14px' }}
value={createRoomFrom.year} value={createRoomFrom.year}
onChange={(e) => { onChange={(e) => {
const regex = /^[0-9]*$/; const regex = /^[0-9]*$/;
@ -416,21 +408,17 @@ const Index: React.FC = () => {
} }
}} }}
/> />
</div>
<div>
<span></span>
<Select <Select
placeholder='请选择学科' placeholder='请选择学科'
style={{ flexGrow: 1 }} style={{ width: '100%', marginBottom: '14px' }}
options={subjectList} options={subjectList}
value={createRoomFrom.subject} onChange={(e) => { value={createRoomFrom.subject === "" ? null : 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'
}}> }}>
@ -445,6 +433,9 @@ 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: 0, subject: null,
year: '0', year: "",
}) })
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: 0, subject: null,
year: '0', year: "",
}) })
setAddUserModal(true) setAddUserModal(true)
} }
@ -181,8 +181,8 @@ const User: React.FC = () => {
RoleId: null, RoleId: null,
Pwd: "", Pwd: "",
UserName: "", UserName: "",
subject: 0, subject: null,
year: '0', year: "",
}) })
setAddUserModal(true) setAddUserModal(true)
} }
@ -426,6 +426,9 @@ 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,