|
|
@@ -7,9 +7,10 @@ import ContanctLowerList from '@/components/PopContent/Contacts/ContanctLowerLis
|
|
|
import { apiContactDetail } from '@/services/contact'
|
|
|
import useAutoTable from '@/hooks/useAutoTable'
|
|
|
import consts from '@/consts'
|
|
|
+import { connect } from 'dva'
|
|
|
|
|
|
const Popcontent = props => {
|
|
|
- const { visible, onClose, collapsed, id = '' } = props
|
|
|
+ const { dispatch, shouldUpdate, visible, onClose, collapsed, id = '' } = props
|
|
|
const needSubtractHeight = 55 // 需要被裁掉的高度
|
|
|
// const needSubtractWidth = (collapsed ? 208 : 48) + 48 + 48 + 48 // 需要被裁掉的高度
|
|
|
const [x, y] = useAutoTable(collapsed, needSubtractHeight)
|
|
|
@@ -28,11 +29,17 @@ const Popcontent = props => {
|
|
|
code = -1
|
|
|
} = await apiContactDetail(id)
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
|
+ if (shouldUpdate) {
|
|
|
+ dispatch({
|
|
|
+ type: 'refresh/commitAction',
|
|
|
+ payload: 'contact'
|
|
|
+ })
|
|
|
+ }
|
|
|
setState({ ...state, client, log, serviceLog })
|
|
|
}
|
|
|
}
|
|
|
useEffect(() => {
|
|
|
- if (visible) {
|
|
|
+ if (visible || shouldUpdate) {
|
|
|
initData()
|
|
|
}
|
|
|
window.addEventListener('resize', () => {
|
|
|
@@ -41,7 +48,7 @@ const Popcontent = props => {
|
|
|
return () => {
|
|
|
window.removeEventListener('resize', () => {})
|
|
|
}
|
|
|
- }, [visible])
|
|
|
+ }, [visible, shouldUpdate])
|
|
|
return (
|
|
|
<div>
|
|
|
<div className="sheet-box">
|
|
|
@@ -75,9 +82,8 @@ const Popcontent = props => {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
-export default Popcontent
|
|
|
+// export default Popcontent
|
|
|
|
|
|
-// export default connect(({ journallist, loading }) => ({
|
|
|
-// journalName: journallist,
|
|
|
-// getlist: loading.effects['journallist/fetch']
|
|
|
-// }))(Popcontent)
|
|
|
+export default connect(({ refresh }) => ({
|
|
|
+ shouldUpdate: refresh.contact
|
|
|
+}))(Popcontent)
|