Commit 88bbcb19 authored by GuanHua's avatar GuanHua
parents 05d23bc0 fb1e7180
......@@ -242,7 +242,7 @@ const AddressList: React.FC<ListProps> = (props) => {
text: '新建',
icon: <PlusOutlined />,
handler: () => {
history.push('/memberCenter/logisticsAbility/logistics/list/addCompany')
history.push('/logisticsAbility/logistics/list/addCompany')
}
}
]
......@@ -272,13 +272,15 @@ const AddressList: React.FC<ListProps> = (props) => {
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
rowClassName="editable-row"
formilyChilds={
<>
<Button type="primary" icon={<PlusOutlined />} onClick={() => history.push(`/memberCenter/logisticsAbility/logistics/list/addressForm?addType=${props.type}`)}>
新建
</Button>
</>
}
formilyChilds={{
children: (
<>
<Button type="primary" icon={<PlusOutlined />} onClick={() => history.push(`/logisticsAbility/logistics/list/addressForm?addType=${props.type}`)}>
新建
</Button>
</>
)
}}
/>
</Card>
</PageHeaderWrapper>
......
import React, { useState, useRef, } from 'react'
import { history } from 'umi'
import { Card, Button, Tabs } from 'antd'
import { Card, Button } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { ContainerOutlined } from '@ant-design/icons'
import {
SchemaForm,
FormMegaLayout,
Field,
FormButtonGroup,
createFormActions
} from '@formily/antd'
import { Input, FormTab, Select, Checkbox } from '@formily/antd-components'
import 'antd/dist/antd.css'
import './index.less'
const components = { Input, Select }
import ChinaImg from '../../../../mockStatic/china.png'
import gou from '../../../../mockStatic/gou.png'
import japenImg from '../../../../mockStatic/japen.png'
import korenImg from '../../../../mockStatic/koren.png'
import us from '../../../../mockStatic/us.png'
const _width: number = 24
const _height: number = 17
const selectList: any = [
{ label: <><img src={ChinaImg} style={{ width: _width, height: 17 }} /> +86</>, value: '1' },
{ label: <><img src={gou} style={{ width: _width, height: 17 }} /> +86</>, value: '2' },
{ label: <><img src={japenImg} style={{ width: _width, height: 17 }} /> +86</>, value: '3' },
{ label: <><img src={korenImg} style={{ width: _width, height: 17 }} /> +86</>, value: '4' },
{ label: <><img src={us} style={{ width: _width, height: 17 }} /> +86</>, value: '5' }
]
const actions = createFormActions()
const addMember: React.FC<[]> = () => {
return (
<PageHeaderWrapper
......@@ -18,11 +45,187 @@ const addMember: React.FC<[]> = () => {
</>
]}
extra={[
<Button className='saveBtn' icon={<ContainerOutlined />}>保存</Button>
<Button
className='saveBtn'
icon={<ContainerOutlined />}
onClick={() => actions.submit()}
>
保存
</Button>
]}
>
<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"
/>
<FormMegaLayout label='注册手机号' inline required >
<Field
name="phoneHead"
required
enum={selectList}
default={'1'}
x-props={{ style: { width: 128 } }}
x-component="Select"
x-component-props={{
placeholder: '请选择'
}}
/>
<Field
name="mobiePhone"
required
x-props={{ style: { width: 424 } }}
x-component="Input"
x-component-props={{
placeholder: '输入你的手机号码'
}}
/>
</FormMegaLayout>
<Field
type="string"
name="eee"
title="注册邮箱"
x-props={{ style: { width: 572 } }}
x-component="Input"
/>
</FormMegaLayout>
</FormTab.TabPane>
<FormTab.TabPane name="tab-2" tab="渠道信息">
<FormMegaLayout
labelWidth="140"
labelAlign="left"
>
<Field
type="string"
name="level"
title="渠道级别"
x-props={{ style: { width: 572 } }}
required
x-component="Input"
x-component-props={{
placeholder: '12',
disable: true
}}
/>
<Field
type="string"
name="a3"
title="电商渠道"
x-props={{ style: { width: 572 } }}
enum={[
{ value: 1, label: '显示' },
{ value: 0, label: '隐藏' }
]}
required
x-component="Select"
/>
<FormMegaLayout label='代理地市' inline required >
<Field
type="string"
name="province"
x-props={{ style: { width: 278 } }}
enum={[
{ value: 1, label: '广东省' },
{ value: 0, label: '湖南省' }
]}
required
x-component="Select"
x-component-props={{
placeholder: '-省份/直辖市-'
}}
/>
<Field
type="string"
name="city"
x-props={{ style: { width: 278 } }}
enum={[
{ value: 1, label: '广州' },
{ value: 0, label: '珠海' }
]}
required
x-component="Select"
x-component-props={{
placeholder: '-市-'
}}
/>
<Field
type="string"
name="county"
x-props={{ style: { width: 278 } }}
enum={[
{ value: 1, label: '海珠区' },
{ value: 0, label: '白云区' }
]}
required
x-component="Select"
x-component-props={{
placeholder: '-区-'
}}
/>
</FormMegaLayout>
<Field
type="string"
name="a5"
title="渠道描述"
required
x-component="Input"
/>
</FormMegaLayout>
{/* <Field
type="string"
name="a2"
title="渠道级别"
></Field> */}
</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>
</PageHeaderWrapper>
)
......
......@@ -173,23 +173,29 @@ const memberImport: React.FC<{}> = () => {
}}
formilyProps={{
layouts: {
order: 1
order: 1,
span: 4
},
ctx: {
inline: false,
schema: {
type: 'object',
properties: {
name: {
type: 'string',
'x-component': 'Search',
megaLayout0: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
placeholder: '请输入'
}
},
names: {
type: 'string',
'x-component-props': {
placeholder: '请输入'
grid: true,
columns: 2,
},
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '请输入'
}
}
}
}
}
......@@ -198,9 +204,6 @@ const memberImport: React.FC<{}> = () => {
}}
formilyChilds={
{
layouts: {
order: 0
},
children: (
<>
<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