|
@@ -1,4 +1,4 @@
|
|
|
-import React, { useState } from 'react'
|
|
|
+import React, { useState, useEffect } from 'react'
|
|
|
import { Button, message, TreeSelect, Table, Popconfirm } from 'antd'
|
|
|
import type { FormInstance } from 'antd'
|
|
|
import ProForm, { ModalForm, ProFormText } from '@ant-design/pro-form'
|
|
@@ -55,7 +55,12 @@ const defaultData = [
|
|
|
]
|
|
|
|
|
|
const Contact: React.FC = () => {
|
|
|
- const { department } = useModel('department')
|
|
|
+ const { department, fetchDepartment } = useModel('department')
|
|
|
+ useEffect(() => {
|
|
|
+ if (!department.length) {
|
|
|
+ fetchDepartment()
|
|
|
+ }
|
|
|
+ }, [])
|
|
|
const formRef = useRef<FormInstance>(null)
|
|
|
|
|
|
const [editableKeys, setEditableRowKeys] = useState<React.Key[]>()
|