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
c857db9d
Commit
c857db9d
authored
Aug 07, 2020
by
tjy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into dev
parents
7595641a
c8dbdc23
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
8 deletions
+93
-8
CircleBox.tsx
src/components/NiceForm/components/CircleBox.tsx
+17
-0
CustomSlider.tsx
src/components/NiceForm/components/CustomSlider.tsx
+16
-7
index.less
src/components/NiceForm/index.less
+27
-0
index.tsx
src/components/NiceForm/index.tsx
+4
-1
useSyncValues.ts
src/formSchema/effects/useSyncValues.ts
+18
-0
reset.less
src/global/styles/reset.less
+11
-0
No files found.
src/components/NiceForm/components/CircleBox.tsx
0 → 100644
View file @
c857db9d
import
React
from
'react'
import
styled
from
'styled-components'
const
CircleBox
=
(
props
)
=>
{
return
(
<
div
className=
'form-circle-box'
>
{
props
.
value
}
</
div
>
)
}
CircleBox
.
defaultProps
=
{}
CircleBox
.
isFieldComponent
=
true
;
export
default
CircleBox
\ No newline at end of file
src/components/NiceForm/components/CustomSlider.tsx
View file @
c857db9d
...
...
@@ -3,18 +3,27 @@ import { Slider, Input, Space } from 'antd'
const
CustomSlider
=
(
props
)
=>
{
const
value
=
props
.
value
||
0
const
max
=
props
.
props
[
'x-component-props'
]?.
max
||
0
const
componentProps
=
props
.
props
[
'x-component-props'
]
||
{}
const
{
max
=
0
,
width
=
'100%'
,
layout
=
{},
isNumber
=
false
}
=
componentProps
return
(
<
div
style=
{
{
width
:
'100%'
}
}
>
<
div
style=
{
{
width
:
'100%'
,
...
layout
}
}
>
<
Slider
style=
{
{
width
}
}
disabled=
{
!
props
.
editable
}
value=
{
value
}
onChange=
{
e
=>
props
.
mutators
.
change
(
e
)
}
{
...
props
.
props
['
x
-
component
-
props
']}
></
Slider
>
<
Space
>
<
Input
type=
'number'
disabled
max=
{
max
}
value=
{
props
.
value
}
onChange=
{
e
=>
props
.
mutators
.
change
(
e
.
target
.
value
)
}
addonAfter=
'尺'
/>
{
max
&&
<
span
>
还剩:
{
max
-
value
}
尺
</
span
>
}
</
Space
>
{
...
props
.
props
['
x
-
component
-
props
']}
/>
{
isNumber
?
<
div
>
<
Input
type=
'number'
className=
'underline_input'
max=
{
max
}
value=
{
props
.
value
}
onChange=
{
e
=>
props
.
mutators
.
change
(
e
.
target
.
value
)
}
/>
</
div
>
:
<
Space
>
<
Input
type=
'number'
disabled
max=
{
max
}
value=
{
props
.
value
}
onChange=
{
e
=>
props
.
mutators
.
change
(
e
.
target
.
value
)
}
addonAfter=
'尺'
/>
{
max
&&
<
span
>
还剩:
{
max
-
value
}
尺
</
span
>
}
</
Space
>
}
</
div
>
)
}
...
...
src/components/NiceForm/index.less
View file @
c857db9d
.form-circle-box {
width: 160px;
height: 160px;
border: 3px solid #efefef;
background: #fff;
text-align: center;
line-height: 160px;
font-size: 20px;
border-radius: 50%;
}
.underline_input {
max-width: 200px;
background: none;
border: none;
outline: none;
font-size: 32px;
border-bottom: 1px solid #DFE1E6;
padding: 8px 19px;
text-align: center;
display: inline-block;
&:focus{
box-shadow: none;
border-bottom: 1px solid #DFE1E6;
}
}
\ No newline at end of file
src/components/NiceForm/index.tsx
View file @
c857db9d
...
...
@@ -16,6 +16,8 @@ import MultTable from './components/MultTable';
import
CustomRegistryPhone
from
'./components/CustomRegistryPhone'
;
import
CustomRelevance
from
'./components/CustomRelevance'
;
import
Children
from
'./components/Children'
;
import
CircleBox
from
'./components/CircleBox'
;
import
'./index.less'
export
interface
NiceFormProps
extends
IAntdSchemaFormProps
{}
...
...
@@ -54,7 +56,8 @@ const NiceForm: React.FC<NiceFormProps> = props => {
MultTable
,
CustomRegistryPhone
,
CustomRelevance
,
Children
Children
,
CircleBox
};
const
defineComponents
=
Object
.
assign
(
customComponents
,
components
);
...
...
src/formSchema/effects/useSyncValues.ts
0 → 100644
View file @
c857db9d
import
{
FormEffectHooks
}
from
'@formily/antd'
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
const
{
onFieldValueChange$
}
=
FormEffectHooks
/**
* @description 用于同步表单的值
* @param target 同步的目标路径
* @param syncArr 被同步的表单字段
*/
export
const
useSyncValues
=
(
target
:
string
,
syncArr
:
string
[])
=>
{
const
linkage
=
useLinkageUtils
()
onFieldValueChange$
(
target
).
subscribe
(
state
=>
{
syncArr
.
forEach
(
v
=>
{
linkage
.
value
(
v
,
state
.
value
)
})
})
}
\ No newline at end of file
src/global/styles/reset.less
View file @
c857db9d
@import './mixins/layout.less';
#root {
// 去除数字输入框的箭头
input[type=number] {
-moz-appearance:textfield;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
.identityRadio{
display: flex;
flex-direction: column;
...
...
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