删除会议室
This commit is contained in:
parent
b746a50d1a
commit
86ccca642d
|
|
@ -5,12 +5,17 @@ export const GetRoom = (data: { pageIndex: number, pageSize: number }) =>
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const PostRomm = (data: any) =>
|
export const PostRoom = (data: any) =>
|
||||||
request({
|
request({
|
||||||
url: `/home/room`,
|
url: `/home/room`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data,
|
data,
|
||||||
})
|
})
|
||||||
|
export const DeleteRoom = (roomId: string) =>
|
||||||
|
request({
|
||||||
|
url: `/home/room?roomId=${roomId}`,
|
||||||
|
method: 'delete',
|
||||||
|
})
|
||||||
|
|
||||||
export const GetCheckoutRoomNum = (roomNum: string) =>
|
export const GetCheckoutRoomNum = (roomNum: string) =>
|
||||||
request({
|
request({
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
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 } from "antd";
|
import { Button, Input, Modal, Pagination, Empty, message, Popover, Popconfirm } from "antd";
|
||||||
import { GetRoom, PostRomm, GetCheckoutRoomNum, GetRoomRtcToken } from '@/api/Home/Index';
|
import { GetRoom, PostRoom, GetCheckoutRoomNum, GetRoomRtcToken, DeleteRoom } from '@/api/Home/Index';
|
||||||
import ImageUrl from '@/utils/package/imageUrl'
|
import ImageUrl from '@/utils/package/imageUrl'
|
||||||
import { ReloadOutlined } from '@ant-design/icons';
|
import { ReloadOutlined } from '@ant-design/icons';
|
||||||
import JoinSetting from '@/components/JoinSetting';
|
import JoinSetting from '@/components/JoinSetting';
|
||||||
|
|
@ -89,6 +89,15 @@ const Index: React.FC = () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const changeOpen = (index: number, bool: boolean): void => {
|
||||||
|
const newList = [...list.data] as any;
|
||||||
|
newList[index].open = bool
|
||||||
|
setList({
|
||||||
|
...list,
|
||||||
|
data: newList
|
||||||
|
})
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={styles.index}>
|
<div className={styles.index}>
|
||||||
|
|
@ -149,8 +158,46 @@ const Index: React.FC = () => {
|
||||||
<img src={ImageUrl.icon10} alt="" />
|
<img src={ImageUrl.icon10} alt="" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
<Popover
|
||||||
{/* <Button type="primary" danger>设置</Button> */}
|
content={
|
||||||
|
<div className='meetingContentFooterPopover'>
|
||||||
|
<Popconfirm
|
||||||
|
title="提示"
|
||||||
|
description={`确定删除该会议吗`}
|
||||||
|
onConfirm={async () => {
|
||||||
|
DeleteRoom(item.id).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
message.success('删除成功')
|
||||||
|
changeOpen(index, false)
|
||||||
|
getRoomList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
onCancel={() => {
|
||||||
|
changeOpen(index, false)
|
||||||
|
}}
|
||||||
|
okText="确定"
|
||||||
|
cancelText="取消"
|
||||||
|
>
|
||||||
|
<div>删除会议室</div>
|
||||||
|
</Popconfirm>
|
||||||
|
<div onClick={() => {
|
||||||
|
changeOpen(index, false)
|
||||||
|
}}>导出参会记录</div>
|
||||||
|
<div onClick={() => {
|
||||||
|
changeOpen(index, false)
|
||||||
|
}}>取消</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
title=""
|
||||||
|
trigger="click"
|
||||||
|
open={item.open}
|
||||||
|
onOpenChange={() => {
|
||||||
|
changeOpen(index, true)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Button type="primary" danger>更多</Button>
|
||||||
|
</Popover>
|
||||||
<Button type="primary"
|
<Button type="primary"
|
||||||
iconPosition={'end'}
|
iconPosition={'end'}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
|
|
@ -269,7 +316,7 @@ const Index: React.FC = () => {
|
||||||
if (bool) {
|
if (bool) {
|
||||||
message.error('房间号已存在!')
|
message.error('房间号已存在!')
|
||||||
} else {
|
} else {
|
||||||
PostRomm(createRoomFrom).then(res => {
|
PostRoom(createRoomFrom).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
message.success('创建成功!')
|
message.success('创建成功!')
|
||||||
setCreateRoomModal(false)
|
setCreateRoomModal(false)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue