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
be1adf3e
Commit
be1adf3e
authored
Nov 02, 2022
by
邓超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改工作流编辑器选中样式
parent
fd10e934
Pipeline
#63012
passed with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
16 deletions
+54
-16
FlowChart.jsx
...r/workOrder/workflowEdit/workFlowComponents/FlowChart.jsx
+38
-11
NodeModal.jsx
...Edit/workFlowComponents/flowChartComponents/NodeModal.jsx
+6
-3
NodeModal.less
...dit/workFlowComponents/flowChartComponents/NodeModal.less
+7
-1
workflow.less
src/pages/bsmanager/workOrder/workflowEdit/workflow.less
+3
-1
No files found.
src/pages/bsmanager/workOrder/workflowEdit/workFlowComponents/FlowChart.jsx
View file @
be1adf3e
...
...
@@ -49,6 +49,7 @@ const FlowChart = props => {
const
[
showLeaveTip
,
setShowLeaveTip
]
=
useState
(
false
);
// 离开路由是否又提醒
const
[
newSerialNo
,
setNewSerialNo
]
=
useState
(
0
);
const
[
nodeLength
,
setNodeLength
]
=
useState
();
const
[
buttonLoading
,
setButtonLoading
]
=
useState
();
// 发布按钮保存loading
const
objGo
=
go
.
GraphObject
.
make
;
// 监听删除,给删除数组里添加删除id
useEffect
(()
=>
{
...
...
@@ -312,10 +313,10 @@ const FlowChart = props => {
makePort
(
'B'
,
go
.
Spot
.
Bottom
),
{
linkValidation
(
fromnode
,
fromport
,
tonode
,
toport
,
thisLink
)
{
console
.
log
(
fromnode
.
data
,
tonode
.
data
,
'aaaaaa'
);
if
(
fromnode
.
data
.
NodeType
===
'20'
&&
tonode
.
data
.
NodeType
===
'20'
)
{
return
false
;
}
//
console.log(fromnode.data, tonode.data, 'aaaaaa');
//
if (fromnode.data.NodeType === '20' && tonode.data.NodeType === '20') {
//
return false;
//
}
return
true
;
},
// 处理鼠标进入/离开事件以显示/隐藏端口
...
...
@@ -340,11 +341,11 @@ const FlowChart = props => {
curve
:
go
.
Link
.
JumpOver
,
corner
:
5
,
toShortLength
:
4
,
//
selectionAdornmentTemplate: objGo(
//
go.Adornment,
// objGo(go.Shape, { isPanelMain: true, stroke: 'red
', strokeWidth: 2 }), // 修改线颜色和大小
// objGo(go.Shape, { toArrow: 'Standard', fill: 'red', stroke: null
}), // 修改线箭头的颜色和大小
//
),
selectionAdornmentTemplate
:
objGo
(
go
.
Adornment
,
objGo
(
go
.
Shape
,
{
isPanelMain
:
true
,
stroke
:
'#faad14
'
,
strokeWidth
:
2
}),
// 修改线颜色和大小
objGo
(
go
.
Shape
,
{
toArrow
:
'Standard'
,
fill
:
'#faad14'
,
stroke
:
'#faad14'
}),
// 修改线箭头的颜色和大小
),
},
new
go
.
Binding
(
'points'
).
makeTwoWay
(),
objGo
(
...
...
@@ -454,7 +455,29 @@ const FlowChart = props => {
newKey
=
1
;
newNum
=
1
;
}
let
NodeName
=
''
;
switch
(
type
)
{
case
'1'
:
NodeName
=
`开始节点
${
newNum
}
`
;
break
;
case
'0'
:
NodeName
=
`普通节点
${
newNum
}
`
;
break
;
case
'2'
:
NodeName
=
`结束节点
${
newNum
}
`
;
break
;
case
'20'
:
NodeName
=
`条件网关
${
newNum
}
`
;
break
;
case
'21'
:
NodeName
=
`汇合网关
${
newNum
}
`
;
break
;
case
'22'
:
NodeName
=
`并行网关
${
newNum
}
`
;
break
;
default
:
break
;
}
setNodeLength
(
list
.
length
);
console
.
log
(
newNum
,
newKey
);
setNewSerialNo
(
newNum
);
...
...
@@ -465,6 +488,7 @@ const FlowChart = props => {
NodeId
:
newKey
,
NodeType
:
type
,
SerialNo
:
newNum
,
NodeName
,
aheadHandle
:
1
,
NodeHandling
:
1
,
RuleList
:
[],
...
...
@@ -613,6 +637,7 @@ const FlowChart = props => {
// 保存流程
const
saveFlow
=
()
=>
{
setButtonLoading
(
true
);
let
diagramObj
=
JSON
.
parse
(
diagram
.
model
.
toJson
());
// let list = isRepeat(diagramObj.nodeDataArray, 'SerialNo');
...
...
@@ -632,6 +657,7 @@ const FlowChart = props => {
Nodes
:
diagramObj
.
nodeDataArray
,
})
.
then
(
res
=>
{
setButtonLoading
(
false
);
if
(
res
.
code
===
0
)
{
setDeleteNodes
([]);
setDeleteLines
([]);
...
...
@@ -653,6 +679,7 @@ const FlowChart = props => {
}
})
.
catch
(()
=>
{
setButtonLoading
(
false
);
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
...
...
@@ -677,7 +704,7 @@ const FlowChart = props => {
))
}
</
div
>
<
div
className=
{
styles
.
buttonList
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
saveFlow
()
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
saveFlow
()
}
loading=
{
buttonLoading
}
>
发布
</
Button
>
</
div
>
...
...
src/pages/bsmanager/workOrder/workflowEdit/workFlowComponents/flowChartComponents/NodeModal.jsx
View file @
be1adf3e
...
...
@@ -196,12 +196,13 @@ const NodeModal = props => {
// 获取表单回显
const
getFormData
=
()
=>
{
const
{
NodeName
,
NodeType
,
SerialNo
,
aheadHandle
,
NodeHandling
}
=
editMsg
;
console
.
log
(
NodeHandling
,
'NodeHandling'
);
form
.
setFieldsValue
({
NodeName
,
NodeType
,
SerialNo
,
aheadHandle
:
aheadHandle
||
1
,
NodeHandling
:
NodeHandling
||
1
,
aheadHandle
:
aheadHandle
||
aheadHandle
===
0
?
aheadHandle
:
1
,
NodeHandling
:
NodeHandling
||
NodeHandling
===
0
?
NodeHandling
:
1
,
});
setNodeMsg
(
editMsg
);
setFlag
(
flag
+
1
);
...
...
@@ -209,6 +210,7 @@ const NodeModal = props => {
// 提交表单
const
onFinish
=
()
=>
{
form
.
validateFields
().
then
(
validate
=>
{
console
.
log
(
validate
,
'validate'
);
if
(
validate
)
{
validate
.
SerialNo
=
Number
(
validate
.
SerialNo
);
let
nodeDetail
=
JSON
.
stringify
({
...
...
@@ -651,7 +653,8 @@ const NodeModal = props => {
<
div
className=
{
styles
.
buttonBox
}
onClick=
{
()
=>
editRule
(
item
,
index
)
}
>
<
div
className=
{
styles
.
setButton
}
>
<
Tooltip
title=
{
item
.
RuleContent
}
>
<
span
>
{
item
.
RuleContent
?
'已设置条件'
:
'设置条件'
}
</
span
>
{
/* <span>{item.RuleContent ? '已设置条件' : '设置条件'} </span> */
}
<
span
>
{
item
.
RuleContent
}
</
span
>
</
Tooltip
>
</
div
>
<
div
className=
{
styles
.
addIcon
}
>
...
...
src/pages/bsmanager/workOrder/workflowEdit/workFlowComponents/flowChartComponents/NodeModal.less
View file @
be1adf3e
...
...
@@ -28,6 +28,7 @@
.ruleBox {
margin-top: 5px;
margin-bottom: 15px;
.ruleTitle {
display: flex;
justify-content: space-between;
...
...
@@ -73,7 +74,12 @@
height: 100%;
line-height: 34px;
border: 2px solid #6A98FA;
text-align: center;
text-align: left;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding: 0 10px;
}
.addIcon {
...
...
src/pages/bsmanager/workOrder/workflowEdit/workflow.less
View file @
be1adf3e
...
...
@@ -111,6 +111,7 @@
justify-content: space-between;
align-items: center;
padding: 0 10px;
.nodeList {
display: flex;
...
...
@@ -119,7 +120,8 @@
align-items: center;
justify-content: center;
height: 40px;
width: 145px;
padding: 0 10px;
border-radius: 10px;
background-color: #D9E0FF;
margin-right: 10px;
...
...
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