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
b588457e
Commit
b588457e
authored
Jun 08, 2020
by
满振华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复表格
parent
2663914e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
getFormatter.tsx
...onents/apolloTable/component/base/_utils/getFormatter.tsx
+7
-2
setFormatter.tsx
...onents/apolloTable/component/base/_utils/setFormatter.tsx
+7
-1
index.tsx
components/apolloTable/editFormV3/index.tsx
+1
-0
No files found.
components/apolloTable/component/base/_utils/getFormatter.tsx
View file @
b588457e
...
...
@@ -93,11 +93,16 @@ export const GetFormatter = {
return
newValue
[
0
].
value
;
},
NUMBER
:
(
val
,
config
)
=>
{
cons
t
newValue
=
initValue
(
val
);
le
t
newValue
=
initValue
(
val
);
if
(
!
newValue
)
{
return
undefined
;
}
const
{
precision
}
=
config
;
const
{
precision
,
unit
}
=
config
;
if
(
unit
&&
unit
.
code
===
'wan'
)
{
let
formateVal
=
Number
((
newValue
[
0
]
||
{}).
value
);
formateVal
=
formateVal
?
formateVal
/
10000
:
formateVal
;
newValue
=
[{
value
:
formateVal
,
text
:
formateVal
}]
}
if
(
precision
>=
0
&&
isNumber
(
newValue
[
0
].
value
))
{
return
Number
(
newValue
[
0
].
value
).
toFixed
(
precision
);
}
...
...
components/apolloTable/component/base/_utils/setFormatter.tsx
View file @
b588457e
...
...
@@ -82,8 +82,14 @@ export const SetFormatter = {
RATE
:
(
val
)
=>
{
return
[{
value
:
val
,
text
:
val
}];
},
NUMBER
:
(
val
)
=>
{
NUMBER
:
(
val
,
config
)
=>
{
debugger
if
(
!
isNumber
(
val
))
return
emptyModel
;
const
{
unit
=
{}
}
=
config
||
{};
// 设置单位
if
(
unit
&&
unit
.
code
===
'wan'
)
{
const
newVal
=
val
?
val
*
10000
:
val
;
return
[{
value
:
newVal
,
text
:
newVal
}]
}
return
[{
value
:
val
,
text
:
val
}];
},
PERCENTAGE
:
(
val
)
=>
{
...
...
components/apolloTable/editFormV3/index.tsx
View file @
b588457e
...
...
@@ -132,6 +132,7 @@ class FormWrap extends Component {
};
const
transferColumn
=
transferAttr
(
columnType
,
newProps
);
const
disabled
=
readOnlyFlag
||
(
dynamicCellConfigDTO
&&
dynamicCellConfigDTO
.
readonlyFlag
);
return
(
<
FormItem
key=
{
columnName
}
label=
{
this
.
renderLabel
(
item
)
}
>
{
getFieldDecorator
(
columnName
,
{
...
...
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