|
|
@@ -8,8 +8,10 @@ import { queryCompany, apiAddCompany } from '@/services/company'
|
|
|
import LazyCascader from '@/components/LazyCascader'
|
|
|
import Companys from '@/components/PopContent/Companys'
|
|
|
import AddCompany from '@/pages/Customer/Company/AddCompany'
|
|
|
+import { useModal } from '@/components/Modal'
|
|
|
|
|
|
const Company = props => {
|
|
|
+ const { toggleDrawer, setDrawerProps } = useModal()
|
|
|
const { collapsed } = props
|
|
|
const needSubtractHeight = 48 + 48 + 48 + 64 + 24 + 32 // 需要被裁掉的高度
|
|
|
const needSubtractWidth = (collapsed ? 208 : 48) + 48 + 48 + 48 // 需要被裁掉的高度
|
|
|
@@ -61,17 +63,25 @@ const Company = props => {
|
|
|
|
|
|
// 展示drawer
|
|
|
const showDrawer = id => {
|
|
|
- // console.log(id);
|
|
|
- setState({ ...state, id, visible: true })
|
|
|
+ setDrawerProps({
|
|
|
+ closable: true,
|
|
|
+ onClose: () => toggleDrawer(),
|
|
|
+ bodyStyle: {
|
|
|
+ height: '100vh',
|
|
|
+ overflowY: 'hidden'
|
|
|
+ },
|
|
|
+ children: <Companys id={id} />
|
|
|
+ })
|
|
|
+ toggleDrawer()
|
|
|
}
|
|
|
|
|
|
// 隐藏drawer
|
|
|
- const hideDrawer = () => {
|
|
|
- setState({ ...state, visible: false, id: '' })
|
|
|
- }
|
|
|
- const onCreate = values => {
|
|
|
- console.log(values)
|
|
|
- }
|
|
|
+ // const hideDrawer = () => {
|
|
|
+ // setState({ ...state, visible: false, id: '' })
|
|
|
+ // }
|
|
|
+ // const onCreate = values => {
|
|
|
+ // console.log(values)
|
|
|
+ // }
|
|
|
const columns = [
|
|
|
{
|
|
|
title: '客户名称',
|
|
|
@@ -180,7 +190,6 @@ const Company = props => {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-
|
|
|
return (
|
|
|
<div>
|
|
|
<ProTable
|
|
|
@@ -197,8 +206,7 @@ const Company = props => {
|
|
|
<Button
|
|
|
key="button"
|
|
|
type="primary"
|
|
|
- onClick={() => setAddCompany({ ...addCompany, visible: true })}
|
|
|
- >
|
|
|
+ onClick={() => setAddCompany({ ...addCompany, visible: true })}>
|
|
|
<SvgIcon type="icon-plus" />
|
|
|
客户
|
|
|
</Button>
|
|
|
@@ -221,7 +229,7 @@ const Company = props => {
|
|
|
visible={addCompany.visible}
|
|
|
onCancel={() => setAddCompany({ ...addCompany, visible: false })}
|
|
|
/>
|
|
|
- <Companys onClose={hideDrawer} visible={state.visible} onCreate={onCreate} id={state.id} />
|
|
|
+ {/* <Companys onClose={hideDrawer} visible={state.visible} onCreate={onCreate} id={state.id} /> */}
|
|
|
</div>
|
|
|
)
|
|
|
}
|