|
@@ -12,8 +12,10 @@ 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'
|
|
import { useDebounceFn } from 'ahooks'
|
|
|
|
|
+import { useModal } from '@/components/Drawer'
|
|
|
|
|
|
|
|
const Contact = props => {
|
|
const Contact = props => {
|
|
|
|
|
+ const { toggleDrawer, setDrawerProps } = useModal()
|
|
|
const { collapsed } = props
|
|
const { collapsed } = props
|
|
|
const needSubtractHeight = 48 + 48 + 48 + 64 + 24 + 32 // 需要被裁掉的高度
|
|
const needSubtractHeight = 48 + 48 + 48 + 64 + 24 + 32 // 需要被裁掉的高度
|
|
|
const needSubtractWidth = (collapsed ? 208 : 48) + 48 + 48 + 48 // 需要被裁掉的高度
|
|
const needSubtractWidth = (collapsed ? 208 : 48) + 48 + 48 + 48 // 需要被裁掉的高度
|
|
@@ -63,21 +65,16 @@ const Contact = props => {
|
|
|
|
|
|
|
|
// 展示drawer
|
|
// 展示drawer
|
|
|
const showDrawer = id => {
|
|
const showDrawer = id => {
|
|
|
- // console.log(id);
|
|
|
|
|
- setState({ ...state, id, visible: true })
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 隐藏drawer
|
|
|
|
|
- const hideDrawer = () => {
|
|
|
|
|
- setState({ ...state, visible: false, id: '' })
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const onCreate = values => {
|
|
|
|
|
- console.log(values)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const onChange = values => {
|
|
|
|
|
- console.log(values)
|
|
|
|
|
|
|
+ setDrawerProps({
|
|
|
|
|
+ closable: true,
|
|
|
|
|
+ onClose: () => toggleDrawer(),
|
|
|
|
|
+ bodyStyle: {
|
|
|
|
|
+ height: '100vh',
|
|
|
|
|
+ overflowY: 'hidden'
|
|
|
|
|
+ },
|
|
|
|
|
+ children: <Contacts id={id} />
|
|
|
|
|
+ })
|
|
|
|
|
+ toggleDrawer()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const columns = [
|
|
const columns = [
|
|
@@ -338,7 +335,6 @@ const Contact = props => {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
- // props.getlist();
|
|
|
|
|
initData()
|
|
initData()
|
|
|
}, [])
|
|
}, [])
|
|
|
|
|
|
|
@@ -357,8 +353,7 @@ const Contact = props => {
|
|
|
initData({ province, city, area })
|
|
initData({ province, city, area })
|
|
|
}
|
|
}
|
|
|
return (
|
|
return (
|
|
|
- // <PageHeaderWrapper></PageHeaderWrapper>
|
|
|
|
|
- <div>
|
|
|
|
|
|
|
+ <>
|
|
|
<div className={styles.tableContent}>
|
|
<div className={styles.tableContent}>
|
|
|
<ProTable
|
|
<ProTable
|
|
|
rowKey={record => record.id}
|
|
rowKey={record => record.id}
|
|
@@ -406,16 +401,11 @@ const Contact = props => {
|
|
|
visible={addClient.visible}
|
|
visible={addClient.visible}
|
|
|
onCancel={() => setAddClient({ ...addClient, visible: false })}
|
|
onCancel={() => setAddClient({ ...addClient, visible: false })}
|
|
|
/>
|
|
/>
|
|
|
- <Contacts onClose={hideDrawer} visible={state.visible} onCreate={onCreate} id={state.id} />
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export default connect(({ district, global, loading }) => ({
|
|
|
|
|
- // contactName: contact,
|
|
|
|
|
- // data: contact.data,
|
|
|
|
|
- // total: contact.total,
|
|
|
|
|
|
|
+export default connect(({ district, loading }) => ({
|
|
|
districtName: district,
|
|
districtName: district,
|
|
|
- // collapsed: global.collapsed,
|
|
|
|
|
getlist: loading.effects['contact/fetch']
|
|
getlist: loading.effects['contact/fetch']
|
|
|
}))(Contact)
|
|
}))(Contact)
|