|
@@ -2,7 +2,7 @@ import { Input, Button, Spin, message } from 'antd'
|
|
|
import React, { useState, useEffect, useRef } from 'react'
|
|
import React, { useState, useEffect, useRef } from 'react'
|
|
|
import styles from './index.less'
|
|
import styles from './index.less'
|
|
|
import { SearchOutlined, CloseOutlined } from '@ant-design/icons'
|
|
import { SearchOutlined, CloseOutlined } from '@ant-design/icons'
|
|
|
-import { useDebounceFn, useThrottleFn } from 'ahooks'
|
|
|
|
|
|
|
+import { useDebounceFn } from 'ahooks'
|
|
|
import { useDispatch } from 'dva'
|
|
import { useDispatch } from 'dva'
|
|
|
import AddCustomerModal from '../AddCustomerModal'
|
|
import AddCustomerModal from '../AddCustomerModal'
|
|
|
import { createCustomer, queryCustomers } from '@/services/customer'
|
|
import { createCustomer, queryCustomers } from '@/services/customer'
|
|
@@ -22,10 +22,8 @@ const SearchModal = ({ clientId, onSelect }) => {
|
|
|
total: 0
|
|
total: 0
|
|
|
})
|
|
})
|
|
|
const initData = async params => {
|
|
const initData = async params => {
|
|
|
- const {
|
|
|
|
|
- data: { customer, total } = { customer: [], total: 0 },
|
|
|
|
|
- code = -1
|
|
|
|
|
- } = await queryCustomers(params)
|
|
|
|
|
|
|
+ const { data: { customer, total } = { customer: [], total: 0 }, code = -1 } =
|
|
|
|
|
+ await queryCustomers(params)
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
|
if (params?.page === 1) {
|
|
if (params?.page === 1) {
|
|
|
// 请求的是第一页
|
|
// 请求的是第一页
|