Explorar o código

fix: 更新标签名称列表不刷新

lanjianrong %!s(int64=5) %!d(string=hai) anos
pai
achega
c5fad42627

+ 11 - 5
src/pages/Customer/Company/components/PersonLabel/index.jsx

@@ -55,9 +55,12 @@ const PersonLabel = props => {
     tagColumn,
     modeType = LabelModeType.column,
     checkCallBack,
-    dispatch
+    dispatch,
+    loadingContact,
+    loadingCompany
   } = props
   const [dropdownType, setDropdownType] = useState(DropdownTypeEnum.check)
+
   const tags = useMemo(() => {
     if (tagColumn === TagDataTypeEnum.CONTACT) {
       // 联系人
@@ -74,7 +77,8 @@ const PersonLabel = props => {
       return props.companyTeamTags
     }
     return []
-  }, [tagType, tagColumn])
+  }, [tagType, tagColumn, loadingContact, loadingCompany])
+
   const [checkedIds, setCheckedIds] = useState([])
   useEffect(() => {
     if (modeType === LabelModeType.column) {
@@ -85,7 +89,7 @@ const PersonLabel = props => {
   const [showOkBtn, setShowOkBtn] = useState(false)
   const initData = () => {
     dispatch({
-      type: `${tagColumn === TagDataTypeEnum.COMPANY ? 'contact' : 'company'}/fetchTags`,
+      type: `${tagColumn === TagDataTypeEnum.COMPANY ? 'company' : 'contact'}/fetchTags`,
       payload: { tagType, tagColumn }
     })
   }
@@ -280,9 +284,11 @@ const DropDownMenu = props => {
   )
 }
 
-export default connect(({ contact, company }) => ({
+export default connect(({ contact, company, loading }) => ({
   contactPersonTags: contact.personTags,
   contactTeamTags: contact.teamTags,
   companyPersonTags: company.personTags,
-  companyTeamTags: company.teamTags
+  companyTeamTags: company.teamTags,
+  loadingContact: loading.models.contact,
+  loadingCompany: loading.models.company
 }))(PersonLabel)

+ 1 - 1
src/pages/Customer/Contact/components/CustomerModal/index.less

@@ -29,7 +29,7 @@
       background-clip: border-box;
       border: 1px solid rgba(0, 0, 0, 0.08);
       border-radius: 4px;
-      box-shadow: 0 0 13px 0 rgb(74 53 107 / 8%) !important;
+      box-shadow: 0 0 13px 0 rgba(74, 53, 107, 0.08);
       &:not(:last-of-type) {
         margin-bottom: 1rem;
       }

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

@@ -67,6 +67,7 @@ const Contact = props => {
     return { personTagMap, teamTagMap, personOptions, teamOptions }
   }, [personTags, teamTags, personTagColorMap, teamTagColorMap])
 
+  // console.log('tag', tag)
   const toolbarOptionsChange = (type, ids) => {
     // console.log('type', type, 'ids', ids)
     setTagState({ ...tagState, [type]: ids })