Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
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
ReactWeb5
CivManage
Commits
2f66a49f
Commit
2f66a49f
authored
Nov 02, 2022
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '关联表单形态映射字段切换提交增加验证'
parent
f600299e
Pipeline
#62962
passed with stages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
25 deletions
+60
-25
fieldEditor.jsx
...s/bsmanager/base/tablemanager/filedConfig/fieldEditor.jsx
+60
-25
No files found.
src/pages/bsmanager/base/tablemanager/filedConfig/fieldEditor.jsx
View file @
2f66a49f
...
...
@@ -49,6 +49,7 @@ import {
InfoCircleOutlined
,
MinusCircleOutlined
,
PlusOutlined
,
SwapOutlined
,
}
from
'@ant-design/icons'
;
import
styles
from
'./index.less'
;
import
VerifyModal
from
'./VerifyModal'
;
...
...
@@ -215,6 +216,8 @@ const AddModal = props => {
// 不切换树
if
(
valueData
.
length
==
0
)
{
console
.
log
(
pramData
);
formAdd
.
validateFields
().
then
(
validate1
=>
{
if
(
validate1
)
{
form
.
validateFields
().
then
(
validate
=>
{
if
(
validate
)
{
setLoading
(
true
);
...
...
@@ -442,9 +445,16 @@ const AddModal = props => {
});
}
});
}
});
}
else
{
formAdd
.
validateFields
().
then
(
validate
=>
{
if
(
validate
)
{
onSelect
(
1.14
,
keep
);
}
});
}
};
useEffect
(()
=>
{
...
...
@@ -1230,7 +1240,8 @@ const AddModal = props => {
value
==
'图片'
||
value
==
'可预览图片'
||
value
==
'录音'
||
value
==
'视频'
value
==
'视频'
||
value
==
'关联表单'
)
{
form
.
setFieldsValue
({
RowSpan
:
6
});
}
else
{
...
...
@@ -2319,6 +2330,8 @@ const AddModal = props => {
}
}
// formAdd.validateFields().then(validate1 => {
// if(validate1){
form
.
validateFields
().
then
(
validate
=>
{
if
(
validate
)
{
setLoading
(
true
);
...
...
@@ -2458,7 +2471,18 @@ const AddModal = props => {
}
console
.
log
(
lii
);
lii
.
push
(
arrlist
);
aalist
.
映射字段
=
lii
;
let
lia
=
[];
lii
.
length
>
0
&&
lii
.
map
(
i
=>
{
if
(
i
){
if
(
i
.
key
&&
i
.
value
){
lia
.
push
(
i
)
}
}
})
console
.
log
(
lia
)
aalist
.
映射字段
=
lia
;
console
.
log
(
aalist
);
data
[
0
].
Config
=
JSON
.
stringify
(
aalist
);
break
;
case
'选择器'
:
...
...
@@ -2607,6 +2631,11 @@ const AddModal = props => {
}
}
});
// }
// });
};
const
onChange2
=
e
=>
{
...
...
@@ -3296,19 +3325,20 @@ const AddModal = props => {
<
Col
span=
{
11
}
>
<
Item
name=
"workOrder"
rules=
{
[{
required
:
true
,
message
:
'请输入
映射
名'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请输入
字段
名'
}]
}
style=
{
{
marginBottom
:
0
}
}
>
<
Input
placeholder=
"请输入
映射
名"
/>
<
Input
placeholder=
"请输入
字段
名"
/>
</
Item
>
</
Col
>
<
Col
span=
{
2
}
style=
{
{
paddingTop
:
'3px'
}
}
><
SwapOutlined
style=
{
{
marginLeft
:
'14px'
}
}
/></
Col
>
<
Col
span=
{
11
}
>
<
Item
name=
"eventOrder"
rules=
{
[{
required
:
true
,
message
:
'请输入映射
值
'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请输入映射
字段名
'
}]
}
style=
{
{
marginBottom
:
0
}
}
>
<
Input
placeholder=
"请输入映射
值"
style=
{
{
marginLeft
:
'41px'
,
width
:
'189px'
}
}
/>
<
Input
placeholder=
"请输入映射
字段名"
style=
{
{
width
:
'189px'
}
}
/>
</
Item
>
</
Col
>
</
Row
>
...
...
@@ -3334,32 +3364,37 @@ const AddModal = props => {
fieldKey=
{
[
fieldKey
,
'key'
]
}
validateTrigger=
{
[
'onChange'
,
'onBlur'
]
}
rules=
{
[
{
required
:
true
,
message
:
'请填写映射名'
},
//
{
// validator: () =>
{
// // 验证参数名不能重复
// const allKey = form
// .getFieldsValue()
// .parmars.map(item => (item ? item.key : ''));
// const repeatKey = new Set(allKey);
// if (repeatKey.size !== allKey.length)
{
// return Promise.reject(new Error('参数名重复'));
//
}
// return Promise.resolve();
//
},
//
},
{
required
:
true
,
message
:
'请填写字段名'
},
{
validator
:
()
=>
{
let
aa
=
formAdd
.
getFieldsValue
().
parmars
let
data
=
[];
aa
.
length
>
0
&&
aa
.
map
(
i
=>
{
if
(
i
){
data
.
push
(
i
.
key
)
}
})
let
list
=
new
Set
(
data
);
let
ee
=
form
.
getFieldsValue
().
workOrder
;
if
(
list
.
size
!==
data
.
length
||
data
.
indexOf
(
ee
)
!=
-
1
)
{
return
Promise
.
reject
(
new
Error
(
'字段名重复'
));
}
return
Promise
.
resolve
();
},
},
]
}
>
<
Input
placeholder=
"请填写
映射
名"
style=
{
{
width
:
'227px'
,
marginLeft
:
'98px'
}
}
/>
<
Input
placeholder=
"请填写
字段
名"
style=
{
{
width
:
'227px'
,
marginLeft
:
'98px'
}
}
/>
</
Form
.
Item
>
<
SwapOutlined
style=
{
{
marginLeft
:
'6px'
}
}
/>
<
Form
.
Item
{
...
restField
}
style=
{
{
marginBottom
:
'5px'
}
}
name=
{
[
name
,
'value'
]
}
fieldKey=
{
[
fieldKey
,
'value'
]
}
rules=
{
[{
required
:
true
,
message
:
'请填写映射
值
'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请填写映射
字段名
'
}]
}
>
<
Input
placeholder=
"请填写映射
值"
style=
{
{
width
:
'188px'
,
marginLeft
:
'32
px'
}
}
/>
<
Input
placeholder=
"请填写映射
字段名"
style=
{
{
width
:
'188px'
,
marginLeft
:
'6
px'
}
}
/>
</
Form
.
Item
>
<
MinusCircleOutlined
onClick=
{
()
=>
remove
(
name
)
}
...
...
@@ -3369,7 +3404,7 @@ const AddModal = props => {
))
}
<
Form
.
Item
>
<
Button
style=
{
{
width
:
'4
94
px'
,
marginLeft
:
'100px'
}
}
style=
{
{
width
:
'4
56
px'
,
marginLeft
:
'100px'
}
}
type=
"dashed"
onClick=
{
()
=>
add
()
}
block
...
...
@@ -3397,7 +3432,7 @@ const AddModal = props => {
labelCol=
{
{
span
:
4
}
}
rules=
{
[{
required
:
true
,
message
:
'请输入控制规则'
}]
}
>
<
TextArea
placeholder=
"示例:
部门=
'研发一部'
{表名
.
是否缴费}
=
‘是’
and
{表名
.
缴费金额}
>
1000" /
>
<
TextArea
placeholder=
"示例:
{
表名
.
是否缴费
}
=
‘是’
and
{表名
.
缴费金额}
>
1000" /
>
</
Item
>
</>
);
...
...
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