Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
e8f88e53
Commit
e8f88e53
authored
Aug 25, 2020
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
developing
parent
7fd252ce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
35 deletions
+96
-35
index.tsx
src/components/NiceForm/index.tsx
+3
-4
addMember.tsx
src/pages/member/memberImport/addMember.tsx
+1
-15
index.tsx
src/pages/member/memberImport/schema/index.tsx
+92
-16
No files found.
src/components/NiceForm/index.tsx
View file @
e8f88e53
...
...
@@ -2,7 +2,6 @@ import React from 'react';
import
SchemaForm
,
{
IAntdSchemaFormProps
,
createVirtualBox
,
registerVirtualBox
,
Schema
,
SchemaField
,
FormButtonGroup
,
Reset
,
createControllerBox
,
registerValidationRules
,
}
from
'@formily/antd'
;
import
{
Input
}
from
'@formily/antd-components'
;
import
{
Button
,
Space
,
Row
,
Col
}
from
'antd'
;
import
styled
from
'styled-components'
import
CustomUpload
from
'./components/CustomUpload'
;
...
...
@@ -22,8 +21,8 @@ import CircleBox from './components/CircleBox';
import
Phone
from
'./components/Phone'
;
import
CustomRadio
from
'./components/CustomRadio'
;
import
SearchSelect
from
'./components/SearchSelect'
;
import
'./index.less'
import
{
Checkbox
}
from
'@formily/antd-component
s'
;
import
{
Checkbox
,
Input
}
from
'@formily/antd-components'
;
import
'./index.les
s'
;
export
interface
NiceFormProps
extends
IAntdSchemaFormProps
{}
...
...
@@ -115,7 +114,7 @@ const NiceForm: React.FC<NiceFormProps> = props => {
SchemaFormButtonGroup
,
FlexBox
,
Phone
,
SearchSelect
,
SearchSelect
,
Input
,
};
...
...
src/pages/member/memberImport/addMember.tsx
View file @
e8f88e53
...
...
@@ -11,8 +11,8 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
;
import
{
useAsyncInitSelect
}
from
'@/formSchema/effects/useAsyncInitSelect'
;
import
{
initDetailSchema
}
from
'./schema'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
initDetailSchema
}
from
'./schema'
;
const
formActions
=
createFormActions
();
...
...
@@ -84,20 +84,6 @@ const addMember: React.FC<any> = props => {
});
},
[]);
// 模拟请求
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
queryResult
=
data
.
find
(
v
=>
v
.
key
===
params
.
keywords
);
setTimeout
(()
=>
{
resolve
({
code
:
200
,
message
:
''
,
data
:
queryResult
?
[
queryResult
]
:
data
,
});
},
1000
);
});
};
const
handleSubmit
=
(
values
:
any
)
=>
{
console
.
log
(
values
);
};
...
...
src/pages/member/memberImport/schema/index.tsx
View file @
e8f88e53
...
...
@@ -7,11 +7,11 @@ export const importSchema: ISchema = {
properties
:
{
mageLayout
:
{
type
:
'object'
,
'x-component'
:
'
mega-l
ayout'
,
'x-component'
:
'
Mega-L
ayout'
,
properties
:
{
topLayout
:
{
type
:
'object'
,
'x-component'
:
'
mega-l
ayout'
,
'x-component'
:
'
Mega-L
ayout'
,
'x-component-props'
:
{
grid
:
true
,
},
...
...
@@ -34,7 +34,7 @@ export const importSchema: ISchema = {
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'
flex-l
ayout'
,
'x-component'
:
'
Flex-L
ayout'
,
'x-component-props'
:
{
rowStyle
:
{
flexWrap
:
'nowrap'
,
...
...
@@ -105,7 +105,7 @@ export const auditModalSchema = props => {
properties
:
{
MEGA_LAYOUT
:
{
type
:
'object'
,
'x-component'
:
'
mega-l
ayout'
,
'x-component'
:
'
Mega-L
ayout'
,
'x-component-props'
:
{
labelAlign
:
'top'
,
},
...
...
@@ -113,7 +113,7 @@ export const auditModalSchema = props => {
remark
:
{
type
:
'string'
,
title
:
`会员
${
props
.
status
===
1
?
'解冻'
:
'冻结'
}
原因`
,
'x-component'
:
'
texta
rea'
,
'x-component'
:
'
TextA
rea'
,
'x-component-props'
:
{
placeholder
:
'在此输入你的内容,最长120个字符,60个汉字'
,
maxLength
:
60
,
...
...
@@ -168,18 +168,18 @@ const getCompnentValue = (elements: any) => {
};
export
const
initDetailSchema
=
(
props
:
any
)
=>
{
let
tabSchema
=
{
let
tabSchema
:
ISchema
=
{
properties
:
{
'tab-1'
:
{
type
:
'object'
,
'x-component'
:
'
tabp
ane'
,
'x-component'
:
'
TabP
ane'
,
'x-component-props'
:
{
tab
:
'基本信息'
,
},
properties
:
{
MEGA_LAYOUT1
:
{
type
:
'object'
,
'x-component'
:
'
mega-l
ayout'
,
'x-component'
:
'
Mega-L
ayout'
,
'x-component-props'
:
{
labelCol
:
4
,
wrapperCol
:
8
,
...
...
@@ -214,10 +214,8 @@ export const initDetailSchema = (props: any) => {
},
},
MEGA_LAYOUT1_1
:
{
key
:
'MEGA_LAYOUT1_1'
,
type
:
'object'
,
name
:
'MEGA_LAYOUT1_1'
,
'x-component'
:
'mega-layout'
,
'x-component'
:
'Mega-Layout'
,
'x-component-props'
:
{
label
:
'注册手机'
,
required
:
true
,
...
...
@@ -250,22 +248,98 @@ export const initDetailSchema = (props: any) => {
},
},
},
},
'tab-2'
:
{
type
:
'object'
,
'x-component'
:
'TabPane'
,
'x-component-props'
:
{
tab
:
'渠道信息'
,
},
properties
:
{
MEGA_LAYOUT1
:
{
type
:
'object'
,
'x-component'
:
'Mega-Layout'
,
'x-component-props'
:
{
labelCol
:
4
,
wrapperCol
:
12
,
labelAlign
:
'left'
,
full
:
true
,
},
properties
:
{
channelLevel
:
{
type
:
'text'
,
title
:
'渠道级别'
,
},
channelType
:
{
type
:
'string'
,
enum
:
[
{
label
:
'电商渠道'
,
value
:
'1'
},
{
label
:
'线下渠道'
,
value
:
'2'
},
],
title
:
'渠道类型'
,
required
:
true
,
'x-component-props'
:
{
defaultValue
:
'1'
,
},
},
cities
:
{
type
:
'array'
,
title
:
'代理城市'
,
required
:
true
,
'x-component'
:
'CustomAddArray'
,
default
:
[
{
province
:
'1'
,
city
:
'2'
},
{
province
:
'2'
,
city
:
'1'
},
],
items
:
{
type
:
'object'
,
properties
:
{
province
:
{
type
:
'string'
,
enum
:
[
{
label
:
'广东省'
,
value
:
'1'
},
{
label
:
'湖南省'
,
value
:
'2'
},
],
},
city
:
{
type
:
'string'
,
enum
:
[
{
label
:
'广州'
,
value
:
'1'
},
{
label
:
'深圳'
,
value
:
'2'
},
],
}
}
}
},
desc
:
{
type
:
'string'
,
title
:
'渠道描述'
,
required
:
true
,
'x-component'
:
'TextArea'
,
'x-component-props'
:
{
rows
:
4
,
placeholder
:
'最大200个字符,100个汉字'
,
},
},
},
},
},
},
},
};
if
(
Object
.
keys
(
props
).
length
>
0
)
{
for
(
let
[
index
,
item
]
of
props
.
groups
.
entries
())
{
tabSchema
.
properties
[
`tab-
${
index
+
2
}
`
]
=
{
tabSchema
.
properties
[
`tab-
${
index
+
3
}
`
]
=
{
type
:
'object'
,
'x-component'
:
'
tabp
ane'
,
'x-component'
:
'
TabP
ane'
,
'x-component-props'
:
{
tab
:
item
.
groupName
,
},
properties
:
{
[
`MEGA_LAYOUT
${
index
+
2
}
`
]:
{
type
:
'object'
,
'x-component'
:
'
mega-l
ayout'
,
'x-component'
:
'
Mega-L
ayout'
,
'x-component-props'
:
{
labelCol
:
4
,
wrapperCol
:
8
,
...
...
@@ -283,8 +357,10 @@ export const initDetailSchema = (props: any) => {
properties
:
{
REPOSIT_TABS
:
{
type
:
'object'
,
'x-component'
:
'tab'
,
'x-component-props'
:
{},
'x-component'
:
'Tab'
,
'x-component-props'
:
{
type
:
'card'
,
},
...
tabSchema
,
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment