Преглед изворни кода

fix: 人员管理组织架构回显异常

lanjianrong пре 3 година
родитељ
комит
e3971d33c3
1 измењених фајлова са 6 додато и 4 уклоњено
  1. 6 4
      src/pages/Institutions/Staff/components/StaffDetail.tsx

+ 6 - 4
src/pages/Institutions/Staff/components/StaffDetail.tsx

@@ -55,9 +55,7 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
   accountTypeList,
   reload
 }) => {
-  console.log(defaultFormData)
-
-  const { institution, ...otherValues } = defaultFormData
+  const { institution, organizationalStructure, ...otherValues } = defaultFormData
   const formRef = useRef<ProFormInstance>(null)
   const { run: tryUpdateAccount } = useRequest(updateAccount, {
     manual: true,
@@ -113,7 +111,11 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
       createForm({
         validateFirst: true,
         readPretty: type === ModalType.PREVIEW,
-        initialValues: { ...otherValues, institutionID: institution.ID },
+        initialValues: {
+          ...otherValues,
+          institutionID: institution.ID,
+          organizationalStructureID: organizationalStructure?.ID
+        },
         effects(form) {
           onFieldMount('password', field => {
             type !== ModalType.ADD && field.setDisplay('none')