|
@@ -11,6 +11,7 @@ import consts from '@/consts'
|
|
|
import { queryContact, apiAddClient } from '@/services/contact'
|
|
import { queryContact, apiAddClient } from '@/services/contact'
|
|
|
import styles from './index.less'
|
|
import styles from './index.less'
|
|
|
import LazyCascader from '@/components/LazyCascader'
|
|
import LazyCascader from '@/components/LazyCascader'
|
|
|
|
|
+import { useDebounceFn } from 'ahooks'
|
|
|
|
|
|
|
|
const Contact = props => {
|
|
const Contact = props => {
|
|
|
const { collapsed } = props
|
|
const { collapsed } = props
|
|
@@ -291,11 +292,7 @@ const Contact = props => {
|
|
|
width: 150
|
|
width: 150
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
- // const { data = [], total = 0 } = props
|
|
|
|
|
- // const { contactName: { list } } = props // 将contact中的pros.list命名为list
|
|
|
|
|
- // const contanctlist = [...list]
|
|
|
|
|
- // console.log(props)
|
|
|
|
|
- // console.log(contanctlist)
|
|
|
|
|
|
|
+
|
|
|
const [columnsStateMap, setColumnsStateMap] = useState({
|
|
const [columnsStateMap, setColumnsStateMap] = useState({
|
|
|
telephone: {
|
|
telephone: {
|
|
|
show: false
|
|
show: false
|
|
@@ -349,6 +346,12 @@ const Contact = props => {
|
|
|
initData({ search: value })
|
|
initData({ search: value })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ const searchOnchange = e => {
|
|
|
|
|
+ const { value = '' } = e.target
|
|
|
|
|
+ initData({ search: value })
|
|
|
|
|
+ }
|
|
|
|
|
+ const { run: handleSearchInputChange } = useDebounceFn(searchOnchange)
|
|
|
|
|
+
|
|
|
const onDistrictChange = value => {
|
|
const onDistrictChange = value => {
|
|
|
const [province = '', city = '', area = ''] = value
|
|
const [province = '', city = '', area = ''] = value
|
|
|
initData({ province, city, area })
|
|
initData({ province, city, area })
|
|
@@ -371,7 +374,8 @@ const Contact = props => {
|
|
|
search={false}
|
|
search={false}
|
|
|
toolbar={{
|
|
toolbar={{
|
|
|
search: {
|
|
search: {
|
|
|
- onSearch: handleSearch
|
|
|
|
|
|
|
+ onSearch: handleSearch,
|
|
|
|
|
+ onChange: handleSearchInputChange
|
|
|
},
|
|
},
|
|
|
actions: [
|
|
actions: [
|
|
|
<LazyCascader onChange={onDistrictChange} key="LazyCascader" />,
|
|
<LazyCascader onChange={onDistrictChange} key="LazyCascader" />,
|