Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
f1d9dc29
提交
f1d9dc29
authored
4 年前
作者:
chlolch
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改bug
上级
c98d63ff
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
24 行增加
和
21 行删除
+24
-21
ChildForm.jsx
one_stop_public/libs/ChildForm.jsx
+24
-21
index.jsx
one_stop_public/tableCompon/index.jsx
+0
-0
没有找到文件。
one_stop_public/libs/ChildForm.jsx
浏览文件 @
f1d9dc29
...
@@ -11,7 +11,7 @@ export default class ChildForm extends React.Component {
...
@@ -11,7 +11,7 @@ export default class ChildForm extends React.Component {
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
const
value
=
props
.
value
||
{};
const
value
=
props
.
value
||
{};
this
.
state
=
value
this
.
state
=
value
}
}
...
@@ -26,7 +26,7 @@ export default class ChildForm extends React.Component {
...
@@ -26,7 +26,7 @@ export default class ChildForm extends React.Component {
// Should be a controlled component.
// Should be a controlled component.
if
(
'value'
in
nextProps
)
{
if
(
'value'
in
nextProps
)
{
const
value
=
nextProps
.
value
;
const
value
=
nextProps
.
value
;
this
.
state
=
value
this
.
state
=
value
}
}
}
}
componentDidMount
=
()
=>
{
componentDidMount
=
()
=>
{
...
@@ -54,7 +54,7 @@ export default class ChildForm extends React.Component {
...
@@ -54,7 +54,7 @@ export default class ChildForm extends React.Component {
}
}
delete
=
(
uuid
)
=>
{
delete
=
(
uuid
)
=>
{
const
objs
=
this
.
state
const
objs
=
this
.
state
const
{
json
:{
numCode
},
form
,
base52
}
=
this
.
props
const
{
json
:
{
numCode
},
form
,
base52
}
=
this
.
props
if
(
this
.
props
.
min
!=
null
&&
Object
.
keys
(
objs
).
length
-
1
<
this
.
props
.
min
)
{
if
(
this
.
props
.
min
!=
null
&&
Object
.
keys
(
objs
).
length
-
1
<
this
.
props
.
min
)
{
message
.
error
(
"不能小于最小限制"
)
message
.
error
(
"不能小于最小限制"
)
...
@@ -67,14 +67,14 @@ export default class ChildForm extends React.Component {
...
@@ -67,14 +67,14 @@ export default class ChildForm extends React.Component {
}
}
this
.
triggerChange
({
...
objs
});
this
.
triggerChange
({
...
objs
});
if
(
numCode
!=
null
)
{
if
(
numCode
!=
null
)
{
this
.
props
.
form
.
setFieldsValue
({
[
numCode
]:
Object
.
keys
(
objs
).
length
})
this
.
props
.
form
.
setFieldsValue
({
[
numCode
]:
Object
.
keys
(
objs
).
length
})
}
}
}
}
add
=
()
=>
{
add
=
()
=>
{
const
objs
=
this
.
state
const
objs
=
this
.
state
const
{
json
:{
numCode
},
form
,
base52
}
=
this
.
props
const
{
json
:
{
numCode
},
form
,
base52
}
=
this
.
props
if
(
this
.
props
.
max
!=
null
&&
Object
.
keys
(
objs
).
length
+
1
>
this
.
props
.
max
)
{
if
(
this
.
props
.
max
!=
null
&&
Object
.
keys
(
objs
).
length
+
1
>
this
.
props
.
max
)
{
message
.
error
(
"不能大于最大限制"
)
message
.
error
(
"不能大于最大限制"
)
...
@@ -86,10 +86,10 @@ export default class ChildForm extends React.Component {
...
@@ -86,10 +86,10 @@ export default class ChildForm extends React.Component {
this
.
setState
({
...
objs
});
this
.
setState
({
...
objs
});
}
}
this
.
triggerChange
({
...
objs
});
this
.
triggerChange
({
...
objs
});
if
(
numCode
!=
null
)
{
if
(
numCode
!=
null
)
{
this
.
props
.
form
.
setFieldsValue
({
[
numCode
]:
Object
.
keys
(
objs
).
length
})
this
.
props
.
form
.
setFieldsValue
({
[
numCode
]:
Object
.
keys
(
objs
).
length
})
}
}
}
}
...
@@ -98,12 +98,13 @@ export default class ChildForm extends React.Component {
...
@@ -98,12 +98,13 @@ export default class ChildForm extends React.Component {
render
()
{
render
()
{
const
objs
=
this
.
state
;
const
objs
=
this
.
state
;
const
{
form
,
mapData
,
sqlData
,
defaultValues
,
datas
,
base52
,
isEdit
,
addName
,
deleteName
,
obj
,
isMobile
,
json
,
modalInit
}
=
this
.
props
const
{
form
,
mapData
,
sqlData
,
defaultValues
,
datas
,
base52
,
isEdit
,
addName
,
deleteName
,
obj
,
isMobile
,
json
,
modalInit
}
=
this
.
props
const
span
=
json
.
span
||
24
const
span
=
json
.
span
||
24
const
gutter
=
json
.
gutter
!=
null
?
json
.
gutter
:
0
const
gutter
=
json
.
gutter
!=
null
?
json
.
gutter
:
0
const
rights
=
this
.
props
.
rights
const
rights
=
this
.
props
.
rights
if
(
datas
==
null
)
{
if
(
datas
==
null
)
{
return
(<
div
>
还没有配置子表单key
</
div
>)
return
(<
div
>
还没有配置子表单key
</
div
>)
}
}
...
@@ -113,35 +114,37 @@ export default class ChildForm extends React.Component {
...
@@ -113,35 +114,37 @@ export default class ChildForm extends React.Component {
return
(
return
(
<
WingBlank
size=
"lg"
>
<
WingBlank
size=
"lg"
>
{
Object
.
keys
(
objs
).
length
>
1
||
rights
.
includes
(
"add"
)
?
<
Card
style=
{
{
marginLeft
:
'-27px'
}
}
>
{
Object
.
keys
(
objs
).
length
>
1
||
rights
.
includes
(
"add"
)
?
<
Card
style=
{
{
marginLeft
:
'-27px'
}
}
>
<
Card
.
Body
style=
{
{
minHeight
:
10
}
}
>
<
Card
.
Body
style=
{
{
minHeight
:
10
}
}
>
{
Object
.
keys
(
objs
).
map
((
r
)
=>
{
{
Object
.
keys
(
objs
).
map
((
r
)
=>
{
if
(
r
==
""
)
{
if
(
r
==
""
)
{
return
""
return
""
}
}
return
<
Row
key=
{
r
}
gutter=
{
gutter
}
><
Col
style=
{
{
textAlign
:
'right'
}
}
span=
{
isEdit
?
23
:
span
}
>
return
<
Row
key=
{
r
}
gutter=
{
gutter
}
><
Col
style=
{
{
textAlign
:
'right'
}
}
span=
{
isEdit
?
23
:
span
}
>
<
ZdyTable
key=
{
r
}
modalInit=
{
modalInit
}
formCode=
{
this
.
props
.
formCode
}
<
ZdyTable
key=
{
r
}
modalInit=
{
modalInit
}
formCode=
{
this
.
props
.
formCode
}
formId=
{
this
.
props
.
formId
}
formId=
{
this
.
props
.
formId
}
formConfig=
{
datas
}
get=
'mobile'
fatherCode=
{
base52
}
isEdit=
{
isEdit
}
index=
{
r
}
obj=
{
objs
[
r
]
}
fatherObj=
{
this
.
props
.
fatherObj
}
init=
{
objs
}
isChild=
{
true
}
form=
{
form
}
mapData=
{
mapData
}
sqlData=
{
sqlData
}
{
...
datas
}
defaultValues=
{
defaultValues
}
/>
formConfig=
{
datas
}
get=
'mobile'
fatherCode=
{
base52
}
isEdit=
{
isEdit
}
index=
{
r
}
obj=
{
objs
[
r
]
}
fatherObj=
{
this
.
props
.
fatherObj
}
init=
{
objs
}
isChild=
{
true
}
form=
{
form
}
mapData=
{
mapData
}
sqlData=
{
sqlData
}
{
...
datas
}
defaultValues=
{
defaultValues
}
/>
{
rights
.
includes
(
"delete"
)
&&
isEdit
?
<
Button
type=
'danger'
size=
"small"
onClick=
{
this
.
delete
.
bind
(
this
,
r
)
}
>
{
deleteName
||
"删除"
}
</
Button
>
:
''
}
{
rights
.
includes
(
"delete"
)
&&
isEdit
?
<
Button
type=
'danger'
size=
"small"
onClick=
{
this
.
delete
.
bind
(
this
,
r
)
}
>
{
deleteName
||
"删除"
}
</
Button
>
:
''
}
</
Col
>
</
Col
>
</
Row
>
</
Row
>
})
}
})
}
{
rights
.
includes
(
"add"
)
?
<
Row
>
{
rights
.
includes
(
"add"
)
?
<
Row
>
<
Col
style=
{
{
textAlign
:
"center"
}
}
><
Button
type=
"primary"
size=
"small"
style=
{
{
margin
:
"auto"
}
}
onClick=
{
this
.
add
}
>
{
addName
||
"新增"
}
</
Button
>
</
Col
>
<
Col
style=
{
{
textAlign
:
"center"
}
}
><
Button
type=
"primary"
size=
"small"
style=
{
{
margin
:
"auto"
}
}
onClick=
{
this
.
add
}
>
{
addName
||
"新增"
}
</
Button
>
</
Col
>
</
Row
>
:
""
}
</
Row
>
:
""
}
</
Card
.
Body
>
</
Card
.
Body
>
</
Card
>
:
""
}
</
Card
>
:
""
}
</
WingBlank
>
</
WingBlank
>
)
)
}
}
return
(
return
(
<
div
style=
{
{
width
:
"100%"
}
}
>
<
div
style=
{
{
width
:
"100%"
}
}
>
<
Row
gutter=
{
gutter
}
>
<
Row
gutter=
{
gutter
}
>
{
Object
.
keys
(
objs
).
map
((
r
)
=>
{
{
Object
.
keys
(
objs
).
map
((
r
)
=>
{
if
(
r
==
""
)
{
if
(
r
==
""
)
{
return
""
return
""
}
}
...
...
This diff is collapsed.
Click to expand it.
one_stop_public/tableCompon/index.jsx
浏览文件 @
f1d9dc29
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论