Commit e3c4f9b9 authored by tjy's avatar tjy

新增会员

parent 4825a9d6
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
"@umijs/preset-react": "1.x", "@umijs/preset-react": "1.x",
"@umijs/test": "^3.2.0", "@umijs/test": "^3.2.0",
"bizcharts": "^4.0.7", "bizcharts": "^4.0.7",
"god": "0.1.7", "god": "0.1.12",
"lint-staged": "^10.0.7", "lint-staged": "^10.0.7",
"mobx": "^5.15.4", "mobx": "^5.15.4",
"mobx-react": "^6.2.2", "mobx-react": "^6.2.2",
......
import React, { useState, useRef, } from 'react' import React, { useState, useRef, } from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Card, Button, Tabs } from 'antd' import { Card, Button } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { ContainerOutlined } from '@ant-design/icons' import { ContainerOutlined } from '@ant-design/icons'
import {
SchemaForm,
FormMegaLayout,
Field,
createFormActions
} from '@formily/antd'
import { Input, FormTab, Select } from '@formily/antd-components'
import 'antd/dist/antd.css'
import './index.less' import './index.less'
const components = { Input, Select }
const actions = createFormActions()
const addMember: React.FC<[]> = () => { const addMember: React.FC<[]> = () => {
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
...@@ -18,11 +30,119 @@ const addMember: React.FC<[]> = () => { ...@@ -18,11 +30,119 @@ const addMember: React.FC<[]> = () => {
</> </>
]} ]}
extra={[ extra={[
<Button className='saveBtn' icon={<ContainerOutlined />}>保存</Button> <Button
className='saveBtn'
icon={<ContainerOutlined />}
onClick={() => actions.submit()}
>
保存
</Button>
]} ]}
> >
<Card> <Card>
<SchemaForm
components={components}
actions={actions}
>
<FormTab name="tabs" defaultActiveKey={'tab-1'}>
<FormTab.TabPane name="tab-1" tab="基本信息">
<FormMegaLayout
labelWidth="140"
labelAlign="left"
>
<Field
name="aaa"
type="number"
title="会员类型"
x-props={{ style: { width: 572 } }}
enum={[
{ value: 1, label: '显示' },
{ value: 0, label: '隐藏' }
]}
required
x-component="Select"
/>
<Field
name="bbb"
type="number"
title="会员角色"
x-props={{ style: { width: 572 } }}
enum={[
{ value: 1, label: '显示' },
{ value: 0, label: '隐藏' }
]}
required
x-component="Select"
/>
<Field
name="ccc"
type="number"
title="会员等级"
x-props={{ style: { width: 572 } }}
enum={[
{ value: 1, label: '显示' },
{ value: 0, label: '隐藏' }
]}
required
x-component="Select"
/>
<Field
name="ddd"
type="number"
title="会员等级"
x-props={{ style: { width: 572 } }}
enum={[
{ value: 1, label: '显示' },
{ value: 0, label: '隐藏' }
]}
required
x-component="Select"
/>
<Field
type="string"
name="eee"
title="注册邮箱"
x-props={{ style: { width: 572 } }}
x-component="Input"
/>
</FormMegaLayout>
</FormTab.TabPane>
<FormTab.TabPane name="tab-2" tab="渠道信息">
<Field
type="string"
name="a2"
title="字段2"
required
x-component="Input"
/>
<Field
type="string"
name="a3"
title="字段3"
required
x-component="Input"
/>
<Field
type="string"
name="a4"
title="字段4"
required
x-component="Input"
/>
<Field
type="string"
name="a5"
title="字段5"
required
x-component="Input"
/>
</FormTab.TabPane>
<FormTab.TabPane name="tab-3" tab="营业执照"></FormTab.TabPane>
<FormTab.TabPane name="tab-4" tab="法定代表人"></FormTab.TabPane>
<FormTab.TabPane name="tab-5" tab="联系信息"></FormTab.TabPane>
<FormTab.TabPane name="tab-6" tab="流转记录"></FormTab.TabPane>
</FormTab>
</SchemaForm>
</Card> </Card>
</PageHeaderWrapper> </PageHeaderWrapper>
) )
......
...@@ -173,23 +173,29 @@ const memberImport: React.FC<{}> = () => { ...@@ -173,23 +173,29 @@ const memberImport: React.FC<{}> = () => {
}} }}
formilyProps={{ formilyProps={{
layouts: { layouts: {
order: 1 order: 1,
span: 4
}, },
ctx: { ctx: {
inline: false,
schema: { schema: {
type: 'object', type: 'object',
properties: { properties: {
name: { megaLayout0: {
type: 'string', type: 'object',
'x-component': 'Search', 'x-component': 'mega-layout',
'x-component-props': { 'x-component-props': {
placeholder: '请输入' grid: true,
} columns: 2,
}, },
names: { properties: {
type: 'string', name: {
'x-component-props': { type: 'string',
placeholder: '请输入' 'x-component': 'Search',
'x-component-props': {
placeholder: '请输入'
}
}
} }
} }
} }
...@@ -198,9 +204,6 @@ const memberImport: React.FC<{}> = () => { ...@@ -198,9 +204,6 @@ const memberImport: React.FC<{}> = () => {
}} }}
formilyChilds={ formilyChilds={
{ {
layouts: {
order: 0
},
children: ( children: (
<> <>
<Button <Button
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment