|
|
@@ -1,7 +1,29 @@
|
|
|
-import React from 'react'
|
|
|
+import React, { useState, useEffect } from 'react'
|
|
|
+import { Modal } from 'antd'
|
|
|
+import consts from '@/consts'
|
|
|
+import { connect } from 'dva'
|
|
|
import ProTable from '@ant-design/pro-table'
|
|
|
+import { queryReminderList } from '@/services/dashboard'
|
|
|
|
|
|
-const ReminderList = () => {
|
|
|
+const ReminderList = props => {
|
|
|
+ const { visible, onCancel, loading, dataId = '' } = props
|
|
|
+ const [state, setState] = useState({
|
|
|
+ loading: false,
|
|
|
+ client: []
|
|
|
+ })
|
|
|
+ const initData = async id => {
|
|
|
+ setState({ ...state, loading: true })
|
|
|
+ const {
|
|
|
+ data: { client = [] },
|
|
|
+ code = -1
|
|
|
+ } = await queryReminderList(id)
|
|
|
+ if (code === consts.RET_CODE.SUCCESS) {
|
|
|
+ setState({ ...state, client, loading: false })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ useEffect(() => {
|
|
|
+ visible && initData(dataId)
|
|
|
+ }, [visible])
|
|
|
const columns = [
|
|
|
{
|
|
|
title: '客户名称',
|
|
|
@@ -42,16 +64,20 @@ const ReminderList = () => {
|
|
|
]
|
|
|
return (
|
|
|
<div>
|
|
|
- <ProTable
|
|
|
- rowKey={record => record.rank}
|
|
|
- columns={columns}
|
|
|
- // dataSource={}
|
|
|
- search={false}
|
|
|
- toolBarRender={false}
|
|
|
- pagination={false}
|
|
|
- />
|
|
|
+ <Modal visible={visible} confirmLoading={loading} onCancel={onCancel} width={800}>
|
|
|
+ <ProTable
|
|
|
+ rowKey={record => record.rank}
|
|
|
+ columns={columns}
|
|
|
+ // dataSource={}
|
|
|
+ search={false}
|
|
|
+ toolBarRender={false}
|
|
|
+ pagination={false}
|
|
|
+ />
|
|
|
+ </Modal>
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
|
|
|
|
-export default ReminderList
|
|
|
+export default connect(({ single }) => ({
|
|
|
+ visible: single.drawer.visible
|
|
|
+}))(ReminderList)
|