|
@@ -16,7 +16,7 @@ import { useModal } from '@/components/Modal'
|
|
|
|
|
|
|
|
const Contact = props => {
|
|
const Contact = props => {
|
|
|
const { toggleDrawer, setDrawerProps } = useModal()
|
|
const { toggleDrawer, setDrawerProps } = useModal()
|
|
|
- const { collapsed } = props
|
|
|
|
|
|
|
+ const { dispatch, collapsed, shouldUpdate } = 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 // 需要被裁掉的高度
|
|
|
|
|
|
|
@@ -45,6 +45,12 @@ const Contact = props => {
|
|
|
}
|
|
}
|
|
|
} = await queryContact(payload)
|
|
} = await queryContact(payload)
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
|
|
|
+ if (shouldUpdate) {
|
|
|
|
|
+ dispatch({
|
|
|
|
|
+ type: 'refresh/commitAction',
|
|
|
|
|
+ payload: 'contact'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
setState({ ...state, data: client, journal: log, servicelist: serviceLog, total })
|
|
setState({ ...state, data: client, journal: log, servicelist: serviceLog, total })
|
|
|
if (addClient.visible) {
|
|
if (addClient.visible) {
|
|
|
setAddClient({ ...addClient, loading: false, visible: false })
|
|
setAddClient({ ...addClient, loading: false, visible: false })
|
|
@@ -335,8 +341,11 @@ const Contact = props => {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
- initData()
|
|
|
|
|
- }, [])
|
|
|
|
|
|
|
+ if (shouldUpdate) {
|
|
|
|
|
+ initData()
|
|
|
|
|
+ }
|
|
|
|
|
+ // initData()
|
|
|
|
|
+ }, [shouldUpdate])
|
|
|
|
|
|
|
|
const handleSearch = value => {
|
|
const handleSearch = value => {
|
|
|
initData({ search: value })
|
|
initData({ search: value })
|
|
@@ -369,6 +378,7 @@ const Contact = props => {
|
|
|
search={false}
|
|
search={false}
|
|
|
toolbar={{
|
|
toolbar={{
|
|
|
search: {
|
|
search: {
|
|
|
|
|
+ allowClear: true,
|
|
|
onSearch: handleSearch,
|
|
onSearch: handleSearch,
|
|
|
onChange: handleSearchInputChange
|
|
onChange: handleSearchInputChange
|
|
|
},
|
|
},
|
|
@@ -387,6 +397,7 @@ const Contact = props => {
|
|
|
columnsStateMap={columnsStateMap}
|
|
columnsStateMap={columnsStateMap}
|
|
|
onColumnsStateChange={map => setColumnsStateMap(map)}
|
|
onColumnsStateChange={map => setColumnsStateMap(map)}
|
|
|
headerTitle="联系人"
|
|
headerTitle="联系人"
|
|
|
|
|
+ // type="contactlist"
|
|
|
// toolBarRender={() => [
|
|
// toolBarRender={() => [
|
|
|
// <Button key="button" type="primary">
|
|
// <Button key="button" type="primary">
|
|
|
// <SvgIcon type="icon-plus" />
|
|
// <SvgIcon type="icon-plus" />
|
|
@@ -405,7 +416,8 @@ const Contact = props => {
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export default connect(({ district, loading }) => ({
|
|
|
|
|
|
|
+export default connect(({ district, loading, refresh }) => ({
|
|
|
districtName: district,
|
|
districtName: district,
|
|
|
- getlist: loading.effects['contact/fetch']
|
|
|
|
|
|
|
+ getlist: loading.effects['contact/fetch'],
|
|
|
|
|
+ shouldUpdate: refresh.contact
|
|
|
}))(Contact)
|
|
}))(Contact)
|