lanjianrong 3 years ago
parent
commit
68feefb523
2 changed files with 9 additions and 3 deletions
  1. 7 3
      src/pages/Institutions/Staff/index.tsx
  2. 2 0
      src/pages/Institutions/model.ts

+ 7 - 3
src/pages/Institutions/Staff/index.tsx

@@ -19,11 +19,13 @@ type ListProps = ConnectProps & {
 }
 
 const CompanyList: React.FC<ListProps> = ({ dispatch, accountTypeList }) => {
+  console.log(accountTypeList)
+
   const tRef = useRef<ActionType>(null)
   useEffect(() => {
     if (!accountTypeList.length) {
       dispatch({
-        type: 'project/queryAccountTypeList'
+        type: 'institutions/queryAccountTypeList'
       })
     }
     dispatch({
@@ -87,7 +89,6 @@ const CompanyList: React.FC<ListProps> = ({ dispatch, accountTypeList }) => {
       title: '账号类型',
       filters: true,
       filterMultiple: false,
-      render: (_, record) => <div>{record.accountType.name}</div>,
       valueEnum: accountTypeList.reduce((prev, curr) => {
         const items = { ...prev }
         items[curr.value] = {
@@ -189,7 +190,10 @@ export default connect(
     institutions: InstitutionsModelState
     schemaBase: SchemaBaseModelState
   }) => ({
-    accountTypeList: institutions.accountType.map(item => ({ label: item.name, value: item.ID })),
+    accountTypeList: institutions.accountType.map(item => ({
+      label: item.name,
+      value: item.value
+    })),
     schema: schemaBase.base[BaseMenuEnum.STAFF]?.schema
   })
 )(CompanyList)

+ 2 - 0
src/pages/Institutions/model.ts

@@ -42,6 +42,8 @@ const InstitutionsModel: InstitutionsModelType = {
       // }
     },
     *queryAccountTypeList(_, { call, put }) {
+      console.log('111')
+
       const response = yield call(getAccountTypeList)
       if (response?.code === consts.RET_CODE.SUCCESS) {
         yield put({