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
a0f638f3
Commit
a0f638f3
authored
Jun 08, 2020
by
zhangwenshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update apolloTable editform
parent
2663914e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
29 deletions
+5
-29
index.tsx
components/apolloTable/editFormV3/index.tsx
+5
-29
No files found.
components/apolloTable/editFormV3/index.tsx
View file @
a0f638f3
...
@@ -29,15 +29,14 @@ class FormWrap extends Component {
...
@@ -29,15 +29,14 @@ class FormWrap extends Component {
form
.
validateFieldsAndScroll
((
err
,
values
)
=>
{
form
.
validateFieldsAndScroll
((
err
,
values
)
=>
{
if
(
!
err
)
{
if
(
!
err
)
{
const
newValues
:
any
[]
=
[];
const
newValues
:
any
[]
=
[];
debugger
_
.
keys
(
values
).
map
((
key
)
=>
{
_
.
keys
(
values
).
map
((
key
)
=>
{
const
item
=
data
.
find
((
temp
:
any
)
=>
{
const
item
=
data
.
find
((
temp
:
any
)
=>
{
return
temp
.
columnName
===
key
;
return
temp
.
columnName
===
key
;
});
});
const
{
columnType
,
renderEditForm
,
readOnlyFlag
,
dynamicCellConfigDTO
}
=
item
;
const
{
columnType
,
renderEditForm
,
readOnlyFlag
,
dynamicCellConfigDTO
}
=
item
;
//
if (readOnlyFlag || (dynamicCellConfigDTO && dynamicCellConfigDTO.readonlyFlag)) {
if
(
readOnlyFlag
||
(
dynamicCellConfigDTO
&&
dynamicCellConfigDTO
.
readonlyFlag
))
{
//
return;
return
;
//
}
}
let
detailConfig
:
any
;
let
detailConfig
:
any
;
if
(
typeof
renderEditForm
===
'function'
)
{
if
(
typeof
renderEditForm
===
'function'
)
{
detailConfig
=
renderEditForm
({
cellData
:
values
[
key
],
rowData
,
columnConfig
:
item
});
detailConfig
=
renderEditForm
({
cellData
:
values
[
key
],
rowData
,
columnConfig
:
item
});
...
@@ -81,29 +80,6 @@ class FormWrap extends Component {
...
@@ -81,29 +80,6 @@ class FormWrap extends Component {
);
);
};
};
validateRequired
=
(
item
,
rule
,
value
,
callback
)
=>
{
const
{
columnAttrObj
=
{}
}
=
item
;
const
{
validator
}
=
columnAttrObj
;
if
(
!
item
.
requiredFlag
)
{
callback
();
return
;
}
if
(
!
value
||
value
.
length
===
0
)
{
callback
(
'必填项不能为空'
);
return
;
}
const
[
first
]
=
value
;
if
(
!
first
.
text
&&
first
.
text
!==
0
&&
!
first
.
value
&&
first
.
value
!==
0
)
{
callback
(
'必填项不能为空'
);
return
;
}
if
(
validator
&&
typeof
validator
===
'function'
)
{
const
values
=
this
.
props
.
form
.
getFieldsValue
();
callback
(
validator
({
value
,
values
,
item
}));
}
callback
();
};
renderEditForm
=
(
item
)
=>
{
renderEditForm
=
(
item
)
=>
{
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
const
{
rowData
}
=
this
.
props
;
const
{
rowData
}
=
this
.
props
;
...
@@ -158,7 +134,7 @@ class FormWrap extends Component {
...
@@ -158,7 +134,7 @@ class FormWrap extends Component {
};
};
render
()
{
render
()
{
const
{
loading
,
isShowDelBtn
,
data
,
btnWrapStyle
,
name
,
colsNum
}
=
this
.
props
;
const
{
loading
,
isShowDelBtn
,
data
,
btnWrapStyle
,
name
,
colsNum
,
delLabel
}
=
this
.
props
;
return
(
return
(
<
Provider
value=
{
{
locale
:
this
.
getContext
()
}
}
>
<
Provider
value=
{
{
locale
:
this
.
getContext
()
}
}
>
...
@@ -193,7 +169,7 @@ class FormWrap extends Component {
...
@@ -193,7 +169,7 @@ class FormWrap extends Component {
<
div
style=
{
{
display
:
'flex'
,
justifyContent
:
'center'
}
}
>
<
div
style=
{
{
display
:
'flex'
,
justifyContent
:
'center'
}
}
>
{
isShowDelBtn
?
(
{
isShowDelBtn
?
(
<
Button
onClick=
{
this
.
handleDelete
}
type=
"link"
className=
{
styles
.
delBtnCls
}
>
<
Button
onClick=
{
this
.
handleDelete
}
type=
"link"
className=
{
styles
.
delBtnCls
}
>
删除
{
delLabel
||
'删除'
}
</
Button
>
</
Button
>
)
:
null
}
)
:
null
}
<
Button
onClick=
{
this
.
handleCancel
}
className=
{
styles
.
btnCls
}
>
<
Button
onClick=
{
this
.
handleCancel
}
className=
{
styles
.
btnCls
}
>
...
...
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