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
9816e413
Commit
9816e413
authored
Oct 31, 2022
by
邓超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改规则点击新增、线条根据节点颜色修改
parent
b611058d
Pipeline
#62817
passed with stages
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
11 deletions
+65
-11
FlowChart.jsx
...r/workOrder/workflowEdit/workFlowComponents/FlowChart.jsx
+38
-2
NodeModal.jsx
...Edit/workFlowComponents/flowChartComponents/NodeModal.jsx
+5
-5
RuleConfig.jsx
...ts/flowChartComponents/nodeModalComponents/RuleConfig.jsx
+8
-4
RuleConfig.less
...s/flowChartComponents/nodeModalComponents/RuleConfig.less
+14
-0
No files found.
src/pages/bsmanager/workOrder/workflowEdit/workFlowComponents/FlowChart.jsx
View file @
9816e413
...
...
@@ -194,6 +194,8 @@ const FlowChart = props => {
case
'20'
:
return
gatewayExclusive
;
case
'21'
:
return
gatewayInclude
;
case
'22'
:
return
gatewayConfluence
;
default
:
return
null
;
...
...
@@ -213,6 +215,8 @@ const FlowChart = props => {
return
52
;
case
'21'
:
return
52
;
case
'22'
:
return
52
;
default
:
return
null
;
}
...
...
@@ -232,6 +236,8 @@ const FlowChart = props => {
return
52
;
case
'21'
:
return
52
;
case
'22'
:
return
52
;
default
:
return
null
;
}
...
...
@@ -264,6 +270,8 @@ const FlowChart = props => {
return
null
;
case
'21'
:
return
null
;
case
'22'
:
return
null
;
default
:
return
null
;
...
...
@@ -316,11 +324,39 @@ const FlowChart = props => {
new
go
.
Binding
(
'points'
).
makeTwoWay
(),
objGo
(
go
.
Shape
,
// 链接路径形状
{
isPanelMain
:
true
,
strokeWidth
:
2
,
stroke
:
'#1685FF'
},
{
isPanelMain
:
true
,
strokeWidth
:
2
,
},
new
go
.
Binding
(
'stroke'
,
'from'
,
v
=>
{
console
.
log
(
diagram
.
model
.
findNodeDataForKey
(
v
));
const
msg
=
diagram
.
model
.
findNodeDataForKey
(
v
);
if
(
msg
.
NodeType
===
'20'
||
msg
.
NodeType
===
'22'
)
{
return
'red'
;
}
return
'#1685FF'
;
}),
),
objGo
(
go
.
Shape
,
// 箭头
{
toArrow
:
'Standard'
,
stroke
:
'#1685FF'
,
fill
:
'#1685FF'
},
{
toArrow
:
'Standard'
},
new
go
.
Binding
(
'stroke'
,
'from'
,
v
=>
{
console
.
log
(
diagram
.
model
.
findNodeDataForKey
(
v
));
const
msg
=
diagram
.
model
.
findNodeDataForKey
(
v
);
if
(
msg
.
NodeType
===
'20'
||
msg
.
NodeType
===
'22'
)
{
return
'red'
;
}
return
'#1685FF'
;
}),
new
go
.
Binding
(
'fill'
,
'from'
,
v
=>
{
console
.
log
(
diagram
.
model
.
findNodeDataForKey
(
v
));
const
msg
=
diagram
.
model
.
findNodeDataForKey
(
v
);
if
(
msg
.
NodeType
===
'20'
||
msg
.
NodeType
===
'22'
)
{
return
'red'
;
}
return
'#1685FF'
;
}),
),
// {
// // 处理双击
...
...
src/pages/bsmanager/workOrder/workflowEdit/workFlowComponents/flowChartComponents/NodeModal.jsx
View file @
9816e413
...
...
@@ -24,7 +24,6 @@ import Undertaker from './nodeModalComponents/Undertaker';
import
RuleConfig
from
'./nodeModalComponents/RuleConfig'
;
import
styles
from
'./NodeModal.less'
;
import
{
GetFormDataSource
}
from
'@/services/workflow/workflow'
;
import
{
log
}
from
'@antv/g2plot/lib/utils'
;
const
{
Option
}
=
Select
;
let
chnNumChar
=
[
'零'
,
'一'
,
'二'
,
'三'
,
'四'
,
'五'
,
'六'
,
'七'
,
'八'
,
'九'
];
...
...
@@ -75,7 +74,7 @@ const NodeModal = props => {
// 获取网关连接的节点
if
(
editMsg
.
NodeType
===
'21'
||
editMsg
.
NodeType
===
'20'
)
{
getNextLinkNodes
(
editMsg
.
key
);
getPreviousLinkNodes
(
editMsg
.
key
);
//
getPreviousLinkNodes(editMsg.key);
setRuleList
(
editMsg
.
RuleList
);
// 获取表数据
GetFormDataSource
({
flowID
}).
then
(
res
=>
{
...
...
@@ -88,9 +87,10 @@ const NodeModal = props => {
TableName
:
item
.
TableName
,
});
}
if
(
previousLinkNodes
.
current
.
some
(
ele
=>
ele
.
NodeName
===
item
.
NodeName
))
{
list
.
add
(
item
.
TableName
);
}
// if (previousLinkNodes.current.some(ele => ele.NodeName === item.NodeName)) {
// list.add(item.TableName);
// }
});
talbeList
.
current
=
[...
list
];
setFlag
(
flag
+
1
);
...
...
@@ -311,7 +311,7 @@ const NodeModal = props => {
'更新时间'
,
'上报时间'
,
],
TableName
:
'
默认
字段'
,
TableName
:
'
内部
字段'
,
},
];
console
.
log
(
listfleld
,
allFieldList
.
current
,
'listfleld1111'
);
...
...
src/pages/bsmanager/workOrder/workflowEdit/workFlowComponents/flowChartComponents/nodeModalComponents/RuleConfig.jsx
View file @
9816e413
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'react'
;
import
{
Modal
,
Input
,
Form
}
from
'antd'
;
import
styles
from
'./RuleConfig.less'
;
import
Tree
from
'@/components/ExpendableTree'
;
...
...
@@ -8,7 +8,7 @@ const RuleConfig = props => {
const
[
rule
,
setRule
]
=
useState
([]);
const
[
expandedKey
,
setExpandedKey
]
=
useState
(
''
);
// 默认展开项
const
[
currentSelectId
,
setCurrentSelectId
]
=
useState
(
''
);
// 选中得节点
const
ruleText
=
useRef
();
const
[
form
]
=
Form
.
useForm
();
useEffect
(()
=>
{
if
(
visible
)
{
...
...
@@ -27,18 +27,21 @@ const RuleConfig = props => {
};
// 处理树数据
const
mapTree
=
(
val
,
index
)
=>
{
console
.
log
(
val
,
'val'
);
return
{
title
:
val
.
TableName
,
key
:
val
.
TableName
,
children
:
val
.
TableFieldNames
.
map
(
item
=>
({
title
:
item
,
key
:
`
${
val
.
TableName
}
&
${
item
}
`
,
key
:
`
${
val
.
TableName
}
.
${
item
}
`
,
})),
};
};
const
onSelect
=
(
prop
,
treeNode
)
=>
{
console
.
log
(
prop
,
treeNode
);
if
(
!
treeNode
.
node
.
children
)
{
setRule
(
`
${
rule
}
{
${
treeNode
.
node
.
key
}
} `
);
ruleText
.
current
.
focus
();
}
setCurrentSelectId
(
prop
[
0
]);
};
return
(
...
...
@@ -71,6 +74,7 @@ const RuleConfig = props => {
autoSize=
{
{
minRows
:
19
,
maxRows
:
19
}
}
value=
{
rule
}
rows=
{
4
}
ref=
{
ruleText
}
onChange=
{
e
=>
setRule
(
e
.
target
.
value
)
}
/>
</
div
>
...
...
src/pages/bsmanager/workOrder/workflowEdit/workFlowComponents/flowChartComponents/nodeModalComponents/RuleConfig.less
View file @
9816e413
.configContent {
height: 600px;
display: flex;
.leftTree {
width: 250px;
height: 100%;
margin-right: 10px;
overflow-y: scroll;
}
.rightContent {
.textAreaBox {
// height: 400px;
// overflow-y: scroll;
.textArea {
min-height: 400px;
border: 1px solid #ccc;
}
}
}
}
\ No newline at end of file
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