Commit e51a07a3 authored by tjy's avatar tjy

新增新建会员

parent a474c389
......@@ -3,10 +3,10 @@
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @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 { Modal,Card ,Button, Form,InputNumber, Radio, Popconfirm,Switch, Input } from 'antd';
import { Modal, Card, Button, Form, InputNumber, Radio, Popconfirm, Switch, Input } from 'antd';
import {
PlayCircleOutlined,
PauseCircleOutlined,
......@@ -15,7 +15,7 @@ import {
PlusCircleOutlined
} from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import {StandardTable} from 'god'
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController'
......@@ -27,9 +27,9 @@ const data = [
tel: '02020',
required: '平台物流服务商',
isDefault: 0,
code:252525,
code: 252525,
status: 1,
address:'地址'
address: '地址'
},
{
key: '2',
......@@ -38,15 +38,15 @@ const data = [
tel: '02020',
required: '平台物流服务商',
isDefault: 0,
code:252525,
code: 252525,
status: 0,
address:'地址32'
address: '地址32'
},
]
// 模拟请求
const fetchData = (params:any) => {
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
resolve(data)
// const queryResult = data.find(v => v.key === params.keywords)
......@@ -69,12 +69,12 @@ const fetchData = (params:any) => {
// })
// })
// }
interface Item{
interface Item {
key: string
}
//父页面传递来的参数
export interface ListProps{
title?:React.ReactNode,
export interface ListProps {
title?: React.ReactNode,
type: string
}
export interface ListType {
......@@ -91,7 +91,7 @@ interface EditableCellProps extends React.HTMLAttributes<HTMLElement> {
children: React.ReactNode;
}
const EditableCell : React.FC<EditableCellProps> = ({
const EditableCell: React.FC<EditableCellProps> = ({
editing,
dataIndex,
title,
......@@ -118,8 +118,8 @@ const EditableCell : React.FC<EditableCellProps> = ({
{inputNode}
</Form.Item>
) : (
children
)}
children
)}
</td>
);
};
......@@ -151,7 +151,7 @@ const AddressList: React.FC<ListProps> = (props) => {
align: 'left',
dataIndex: 'address',
key: 'address',
render: (_:any, record:any) =>(
render: (_: any, record: any) => (
<>
{record.address}
</>
......@@ -180,8 +180,8 @@ const AddressList: React.FC<ListProps> = (props) => {
align: 'center',
dataIndex: 'isDefault',
key: 'isDefault',
render: (_:any, record:any) =>
<Switch size='small' defaultChecked={record.isDefault== 0? false: true}
render: (_: any, record: any) =>
<Switch size='small' defaultChecked={record.isDefault == 0 ? false : true}
/>,
},
......@@ -189,20 +189,20 @@ const AddressList: React.FC<ListProps> = (props) => {
title: '操作',
dataIndex: 'option',
align: 'center',
render: (_:any, record:any) => {
render: (_: any, record: any) => {
return (
<>
<Button type='link'>启用</Button>
{
record.status === 0 ?
<><Button type="link" onClick={() => edit(record)}>编辑</Button>
<Popconfirm title="确定要删除吗?" okText="是" cancelText="否" onConfirm={handleDelete}>
<Button type='link'>
删除
{
record.status === 0 ?
<><Button type="link" onClick={() => edit(record)}>编辑</Button>
<Popconfirm title="确定要删除吗?" okText="是" cancelText="否" onConfirm={handleDelete}>
<Button type='link'>
删除
</Button>
</Popconfirm>
</>:''
}
</Popconfirm>
</> : ''
}
<Button type='link'>查看</Button>
</>
)
......@@ -218,9 +218,9 @@ const AddressList: React.FC<ListProps> = (props) => {
// }
// }, [input])
const onDefaultChange = (id:any,checked: boolean) => {
console.log(id,checked)
columns.forEach((v,index) => {
const onDefaultChange = (id: any, checked: boolean) => {
console.log(id, checked)
columns.forEach((v, index) => {
})
}
......@@ -241,13 +241,13 @@ const AddressList: React.FC<ListProps> = (props) => {
type: 'primary',
text: '新建',
icon: <PlusOutlined />,
handler: ()=>{
handler: () => {
history.push('/logisticsAbility/logistics/list/addCompany')
}
}
]
const handleSee = (record:any) => {
const handleSee = (record: any) => {
console.log('see')
}
......@@ -270,21 +270,23 @@ const AddressList: React.FC<ListProps> = (props) => {
<StandardTable
columns={columns}
currentRef={ref}
fetchTableData={(params:any) => fetchData(params)}
fetchTableData={(params: any) => fetchData(params)}
rowClassName="editable-row"
formilyChilds = {
<>
<Button type="primary" icon={<PlusOutlined />} onClick={() => history.push(`/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>
)
}
AddressList.defaultProps = {
}
export default AddressList
\ No newline at end of file
......@@ -7,14 +7,29 @@ import {
SchemaForm,
FormMegaLayout,
Field,
FormButtonGroup,
createFormActions
} 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 './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<[]> = () => {
......@@ -86,10 +101,58 @@ const addMember: React.FC<[]> = () => {
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
name="ddd"
type="number"
title="会员等级"
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: '显示' },
......@@ -98,44 +161,64 @@ const addMember: React.FC<[]> = () => {
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="eee"
title="注册邮箱"
x-props={{ style: { width: 572 } }}
name="a5"
title="渠道描述"
required
x-component="Input"
/>
</FormMegaLayout>
</FormTab.TabPane>
<FormTab.TabPane name="tab-2" tab="渠道信息">
<Field
{/* <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"
/>
title="渠道级别"
></Field> */}
</FormTab.TabPane>
<FormTab.TabPane name="tab-3" 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