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
f45d17ab
Commit
f45d17ab
authored
Nov 07, 2022
by
邓超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改规则节点后的线显示规则名称
parent
9270de0d
Pipeline
#63265
passed with stages
Changes
3
Pipelines
1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
9 deletions
+55
-9
index.jsx
src/components/RuleConfig/index.jsx
+2
-2
FlowChart.jsx
...r/workOrder/workflowEdit/workFlowComponents/FlowChart.jsx
+0
-0
NodeModal.jsx
...Edit/workFlowComponents/flowChartComponents/NodeModal.jsx
+53
-7
No files found.
src/components/RuleConfig/index.jsx
View file @
f45d17ab
...
...
@@ -2,7 +2,7 @@
* @Author: dengchao 754083046@qq.com
* @Date: 2022-11-02 14:37:53
* @LastEditors: dengchao 754083046@qq.com
* @LastEditTime: 2022-11-0
2 14:40:57
* @LastEditTime: 2022-11-0
7 11:48:08
* @FilePath: \maintenance\src\components\RuleConfig\index.jsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -53,7 +53,7 @@ const RuleConfig = props => {
return
(
<
div
>
<
Modal
title=
"节点
扭
转规则配置"
title=
"节点
流
转规则配置"
visible=
{
visible
}
onOk=
{
onSave
}
width=
"860px"
...
...
src/pages/bsmanager/workOrder/workflowEdit/workFlowComponents/FlowChart.jsx
View file @
f45d17ab
This diff is collapsed.
Click to expand it.
src/pages/bsmanager/workOrder/workflowEdit/workFlowComponents/flowChartComponents/NodeModal.jsx
View file @
f45d17ab
...
...
@@ -12,6 +12,7 @@ import {
Popconfirm
,
message
,
}
from
'antd'
;
import
lodash
from
'lodash'
;
import
{
DeleteOutlined
,
EditTwoTone
,
...
...
@@ -164,7 +165,7 @@ const NodeModal = props => {
let
linkNode
=
flowData
.
nodeDataArray
.
find
(
ele
=>
ele
.
key
===
item
.
to
);
if
(
linkNode
.
NodeType
===
'20'
)
{
getNextLinkNodes
(
linkNode
.
key
);
}
else
{
}
else
if
(
!
nextlinkNodes
.
current
.
some
(
ele
=>
ele
.
key
===
linkNode
.
key
))
{
nextlinkNodes
.
current
.
push
(
linkNode
);
}
}
...
...
@@ -209,6 +210,27 @@ const NodeModal = props => {
};
// 提交表单
const
onFinish
=
()
=>
{
// 规则填写校验
for
(
let
i
=
0
;
i
<
RuleList
.
length
;
i
++
)
{
if
(
!
RuleList
[
i
].
RuleName
)
{
message
.
error
(
'请填写规则名称'
);
return
;
}
if
(
!
RuleList
[
i
].
NextNodeId
&&
RuleList
[
i
].
NextNodeId
!==
0
)
{
message
.
error
(
'请选择需要流转的节点'
);
return
;
}
if
(
!
RuleList
[
i
].
RuleContent
)
{
message
.
error
(
'请填写规则'
);
return
;
}
}
const
newListLength
=
new
Set
(
RuleList
.
map
(
item
=>
item
.
NextNodeId
)).
size
;
if
(
RuleList
.
length
>
newListLength
)
{
message
.
error
(
'规则流转到的节点不能重复'
);
return
;
}
form
.
validateFields
().
then
(
validate
=>
{
console
.
log
(
validate
,
'validate'
);
if
(
validate
)
{
...
...
@@ -263,8 +285,16 @@ const NodeModal = props => {
// 添加规则
const
addRule
=
()
=>
{
console
.
log
(
fieldList
,
'fieldList'
);
if
(
nextlinkNodes
.
current
.
length
===
0
)
{
message
.
error
(
'请连接需要添加规则的节点'
);
return
;
}
if
(
RuleList
.
length
===
nextlinkNodes
.
current
.
length
)
{
message
.
error
(
'请连接需要添加规则的节点'
);
return
;
}
let
list
=
JSON
.
parse
(
JSON
.
stringify
(
RuleList
));
list
.
push
({
RuleContent
:
''
,
NextNode
Name
:
''
,
TableNames
:
''
});
list
.
push
({
RuleContent
:
''
,
NextNode
Id
:
''
,
TableNames
:
''
,
RuleName
:
''
});
setRuleList
(
list
);
};
// 删除规则
...
...
@@ -284,10 +314,13 @@ const NodeModal = props => {
};
// 网关表单配置监听
const
formChage
=
(
e
,
index
,
field
)
=>
{
console
.
log
(
e
,
'fasdfga'
);
let
list
=
JSON
.
parse
(
JSON
.
stringify
(
RuleList
));
let
list
=
lodash
.
cloneDeep
(
RuleList
);
if
(
field
===
'TableNames'
)
{
list
[
index
][
field
]
=
e
.
join
(
','
);
}
if
(
field
===
'RuleName'
)
{
e
.
persist
();
list
[
index
][
field
]
=
e
.
target
.
value
;
}
else
{
list
[
index
][
field
]
=
e
;
}
...
...
@@ -628,18 +661,31 @@ const NodeModal = props => {
<
div
className=
{
styles
.
textContet
}
>
规则
{
NumberToChinese
(
index
+
1
)
}
</
div
>
<
DeleteOutlined
style=
{
{
cursor
:
'pointer'
}
}
onClick=
{
()
=>
deleRule
(
index
)
}
/>
</
div
>
<
div
className=
{
styles
.
formBox
}
>
<
div
className=
{
styles
.
label
}
>
规则名称:
</
div
>
<
div
className=
{
styles
.
item
}
>
<
Input
style=
{
{
width
:
'100%'
}
}
value=
{
item
.
RuleName
}
placeholder=
"请输入规则名称"
onChange=
{
e
=>
{
formChage
(
e
,
index
,
'RuleName'
);
}
}
/>
</
div
>
</
div
>
<
div
className=
{
styles
.
formBox
}
>
<
div
className=
{
styles
.
label
}
>
设置规则条件,需要流转到节点:
</
div
>
<
div
className=
{
styles
.
item
}
>
<
Select
style=
{
{
width
:
'100%'
}
}
value=
{
item
.
NextNode
Name
}
value=
{
item
.
NextNode
Id
}
onChange=
{
e
=>
{
formChage
(
e
,
index
,
'NextNode
Name
'
);
formChage
(
e
,
index
,
'NextNode
Id
'
);
}
}
>
{
nextlinkNodes
.
current
.
map
(
ele
=>
(
<
Option
value=
{
ele
.
Node
Name
}
key=
{
ele
.
NodeName
}
>
<
Option
value=
{
ele
.
Node
Id
}
key=
{
ele
.
NodeName
}
>
{
ele
.
NodeName
}
</
Option
>
))
}
...
...
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