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
5293754d
Commit
5293754d
authored
Apr 01, 2025
by
彭俊龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:自动化工单测试
parent
9863752b
Pipeline
#96628
failed with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
251 additions
and
198 deletions
+251
-198
index.js
...manager/workOrder/autoCase/components/CaseModify/index.js
+230
-198
index.js
src/pages/bsmanager/workOrder/autoCase/index.js
+15
-0
flow.js
src/services/flow/flow.js
+6
-0
No files found.
src/pages/bsmanager/workOrder/autoCase/components/CaseModify/index.js
View file @
5293754d
...
...
@@ -20,7 +20,11 @@ import moment from 'moment/moment';
import
RuleConfig
from
'@/components/RuleConfig'
;
import
PeopleSelector
from
'@/components/PeopleSelector'
;
import
{
WFGetAllFlow
,
GetFormDataSource
,
GetFlowNode
}
from
'@/services/workflow/workflow'
;
import
{
GetScheduledConfigFlowNode
,
GetConditionConfigFlowNode
}
from
'@/services/flow/flow'
;
import
{
GetScheduledConfigFlowNode
,
GetConditionConfigFlowNode
,
GetBizMetaData
,
}
from
'@/services/flow/flow'
;
import
{
GetSubEventFlows
}
from
'@/services/workflow/workflow'
;
import
imgEnd
from
'@/assets/images/workFlow/nodeEnd.png'
;
import
gatewayConfluence
from
'@/assets/images/workFlow/gatewayParallel.png'
;
...
...
@@ -28,16 +32,18 @@ import gatewayExclusive from '@/assets/images/workFlow/gatewayCondition.png';
import
gatewayInclude
from
'@/assets/images/workFlow/gatewayJoin.png'
;
import
imgGeneral
from
'@/assets/images/workFlow/nodeGeneral.png'
;
import
imgStart
from
'@/assets/images/workFlow/nodeStart.png'
;
import
styles
from
'./index.less'
import
styles
from
'./index.less'
;
import
*
as
go
from
'gojs'
;
import
{
isObject
}
from
'lodash'
;
import
{
FormRender
}
from
'panda-xform'
;
const
days
=
moment
().
daysInMonth
();
const
allDays
=
[...
Array
.
from
({
length
:
days
+
1
},
(
_
,
i
)
=>
i
+
1
)];
const
weeks
=
[
'星期一'
,
'星期二'
,
'星期三'
,
'星期四'
,
'星期五'
,
'星期六'
,
'星期天'
];
const
weeks1
=
[
'第一周'
,
'第二周'
,
'第三周'
,
'第四周'
,
'最后一周'
];
let
myDiagram
=
null
;
const
CaseModify
=
props
=>
{
let
_$
=
go
.
GraphObject
.
make
;
const
{
visible
,
mode
,
onClose
,
onOk
,
flowConfigDetail
}
=
props
;
let
_$
=
go
.
GraphObject
.
make
;
const
{
visible
,
mode
,
onClose
,
onOk
,
flowConfigDetail
,
flowCenterData
}
=
props
;
const
[
planType
,
setPlanType
]
=
useState
(
'ByLoop'
);
// ByLoop:循环 ByDay:每天 ByWeek:每周 ByMonth:每月
const
[
timeType
,
setTimeType
]
=
useState
(
''
);
const
[
showTtype
,
setShowTtype
]
=
useState
(
'time'
);
...
...
@@ -45,6 +51,7 @@ const CaseModify = props => {
const
[
showPersonSelect
,
setShowPersonSelect
]
=
useState
(
false
);
const
[
openTeditor
,
setOpenTeditor
]
=
useState
(
false
);
const
[
loadding
,
setloadding
]
=
useState
(
false
);
const
[
schemaValues
,
setSchemaValues
]
=
useState
({
values
:
[],
formJson
:
{}
});
const
[
configInfo
,
setConfigInfo
]
=
useState
({
schemeName
:
''
,
schemeNameErrMsg
:
''
,
//验证必填提示词
...
...
@@ -82,7 +89,11 @@ const CaseModify = props => {
const
[
flowList
,
setFlowList
]
=
useState
([]);
const
[
nodeNams
,
setNodeNames
]
=
useState
([]);
const
[
isPreview
,
setIsPreView
]
=
useState
(
false
);
const
[
formVisible
,
setFormVisible
]
=
useState
(
false
);
const
[
showForm
,
setShowForm
]
=
useState
(
false
);
const
[
errorMsg
,
setErrorMsg
]
=
useState
(
''
);
//定时触发下的参数校验
let
formRef
=
useRef
(
null
);
let
formJsonRef
=
useRef
({})
let
weekType
=
useRef
(
''
);
//每周 按周 第几周 周几执行
let
timeUnit
=
useRef
(
'hour'
);
let
ruleContent
=
useRef
(
''
);
...
...
@@ -90,9 +101,7 @@ const CaseModify = props => {
let
roleIdsRef
=
useRef
([]);
let
ruleField
=
useRef
([]);
let
flowData
=
useRef
([]);
let
imgUrl
=
useRef
(
''
);
let
flowTree
=
useRef
([])
let
flowDataList
=
useRef
({})
let
flowDataList
=
useRef
({});
let
postData
=
useRef
({
id
:
null
,
schemeName
:
''
,
...
...
@@ -110,6 +119,7 @@ const CaseModify = props => {
scheduledConfig
:
{
userIds
:
[],
//用户ID
roleIds
:
[],
//角色ID
Values
:
[],
//工单移交模板
agentConfig
:
''
,
},
//定时触发
});
...
...
@@ -142,57 +152,6 @@ const CaseModify = props => {
}
},
[
visible
]);
const
init
=
()
=>
{
postData
.
current
=
{
id
:
null
,
schemeName
:
''
,
triggerMethod
:
'条件触发'
,
flowId
:
null
,
flowName
:
''
,
eventId
:
null
,
eventName
:
''
,
activityId
:
null
,
activityName
:
''
,
isEnabled
:
1
,
conditionConfig
:
{
ruleList
:
[],
},
//条件触发
scheduledConfig
:
{
userIds
:
[],
//用户ID
roleIds
:
[],
//角色ID
agentConfig
:
''
,
},
//定时触发
};
setRuleInfos
([
{
id
:
1
,
userIds
:
[],
userIdsErrMsg
:
''
,
//验证必填提示词
roleIds
:
[],
tableNames
:
''
,
ruleContent
:
''
,
ruleContentErrMsg
:
''
,
//验证必填提示词
ruleName
:
''
,
ruleNameErrMsg
:
''
,
//验证必填提示词
},
]);
setConfigInfo
({
schemeName
:
''
,
schemeNameErrMsg
:
''
,
//验证必填提示词
triggerType
:
'条件触发'
,
flowId
:
''
,
flowIdErrMsg
:
''
,
//验证必填提示词
activityId
:
''
,
activityIdErrMsg
:
''
,
//验证必填提示词
userIds
:
[],
//定时触发使用
roleIds
:
[],
//定时触发使用
});
setNodeNames
([]);
ruleField
.
current
=
[]
tableName
.
current
=
null
ruleContent
.
current
=
''
};
const
dealPostData
=
async
detail
=>
{
const
{
ID
,
...
...
@@ -223,6 +182,8 @@ const CaseModify = props => {
{
let
res
;
if
(
TriggerMethod
===
'定时触发'
)
{
setShowForm
(
true
);
getBizMetaData
(
detail
);
res
=
await
GetConditionConfigFlowNode
({
flowId
:
FlowId
});
}
else
{
res
=
await
GetScheduledConfigFlowNode
({
flowId
:
FlowId
});
...
...
@@ -250,24 +211,28 @@ const CaseModify = props => {
return
;
}
}
const
{
UserIds
,
AgentConfig
,
RoleIds
}
=
ScheduledConfig
let
userIds
=
[]
let
roleIds
=
[]
if
(
UserIds
.
length
>
0
){
userIds
=
UserIds
&&
UserIds
.
map
(
v
=>
{
return
{
id
:
v
.
ID
,
name
:
v
.
Name
}
})
const
{
UserIds
,
AgentConfig
,
RoleIds
}
=
ScheduledConfig
;
let
userIds
=
[];
let
roleIds
=
[];
if
(
UserIds
.
length
>
0
)
{
userIds
=
UserIds
&&
UserIds
.
map
(
v
=>
{
return
{
id
:
v
.
ID
,
name
:
v
.
Name
,
};
});
}
if
(
RoleIds
.
length
>
0
){
roleIds
=
RoleIds
&&
RoleIds
.
map
(
v
=>
{
return
{
id
:
v
.
ID
,
name
:
v
.
Name
}
})
if
(
RoleIds
.
length
>
0
)
{
roleIds
=
RoleIds
&&
RoleIds
.
map
(
v
=>
{
return
{
id
:
v
.
ID
,
name
:
v
.
Name
,
};
});
}
setConfigInfo
({
...
configInfo
,
...
...
@@ -276,7 +241,7 @@ const CaseModify = props => {
triggerType
:
TriggerMethod
,
schemeName
:
SchemeName
,
roleIds
,
userIds
userIds
,
});
if
(
TriggerMethod
===
'条件触发'
)
{
const
{
code
,
msg
,
data
}
=
await
GetFormDataSource
({
flowId
:
FlowId
});
...
...
@@ -334,7 +299,6 @@ const CaseModify = props => {
setRuleInfos
(
rules
);
}
}
else
{
const
{
LoopMode
,
LoopUnit
,
...
...
@@ -385,20 +349,6 @@ const CaseModify = props => {
}
};
const
toLowerFirstLetterKeysDeep
=
obj
=>
{
if
(
Array
.
isArray
(
obj
))
{
return
obj
.
map
(
toLowerFirstLetterKeysDeep
);
}
else
if
(
obj
!==
null
&&
typeof
obj
===
'object'
)
{
return
Object
.
fromEntries
(
Object
.
entries
(
obj
).
map
(([
key
,
value
])
=>
[
key
.
charAt
(
0
).
toLowerCase
()
+
key
.
slice
(
1
),
toLowerFirstLetterKeysDeep
(
value
),
]),
);
}
return
obj
;
};
const
getEventFlow
=
async
()
=>
{
const
{
code
,
data
,
msg
}
=
await
GetSubEventFlows
();
if
(
code
===
0
)
{
...
...
@@ -411,35 +361,79 @@ const CaseModify = props => {
message
.
error
(
msg
);
}
};
const
getPrewViewImage
=
async
(
flowId
)
=>
{
let
res
=
await
GetFlowNode
({
flowID
:
flowId
});
const
getPrewViewImage
=
async
flowId
=>
{
let
res
=
await
GetFlowNode
({
flowID
:
flowId
});
if
(
res
.
code
===
0
)
{
res
.
data
.
Nodes
.
forEach
(
item
=>
{
item
.
nodeDetail
=
JSON
.
stringify
(
item
);
item
.
key
=
item
.
NodeName
item
.
key
=
item
.
NodeName
;
});
res
.
data
.
Lines
.
forEach
(
item
=>
{
item
.
lineDetail
=
JSON
.
stringify
(
item
);
});
flowDataList
.
current
=
{
...
res
.
data
,
flowName
:
postData
.
current
.
flowName
}
initMap
(
flowDataList
.
current
)
flowDataList
.
current
=
{
...
res
.
data
,
flowName
:
postData
.
current
.
flowName
}
;
initMap
(
flowDataList
.
current
)
;
}
else
{
message
.
error
(
res
.
msg
);
}
setIsPreView
(
true
)
}
setIsPreView
(
true
)
;
}
;
const
getBizMetaData
=
async
detail
=>
{
if
(
!
flowCenterData
.
length
)
return
;
const
{
ID
,
IsEnabled
,
TriggerMethod
,
SchemeName
,
ActivityId
,
ActivityName
,
EventId
,
EventName
,
FlowId
,
FlowName
,
ScheduledConfig
,
ConditionConfig
,
}
=
detail
;
let
paramObj
=
flowCenterData
.
find
(
v
=>
v
.
flowName
===
FlowName
&&
v
.
eventName
===
EventName
);
if
(
paramObj
)
{
paramObj
=
{
...
paramObj
,
userId
:
1
,
};
const
{
code
,
data
,
msg
}
=
await
GetBizMetaData
(
paramObj
);
const
{
formJson
,
values
}
=
data
[
0
];
const
jsonObj
=
JSON
.
parse
(
formJson
)
setSchemaValues
({
values
,
formJson
:
jsonObj
});
console
.
log
(
formData
,
'formDataformData'
)
}
};
const
getFormData
=
(
jsonObj
)
=>
{
let
formData
=
{};
Object
.
keys
(
jsonObj
.
properties
).
forEach
(
v
=>
{
const
obj
=
jsonObj
.
properties
[
v
];
Object
.
keys
(
obj
.
properties
).
forEach
(
x
=>
{
formData
[
x
]
=
obj
.
properties
[
x
];
})
})
return
formData
;
}
//计算循环的下次执行时间
const
handleTimeInfo
=
(
timeUnit
,
num
)
=>
{
if
(
startTime
)
{
setTip
(
moment
(
startTime
).
add
(
num
,
timeUnit
).
format
(
'YYYY-MM-DD HH:mm:ss'
));
setTip
(
moment
(
startTime
)
.
add
(
num
,
timeUnit
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
);
}
};
//计算下次执行时间每月按日
const
getTipByDay
=
(
dayVals
,
timeVals
)
=>
{
if
(
!
timeVals
.
length
||
!
dayVals
.
length
)
return
;
const
now
=
moment
(
startTime
)
const
now
=
moment
(
startTime
)
;
const
times
=
timeVals
.
sort
((
a
,
b
)
=>
a
-
b
);
if
(
dayVals
.
length
==
1
&&
dayVals
[
0
]
===
allDays
[
allDays
.
length
-
1
])
{
return
now
...
...
@@ -925,7 +919,7 @@ const CaseModify = props => {
const
handleSelectRuleType
=
(
e
,
type
)
=>
{
const
{
checked
}
=
e
.
target
;
generatePostData
({
triggerMethod
:
type
});
setShowForm
(
type
===
'定时触发'
)
if
(
type
===
'定时触发'
)
{
generatePostData
({});
if
(
nodeNams
.
length
>
0
)
{
...
...
@@ -985,12 +979,18 @@ const CaseModify = props => {
v
.
id
===
(
id
||
currentRuleId
.
current
)
?
{
...
v
,
userIds
:
person
.
length
>
0
?
person
.
map
(
x
=>
{
return
{
id
:
Number
(
x
.
value
),
name
:
x
.
label
};
})
:
[]
,
userIds
:
person
.
length
>
0
?
person
.
map
(
x
=>
{
return
{
id
:
Number
(
x
.
value
),
name
:
x
.
label
};
})
:
[]
,
userIds
:
person
.
length
>
0
?
person
.
map
(
x
=>
{
return
{
id
:
Number
(
x
.
value
),
name
:
x
.
label
};
})
:
[],
userIds
:
person
.
length
>
0
?
person
.
map
(
x
=>
{
return
{
id
:
Number
(
x
.
value
),
name
:
x
.
label
};
})
:
[],
}
:
v
,
);
...
...
@@ -1044,8 +1044,7 @@ const CaseModify = props => {
let
flowIdErrMsg
=
''
;
let
activityIdErrMsg
=
''
;
let
userIdsErrMsg
=
''
;
let
isOk
=
hasValue
(
schemeName
)
&&
hasValue
(
flowId
)
&&
hasValue
(
activityId
);
let
isOk
=
hasValue
(
schemeName
)
&&
hasValue
(
flowId
)
&&
hasValue
(
activityId
);
if
(
!
schemeName
)
{
schemeNameErrMsg
=
'方案名称必填'
;
...
...
@@ -1064,7 +1063,7 @@ const CaseModify = props => {
}
else
{
activityIdErrMsg
=
''
;
}
console
.
log
(
userIds
,
roleIds
,
'userIds, roleIdsuserIds, roleIds'
);
console
.
log
(
userIds
,
roleIds
,
'userIds, roleIdsuserIds, roleIds'
);
if
(
userIds
.
length
<
1
&&
roleIds
.
length
<
1
)
{
userIdsErrMsg
=
'请选择下一节点办理人'
;
}
else
{
...
...
@@ -1082,7 +1081,10 @@ const CaseModify = props => {
isOk
=
isOk
&&
ruleInfos
.
every
(
v
=>
(
v
.
userIds
.
length
>
0
||
v
.
roleIds
.
length
>
0
)
&&
hasValue
(
v
.
ruleContent
)
&&
hasValue
(
v
.
ruleName
),
v
=>
(
v
.
userIds
.
length
>
0
||
v
.
roleIds
.
length
>
0
)
&&
hasValue
(
v
.
ruleContent
)
&&
hasValue
(
v
.
ruleName
),
);
let
infos
=
ruleInfos
;
for
(
let
i
of
infos
)
{
...
...
@@ -1159,10 +1161,10 @@ const CaseModify = props => {
const
handleOnOk
=
()
=>
{
if
(
!
isValid
())
{
message
.
warn
(
'校验未通过,请检查表单填写信息!'
)
message
.
warn
(
'校验未通过,请检查表单填写信息!'
)
;
return
;
}
setloadding
(
true
)
setloadding
(
true
)
;
if
(
configInfo
.
triggerType
===
'条件触发'
)
{
postData
.
current
.
conditionConfig
=
{
ruleList
:
ruleInfos
,
...
...
@@ -1199,7 +1201,7 @@ const CaseModify = props => {
roleIds
:
configInfo
.
roleIds
,
};
}
const
fn
=
()
=>
setloadding
(
false
)
const
fn
=
()
=>
setloadding
(
false
);
onOk
(
postData
.
current
,
fn
);
};
...
...
@@ -1223,8 +1225,7 @@ const CaseModify = props => {
setShowPersonSelect
(
true
);
};
const
initMap
=
(
data
)
=>
{
const
initMap
=
data
=>
{
setTimeout
(()
=>
{
if
(
myDiagram
)
{
myDiagram
.
div
=
null
;
// 断开现有 Diagram 的 div 绑定
...
...
@@ -1258,9 +1259,7 @@ const CaseModify = props => {
go
.
Node
,
'Auto'
,
// { deletable: false, toolTip: tooltiptemplate },
new
go
.
Binding
(
'location'
,
'points'
,
go
.
Point
.
parse
).
makeTwoWay
(
go
.
Point
.
stringify
,
),
new
go
.
Binding
(
'location'
,
'points'
,
go
.
Point
.
parse
).
makeTwoWay
(
go
.
Point
.
stringify
),
// 节点样式配置
_$
(
go
.
Panel
,
...
...
@@ -1268,7 +1267,7 @@ const CaseModify = props => {
nodeBoxStyle
(
'height'
),
_$
(
go
.
Picture
,
new
go
.
Binding
(
'source'
,
'nodeDetail'
,
(
v
)
=>
{
new
go
.
Binding
(
'source'
,
'nodeDetail'
,
v
=>
{
const
obj
=
JSON
.
parse
(
v
);
console
.
log
(
obj
,
'vvvvvvv'
);
switch
(
obj
.
NodeType
)
{
...
...
@@ -1317,13 +1316,9 @@ const CaseModify = props => {
overflow
:
go
.
TextBlock
.
OverflowEllipsis
,
font
:
'normal 12pt Microsoft YaHei'
,
},
new
go
.
Binding
(
'text'
,
'nodeDetail'
,
(
v
)
=>
{
new
go
.
Binding
(
'text'
,
'nodeDetail'
,
v
=>
{
const
obj
=
JSON
.
parse
(
v
);
if
(
obj
.
NodeType
===
'20'
||
obj
.
NodeType
===
'21'
||
obj
.
NodeType
===
'22'
)
{
if
(
obj
.
NodeType
===
'20'
||
obj
.
NodeType
===
'21'
||
obj
.
NodeType
===
'22'
)
{
return
''
;
}
return
obj
.
NodeName
.
slice
(
0
,
6
);
...
...
@@ -1338,22 +1333,14 @@ const CaseModify = props => {
overflow
:
go
.
TextBlock
.
OverflowEllipsis
,
font
:
'normal 12pt Microsoft YaHei'
,
},
new
go
.
Binding
(
'spacingAbove'
,
'undertakeman'
,
(
v
)
=>
v
?.
length
>
0
?
5
:
0
,
),
new
go
.
Binding
(
'height'
,
'undertakeman'
,
(
v
)
=>
v
?.
length
>
0
?
30
:
0
,
),
new
go
.
Binding
(
'margin'
,
'undertakeman'
,
(
v
)
=>
new
go
.
Binding
(
'spacingAbove'
,
'undertakeman'
,
v
=>
(
v
?.
length
>
0
?
5
:
0
)),
new
go
.
Binding
(
'height'
,
'undertakeman'
,
v
=>
(
v
?.
length
>
0
?
30
:
0
)),
new
go
.
Binding
(
'margin'
,
'undertakeman'
,
v
=>
v
?.
length
>
0
?
new
go
.
Margin
(
10
,
10
,
0
,
10
)
:
0
,
),
new
go
.
Binding
(
'text'
,
'nodeDetail'
,
(
v
)
=>
{
new
go
.
Binding
(
'text'
,
'nodeDetail'
,
v
=>
{
const
obj
=
JSON
.
parse
(
v
);
if
(
obj
.
NodeType
===
'20'
||
obj
.
NodeType
===
'21'
||
obj
.
NodeType
===
'22'
)
{
if
(
obj
.
NodeType
===
'20'
||
obj
.
NodeType
===
'21'
||
obj
.
NodeType
===
'22'
)
{
return
''
;
}
if
(
obj
.
RoleList
?.
length
===
0
)
{
...
...
@@ -1372,16 +1359,13 @@ const CaseModify = props => {
mouseEnter
(
e
,
node
)
{
// console.log(e, node);
},
mouseLeave
(
e
,
node
)
{
},
mouseLeave
(
e
,
node
)
{},
// 处理双击
doubleClick
(
e
,
node
)
{
},
doubleClick
(
e
,
node
)
{},
// define a tooltip for each node that displays the color as text
// define a tooltip for each node that displays the color as text
toolTip
:
_$
(
'ToolTip'
,
_$
(
go
.
TextBlock
,
{
margin
:
4
},
new
go
.
Binding
(
'text'
,
'tip'
)),
),
// end of Adornment
toolTip
:
_$
(
'ToolTip'
,
_$
(
go
.
TextBlock
,
{
margin
:
4
},
new
go
.
Binding
(
'text'
,
'tip'
))),
// end of Adornment
},
);
// 链接设置
...
...
@@ -1397,7 +1381,7 @@ const CaseModify = props => {
_$
(
go
.
Shape
,
// 链接路径形状
{
isPanelMain
:
true
,
strokeWidth
:
3
,
stroke
:
'#1685FF'
},
new
go
.
Binding
(
'stroke'
,
'lineType'
,
(
v
)
=>
{
new
go
.
Binding
(
'stroke'
,
'lineType'
,
v
=>
{
// 未完成
if
(
v
===
0
)
{
return
'#342e2e11'
;
...
...
@@ -1408,7 +1392,7 @@ const CaseModify = props => {
}
return
''
;
}),
new
go
.
Binding
(
'strokeDashArray'
,
'lineType'
,
(
v
)
=>
{
new
go
.
Binding
(
'strokeDashArray'
,
'lineType'
,
v
=>
{
// 未完成
if
(
v
===
0
)
{
return
[
6
,
3
];
...
...
@@ -1423,7 +1407,7 @@ const CaseModify = props => {
_$
(
go
.
Shape
,
// 箭头
{
toArrow
:
'Standard'
,
stroke
:
'#1685FF'
,
fill
:
'#1685FF'
},
new
go
.
Binding
(
'fill'
,
'lineType'
,
(
v
)
=>
{
new
go
.
Binding
(
'fill'
,
'lineType'
,
v
=>
{
// 未完成
if
(
v
===
0
)
{
return
'#342e2e11'
;
...
...
@@ -1434,7 +1418,7 @@ const CaseModify = props => {
}
return
''
;
}),
new
go
.
Binding
(
'stroke'
,
'lineType'
,
(
v
)
=>
{
new
go
.
Binding
(
'stroke'
,
'lineType'
,
v
=>
{
// 未完成
if
(
v
===
0
)
{
return
'#342e2e11'
;
...
...
@@ -1462,7 +1446,7 @@ const CaseModify = props => {
font
:
'10pt helvetica, arial, Microsoft YaHei'
,
margin
:
4
,
},
new
go
.
Binding
(
'stroke'
,
'lineType'
,
(
v
)
=>
{
new
go
.
Binding
(
'stroke'
,
'lineType'
,
v
=>
{
// 未完成
if
(
v
===
0
)
{
return
'#d2d2d2'
;
...
...
@@ -1473,7 +1457,7 @@ const CaseModify = props => {
}
return
''
;
}),
new
go
.
Binding
(
'text'
,
'lineDetail'
,
(
v
)
=>
lineText
(
v
)),
new
go
.
Binding
(
'text'
,
'lineDetail'
,
v
=>
lineText
(
v
)),
),
),
);
...
...
@@ -1487,7 +1471,7 @@ const CaseModify = props => {
const
nodeBoxStyle
=
(
atr
,
classname
)
=>
{
switch
(
atr
)
{
case
'width'
:
return
new
go
.
Binding
(
'width'
,
'NodeType'
,
(
v
)
=>
{
return
new
go
.
Binding
(
'width'
,
'NodeType'
,
v
=>
{
switch
(
v
)
{
case
'1'
:
return
140
;
...
...
@@ -1510,7 +1494,7 @@ const CaseModify = props => {
}
});
case
'height'
:
return
new
go
.
Binding
(
'height'
,
'NodeType'
,
(
v
)
=>
{
return
new
go
.
Binding
(
'height'
,
'NodeType'
,
v
=>
{
switch
(
v
)
{
case
'1'
:
return
140
;
...
...
@@ -1533,7 +1517,7 @@ const CaseModify = props => {
}
});
case
'stroke'
:
return
new
go
.
Binding
(
'stroke'
,
'nodeDetail'
,
(
v
)
=>
{
return
new
go
.
Binding
(
'stroke'
,
'nodeDetail'
,
v
=>
{
const
obj
=
JSON
.
parse
(
v
);
switch
(
obj
.
NodeType
)
{
case
'1'
:
...
...
@@ -1553,29 +1537,46 @@ const CaseModify = props => {
return
null
;
}
};
// 线上文案样式
const
lineTextStyle
=
v
=>
{
let
obj
=
JSON
.
parse
(
v
);
let
nodeData
=
myDiagram
.
model
.
findNodeDataForKey
(
obj
.
from
);
if
(
nodeData
.
NodeType
===
'20'
||
nodeData
.
NodeType
===
'21'
)
{
// if(nodeData.)
if
(
nodeData
.
RuleList
.
some
(
ele
=>
ele
.
NextNodeId
===
obj
.
to
))
{
return
'#EFF8FA'
;
// 线上文案样式
const
lineTextStyle
=
v
=>
{
let
obj
=
JSON
.
parse
(
v
);
let
nodeData
=
myDiagram
.
model
.
findNodeDataForKey
(
obj
.
from
);
if
(
nodeData
.
NodeType
===
'20'
||
nodeData
.
NodeType
===
'21'
)
{
// if(nodeData.)
if
(
nodeData
.
RuleList
.
some
(
ele
=>
ele
.
NextNodeId
===
obj
.
to
))
{
return
'#EFF8FA'
;
}
return
'transparent'
;
}
return
'transparent'
;
};
// 线上的文案
const
lineText
=
v
=>
{
let
obj
=
JSON
.
parse
(
v
);
let
nodeData
=
myDiagram
.
model
.
findNodeDataForKey
(
obj
.
from
);
if
(
nodeData
.
NodeType
===
'20'
||
nodeData
.
NodeType
===
'21'
)
{
return
nodeData
.
RuleList
.
find
(
ele
=>
ele
.
NextNodeId
===
obj
.
to
).
RuleName
;
}
return
''
;
};
const
onOK
=
async
()
=>
{
console
.
log
(
formJsonRef
.
current
,
'formJsonRef.current'
);
if
(
isObject
(
formJsonRef
.
current
)){
const
formJsonData
=
getFormData
(
formJsonRef
.
current
);
if
(
isObject
(
formJsonData
)){
Object
.
keys
(
formJsonData
).
forEach
(
v
=>
{
if
(
formJsonData
[
v
].
widget
===
'TextInput'
){
const
{
presetValue
,
isStoreID
}
=
formJsonData
[
v
];
}
})
}
const
formData
=
await
formRef
.
current
.
getValues
();
console
.
log
(
formData
,
formJsonData
,
'formDataformDataformData'
);
}
setFormVisible
(
false
)
}
return
'transparent'
;
};
// 线上的文案
const
lineText
=
v
=>
{
let
obj
=
JSON
.
parse
(
v
);
let
nodeData
=
myDiagram
.
model
.
findNodeDataForKey
(
obj
.
from
);
if
(
nodeData
.
NodeType
===
'20'
||
nodeData
.
NodeType
===
'21'
)
{
return
nodeData
.
RuleList
.
find
(
ele
=>
ele
.
NextNodeId
===
obj
.
to
).
RuleName
;
}
return
''
;
};
const
validContent
=
<
span
style
=
{{
color
:
'red'
,
fontSize
:
'18px'
}}
>*<
/span>
;
return
(
...
...
@@ -1603,7 +1604,7 @@ const lineText = v => {
disabled
=
{
mode
===
'edit'
}
onChange
=
{
v
=>
{
setConfigInfo
({
...
configInfo
,
schemeName
:
v
.
target
.
value
});
generatePostData
({
schemeName
:
v
.
target
.
value
})
generatePostData
({
schemeName
:
v
.
target
.
value
})
;
}}
/
>
<
p
style
=
{{
position
:
'absolute'
,
color
:
'red'
}}
>
{
configInfo
.
schemeNameErrMsg
}
<
/p
>
...
...
@@ -1678,7 +1679,9 @@ const lineText = v => {
style
=
{{
color
:
'#1890ff'
,
border
:
'1px solid #1890ff'
}}
onClick
=
{()
=>
handleCKPerson
(
configInfo
)}
>
{(
configInfo
.
userIds
.
length
>
0
||
configInfo
.
roleIds
.
length
>
0
)
?
'已选下一节点办理人'
:
'选择下一节点办理人'
}
{
configInfo
.
userIds
.
length
>
0
||
configInfo
.
roleIds
.
length
>
0
?
'已选下一节点办理人'
:
'选择下一节点办理人'
}
<
/Button
>
<
p
style
=
{{
position
:
'absolute'
,
color
:
'red'
}}
>
{
configInfo
.
userIdsErrMsg
}
<
/p
>
<
/div
>
...
...
@@ -1761,10 +1764,12 @@ const lineText = v => {
<
span
style
=
{{
color
:
'red'
}}
>
{
v
.
ruleContentErrMsg
}
<
/span
>
<
Button
block
style
=
{{
color
:
'#1890ff'
,
border
:
'1px solid #1890ff'
,
overflow
:
'hidden'
}}
style
=
{{
color
:
'#1890ff'
,
border
:
'1px solid #1890ff'
,
overflow
:
'hidden'
}}
onClick
=
{()
=>
handleRuleClick
(()
=>
setShowPersonSelect
(
true
),
v
.
id
)}
>
{(
v
.
userIds
.
length
||
v
.
roleIds
.
length
)
?
[...(
v
.
userIds
),
...(
v
.
roleIds
)].
map
(
v
=>
v
.
name
).
join
(
','
)
:
'选择下一节点办理人'
}
{
v
.
userIds
.
length
||
v
.
roleIds
.
length
?
[...
v
.
userIds
,
...
v
.
roleIds
].
map
(
v
=>
v
.
name
).
join
(
','
)
:
'选择下一节点办理人'
}
<
/Button
>
<
span
style
=
{{
color
:
'red'
}}
>
{
v
.
userIdsErrMsg
}
<
/span
>
<
/Space
>
...
...
@@ -1799,9 +1804,15 @@ const lineText = v => {
>
<
Space
>
<
span
>
开始时间:
<
/span
>
<
DatePicker
showTime
=
{{
format
:
'HH'
}}
locale
=
{
locale
}
format
=
{
'YYYY-MM-DD HH:00'
}
value
=
{
startTime
}
onChange
=
{
t
=>
setStartTime
(
t
)}
/
>
<
DatePicker
showTime
=
{{
format
:
'HH'
,
}}
locale
=
{
locale
}
format
=
{
'YYYY-MM-DD HH:00'
}
value
=
{
startTime
}
onChange
=
{
t
=>
setStartTime
(
t
)}
/
>
<
span
>
结束时间:
<
/span
>
<
DatePicker
locale
=
{
locale
}
value
=
{
endTime
}
onChange
=
{
t
=>
setEndTime
(
t
)}
/
>
<
/Space
>
...
...
@@ -1921,23 +1932,31 @@ const lineText = v => {
<
/div
>
<
p
style
=
{{
color
:
'red'
}}
>
{
errorMsg
}
<
/p
>
<
span
>
下次请求时间:
{
tip
}
<
/span
>
<
Modal
title
=
"选择时间"
visible
=
{
openTeditor
}
onOk
=
{()
=>
setOpenTeditor
(
false
)}
onCancel
=
{()
=>
setOpenTeditor
(
false
)}
destroyOnClose
footer
=
{[
<
Button
type
=
{
'primary'
}
onClick
=
{()
=>
setOpenTeditor
(
false
)}
>
确定
<
/Button>
,
]}
>
{
timeEditor
()}
<
/Modal
>
{
showForm
&&
(
<
div
style
=
{{
marginTop
:
'20px'
}}
>
<
Space
>
<
span
>
工单移交模板:
<
/span
>
<
Button
onClick
=
{()
=>
setFormVisible
(
true
)}
>
点击查看
<
/Button
>
<
/Space
>
<
/div
>
)}
<
/div
>
<
/
>
)}
<
Modal
title
=
"选择时间"
visible
=
{
openTeditor
}
onOk
=
{()
=>
setOpenTeditor
(
false
)}
onCancel
=
{()
=>
setOpenTeditor
(
false
)}
destroyOnClose
footer
=
{[
<
Button
type
=
{
'primary'
}
onClick
=
{()
=>
setOpenTeditor
(
false
)}
>
确定
<
/Button>
,
]}
>
{
timeEditor
()}
<
/Modal
>
<
Modal
visible
=
{
isPreview
}
centered
...
...
@@ -1947,9 +1966,22 @@ const lineText = v => {
onCancel
=
{()
=>
setIsPreView
(
false
)}
footer
=
{
null
}
>
<
div
className
=
{
styles
.
map
}
>
{
isPreview
&&
<
div
id
=
"myDiagramDiv"
className
=
{
styles
.
diagram
}
><
/div>
}
<
/div
>
<
div
className
=
{
styles
.
map
}
>
{
isPreview
&&
<
div
id
=
"myDiagramDiv"
className
=
{
styles
.
diagram
}
/>
}
<
/div
>
<
/Modal
>
<
Modal
width
=
{
'80%'
}
bodyStyle
=
{{
overflow
:
'auto'
,
height
:
600
,
padding
:
'10px'
}}
title
=
{
'编辑移交模板'
}
maskClosable
=
{
false
}
visible
=
{
formVisible
}
onCancel
=
{()
=>
setFormVisible
(
false
)}
onOk
=
{
onOK
}
destroyOnClose
>
<
FormRender
schemaValues
=
{
schemaValues
}
ref
=
{
formRef
}
/
>
<
/Modal
>
<
RuleConfig
RuleContent
=
{
ruleContent
.
current
}
...
...
src/pages/bsmanager/workOrder/autoCase/index.js
View file @
5293754d
...
...
@@ -28,6 +28,7 @@ import {
DeleteFlowAutoConfig
,
EnableDisableFlowAutoConfig
,
GetFlowAutoConfigDetail
,
GetFlowCenterData
}
from
'@/services/flow/flow'
;
import
{
GetIISAgentConfig
,
...
...
@@ -62,6 +63,7 @@ const AutoCase = props => {
let
flowConfigDetail
=
useRef
(
null
);
let
showlogId
=
useRef
(
null
);
let
planName
=
useRef
(
null
)
let
flowCenterData
=
useRef
(
null
);
const
[
refreshKey
,
setRefreshKey
]
=
useState
(
0
)
let
mode
=
useRef
(
''
);
const
statusObj
=
[
<
Tag
color
=
"default"
>
已停用
<
/Tag>, <Tag color="processing">已启用</
Tag
>
];
...
...
@@ -184,8 +186,20 @@ const AutoCase = props => {
useEffect
(()
=>
{
getTableList
()
getFlowCenterData
()
},
[])
const
getFlowCenterData
=
async
()
=>
{
const
{
code
,
data
,
msg
}
=
await
GetFlowCenterData
({
userID
:
1
,
systemType
:
'业务系统'
,
isFilterOrderMode
:
0
,
isInternal
:
0
});
if
(
code
==
0
){
flowCenterData
.
current
=
data
;
}
}
const
getTableList
=
()
=>
{
GetIISAgentConfig
({
agentName
:
''
}).
then
(
res
=>
{
...
...
@@ -423,6 +437,7 @@ const AutoCase = props => {
{
openEditor
&&
<
CaseModify
visible
=
{
openEditor
}
flowConfigDetail
=
{
flowConfigDetail
.
current
}
flowCenterData
=
{
flowCenterData
.
current
}
mode
=
{
mode
.
current
}
onClose
=
{()
=>
setOpeneditor
(
false
)}
onOk
=
{
onSubmit
}
...
...
src/services/flow/flow.js
View file @
5293754d
...
...
@@ -147,6 +147,12 @@ export const GetFlowAutoConfigDetail = query => get(`${PUBLISH_SERVICE}/WorkFlow
export
const
GetFlowAutoSchemeLogs
=
query
=>
get
(
`
${
PUBLISH_SERVICE
}
/WorkFlow/GetFlowAutoSchemeLogs`
,
query
);
export
const
GetBizMetaData
=
query
=>
post
(
`
${
PANDAWORKFLOW
}
/EventManage/GetBizMetaData`
,
query
);
export
const
GetFlowCenterData
=
query
=>
get
(
`
${
PANDAWORKFLOW
}
/EventManage/GetFlowCenterData`
,
query
);
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