Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
9c0b6752
Commit
9c0b6752
authored
Oct 26, 2017
by
ddcat1115
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update style & add digitUppercase util
parent
339ea67a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
4 deletions
+51
-4
src/routes/Forms/AdvancedForm.js
src/routes/Forms/AdvancedForm.js
+7
-2
src/routes/Forms/StepForm/Step2.js
src/routes/Forms/StepForm/Step2.js
+3
-1
src/routes/Forms/StepForm/style.less
src/routes/Forms/StepForm/style.less
+5
-0
src/routes/Forms/TableForm.js
src/routes/Forms/TableForm.js
+1
-1
src/routes/Forms/style.less
src/routes/Forms/style.less
+9
-0
src/utils/utils.js
src/utils/utils.js
+26
-0
No files found.
src/routes/Forms/AdvancedForm.js
View file @
9c0b6752
...
...
@@ -222,12 +222,17 @@ function AdvancedForm({ form, dispatch, submitting }) {
)}
<
/Form.Item
>
<
/Col
>
<
Col
xl
=
{{
span
:
6
,
offset
:
2
}}
lg
=
{{
span
:
8
}}
md
=
{{
span
:
12
}}
sm
=
{
24
}
>
<
Col
id
=
"
timepicker-container
"
xl
=
{{
span
:
6
,
offset
:
2
}}
lg
=
{{
span
:
8
}}
md
=
{{
span
:
12
}}
sm
=
{
24
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
dateRange2
}
>
{
getFieldDecorator
(
'
dateRange2
'
,
{
rules
:
[{
required
:
true
,
message
:
'
请输入
'
}],
})(
<
TimePicker
placeholder
=
"
提醒时间
"
style
=
{{
width
:
'
100%
'
}}
/
>
<
TimePicker
popupClassName
=
{
styles
.
popup
}
placeholder
=
"
提醒时间
"
style
=
{{
width
:
'
100%
'
}}
getPopupContainer
=
{()
=>
document
.
getElementById
(
'
timepicker-container
'
)}
/
>
)}
<
/Form.Item
>
<
/Col
>
...
...
src/routes/Forms/StepForm/Step2.js
View file @
9c0b6752
import
React
from
'
react
'
;
import
{
Form
,
Input
,
Button
,
Alert
,
Divider
}
from
'
antd
'
;
import
{
routerRedux
}
from
'
dva/router
'
;
import
{
digitUppercase
}
from
'
../../../utils/utils
'
;
import
styles
from
'
./style.less
'
;
export
default
({
formItemLayout
,
form
,
data
,
dispatch
,
submitting
})
=>
{
...
...
@@ -56,7 +57,8 @@ export default ({ formItemLayout, form, data, dispatch, submitting }) => {
className
=
{
styles
.
stepFormText
}
label
=
"
转账金额
"
>
<
span
className
=
{
styles
.
money
}
>
{
data
.
amount
}
<
/span>
元
<
span
className
=
{
styles
.
money
}
>
{
data
.
amount
}
<
/span
>
<
span
className
=
{
styles
.
uppercase
}
>
(
{
digitUppercase
(
data
.
amount
)}
)
<
/span
>
<
/Form.Item
>
<
Divider
style
=
{{
margin
:
'
24px 0
'
}}
/
>
<
Form
.
Item
...
...
src/routes/Forms/StepForm/style.less
View file @
9c0b6752
...
...
@@ -64,7 +64,12 @@
}
.money {
font-family: Helvetica Neue;
font-weight: 500;
font-size: 20px;
line-height: 14px;
}
.uppercase {
font-size: 12px;
}
src/routes/Forms/TableForm.js
View file @
9c0b6752
...
...
@@ -213,7 +213,7 @@ export default class TableForm extends PureComponent {
}}
/
>
<
Button
style
=
{{
width
:
'
100%
'
,
marginTop
:
24
}}
style
=
{{
width
:
'
100%
'
,
marginTop
:
16
,
marginBottom
:
8
}}
type
=
"
dashed
"
onClick
=
{
this
.
newMember
}
icon
=
"
plus
"
...
...
src/routes/Forms/style.less
View file @
9c0b6752
...
...
@@ -88,3 +88,12 @@
color: @text-color-secondary;
font-style: normal;
}
.popup {
width: ~"calc(100% - 16px)";
:global {
.ant-time-picker-panel-select {
width: 33.33%;
}
}
}
src/utils/utils.js
View file @
9c0b6752
...
...
@@ -79,3 +79,29 @@ export function getRouteData(path) {
const
nodeList
=
getPlainNode
(
dataList
.
children
);
return
nodeList
;
}
export
function
digitUppercase
(
n
)
{
const
fraction
=
[
'
角
'
,
'
分
'
];
const
digit
=
[
'
零
'
,
'
壹
'
,
'
贰
'
,
'
叁
'
,
'
肆
'
,
'
伍
'
,
'
陆
'
,
'
柒
'
,
'
捌
'
,
'
玖
'
];
const
unit
=
[
[
'
元
'
,
'
万
'
,
'
亿
'
],
[
''
,
'
拾
'
,
'
佰
'
,
'
仟
'
],
];
let
num
=
Math
.
abs
(
n
);
let
s
=
''
;
fraction
.
forEach
((
item
,
index
)
=>
{
s
+=
(
digit
[
Math
.
floor
(
num
*
10
*
(
10
**
index
))
%
10
]
+
item
).
replace
(
/零./
,
''
);
});
s
=
s
||
'
整
'
;
num
=
Math
.
floor
(
num
);
for
(
let
i
=
0
;
i
<
unit
[
0
].
length
&&
num
>
0
;
i
+=
1
)
{
let
p
=
''
;
for
(
let
j
=
0
;
j
<
unit
[
1
].
length
&&
num
>
0
;
j
+=
1
)
{
p
=
digit
[
num
%
10
]
+
unit
[
1
][
j
]
+
p
;
num
=
Math
.
floor
(
num
/
10
);
}
s
=
p
.
replace
(
/
(
零.
)
*零$/
,
''
).
replace
(
/^$/
,
'
零
'
)
+
unit
[
0
][
i
]
+
s
;
}
return
s
.
replace
(
/
(
零.
)
*零元/
,
'
元
'
).
replace
(
/
(
零.
)
+/g
,
'
零
'
).
replace
(
/^整$/
,
'
零元整
'
);
}
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