Browse Source

fix: 标签数据显示异常

lanjianrong 5 years ago
parent
commit
a666d422e2

+ 1 - 1
src/models/company.js

@@ -21,7 +21,7 @@ export default {
           type: 'changeState',
           payload: {
             key: tagType === TagTypeEnum.PERSONTAG ? 'personTags' : 'teamTags',
-            data: response.data
+            data: response.data || []
           }
         })
         yield put({

+ 1 - 1
src/models/contact.js

@@ -21,7 +21,7 @@ export default {
           type: 'changeState',
           payload: {
             key: tagType === TagTypeEnum.PERSONTAG ? 'personTags' : 'teamTags',
-            data: response.data
+            data: response.data || []
           }
         })
         yield put({

+ 1 - 1
src/pages/Customer/Company/index.jsx

@@ -58,7 +58,7 @@ const Company = props => {
     })
 
     return { personTagMap, teamTagMap }
-  }, [personTags, teamTags])
+  }, [personTags, teamTags, personTagColorMap, teamTagColorMap])
 
   const [state, setState] = useState({
     id: '',

+ 2 - 1
src/pages/Customer/Contact/index.jsx

@@ -20,6 +20,7 @@ import { apiBatchLink } from '@/services/customer'
 const Contact = props => {
   const { toggleDrawer, setDrawerProps } = useModal()
   const { personTagColorMap, teamTagColorMap, personTags, teamTags, dispatch } = props
+  // console.log(personTags, personTagColorMap)
 
   const tRef = useRef()
   const [tagState, setTagState] = useState({
@@ -58,7 +59,7 @@ const Contact = props => {
     })
 
     return { personTagMap, teamTagMap }
-  }, [personTags, teamTags])
+  }, [personTags, teamTags, personTagColorMap, teamTagColorMap])
 
   const toolbarOptionsChange = (type, ids) => {
     setTagState({ ...tagState, [type]: ids })