Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
8f5d7a8a
Commit
8f5d7a8a
authored
Dec 27, 2022
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复数字校验问题
parent
7e858c5b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
5 deletions
+32
-5
CommonTemplate.jsx
src/pages/ServiceGoods/components/CommonTemplate.jsx
+17
-5
utils.js
src/utils/utils.js
+15
-0
No files found.
src/pages/ServiceGoods/components/CommonTemplate.jsx
View file @
8f5d7a8a
import
React
from
'
react
'
;
import
{
Select
,
Form
,
InputNumber
,
Input
,
Button
,
Popover
}
from
'
antd
'
;
import
commonStyle
from
'
../common.less
'
;
import
{
debounce
}
from
'
@/utils/utils
'
;
export
const
WrapperContainer
=
props
=>
(
<
div
className=
{
commonStyle
.
container
}
>
{
props
.
children
}
</
div
>
...
...
@@ -77,6 +78,7 @@ export const CreateFormInput = props => {
type
,
batchProps
,
disabeldRender
,
onChange
,
...
options
}
=
props
;
...
...
@@ -87,7 +89,11 @@ export const CreateFormInput = props => {
{
...
options
}
style=
{
{
width
:
'
100%
'
}
}
placeholder=
{
`请输入${title}`
}
onBlur=
{
e
=>
onBlurEvent
(
e
.
target
.
value
,
dataIndex
,
rowIndex
)
}
// onBlur={e => onBlurEvent(e.target.value, dataIndex, rowIndex)}
onChange=
{
e
=>
{
onChange
(
e
);
onBlurEvent
(
e
.
target
.
value
,
dataIndex
,
rowIndex
);
}
}
/>
);
}
...
...
@@ -130,16 +136,22 @@ export const CreateFormInput = props => {
</>
);
}
// console.log('options :>> ', options);
return
(
<
InputNumber
{
...
roleProps
}
{
...
options
}
style=
{
{
width
:
'
100%
'
}
}
placeholder=
{
`请输入${title}`
}
onBlur=
{
e
=>
{
onBlurEvent
(
e
.
target
.
value
,
dataIndex
,
rowIndex
);
}
}
// onBlur={e => {
// const v = e.target.value;
// console.log('v :>> ', v);
// onBlurEvent(+e.target.value || 0, dataIndex, rowIndex);
// }}
onChange=
{
debounce
(
e
=>
{
onChange
(
e
);
onBlurEvent
(
e
,
dataIndex
,
rowIndex
);
},
300
)
}
/>
);
};
src/utils/utils.js
View file @
8f5d7a8a
...
...
@@ -64,6 +64,21 @@ export function isClass(o) {
return
Object
.
prototype
.
toString
.
call
(
o
).
slice
(
8
,
-
1
);
}
export
function
debounce
(
fn
,
delay
=
500
)
{
let
timer
=
null
;
return
function
fun
(...
args
)
{
if
(
timer
)
{
clearTimeout
(
timer
);
}
timer
=
setTimeout
(()
=>
{
timer
=
null
;
fn
.
apply
(
this
,
args
);
},
delay
);
};
}
// 深拷贝
export
function
deepClone
(
obj
)
{
let
result
;
...
...
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