Sfoglia il codice sorgente

feat: 单位的单位性质选择

outaozhen 5 anni fa
parent
commit
7d55d17c0b
1 ha cambiato i file con 18 aggiunte e 3 eliminazioni
  1. 18 3
      src/pages/Customer/Company/index.jsx

+ 18 - 3
src/pages/Customer/Company/index.jsx

@@ -25,6 +25,7 @@ const Company = props => {
     teamTagColorMap,
     personTags,
     teamTags,
+    natures,
     dispatch,
     shouldUpdate,
     loading
@@ -38,11 +39,13 @@ const Company = props => {
 
   const [tagState, setTagState] = useState({
     tagIds: [],
-    tagCooperationIds: []
+    tagCooperationIds: [],
+    natureIds: []
   })
   const tag = useMemo(() => {
     const personTagMap = {}
     const teamTagMap = {}
+    const narnatureMap = {}
     const personOptions = []
     const teamOptions = []
     personTags.forEach(item => {
@@ -73,8 +76,17 @@ const Company = props => {
         )
       }
     })
+    natures.forEach(item => {
+      narnatureMap[item.value] = {
+        text: (
+          <>
+            <span>{item.label}</span>
+          </>
+        )
+      }
+    })
 
-    return { personTagMap, teamTagMap, personOptions, teamOptions }
+    return { personTagMap, teamTagMap, narnatureMap, personOptions, teamOptions }
   }, [loading])
 
   const [state, setState] = useState({
@@ -250,7 +262,9 @@ const Company = props => {
       dataIndex: 'nature',
       key: 'nature',
       search: false,
-      width: 80
+      width: 80,
+      filters: true,
+      valueEnum: tag.narnatureMap
     },
     {
       title: '单位地址',
@@ -517,6 +531,7 @@ export default connect(({ company, refresh, loading }) => ({
   personTags: company.personTags,
   teamTagColorMap: company.teamTagColorMap,
   teamTags: company.teamTags,
+  natures: company.natures,
   loading: loading.models.company,
   shouldUpdate: refresh.company
 }))(Company)