|
|
@@ -0,0 +1,115 @@ |
|
|
|
import React from 'react'; |
|
|
|
import { Modal, Table } from 'antd'; |
|
|
|
import { useModel } from 'umi'; |
|
|
|
import { useState } from 'react'; |
|
|
|
import styles from './SyncModal.less'; |
|
|
|
import ATooltip from '../Tooltip'; |
|
|
|
|
|
|
|
|
|
|
|
const columns = [ |
|
|
|
{ |
|
|
|
title: '文件夹名称', |
|
|
|
dataIndex: 'name', |
|
|
|
width: 120, |
|
|
|
render: (text: string) => ( |
|
|
|
<ATooltip title={text} placement="topLeft"> |
|
|
|
{text} |
|
|
|
</ATooltip> |
|
|
|
), |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '创建人', |
|
|
|
dataIndex: 'age', |
|
|
|
width: 88, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '描述', |
|
|
|
dataIndex: 'address', |
|
|
|
render: (text: string) => ( |
|
|
|
<ATooltip title={text} placement="topLeft"> |
|
|
|
{text} |
|
|
|
</ATooltip> |
|
|
|
), |
|
|
|
}, |
|
|
|
]; |
|
|
|
|
|
|
|
interface DataType { |
|
|
|
key: React.Key; |
|
|
|
name: string; |
|
|
|
age: number; |
|
|
|
address: string; |
|
|
|
} |
|
|
|
|
|
|
|
const data: DataType[] = [ |
|
|
|
{ |
|
|
|
key: '1', |
|
|
|
name: 'John BrownJohn BrownJohn BrownJohn BrownJohn BrownJohn BrownJohn Brown', |
|
|
|
age: 32, |
|
|
|
address: 'New York No. 1 Lake Park', |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: '2', |
|
|
|
name: 'Jim Green', |
|
|
|
age: 42, |
|
|
|
address: 'London No. 1 Lake Park', |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: '3', |
|
|
|
name: 'Joe Black', |
|
|
|
age: 32, |
|
|
|
address: 'Sidney No. 1 Lake Park', |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: '4', |
|
|
|
name: 'Disabled User', |
|
|
|
age: 99, |
|
|
|
address: 'Sidney No. 1 Lake Park', |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: '5', |
|
|
|
name: 'Disabled User', |
|
|
|
age: 99, |
|
|
|
address: 'Sidney No. 1 Lake Park', |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: '6', |
|
|
|
name: 'Disabled User', |
|
|
|
age: 99, |
|
|
|
address: 'Sidney No. 1 Lake Park', |
|
|
|
}, |
|
|
|
]; |
|
|
|
|
|
|
|
export default function SyncModal() { |
|
|
|
const { initialState: { currentUser } = {} } = useModel('@@initialState'); |
|
|
|
const [modalVisible, setModalVisible] = useState(true); |
|
|
|
|
|
|
|
return ( |
|
|
|
<Modal |
|
|
|
title="同步文件夹至工作空间" |
|
|
|
visible={modalVisible} |
|
|
|
wrapClassName={styles.syncModal} |
|
|
|
cancelText="取消" |
|
|
|
okText="确定" |
|
|
|
width={540} |
|
|
|
> |
|
|
|
<div className={styles.title}>选择「与我有关的文件夹」,并同步到「我的电脑/工作空间」中</div> |
|
|
|
<Table |
|
|
|
className={styles.table} |
|
|
|
rowSelection={{ |
|
|
|
type: 'checkbox', |
|
|
|
onChange: (selectedRowKeys: React.Key[], selectedRows: DataType[]) => { |
|
|
|
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows); |
|
|
|
}, |
|
|
|
getCheckboxProps: (record: DataType) => ({ |
|
|
|
disabled: record.name === 'Disabled User', // Column configuration not to be checked |
|
|
|
name: record.name, |
|
|
|
}), |
|
|
|
}} |
|
|
|
pagination={false} |
|
|
|
columns={columns} |
|
|
|
dataSource={data} |
|
|
|
scroll={{ y: 200 }} |
|
|
|
/> |
|
|
|
</Modal> |
|
|
|
) |
|
|
|
} |