This commit is contained in:
yj 2024-12-13 14:09:28 +08:00
parent 631dbf26b1
commit 20e25fa96d
1 changed files with 13 additions and 3 deletions

View File

@ -1,7 +1,7 @@
import styles from '@/page/Home/Index/index.module.scss'
import { useEffect, useState, useRef } from "react";
import Operation from '@/components/Operation';
import { Button, Input, Modal, Pagination, Empty, message, Popover, Popconfirm, DatePicker, Select } from "antd";
import { Button, Input, Modal, Pagination, Empty, message, Popover, Popconfirm, DatePicker, Select, Radio } from "antd";
import { GetRoom, PostRoom, GetCheckoutRoomNum, GetRoomRtcToken, DeleteRoom, GetRecord, PostRoomInfo, GetQrcode } from '@/api/Home/Index';
import ImageUrl from '@/utils/package/imageUrl'
import { ExclamationCircleFilled, ReloadOutlined } from '@ant-design/icons';
@ -42,6 +42,7 @@ const Index: React.FC = () => {
const [subjectList, setSubjectList] = useState<any>([]);
const [timeData, setTimeData] = useState<any>([]);
const [isCreateRoom, setIsCreateRoom] = useState<boolean>(false);
const [allowAnonymous, setAllowAnonymous] = useState(1);
const [baseImage, setBaseImage] = useState('');
const userInfo = JSON.parse(storage.getItem('user') as string)
useEffect(() => {
@ -462,6 +463,15 @@ const Index: React.FC = () => {
})
}} />
</div>
<div>
<span></span>
<Radio.Group onChange={(e) => {
setAllowAnonymous(e.target.value);
}} value={allowAnonymous}>
<Radio value={1}></Radio>
<Radio value={0}></Radio>
</Radio.Group>
</div>
</div>
<div style={{
display: 'flex', justifyContent: 'center'
@ -482,7 +492,7 @@ const Index: React.FC = () => {
if (bool) {
message.error('房间号已存在!')
} else {
PostRoom(createRoomFrom).then(res => {
PostRoom({ ...createRoomFrom, allowAnonymous }).then(res => {
if (res.code === 200) {
message.success('创建成功!')
setCreateRoomModal(false)
@ -492,7 +502,7 @@ const Index: React.FC = () => {
}
})
} else {
PostRoomInfo(createRoomFrom).then(res => {
PostRoomInfo({ ...createRoomFrom, allowAnonymous }).then(res => {
if (res.code === 200) {
message.success('更新成功!')
setCreateRoomModal(false)