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
df1d248b
Commit
df1d248b
authored
Jan 19, 2022
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 重构事件编辑代码
parent
dcd38827
Pipeline
#43041
skipped with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
57 deletions
+53
-57
AddModal.jsx
src/pages/bsmanager/workOrder/incident/AddModal.jsx
+53
-57
No files found.
src/pages/bsmanager/workOrder/incident/AddModal.jsx
View file @
df1d248b
...
@@ -447,7 +447,7 @@ const AddModal = props => {
...
@@ -447,7 +447,7 @@ const AddModal = props => {
const
[
editable
,
setEditable
]
=
useState
(
false
);
const
[
editable
,
setEditable
]
=
useState
(
false
);
const
[
ReportFromMobile
,
setReportFromMobile
]
=
useState
(
false
);
const
[
ReportFromMobile
,
setReportFromMobile
]
=
useState
(
false
);
const
[
ReportFromWeb
,
setReportFromWeb
]
=
useState
(
false
);
const
[
ReportFromWeb
,
setReportFromWeb
]
=
useState
(
false
);
const
[
chee
,
setChee
]
=
useState
(
0
);
const
[
chee
,
setChee
]
=
useState
(
''
);
const
[
pickItem
,
setPickItem
]
=
useState
(
''
);
const
[
pickItem
,
setPickItem
]
=
useState
(
''
);
const
[
prefixName
,
setPrefixName
]
=
useState
(
''
);
const
[
prefixName
,
setPrefixName
]
=
useState
(
''
);
const
[
selectValue
,
setSelectValue
]
=
useState
(
''
);
const
[
selectValue
,
setSelectValue
]
=
useState
(
''
);
...
@@ -534,6 +534,7 @@ const AddModal = props => {
...
@@ -534,6 +534,7 @@ const AddModal = props => {
form
.
resetFields
();
form
.
resetFields
();
setValue
(
''
);
setValue
(
''
);
callBackSubmit
();
callBackSubmit
();
setChee
(
''
);
notification
.
success
({
notification
.
success
({
message
:
'提示'
,
message
:
'提示'
,
duration
:
3
,
duration
:
3
,
...
@@ -561,6 +562,7 @@ const AddModal = props => {
...
@@ -561,6 +562,7 @@ const AddModal = props => {
if
(
res
.
msg
===
'Ok'
)
{
if
(
res
.
msg
===
'Ok'
)
{
form
.
resetFields
();
form
.
resetFields
();
setValue
(
''
);
setValue
(
''
);
setChee
(
''
);
callBackSubmit
();
callBackSubmit
();
notification
.
success
({
notification
.
success
({
message
:
'提示'
,
message
:
'提示'
,
...
@@ -601,7 +603,7 @@ const AddModal = props => {
...
@@ -601,7 +603,7 @@ const AddModal = props => {
setEditable
(
false
);
setEditable
(
false
);
setReportFromMobile
(
false
);
setReportFromMobile
(
false
);
}
else
if
(
type
===
'edit'
)
{
}
else
if
(
type
===
'edit'
)
{
setChee
(
''
);
setChee
();
getEventData1
();
getEventData1
();
GetCM_Event_QueryEventType
({
eventTypeId
:
formObj
.
ID
}).
then
(
res
=>
{
GetCM_Event_QueryEventType
({
eventTypeId
:
formObj
.
ID
}).
then
(
res
=>
{
if
(
res
.
data
.
root
)
{
if
(
res
.
data
.
root
)
{
...
@@ -661,19 +663,13 @@ const AddModal = props => {
...
@@ -661,19 +663,13 @@ const AddModal = props => {
});
});
}
}
setFlag
(
0
);
setFlag
(
0
);
}
else
if
(
type
==
'edit'
)
{
}
else
if
(
type
==
'edit'
||
type
==
'add'
)
{
setEditable
(
false
);
setEditable
(
false
);
setReportFromMobile
(
false
);
setReportFromMobile
(
false
);
setReportFromWeb
(
false
);
setReportFromWeb
(
false
);
form
.
resetFields
();
form
.
resetFields
();
setValue
(
''
);
setValue
(
''
);
setSummaryIsShow
(
'none'
);
setChee
(
''
);
setReportIsShow
(
'none'
);
setDisplayIsShow
(
'none'
);
setEditableIsShow
(
'none'
);
setTransitIsShow
(
'none'
);
setRelatedEventIsShow
(
'none'
);
}
else
if
(
type
==
'add'
)
{
setSummaryIsShow
(
'none'
);
setSummaryIsShow
(
'none'
);
setReportIsShow
(
'none'
);
setReportIsShow
(
'none'
);
setDisplayIsShow
(
'none'
);
setDisplayIsShow
(
'none'
);
...
@@ -1231,7 +1227,7 @@ const AddModal = props => {
...
@@ -1231,7 +1227,7 @@ const AddModal = props => {
return
(
return
(
<
Drawer
<
Drawer
title=
{
type
===
'add'
?
'添加事件类型'
:
'编辑事件类型'
}
title=
{
type
===
'add'
?
'添加事件类型'
:
'编辑事件类型'
}
width=
"
6
00px"
width=
"
5
00px"
destroyOnClose
destroyOnClose
{
...
props
}
{
...
props
}
footer=
{
footer=
{
...
@@ -1243,12 +1239,12 @@ const AddModal = props => {
...
@@ -1243,12 +1239,12 @@ const AddModal = props => {
}
}
// confirmLoading={loading}
// confirmLoading={loading}
>
>
<
Form
form=
{
form
}
labelCol=
{
{
span
:
7
}
}
style=
{
{
overflowY
:
'scroll'
}
}
>
<
Form
form=
{
form
}
style=
{
{
overflowY
:
'scroll'
}
}
>
<
Row
>
<
Row
>
<
Col
span=
{
1
4
}
>
<
Col
span=
{
1
5
}
>
<
Item
<
Item
label=
"事件名称"
label=
"事件名称"
labelCol=
{
{
span
:
7
}
}
labelCol=
{
{
span
:
8
}
}
name=
"Name"
name=
"Name"
rules=
{
[
rules=
{
[
{
{
...
@@ -1257,10 +1253,14 @@ const AddModal = props => {
...
@@ -1257,10 +1253,14 @@ const AddModal = props => {
},
},
]
}
]
}
>
>
<
Input
onChange=
{
prefix
}
placeholder=
"请输入事件名称"
/>
<
Input
onChange=
{
prefix
}
placeholder=
"请输入事件名称"
style=
{
{
marginLeft
:
'-3px'
}
}
/>
</
Item
>
</
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
10
}
>
<
Col
span=
{
9
}
>
<
Item
<
Item
label=
"编码前缀"
label=
"编码前缀"
labelCol=
{
{
span
:
14
}
}
labelCol=
{
{
span
:
14
}
}
...
@@ -1276,23 +1276,13 @@ const AddModal = props => {
...
@@ -1276,23 +1276,13 @@ const AddModal = props => {
</
Item
>
</
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
24
}
>
<
Col
span=
{
24
}
>
<
span
style=
{
{
position
:
'absolute'
,
left
:
'2%'
,
top
:
'9%'
,
color
:
'red'
,
fontSize
:
'16px'
,
}
}
>
*
</
span
>
<
Item
<
Item
label=
"业务类型"
label=
"业务类型"
name=
"BusinessType"
name=
"BusinessType"
labelCol=
{
{
span
:
4
}
}
labelCol=
{
{
span
:
5
}
}
rules=
{
[
rules=
{
[
{
{
required
:
true
,
validator
:
(
rule
,
value
)
=>
{
validator
:
(
rule
,
value
)
=>
{
if
(
form
.
getFieldsValue
().
BusinessType
==
''
)
{
if
(
form
.
getFieldsValue
().
BusinessType
==
''
)
{
return
Promise
.
reject
(
'业务类型必填'
);
return
Promise
.
reject
(
'业务类型必填'
);
...
@@ -1303,7 +1293,12 @@ const AddModal = props => {
...
@@ -1303,7 +1293,12 @@ const AddModal = props => {
]
}
]
}
>
>
<
div
>
<
div
>
<
Input
className=
"ue-editable-select-input"
onChange=
{
inputType
}
value=
{
Type1
}
/>
<
Input
className=
"ue-editable-select-input"
onChange=
{
inputType
}
value=
{
Type1
}
style=
{
{
marginLeft
:
'-3px'
}
}
/>
<
Dropdown
<
Dropdown
placement=
"bottomRight"
placement=
"bottomRight"
style=
{
{
width
:
'430px'
}
}
style=
{
{
width
:
'430px'
}
}
...
@@ -1346,7 +1341,7 @@ const AddModal = props => {
...
@@ -1346,7 +1341,7 @@ const AddModal = props => {
<
Item
<
Item
label=
"事件主表"
label=
"事件主表"
name=
"TableName"
name=
"TableName"
labelCol=
{
{
span
:
4
}
}
labelCol=
{
{
span
:
5
}
}
rules=
{
[
rules=
{
[
{
{
required
:
true
,
required
:
true
,
...
@@ -1354,7 +1349,11 @@ const AddModal = props => {
...
@@ -1354,7 +1349,11 @@ const AddModal = props => {
},
},
]
}
]
}
>
>
<
Select
placeholder=
"选择事件主表"
onChange=
{
changTable
}
>
<
Select
placeholder=
"选择事件主表"
onChange=
{
changTable
}
style=
{
{
marginLeft
:
'-3px'
}
}
>
{
standingTable
{
standingTable
?
standingTable
.
map
((
item
,
index
)
=>
(
?
standingTable
.
map
((
item
,
index
)
=>
(
<
Option
key=
{
index
}
value=
{
item
.
text
}
>
<
Option
key=
{
index
}
value=
{
item
.
text
}
>
...
@@ -1365,15 +1364,16 @@ const AddModal = props => {
...
@@ -1365,15 +1364,16 @@ const AddModal = props => {
</
Select
>
</
Select
>
</
Item
>
</
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
4
}
>
<
Col
span=
{
5
}
>
<
Item
/>
<
Item
/>
</
Col
>
</
Col
>
<
Col
span=
{
20
}
>
<
Col
span=
{
19
}
>
<
Item
>
<
Item
>
<
span
>
客户端上报和配单(需配置事件权限、受理流程)
</
span
>
<
span
>
客户端上报和配单(需配置事件权限、受理流程)
</
span
>
</
Item
>
</
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
4
}
>
<
Col
span=
{
5
}
>
<
Item
/>
<
Item
/>
</
Col
>
</
Col
>
<
Col
span=
{
4
}
>
<
Col
span=
{
4
}
>
...
@@ -1383,7 +1383,7 @@ const AddModal = props => {
...
@@ -1383,7 +1383,7 @@ const AddModal = props => {
</
Checkbox
>
</
Checkbox
>
</
Item
>
</
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
1
6
}
>
<
Col
span=
{
1
5
}
>
<
Item
name=
"ReportFromMobile"
>
<
Item
name=
"ReportFromMobile"
>
<
Checkbox
onChange=
{
onChange4
}
checked=
{
ReportFromMobile
}
>
<
Checkbox
onChange=
{
onChange4
}
checked=
{
ReportFromMobile
}
>
手持
手持
...
@@ -1392,25 +1392,21 @@ const AddModal = props => {
...
@@ -1392,25 +1392,21 @@ const AddModal = props => {
{
/* </Item> */
}
{
/* </Item> */
}
</
Col
>
</
Col
>
<
Col
span=
{
4
}
>
<
Col
span=
{
5
}
>
<
Item
/>
<
Item
/>
</
Col
>
</
Col
>
<
Col
span=
{
20
}
>
<
Col
span=
{
19
}
>
<
Item
name=
"Editable"
>
<
Item
name=
"Editable"
>
<
Checkbox
onChange=
{
onChange1
}
checked=
{
editable
}
>
<
Checkbox
onChange=
{
onChange1
}
checked=
{
editable
}
>
上报后可以编辑(需配置编辑字段)
上报后可以编辑(需配置编辑字段)
</
Checkbox
>
</
Checkbox
>
</
Item
>
</
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
2
3
}
>
<
Col
span=
{
2
4
}
>
<
Item
label=
"上报方式"
name=
"CreateMode"
labelCol=
{
{
span
:
4
}
}
>
<
Item
label=
"上报方式"
name=
"CreateMode"
labelCol=
{
{
span
:
5
}
}
>
<
Radio
.
Group
onChange=
{
onChange2
}
value=
{
value
}
defaultValue=
{
chee
}
>
<
Radio
.
Group
onChange=
{
onChange2
}
value=
{
value
}
defaultValue=
{
chee
}
>
<
Radio
value=
{
0
}
style=
{
{
marginLeft
:
'5px'
}
}
>
<
Radio
value=
{
0
}
>
仅上报
</
Radio
>
仅上报
<
Radio
value=
{
1
}
>
工单分派
</
Radio
>
</
Radio
>
<
Radio
value=
{
1
}
style=
{
{
marginLeft
:
'100px'
}
}
>
工单分派
</
Radio
>
</
Radio
.
Group
>
</
Radio
.
Group
>
</
Item
>
</
Item
>
</
Col
>
</
Col
>
...
@@ -1441,7 +1437,7 @@ const AddModal = props => {
...
@@ -1441,7 +1437,7 @@ const AddModal = props => {
</
div
>
</
div
>
}
}
name=
"SummaryFields"
name=
"SummaryFields"
labelCol=
{
{
span
:
4
}
}
labelCol=
{
{
span
:
5
}
}
rules=
{
[
rules=
{
[
{
{
validator
:
(
rule
,
value
)
=>
{
validator
:
(
rule
,
value
)
=>
{
...
@@ -1493,7 +1489,7 @@ const AddModal = props => {
...
@@ -1493,7 +1489,7 @@ const AddModal = props => {
</
div
>
</
div
>
}
}
name=
"ReportFields"
name=
"ReportFields"
labelCol=
{
{
span
:
4
}
}
labelCol=
{
{
span
:
5
}
}
rules=
{
[
rules=
{
[
{
{
validator
:
(
rule
,
value
)
=>
{
validator
:
(
rule
,
value
)
=>
{
...
@@ -1545,7 +1541,7 @@ const AddModal = props => {
...
@@ -1545,7 +1541,7 @@ const AddModal = props => {
</
div
>
</
div
>
}
}
name=
"DisplayFields"
name=
"DisplayFields"
labelCol=
{
{
span
:
4
}
}
labelCol=
{
{
span
:
5
}
}
rules=
{
[
rules=
{
[
{
{
validator
:
(
rule
,
value
)
=>
{
validator
:
(
rule
,
value
)
=>
{
...
@@ -1597,7 +1593,7 @@ const AddModal = props => {
...
@@ -1597,7 +1593,7 @@ const AddModal = props => {
</
div
>
</
div
>
}
}
name=
"EditableFields"
name=
"EditableFields"
labelCol=
{
{
span
:
4
}
}
labelCol=
{
{
span
:
5
}
}
rules=
{
[
rules=
{
[
{
{
validator
:
(
rule
,
value
)
=>
{
validator
:
(
rule
,
value
)
=>
{
...
@@ -1639,7 +1635,7 @@ const AddModal = props => {
...
@@ -1639,7 +1635,7 @@ const AddModal = props => {
</
div
>
</
div
>
}
}
name=
"TransitFields"
name=
"TransitFields"
labelCol=
{
{
span
:
4
}
}
labelCol=
{
{
span
:
5
}
}
>
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<
Form
.
Item
name=
"TransitFields"
style=
{
{
marginBottom
:
0
,
width
:
'100%'
}
}
>
<
Form
.
Item
name=
"TransitFields"
style=
{
{
marginBottom
:
0
,
width
:
'100%'
}
}
>
...
@@ -1655,7 +1651,7 @@ const AddModal = props => {
...
@@ -1655,7 +1651,7 @@ const AddModal = props => {
</
Item
>
</
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
24
}
>
<
Col
span=
{
24
}
>
<
Item
label=
"事件权限"
name=
"Roles"
labelCol=
{
{
span
:
4
}
}
>
<
Item
label=
"事件权限"
name=
"Roles"
labelCol=
{
{
span
:
5
}
}
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<
Form
.
Item
name=
"Roles"
style=
{
{
marginBottom
:
0
,
width
:
'100%'
}
}
>
<
Form
.
Item
name=
"Roles"
style=
{
{
marginBottom
:
0
,
width
:
'100%'
}
}
>
<
Input
placeholder=
"请选择事件权限"
allowClear
/>
<
Input
placeholder=
"请选择事件权限"
allowClear
/>
...
@@ -1670,22 +1666,22 @@ const AddModal = props => {
...
@@ -1670,22 +1666,22 @@ const AddModal = props => {
</
Item
>
</
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
24
}
>
<
Col
span=
{
24
}
>
<
Item
label=
"置顶条件"
name=
"TopWhere"
labelCol=
{
{
span
:
4
}
}
>
<
Item
label=
"置顶条件"
name=
"TopWhere"
labelCol=
{
{
span
:
5
}
}
>
<
Input
placeholder=
"请输入置顶条件"
allowClear
/>
<
Input
placeholder=
"请输入置顶条件"
allowClear
/>
</
Item
>
</
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
24
}
>
<
Col
span=
{
24
}
>
<
Item
label=
"上报视图"
name=
"ReportPage"
labelCol=
{
{
span
:
4
}
}
>
<
Item
label=
"上报视图"
name=
"ReportPage"
labelCol=
{
{
span
:
5
}
}
>
<
Input
placeholder=
"请输入上报视图"
allowClear
/>
<
Input
placeholder=
"请输入上报视图"
allowClear
/>
</
Item
>
</
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
24
}
>
<
Col
span=
{
24
}
>
<
Item
label=
"处理视图"
name=
"DealPage"
labelCol=
{
{
span
:
4
}
}
>
<
Item
label=
"处理视图"
name=
"DealPage"
labelCol=
{
{
span
:
5
}
}
>
<
Input
placeholder=
"请输入处理视图"
allowClear
/>
<
Input
placeholder=
"请输入处理视图"
allowClear
/>
</
Item
>
</
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
24
}
>
<
Col
span=
{
24
}
>
<
Item
label=
"关联事件"
name=
"RelatedEvents"
labelCol=
{
{
span
:
4
}
}
>
<
Item
label=
"关联事件"
name=
"RelatedEvents"
labelCol=
{
{
span
:
5
}
}
>
<
Input
placeholder=
"请输入关联事件"
allowClear
/>
<
Input
placeholder=
"请输入关联事件"
allowClear
/>
</
Item
>
</
Item
>
</
Col
>
</
Col
>
...
@@ -1706,7 +1702,7 @@ const AddModal = props => {
...
@@ -1706,7 +1702,7 @@ const AddModal = props => {
</
div
>
</
div
>
}
}
name=
"RelatedEventFields"
name=
"RelatedEventFields"
labelCol=
{
{
span
:
4
}
}
labelCol=
{
{
span
:
5
}
}
>
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<
Form
.
Item
name=
"RelatedEventFields"
style=
{
{
marginBottom
:
0
,
width
:
'100%'
}
}
>
<
Form
.
Item
name=
"RelatedEventFields"
style=
{
{
marginBottom
:
0
,
width
:
'100%'
}
}
>
...
@@ -1722,7 +1718,7 @@ const AddModal = props => {
...
@@ -1722,7 +1718,7 @@ const AddModal = props => {
</
Item
>
</
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
24
}
>
<
Col
span=
{
24
}
>
<
Item
label=
"接口配置"
name=
"InterfaceConfig"
labelCol=
{
{
span
:
4
}
}
>
<
Item
label=
"接口配置"
name=
"InterfaceConfig"
labelCol=
{
{
span
:
5
}
}
>
<
Input
placeholder=
"请输入接口配置"
/>
<
Input
placeholder=
"请输入接口配置"
/>
</
Item
>
</
Item
>
</
Col
>
</
Col
>
...
...
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