You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
2.2 KiB
62 lines
2.2 KiB
import React from 'react';
|
|
import { connect } from 'react-redux';
|
|
import { Spin, Table } from 'antd';
|
|
import { DrawerForm, ProForm, ProFormText } from '@ant-design/pro-form';
|
|
import moment from 'moment';
|
|
const UserModal = (props) => {
|
|
const { visible, onVisibleChange,typecard } = props
|
|
console.log(typecard)
|
|
return (
|
|
<Spin spinning={false}>
|
|
<DrawerForm
|
|
width={'90rem'}
|
|
visible={visible}
|
|
onVisibleChange={onVisibleChange}
|
|
// submitter={false}
|
|
>
|
|
{typecard==111?<ProForm.Group>
|
|
<ProFormText
|
|
name="name"
|
|
width="md"
|
|
label="签约客户名称"
|
|
tooltip="最长为 24 位"
|
|
placeholder="请输入名称"
|
|
value="wowowo"
|
|
rules={[{ required: true, message: "必填" }]}
|
|
/>
|
|
<ProFormText width="md" name="company" label="我方公司名称" placeholder="请输入名称" />
|
|
</ProForm.Group>
|
|
:<ProForm.Group>
|
|
<ProFormText
|
|
name="name"
|
|
width="md"
|
|
label="签约客户名称"
|
|
tooltip="最长为 24 位"
|
|
placeholder="请输入名称"
|
|
rules={[{ required: true, message: "必填" }]}
|
|
/>
|
|
<ProFormText width="md" name="company" label="我方公司名称" placeholder="请输入名称" />
|
|
</ProForm.Group>}
|
|
|
|
</DrawerForm>
|
|
</Spin>
|
|
)
|
|
}
|
|
function mapStateToProps(state) {
|
|
const { depMessage } = state;
|
|
const pakData = (dep) => {
|
|
return dep.map((d) => {
|
|
return {
|
|
title: d.name,
|
|
value: d.id,
|
|
children: pakData(d.subordinate)
|
|
}
|
|
})
|
|
}
|
|
let depData = pakData(depMessage.data || [])
|
|
return {
|
|
loading: depMessage.isRequesting,
|
|
depData,
|
|
};
|
|
}
|
|
export default connect(mapStateToProps)(UserModal);
|