Commit e51a07a3 authored by tjy's avatar tjy

新增新建会员

parent a474c389
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* @LastEditors: LeeJiancong * @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-16 19:43:48 * @LastEditTime: 2020-07-16 19:43:48
*/ */
import React, { Component, ReactNode,useRef,useState } from 'react' import React, { Component, ReactNode, useRef, useState } from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Modal,Card ,Button, Form,InputNumber, Radio, Popconfirm,Switch, Input } from 'antd'; import { Modal, Card, Button, Form, InputNumber, Radio, Popconfirm, Switch, Input } from 'antd';
import { import {
PlayCircleOutlined, PlayCircleOutlined,
PauseCircleOutlined, PauseCircleOutlined,
...@@ -15,7 +15,7 @@ import { ...@@ -15,7 +15,7 @@ import {
PlusCircleOutlined PlusCircleOutlined
} from '@ant-design/icons'; } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import {StandardTable} from 'god' import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface' import { ColumnType } from 'antd/lib/table/interface'
import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController' import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController'
...@@ -27,9 +27,9 @@ const data = [ ...@@ -27,9 +27,9 @@ const data = [
tel: '02020', tel: '02020',
required: '平台物流服务商', required: '平台物流服务商',
isDefault: 0, isDefault: 0,
code:252525, code: 252525,
status: 1, status: 1,
address:'地址' address: '地址'
}, },
{ {
key: '2', key: '2',
...@@ -38,15 +38,15 @@ const data = [ ...@@ -38,15 +38,15 @@ const data = [
tel: '02020', tel: '02020',
required: '平台物流服务商', required: '平台物流服务商',
isDefault: 0, isDefault: 0,
code:252525, code: 252525,
status: 0, status: 0,
address:'地址32' address: '地址32'
}, },
] ]
// 模拟请求 // 模拟请求
const fetchData = (params:any) => { const fetchData = (params: any) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
resolve(data) resolve(data)
// const queryResult = data.find(v => v.key === params.keywords) // const queryResult = data.find(v => v.key === params.keywords)
...@@ -69,12 +69,12 @@ const fetchData = (params:any) => { ...@@ -69,12 +69,12 @@ const fetchData = (params:any) => {
// }) // })
// }) // })
// } // }
interface Item{ interface Item {
key: string key: string
} }
//父页面传递来的参数 //父页面传递来的参数
export interface ListProps{ export interface ListProps {
title?:React.ReactNode, title?: React.ReactNode,
type: string type: string
} }
export interface ListType { export interface ListType {
...@@ -91,7 +91,7 @@ interface EditableCellProps extends React.HTMLAttributes<HTMLElement> { ...@@ -91,7 +91,7 @@ interface EditableCellProps extends React.HTMLAttributes<HTMLElement> {
children: React.ReactNode; children: React.ReactNode;
} }
const EditableCell : React.FC<EditableCellProps> = ({ const EditableCell: React.FC<EditableCellProps> = ({
editing, editing,
dataIndex, dataIndex,
title, title,
...@@ -151,7 +151,7 @@ const AddressList: React.FC<ListProps> = (props) => { ...@@ -151,7 +151,7 @@ const AddressList: React.FC<ListProps> = (props) => {
align: 'left', align: 'left',
dataIndex: 'address', dataIndex: 'address',
key: 'address', key: 'address',
render: (_:any, record:any) =>( render: (_: any, record: any) => (
<> <>
{record.address} {record.address}
</> </>
...@@ -180,8 +180,8 @@ const AddressList: React.FC<ListProps> = (props) => { ...@@ -180,8 +180,8 @@ const AddressList: React.FC<ListProps> = (props) => {
align: 'center', align: 'center',
dataIndex: 'isDefault', dataIndex: 'isDefault',
key: 'isDefault', key: 'isDefault',
render: (_:any, record:any) => render: (_: any, record: any) =>
<Switch size='small' defaultChecked={record.isDefault== 0? false: true} <Switch size='small' defaultChecked={record.isDefault == 0 ? false : true}
/>, />,
}, },
...@@ -189,7 +189,7 @@ const AddressList: React.FC<ListProps> = (props) => { ...@@ -189,7 +189,7 @@ const AddressList: React.FC<ListProps> = (props) => {
title: '操作', title: '操作',
dataIndex: 'option', dataIndex: 'option',
align: 'center', align: 'center',
render: (_:any, record:any) => { render: (_: any, record: any) => {
return ( return (
<> <>
<Button type='link'>启用</Button> <Button type='link'>启用</Button>
...@@ -201,7 +201,7 @@ const AddressList: React.FC<ListProps> = (props) => { ...@@ -201,7 +201,7 @@ const AddressList: React.FC<ListProps> = (props) => {
删除 删除
</Button> </Button>
</Popconfirm> </Popconfirm>
</>:'' </> : ''
} }
<Button type='link'>查看</Button> <Button type='link'>查看</Button>
</> </>
...@@ -218,9 +218,9 @@ const AddressList: React.FC<ListProps> = (props) => { ...@@ -218,9 +218,9 @@ const AddressList: React.FC<ListProps> = (props) => {
// } // }
// }, [input]) // }, [input])
const onDefaultChange = (id:any,checked: boolean) => { const onDefaultChange = (id: any, checked: boolean) => {
console.log(id,checked) console.log(id, checked)
columns.forEach((v,index) => { columns.forEach((v, index) => {
}) })
} }
...@@ -241,13 +241,13 @@ const AddressList: React.FC<ListProps> = (props) => { ...@@ -241,13 +241,13 @@ const AddressList: React.FC<ListProps> = (props) => {
type: 'primary', type: 'primary',
text: '新建', text: '新建',
icon: <PlusOutlined />, icon: <PlusOutlined />,
handler: ()=>{ handler: () => {
history.push('/logisticsAbility/logistics/list/addCompany') history.push('/logisticsAbility/logistics/list/addCompany')
} }
} }
] ]
const handleSee = (record:any) => { const handleSee = (record: any) => {
console.log('see') console.log('see')
} }
...@@ -270,15 +270,17 @@ const AddressList: React.FC<ListProps> = (props) => { ...@@ -270,15 +270,17 @@ const AddressList: React.FC<ListProps> = (props) => {
<StandardTable <StandardTable
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
fetchTableData={(params:any) => fetchData(params)} fetchTableData={(params: any) => fetchData(params)}
rowClassName="editable-row" rowClassName="editable-row"
formilyChilds = { formilyChilds={{
children: (
<> <>
<Button type="primary" icon={<PlusOutlined />} onClick={() => history.push(`/logisticsAbility/logistics/list/addressForm?addType=${props.type}`)}> <Button type="primary" icon={<PlusOutlined />} onClick={() => history.push(`/logisticsAbility/logistics/list/addressForm?addType=${props.type}`)}>
新建 新建
</Button> </Button>
</> </>
} )
}}
/> />
</Card> </Card>
</PageHeaderWrapper> </PageHeaderWrapper>
......
...@@ -7,14 +7,29 @@ import { ...@@ -7,14 +7,29 @@ import {
SchemaForm, SchemaForm,
FormMegaLayout, FormMegaLayout,
Field, Field,
FormButtonGroup,
createFormActions createFormActions
} from '@formily/antd' } from '@formily/antd'
import { Input, FormTab, Select } from '@formily/antd-components' import { Input, FormTab, Select, Checkbox } from '@formily/antd-components'
import 'antd/dist/antd.css' import 'antd/dist/antd.css'
import './index.less' import './index.less'
const components = { Input, Select } 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 actions = createFormActions()
const addMember: React.FC<[]> = () => { const addMember: React.FC<[]> = () => {
...@@ -86,18 +101,28 @@ const addMember: React.FC<[]> = () => { ...@@ -86,18 +101,28 @@ const addMember: React.FC<[]> = () => {
required required
x-component="Select" x-component="Select"
/> />
<FormMegaLayout label='注册手机号' inline required >
<Field <Field
name="ddd" name="phoneHead"
type="number"
title="会员等级"
x-props={{ style: { width: 572 } }}
enum={[
{ value: 1, label: '显示' },
{ value: 0, label: '隐藏' }
]}
required required
enum={selectList}
default={'1'}
x-props={{ style: { width: 128 } }}
x-component="Select" 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 <Field
type="string" type="string"
name="eee" name="eee"
...@@ -108,34 +133,92 @@ const addMember: React.FC<[]> = () => { ...@@ -108,34 +133,92 @@ const addMember: React.FC<[]> = () => {
</FormMegaLayout> </FormMegaLayout>
</FormTab.TabPane> </FormTab.TabPane>
<FormTab.TabPane name="tab-2" tab="渠道信息"> <FormTab.TabPane name="tab-2" tab="渠道信息">
<FormMegaLayout
labelWidth="140"
labelAlign="left"
>
<Field <Field
type="string" type="string"
name="a2" name="level"
title="字段2" title="渠道级别"
x-props={{ style: { width: 572 } }}
required required
x-component="Input" x-component="Input"
x-component-props={{
placeholder: '12',
disable: true
}}
/> />
<Field <Field
type="string" type="string"
name="a3" name="a3"
title="字段3" title="电商渠道"
x-props={{ style: { width: 572 } }}
enum={[
{ value: 1, label: '显示' },
{ value: 0, label: '隐藏' }
]}
required required
x-component="Input" x-component="Select"
/> />
<FormMegaLayout label='代理地市' inline required >
<Field <Field
type="string" type="string"
name="a4" name="province"
title="字段4" x-props={{ style: { width: 278 } }}
enum={[
{ value: 1, label: '广东省' },
{ value: 0, label: '湖南省' }
]}
required required
x-component="Input" 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 <Field
type="string" 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" name="a5"
title="字段5" title="渠道描述"
required required
x-component="Input" x-component="Input"
/> />
</FormMegaLayout>
{/* <Field
type="string"
name="a2"
title="渠道级别"
></Field> */}
</FormTab.TabPane> </FormTab.TabPane>
<FormTab.TabPane name="tab-3" tab="营业执照"></FormTab.TabPane> <FormTab.TabPane name="tab-3" tab="营业执照"></FormTab.TabPane>
<FormTab.TabPane name="tab-4" tab="法定代表人"></FormTab.TabPane> <FormTab.TabPane name="tab-4" tab="法定代表人"></FormTab.TabPane>
......
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