|
|
@@ -11,9 +11,6 @@ const ReminderList = props => {
|
|
|
const dispatch = useDispatch()
|
|
|
const { dataType, reminderCyclical } = props
|
|
|
const [state, setState] = useState({
|
|
|
- client: [],
|
|
|
- customer: [],
|
|
|
- business: [],
|
|
|
params: { dataType, reminderCyclical }
|
|
|
})
|
|
|
const clientColumns = [
|
|
|
@@ -93,24 +90,6 @@ const ReminderList = props => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- const initData = async params => {
|
|
|
- const {
|
|
|
- data: { client = [], customer = [], business = [], total = 0 } = {
|
|
|
- client: [],
|
|
|
- customer: [],
|
|
|
- business: [],
|
|
|
- total
|
|
|
- },
|
|
|
- code = -1
|
|
|
- } = await queryReminderList(params)
|
|
|
- if (code === consts.RET_CODE.SUCCESS) {
|
|
|
- setState({ ...state, client, customer, business, total })
|
|
|
- }
|
|
|
- }
|
|
|
- useEffect(() => {
|
|
|
- initData()
|
|
|
- }, [])
|
|
|
-
|
|
|
const closeModal = () => {
|
|
|
dispatch({
|
|
|
type: 'single/changeModal'
|
|
|
@@ -129,25 +108,21 @@ const ReminderList = props => {
|
|
|
size="small"
|
|
|
rowKey={record => record.id}
|
|
|
columns={dataMap[dataType].columns}
|
|
|
- dataSource={state.client}
|
|
|
+ // dataSource={state.client}
|
|
|
params={state.params}
|
|
|
- // request={async params => {
|
|
|
- // const {
|
|
|
- // code = -1,
|
|
|
- // data: { client = [], customer = [], business = [], total = 0 } = {
|
|
|
- // client: [],
|
|
|
- // customer: [],
|
|
|
- // business: [],
|
|
|
- // total: 0
|
|
|
- // }
|
|
|
- // } = await queryReminderList({ ...params })
|
|
|
- // setState({ ...state, client, customer, business })
|
|
|
- // return {
|
|
|
- // data: customer,
|
|
|
- // success: code === consts.RET_CODE.SUCCESS,
|
|
|
- // total
|
|
|
- // }
|
|
|
- // }}
|
|
|
+ request={async params => {
|
|
|
+ const {
|
|
|
+ code = -1,
|
|
|
+ data: { total = 0 } = {
|
|
|
+ total: 0
|
|
|
+ }
|
|
|
+ } = await queryReminderList({ ...params })
|
|
|
+ return {
|
|
|
+ data: [dataType],
|
|
|
+ success: code === consts.RET_CODE.SUCCESS,
|
|
|
+ total
|
|
|
+ }
|
|
|
+ }}
|
|
|
search={false}
|
|
|
toolBarRender={false}
|
|
|
/>
|