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
57678750
Commit
57678750
authored
1 month ago
by
彭俊龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:自动化工单测试
parent
8e02163a
Pipeline
#96641
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
15 deletions
+55
-15
index.js
...manager/workOrder/autoCase/components/CaseModify/index.js
+55
-15
No files found.
src/pages/bsmanager/workOrder/autoCase/components/CaseModify/index.js
View file @
57678750
...
...
@@ -13,6 +13,7 @@ import {
InputNumber
,
Checkbox
,
message
,
Switch
}
from
'antd'
;
import
'moment/dist/locale/zh-cn'
;
import
locale
from
'antd/es/date-picker/locale/zh_CN'
;
...
...
@@ -119,7 +120,7 @@ const CaseModify = props => {
scheduledConfig
:
{
userIds
:
[],
//用户ID
roleIds
:
[],
//角色ID
Values
:
[],
//工单移交模板
values
:
[],
//工单模板提交数据
agentConfig
:
''
,
},
//定时触发
});
...
...
@@ -182,7 +183,7 @@ const CaseModify = props => {
{
let
res
;
if
(
TriggerMethod
===
'定时触发'
)
{
setShowForm
(
true
);
getBizMetaData
(
detail
);
res
=
await
GetConditionConfigFlowNode
({
flowId
:
FlowId
});
}
else
{
...
...
@@ -401,12 +402,24 @@ const CaseModify = props => {
...
paramObj
,
userId
:
1
,
};
const
vals
=
ScheduledConfig
.
Values
setShowForm
(
vals
.
length
>
0
);
const
{
code
,
data
,
msg
}
=
await
GetBizMetaData
(
paramObj
);
const
{
formJson
,
values
}
=
data
[
0
];
const
jsonObj
=
JSON
.
parse
(
formJson
)
const
formValues
=
vals
.
length
>
0
?
values
.
map
(
v
=>
{
const
d
=
vals
.
find
(
x
=>
v
.
fieldName
===
x
.
fieldName
)
if
(
d
){
return
{
...
v
,
fieldValue
:
d
.
fieldValue
}
}
return
v
})
:
values
formJsonRef
.
current
=
jsonObj
setSchemaValues
({
values
,
formJson
:
jsonObj
});
console
.
log
(
formData
,
'formDataformData'
)
setSchemaValues
({
values
:
formValues
,
formJson
:
jsonObj
});
}
};
...
...
@@ -920,7 +933,6 @@ const CaseModify = props => {
const
handleSelectRuleType
=
(
e
,
type
)
=>
{
const
{
checked
}
=
e
.
target
;
generatePostData
({
triggerMethod
:
type
});
setShowForm
(
type
===
'定时触发'
)
if
(
type
===
'定时触发'
)
{
generatePostData
({});
if
(
nodeNams
.
length
>
0
)
{
...
...
@@ -1200,6 +1212,7 @@ const CaseModify = props => {
agentConfig
,
userIds
:
configInfo
.
userIds
,
roleIds
:
configInfo
.
roleIds
,
values
:
showForm
?
postData
.
current
.
scheduledConfig
.
values
:
[]
};
}
const
fn
=
()
=>
setloadding
(
false
);
...
...
@@ -1561,20 +1574,39 @@ const CaseModify = props => {
}
return
''
;
};
const
loaclPaths
=
[
'【本人姓名】'
,
'【本人电话】'
,
'【本人部门】'
]
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
{
errors
,
formValue
}
=
await
formRef
.
current
.
getValues
();
const
values
=
formValue
.
map
(
v
=>
{
if
(
formJsonData
[
v
.
fieldName
]){
const
{
widget
,
presetValue
,
isStoreID
,
isMySite
}
=
formJsonData
[
v
.
fieldName
]
if
(
widget
===
'TextInput'
&&
loaclPaths
.
includes
(
presetValue
)){
return
{
fieldName
:
v
.
fieldName
,
fieldValue
:
''
,
presetValue
,
isStoreID
}
}
else
if
(
widget
===
'ComboBox'
&&
isMySite
){
return
{
fieldName
:
v
.
fieldName
,
fieldValue
:
''
,
presetValue
:
''
,
isStoreID
}
}
})
}
const
formData
=
await
formRef
.
current
.
getValues
();
console
.
log
(
formData
,
formJsonData
,
'formDataformDataformData'
);
return
{
fieldName
:
v
.
fieldName
,
fieldValue
:
v
.
fieldValue
,
presetValue
:
''
,
isStoreID
}
}
})
postData
.
current
.
scheduledConfig
.
Values
=
values
}
setFormVisible
(
false
)
}
...
...
@@ -1933,8 +1965,16 @@ const CaseModify = props => {
<
/div
>
<
p
style
=
{{
color
:
'red'
}}
>
{
errorMsg
}
<
/p
>
<
span
>
下次请求时间:
{
tip
}
<
/span
>
{
configInfo
.
triggerType
==
'定时触发'
&&
<
div
style
=
{{
marginTop
:
'10px'
}}
>
<
Space
>
<
span
>
启用工单模板:
<
/span
>
<
Switch
checkedChildren
=
"开启"
unCheckedChildren
=
"关闭"
checked
=
{
showForm
}
onChange
=
{(
e
)
=>
setShowForm
(
e
)}
/
>
<
/Space
>
<
/div
>
}
{
showForm
&&
(
<
div
style
=
{{
marginTop
:
'
2
0px'
}}
>
<
div
style
=
{{
marginTop
:
'
1
0px'
}}
>
<
Space
>
<
span
>
工单移交模板:
<
/span
>
<
Button
onClick
=
{()
=>
setFormVisible
(
true
)}
>
点击查看
<
/Button
>
...
...
This diff is collapsed.
Click to expand it.
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