diff --git a/web/client/src/sections/organization/components/depModal.js b/web/client/src/sections/organization/components/depModal.js new file mode 100644 index 00000000..3fa50520 --- /dev/null +++ b/web/client/src/sections/organization/components/depModal.js @@ -0,0 +1,88 @@ +import React, { useRef, useState } from 'react'; +import { connect } from 'react-redux'; +import { Spin, Card, Modal, TreeSelect } from 'antd'; +import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form'; + +const DepModal = (props) => { + const { visible, onVisibleChange, onConfirm, depModalType, depData, data } = props; + const formRef = useRef(); + const onFinish = (values) => { + if (onConfirm) { + if (depModalType === 'edit') { + let value = { + name: values.name, + depId: data.id + } + onConfirm(value) + } else { + onConfirm(values); + } + + } + } + + return ( + + + + { + return depData + }} + /> + + + ) +} + +function mapStateToProps(state) { + const { depMessage } = state; + const pakData = (dep) => { + return dep.map((d) => { + return { + title: d.name, + value: d.id, + // key: d.id, + children: pakData(d.subordinate) + } + }) + } + let depData = pakData(depMessage.data || []) + return { + loading: depMessage.isRequesting, + depData, + }; +} + +export default connect(mapStateToProps)(DepModal); \ No newline at end of file