Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
submodule
Project
Project
Details
Activity
Releases
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
web_component
submodule
Commits
5daafbc9
Commit
5daafbc9
authored
Jun 08, 2020
by
zhangwenshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove number edit reg
parent
a0f638f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
21 deletions
+2
-21
index.tsx
components/apolloTable/component/base/edit/number/index.tsx
+2
-21
No files found.
components/apolloTable/component/base/edit/number/index.tsx
View file @
5daafbc9
...
@@ -3,34 +3,15 @@ import { InputNumber } from 'antd';
...
@@ -3,34 +3,15 @@ import { InputNumber } from 'antd';
import
styles
from
'./styles.less'
;
import
styles
from
'./styles.less'
;
import
{
ApolloNumberProps
}
from
'../editInterface'
;
import
{
ApolloNumberProps
}
from
'../editInterface'
;
import
{
antiAssign
}
from
'../../../../utils/utils'
;
import
{
antiAssign
}
from
'../../../../utils/utils'
;
import
{
floatNumberReg
,
intNumberReg
}
from
'../../../../utils/reg'
;
export
const
ApolloNumber
=
(
props
:
ApolloNumberProps
)
=>
{
export
const
ApolloNumber
=
(
props
:
ApolloNumberProps
)
=>
{
const
{
onChange
,
columnConfig
}:
any
=
props
;
const
{
onChange
}:
any
=
props
;
const
{
columnAttrObj
=
{}
}
=
columnConfig
;
const
{
dataType
}
=
columnAttrObj
;
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
]);
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
]);
const
changeValue
=
(
newValue
:
any
)
=>
{
const
changeValue
=
(
newValue
:
any
)
=>
{
if
(
dataType
===
'INT'
)
{
if
(
!
intNumberReg
.
test
(
newValue
))
{
return
false
;
}
}
if
(
dataType
===
'DECIMAL'
)
{
if
(
!
floatNumberReg
.
test
(
newValue
))
{
return
false
;
}
}
if
(
typeof
onChange
===
'function'
)
{
if
(
typeof
onChange
===
'function'
)
{
onChange
(
newValue
);
onChange
(
newValue
);
}
}
};
};
const
{
onEmitChange
,
...
o
}
=
selfProps
;
const
{
onEmitChange
,
...
o
}
=
selfProps
;
return
(
return
<
InputNumber
className=
{
styles
.
number
}
{
...
o
}
onChange=
{
changeValue
}
/>;
<
InputNumber
className=
{
styles
.
number
}
{
...
o
}
onChange=
{
changeValue
}
/>
);
};
};
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