|
@@ -43,6 +43,8 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
|
|
|
organizationList,
|
|
|
reload
|
|
|
}) => {
|
|
|
+ console.log(organizationList)
|
|
|
+
|
|
|
const form = useForm()
|
|
|
useEffect(() => {
|
|
|
if (visible) {
|
|
@@ -93,15 +95,24 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
|
|
|
enumNames: accountTypeList.map(item => item.label)
|
|
|
})
|
|
|
form.setSchemaByPath('institution', {
|
|
|
- enum: organizationList.map(item => item.value),
|
|
|
- enumNames: organizationList.map(item => item.label)
|
|
|
+ // enum: organizationList.map(item => item.value),
|
|
|
+ // enumNames: organizationList.map(item => item.label),
|
|
|
+ description: '',
|
|
|
+ type: 'string',
|
|
|
+ widget: 'treeSelect',
|
|
|
+ props: {
|
|
|
+ treeDefaultExpandAll: true,
|
|
|
+ treeData: [organizationList.label]
|
|
|
+ }
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- const watch = () => {
|
|
|
- form.setValueByPath('institution', { widget: 'treeSelect' })
|
|
|
- }
|
|
|
+ // const watch = {
|
|
|
+ // institution: val => {
|
|
|
+ // console.log('表单的时时数据为:', val)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
// const handleOnFinish = () => {
|
|
|
// ref.current?.validateFields().then(async values => {
|
|
@@ -157,13 +168,7 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
|
|
|
}}
|
|
|
title={type === ModalType.ADD ? '新增账号' : '编辑账号'}>
|
|
|
{schema && (
|
|
|
- <FormRender
|
|
|
- form={form}
|
|
|
- schema={JSON.parse(schema)}
|
|
|
- onFinish={onFinish}
|
|
|
- onMount={onMount}
|
|
|
- watch={watch}
|
|
|
- />
|
|
|
+ <FormRender form={form} schema={JSON.parse(schema)} onFinish={onFinish} onMount={onMount} />
|
|
|
)}
|
|
|
<div>
|
|
|
<Button onClick={form.submit}>提交</Button>
|
|
@@ -185,8 +190,8 @@ export default connect(
|
|
|
value: item.value
|
|
|
})),
|
|
|
organizationList: institutions.organizationType.map(item => ({
|
|
|
- label: item.name,
|
|
|
- value: item.dataID
|
|
|
+ label: item
|
|
|
+ // value: item.dataID
|
|
|
})),
|
|
|
schema: schemaBase.base[BaseMenuEnum.STAFF]?.schema
|
|
|
})
|