|
@@ -113,14 +113,16 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
|
|
|
structureType: '1'
|
|
|
})
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
|
- form.setSchemaByPath('organizationalStructureID', {
|
|
|
- type: 'string',
|
|
|
- widget: 'treeSelect',
|
|
|
- props: {
|
|
|
- treeDefaultExpandAll: true,
|
|
|
- treeData: list
|
|
|
- }
|
|
|
- })
|
|
|
+ setTimeout(() => {
|
|
|
+ form.setSchemaByPath('organizationalStructureID', {
|
|
|
+ type: 'string',
|
|
|
+ widget: 'treeSelect',
|
|
|
+ props: {
|
|
|
+ treeDefaultExpandAll: true,
|
|
|
+ treeData: list
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, 80)
|
|
|
}
|
|
|
}
|
|
|
if (dataID) {
|
|
@@ -137,6 +139,14 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
|
|
|
account.institutionID = data.institution.name
|
|
|
account.organizationalStructureID = data.organizationalStructure?.name
|
|
|
}
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ if (type === ModalType.UPDATE && !data.isCreated) {
|
|
|
+ form.setSchemaByPath('isCreated', {
|
|
|
+ hidden: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }, 80)
|
|
|
form.setValues({
|
|
|
...account
|
|
|
})
|
|
@@ -148,36 +158,38 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
|
|
|
form.setValues(values)
|
|
|
}
|
|
|
}
|
|
|
- form.setSchemaByPath('accountType', {
|
|
|
- type: 'string',
|
|
|
- widget: 'select',
|
|
|
- enum: accountTypeList.map(item => item.value),
|
|
|
- enumNames: accountTypeList.map(item => item.label)
|
|
|
- })
|
|
|
- form.setSchemaByPath('institutionID', {
|
|
|
- type: 'string',
|
|
|
- widget: 'site',
|
|
|
- disabled: institutionDisable
|
|
|
- })
|
|
|
- if (type === ModalType.UPDATE) {
|
|
|
- form.setSchemaByPath('account', {
|
|
|
- disabled: true
|
|
|
+ setTimeout(() => {
|
|
|
+ form.setSchemaByPath('accountType', {
|
|
|
+ type: 'string',
|
|
|
+ widget: 'select',
|
|
|
+ enum: accountTypeList.map(item => item.value),
|
|
|
+ enumNames: accountTypeList.map(item => item.label)
|
|
|
})
|
|
|
- }
|
|
|
-
|
|
|
- form.setSchemaByPath('organizationalStructureID', {
|
|
|
- disabled: hiddenOrganization,
|
|
|
- hidden: !institutionID
|
|
|
- })
|
|
|
- if (hiddenOrganization && (type === ModalType.UPDATE || type === ModalType.PREVIEW)) {
|
|
|
- form.setSchemaByPath('password', {
|
|
|
- hidden: true
|
|
|
+ form.setSchemaByPath('institutionID', {
|
|
|
+ type: 'string',
|
|
|
+ widget: 'site',
|
|
|
+ disabled: institutionDisable
|
|
|
})
|
|
|
- } else {
|
|
|
- form.setSchemaByPath('password', {
|
|
|
- required: false
|
|
|
+ if (type === ModalType.UPDATE) {
|
|
|
+ form.setSchemaByPath('account', {
|
|
|
+ disabled: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ form.setSchemaByPath('organizationalStructureID', {
|
|
|
+ disabled: hiddenOrganization,
|
|
|
+ hidden: !institutionID
|
|
|
})
|
|
|
- }
|
|
|
+ if (hiddenOrganization && (type === ModalType.UPDATE || type === ModalType.PREVIEW)) {
|
|
|
+ form.setSchemaByPath('password', {
|
|
|
+ hidden: true
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ form.setSchemaByPath('password', {
|
|
|
+ required: false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }, 80)
|
|
|
}
|
|
|
|
|
|
const watch = {
|
|
@@ -217,7 +229,7 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
|
|
|
}
|
|
|
}
|
|
|
return (
|
|
|
- <div>
|
|
|
+ <div className="mt-6">
|
|
|
{schema && (
|
|
|
<FormRender
|
|
|
form={form}
|
|
@@ -235,7 +247,8 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
|
|
|
type="primary"
|
|
|
onClick={() => {
|
|
|
form.submit()
|
|
|
- }}>
|
|
|
+ }}
|
|
|
+ >
|
|
|
提交
|
|
|
</Button>
|
|
|
)}
|