yangjie #45
|
|
@ -1,7 +1,7 @@
|
||||||
import styles from '@/page/Home/Index/index.module.scss'
|
import styles from '@/page/Home/Index/index.module.scss'
|
||||||
import { useEffect, useState, useRef } from "react";
|
import { useEffect, useState, useRef } from "react";
|
||||||
import Operation from '@/components/Operation';
|
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 { GetRoom, PostRoom, GetCheckoutRoomNum, GetRoomRtcToken, DeleteRoom, GetRecord, PostRoomInfo, GetQrcode } from '@/api/Home/Index';
|
||||||
import ImageUrl from '@/utils/package/imageUrl'
|
import ImageUrl from '@/utils/package/imageUrl'
|
||||||
import { ExclamationCircleFilled, ReloadOutlined } from '@ant-design/icons';
|
import { ExclamationCircleFilled, ReloadOutlined } from '@ant-design/icons';
|
||||||
|
|
@ -42,6 +42,7 @@ const Index: React.FC = () => {
|
||||||
const [subjectList, setSubjectList] = useState<any>([]);
|
const [subjectList, setSubjectList] = useState<any>([]);
|
||||||
const [timeData, setTimeData] = useState<any>([]);
|
const [timeData, setTimeData] = useState<any>([]);
|
||||||
const [isCreateRoom, setIsCreateRoom] = useState<boolean>(false);
|
const [isCreateRoom, setIsCreateRoom] = useState<boolean>(false);
|
||||||
|
const [allowAnonymous, setAllowAnonymous] = useState(1);
|
||||||
const [baseImage, setBaseImage] = useState('');
|
const [baseImage, setBaseImage] = useState('');
|
||||||
const userInfo = JSON.parse(storage.getItem('user') as string)
|
const userInfo = JSON.parse(storage.getItem('user') as string)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -462,6 +463,15 @@ const Index: React.FC = () => {
|
||||||
})
|
})
|
||||||
}} />
|
}} />
|
||||||
</div>
|
</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>
|
||||||
<div style={{
|
<div style={{
|
||||||
display: 'flex', justifyContent: 'center'
|
display: 'flex', justifyContent: 'center'
|
||||||
|
|
@ -482,7 +492,7 @@ const Index: React.FC = () => {
|
||||||
if (bool) {
|
if (bool) {
|
||||||
message.error('房间号已存在!')
|
message.error('房间号已存在!')
|
||||||
} else {
|
} else {
|
||||||
PostRoom(createRoomFrom).then(res => {
|
PostRoom({ ...createRoomFrom, allowAnonymous }).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
message.success('创建成功!')
|
message.success('创建成功!')
|
||||||
setCreateRoomModal(false)
|
setCreateRoomModal(false)
|
||||||
|
|
@ -492,7 +502,7 @@ const Index: React.FC = () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
PostRoomInfo(createRoomFrom).then(res => {
|
PostRoomInfo({ ...createRoomFrom, allowAnonymous }).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
message.success('更新成功!')
|
message.success('更新成功!')
|
||||||
setCreateRoomModal(false)
|
setCreateRoomModal(false)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue