|
@@ -1,12 +1,15 @@
|
|
|
import { ProFormText } from '@ant-design/pro-form'
|
|
import { ProFormText } from '@ant-design/pro-form'
|
|
|
import { Button, Form, Input, InputNumber, Modal, Select, Space } from 'antd'
|
|
import { Button, Form, Input, InputNumber, Modal, Select, Space } from 'antd'
|
|
|
-import React from 'react'
|
|
|
|
|
|
|
+import React, { useEffect } from 'react'
|
|
|
|
|
+import { useDispatch, connect } from 'umi'
|
|
|
|
|
|
|
|
-const AddEnterprise = (visible, onCancel, onConfirm, ...resetModalProps) => {
|
|
|
|
|
|
|
+const AddEnterprise = ({ visible, onCancel, onConfirm, compilationv2, ...resetModalProps }) => {
|
|
|
|
|
+ console.log(compilationv2)
|
|
|
const layout = {
|
|
const layout = {
|
|
|
layout: 'horizontal',
|
|
layout: 'horizontal',
|
|
|
labelCol: { flex: '100px' }
|
|
labelCol: { flex: '100px' }
|
|
|
}
|
|
}
|
|
|
|
|
+ const options = []
|
|
|
const selectProps = {
|
|
const selectProps = {
|
|
|
mode: 'multiple',
|
|
mode: 'multiple',
|
|
|
style: { width: '100%' },
|
|
style: { width: '100%' },
|
|
@@ -14,6 +17,17 @@ const AddEnterprise = (visible, onCancel, onConfirm, ...resetModalProps) => {
|
|
|
maxTagCount: 'responsive'
|
|
maxTagCount: 'responsive'
|
|
|
}
|
|
}
|
|
|
const [formRef] = Form.useForm()
|
|
const [formRef] = Form.useForm()
|
|
|
|
|
+ const dispatch = useDispatch()
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ if (!compilationv2?.length) {
|
|
|
|
|
+ dispatch({
|
|
|
|
|
+ type: 'personal/fetchCompilationv2',
|
|
|
|
|
+ payload: {
|
|
|
|
|
+ projectType: 1
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
const handleOnOk = () => {
|
|
const handleOnOk = () => {
|
|
|
formRef
|
|
formRef
|
|
|
?.validateFields()
|
|
?.validateFields()
|
|
@@ -42,7 +56,7 @@ const AddEnterprise = (visible, onCancel, onConfirm, ...resetModalProps) => {
|
|
|
visible={visible}
|
|
visible={visible}
|
|
|
onCancel={onCancel}
|
|
onCancel={onCancel}
|
|
|
title="创建企业"
|
|
title="创建企业"
|
|
|
- width="43vw"
|
|
|
|
|
|
|
+ width="35vw"
|
|
|
footer={
|
|
footer={
|
|
|
<div>
|
|
<div>
|
|
|
<Button type="default" className="mr-2" onClick={onCancel}>
|
|
<Button type="default" className="mr-2" onClick={onCancel}>
|
|
@@ -68,16 +82,12 @@ const AddEnterprise = (visible, onCancel, onConfirm, ...resetModalProps) => {
|
|
|
<Select {...selectProps} />
|
|
<Select {...selectProps} />
|
|
|
</Space>
|
|
</Space>
|
|
|
</Form.Item>
|
|
</Form.Item>
|
|
|
- {/* <ProFormText name="cptList" label="授权定额" rules={[{ required: true }]} /> */}
|
|
|
|
|
- <ProFormText
|
|
|
|
|
- name="adminID"
|
|
|
|
|
- label="管理员名称"
|
|
|
|
|
- rules={[{ required: true }]}
|
|
|
|
|
- disabled={true}
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <ProFormText name="adminID" label="管理员名称" rules={[{ required: true }]} />
|
|
|
</Form>
|
|
</Form>
|
|
|
</Modal>
|
|
</Modal>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export default AddEnterprise
|
|
|
|
|
|
|
+export default connect(({ personal }) => ({
|
|
|
|
|
+ compilationv2: personal.compilationv2
|
|
|
|
|
+}))(AddEnterprise)
|