|
@@ -22,6 +22,7 @@ import { ModalType } from '@/utils/enum'
|
|
|
type StaffModalProps = ConnectProps & {
|
|
|
visible: boolean
|
|
|
onVisibleChange: (visible: boolean) => void
|
|
|
+ institutionDisable: boolean
|
|
|
type: ModalType
|
|
|
defaultFormData?: {
|
|
|
ID: string
|
|
@@ -37,6 +38,7 @@ type StaffModalProps = ConnectProps & {
|
|
|
|
|
|
const StaffDrawer: React.FC<StaffModalProps> = ({
|
|
|
visible,
|
|
|
+ institutionDisable,
|
|
|
onVisibleChange,
|
|
|
schema,
|
|
|
dispatch,
|
|
@@ -120,7 +122,15 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
|
|
|
}
|
|
|
|
|
|
const onMount = () => {
|
|
|
- form.setValues(type === ModalType.ADD ? {} : { ...defaultFormData })
|
|
|
+ if (!defaultFormData?.dataID) {
|
|
|
+ form.setValues(type === ModalType.ADD ? {} : { ...defaultFormData })
|
|
|
+ } else {
|
|
|
+ form.setValues(
|
|
|
+ type === ModalType.ADD
|
|
|
+ ? { institutionID: defaultFormData?.institutionID }
|
|
|
+ : { ...defaultFormData }
|
|
|
+ )
|
|
|
+ }
|
|
|
delay(80).then(() => {
|
|
|
form.setSchemaByPath('accountType', {
|
|
|
type: 'string',
|
|
@@ -131,10 +141,23 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
|
|
|
enum: accountTypeList.map(item => item.value),
|
|
|
enumNames: accountTypeList.map(item => item.label)
|
|
|
})
|
|
|
- form.setSchemaByPath('institutionID', {
|
|
|
- type: 'string',
|
|
|
- widget: 'site'
|
|
|
- })
|
|
|
+ if (institutionDisable) {
|
|
|
+ form.setSchemaByPath('institutionID', {
|
|
|
+ type: 'string',
|
|
|
+ widget: 'site',
|
|
|
+ disabled: true
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ form.setSchemaByPath('institutionID', {
|
|
|
+ type: 'string',
|
|
|
+ widget: 'site'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (type === ModalType.UPDATE) {
|
|
|
+ form.setSchemaByPath('account', {
|
|
|
+ disabled: true
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
if (defaultFormData?.institutionID) {
|
|
|
queryOrganizationalStructureList({
|