This commit is contained in:
parent
6fce7478c6
commit
3632bd4d07
|
|
@ -6,7 +6,7 @@ import {
|
|||
SearchOutlined,
|
||||
VerticalAlignBottomOutlined
|
||||
} from '@ant-design/icons';
|
||||
import { Button, Input, message, Modal, Pagination, Progress, Table } from 'antd';
|
||||
import { Button, Input, message, Modal, Pagination, Popconfirm, Progress, Table } from 'antd';
|
||||
import { forwardRef, useEffect, useImperativeHandle, useState, useRef } from "react";
|
||||
import { DeleteRoomFile, GetRoomFile, GetRoomFileDwUrl, GetRoomUpFileurl, GetRoomUserItem, PostRoomFile } from '@/api/Meeting';
|
||||
import axios from 'axios';
|
||||
|
|
@ -129,29 +129,41 @@ const SharedFilesModel = forwardRef((props: any, ref: any) => {
|
|||
})
|
||||
}
|
||||
}} />
|
||||
{roomUserItem && role.ID.includes(roomUserItem.roleId) || roomUserItem.isRoomManager ? <ProfileOutlined title={showRowSelection ? '取消框选' : '显示框选'} onClick={() => {
|
||||
{roomUserItem && (role.ID.includes(roomUserItem.roleId) || roomUserItem.isRoomManager) && fileList.data.length ? <ProfileOutlined title={showRowSelection ? '取消框选' : '显示框选'} onClick={() => {
|
||||
setShowRowSelection(!showRowSelection)
|
||||
}} style={{ color: showRowSelection ? '#5575F2' : 'white' }} /> : null}
|
||||
{showRowSelection ? <DeleteOutlined title='删除' onClick={() => {
|
||||
if (selectedRowKeys.length) {
|
||||
DeleteRoomFile(selectedRowKeys).then(res => {
|
||||
if (res.code === 200) {
|
||||
message.success('删除成功!')
|
||||
if (fileList.pageIndex === 1) {
|
||||
getRoomFile()
|
||||
} else {
|
||||
setFileList({
|
||||
...fileList,
|
||||
pageIndex: 1
|
||||
})
|
||||
}
|
||||
{showRowSelection && fileList.data.length && selectedRowKeys.length ?
|
||||
<Popconfirm
|
||||
title="提示"
|
||||
description="确认删除吗?"
|
||||
onConfirm={() => {
|
||||
if (selectedRowKeys.length) {
|
||||
DeleteRoomFile(selectedRowKeys).then(res => {
|
||||
if (res.code === 200) {
|
||||
message.success('删除成功!')
|
||||
if (fileList.pageIndex === 1) {
|
||||
getRoomFile()
|
||||
} else {
|
||||
setFileList({
|
||||
...fileList,
|
||||
pageIndex: 1
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
message.error('请选择文件!')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
message.error('请选择文件!')
|
||||
}
|
||||
}} /> : null}
|
||||
<Button type="primary" style={{ backgroundColor: '#31353A' }}
|
||||
}}
|
||||
onCancel={() => {
|
||||
|
||||
}}
|
||||
okText="确认"
|
||||
cancelText="取消"
|
||||
>
|
||||
<DeleteOutlined title='删除' />
|
||||
</Popconfirm> : null}
|
||||
{roomUserItem && role.ID.includes(roomUserItem.roleId) || roomUserItem.isRoomManager ? <Button type="primary" style={{ backgroundColor: '#31353A' }}
|
||||
onClick={() => {
|
||||
if (isUpFile) {
|
||||
message.error('文件上传中,请稍后上传。')
|
||||
|
|
@ -211,7 +223,7 @@ const SharedFilesModel = forwardRef((props: any, ref: any) => {
|
|||
};
|
||||
file.click();
|
||||
}}
|
||||
>上传</Button>
|
||||
>上传</Button> : null}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
|
@ -341,7 +353,7 @@ const SharedFilesModel = forwardRef((props: any, ref: any) => {
|
|||
...fileList,
|
||||
pageIndex: e
|
||||
})
|
||||
}} pageSize={fileList.pageSize} current={fileList.pageIndex} hideOnSinglePage={true} showSizeChanger={false}/>
|
||||
}} pageSize={fileList.pageSize} current={fileList.pageIndex} hideOnSinglePage={true} showSizeChanger={false} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue