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
d1aac0ea
Commit
d1aac0ea
authored
Nov 27, 2024
by
涂伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: '事件配置新增通用事件配置'
parent
069be2a3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
137 additions
and
3 deletions
+137
-3
index.jsx
...smanager/workOrder/incident/AddModal/AddAccount/index.jsx
+0
-0
index.less
...manager/workOrder/incident/AddModal/AddAccount/index.less
+8
-0
index.js
src/pages/bsmanager/workOrder/incident/AddModal/index.js
+127
-3
incident.jsx
src/pages/bsmanager/workOrder/incident/incident.jsx
+2
-0
No files found.
src/pages/bsmanager/workOrder/incident/AddModal/AddAccount/index.jsx
0 → 100644
View file @
d1aac0ea
This diff is collapsed.
Click to expand it.
src/pages/bsmanager/workOrder/incident/AddModal/AddAccount/index.less
0 → 100644
View file @
d1aac0ea
.AddAccount{
:global {
.ant-row {
width: 520px !important;
}
}
}
\ No newline at end of file
src/pages/bsmanager/workOrder/incident/AddModal/index.js
View file @
d1aac0ea
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'react'
;
import
{
Drawer
,
Form
,
Input
,
notification
,
Space
,
Row
,
Col
,
Select
,
Checkbox
,
Button
,
Tooltip
,
Image
,
Switch
,
Spin
}
from
'antd'
;
import
{
Drawer
,
Table
,
Form
,
Input
,
notification
,
Space
,
Row
,
Col
,
Select
,
Checkbox
,
Button
,
Tooltip
,
Image
,
Switch
,
Spin
}
from
'antd'
;
import
{
GetCM_Event_LoadEventTypeTable
,
LoadEventFields
,
...
...
@@ -20,6 +20,7 @@ import caseImg from '@/assets/images/workOptions/工单.png';
import
caseChooseImg
from
'@/assets/images/workOptions/工单发起选中.png'
;
import
eventChooseImg
from
'@/assets/images/workOptions/事件选中.png'
;
import
SelectField
from
'./SelectField'
;
import
AddAccount
from
'./AddAccount'
;
const
{
Option
}
=
Select
;
const
{
Item
}
=
Form
;
...
...
@@ -415,6 +416,7 @@ const AddModal = (props) => {
maxLength
,
selectData
,
rember1
,
businessArr
}
=
props
;
const
[
checkedList1
,
setCheckedList1
]
=
useState
([]);
...
...
@@ -454,7 +456,12 @@ const AddModal = (props) => {
const
[
eventFlowId
,
setEventFlowId
]
=
useState
(
0
);
const
[
show
,
setShow
]
=
useState
(
'hidden'
);
const
[
initWay
,
setInitWay
]
=
useState
();
// 初始上报方式
const
[
viewModal
,
setViewModal
]
=
useState
(
false
);
const
[
index
,
setIndex
]
=
useState
(
0
)
const
[
modalType
,
setModalType
]
=
useState
(
''
);
const
[
viewMsg
,
setviewMsg
]
=
useState
({});
// 保存编辑的信息
const
selectFieldRef
=
useRef
(
null
)
const
tableData
=
useRef
([]);
// 通用事件回显的表格
const
onSubmit
=
()
=>
{
form
.
validateFields
().
then
(
validate
=>
{
...
...
@@ -480,7 +487,7 @@ const AddModal = (props) => {
notification
.
warning
({
message
:
'提示'
,
description
:
'事件权限必填'
})
}
else
{
if
(
type
==
'edit'
)
{
CM_Event_EditEventTable
({
ID
:
formObj
.
ID
,
...
obj
,
Order
,
EventFlowId
:
eventFlowId
,
})
CM_Event_EditEventTable
({
ID
:
formObj
.
ID
,
...
obj
,
Order
,
EventFlowId
:
eventFlowId
,
SubEventInfo
:
tableData
.
current
})
.
then
(
res
=>
{
if
(
res
.
msg
===
'Ok'
)
{
form
.
resetFields
();
...
...
@@ -500,7 +507,7 @@ const AddModal = (props) => {
if
(
obj
.
Roles
==
undefined
)
{
obj
.
Roles
=
''
;
}
CM_Event_AddEventTable
({
...
obj
,
Order
:
maxLength
}).
then
(
res
=>
{
CM_Event_AddEventTable
({
...
obj
,
Order
:
maxLength
,
SubEventInfo
:
tableData
.
current
}).
then
(
res
=>
{
if
(
res
.
msg
===
'Ok'
)
{
form
.
resetFields
();
setValue
(
''
);
...
...
@@ -525,6 +532,7 @@ const AddModal = (props) => {
getRole
();
if
(
type
===
'add'
)
{
form
.
setFieldsValue
({
BusinessType
:
rember1
});
tableData
.
current
=
[]
setValue
(
1
);
getEventData
();
setSelectValue
(
selectData
[
0
]);
...
...
@@ -554,6 +562,7 @@ const AddModal = (props) => {
setReportType
({
visibleCheck
:
Boolean
(
Reportable
),
ReportFromMobile
,
ReportFromWeb
})
setOrder
(
res
.
data
.
root
.
Order
);
form
.
setFieldsValue
({
...
res
.
data
.
root
});
tableData
.
current
=
res
.
data
.
root
.
SubEventInfo
if
(
res
.
data
.
root
.
ImageExpression
)
{
setImageUrl
(
`
${
window
.
location
.
origin
}
/civweb4/
${
res
.
data
.
root
.
ImageExpression
}
`
);
setIm
(
res
.
data
.
root
.
ImageExpression
);
...
...
@@ -943,6 +952,54 @@ const AddModal = (props) => {
setReportType
({
...
reportType
,
...
values
})
}
// 定义表格
const
columns
=
[
{
title
:
'事件名称'
,
dataIndex
:
'SubFlowEventName'
,
align
:
'center'
,
render
:
(
text
,
record
)
=>
{
if
(
text
===
'(未配置)'
||
text
===
'(无)'
)
{
return
<
span
style
=
{{
color
:
'grey'
}}
>
{
text
}
<
/span>
;
}
return
<
span
>
{
text
||
record
.
WebPage
}
<
/span>
;
},
},
// {
// title: '源字段',
// dataIndex: 'Fields',
// align: 'center',
// render: (text, record) => {
// if (text === '(未配置)' || text === '(无)') {
// return <span style={{ color: 'grey' }}>{text}</span>;
// }
// return <span>{text || record.WebPage}</span>;
// },
// },
{
title
:
'操作'
,
align
:
'center'
,
ellipsis
:
true
,
render
:
record
=>
(
<>
<
Space
>
<
DeleteOutlined
onClick
=
{()
=>
delRow
(
record
)}
style
=
{{
fontSize
:
'16px'
,
color
:
'#e86060'
}}
/
>
<
/Space
>
<
/
>
),
},
];
const
delRow
=
record
=>
{
let
list
=
JSON
.
parse
(
JSON
.
stringify
(
tableData
.
current
));
list
=
list
.
filter
(
item
=>
item
.
SubFlowEventConfigID
!==
record
.
SubFlowEventConfigID
);
tableData
.
current
=
list
;
setFlag
(
flag
+
1
)
};
const
onOK
=
prop
=>
{
setIsVisible
(
false
);
let
inputText
=
{};
...
...
@@ -1176,6 +1233,24 @@ const AddModal = (props) => {
setShow
(
'hidden'
);
};
const
saveView
=
(
val
,
type
)
=>
{
let
list
=
JSON
.
parse
(
JSON
.
stringify
(
tableData
.
current
));
if
(
type
===
'add'
)
{
list
.
push
({
...
val
});
}
else
{
list
[
index
]
=
val
}
tableData
.
current
=
list
;
// nodeChage('AccountFlowNodeBackfillConfigs', tableData.current);
setViewModal
(
false
);
};
const
toEdit
=
val
=>
{
setViewModal
(
true
);
setModalType
(
'edit'
);
setviewMsg
(
val
);
};
return
(
<
Drawer
title
=
{
type
===
'add'
?
'添加事件'
:
'编辑事件'
}
...
...
@@ -1764,6 +1839,43 @@ const AddModal = (props) => {
<
/Item
>
<
/Col
>
<
/Row
>
<
Row
>
<
Col
span
=
{
24
}
>
<
Item
label
=
"通用事件"
name
=
"usualEvent"
// style={{ height: '112px' }}
labelCol
=
{{
span
:
5
}}
>
<
Button
type
=
"primary"
onClick
=
{()
=>
{
setViewModal
(
true
);
setModalType
(
'add'
);
}}
style
=
{{
display
:
'flex'
,
alignItems
:
'center'
}}
icon
=
{
<
PlusOutlined
/>
}
>
新增通用事件
<
/Button
>
<
Table
dataSource
=
{
tableData
.
current
}
columns
=
{
columns
}
rowKey
=
{
record
=>
record
.
key
}
bordered
size
=
"small"
scroll
=
{{
y
:
'calc(100vh - 630px)'
}}
onRow
=
{(
record
,
index
)
=>
({
onDoubleClick
:
()
=>
{
setIndex
(
index
)
toEdit
(
record
,
index
);
},
})}
pagination
=
{
false
}
/
>
<
/Item
>
<
/Col
>
<
/Row
>
<
/Form
>
)}
<
/Spin
>
...
...
@@ -1808,6 +1920,18 @@ const AddModal = (props) => {
formObj
=
{
formObj
}
/
>
<
SelectField
ref
=
{
selectFieldRef
}
filed
=
{
filed
}
filedArray
=
{
nu
}
submit
=
{
submitField
}
/
>
<
AddAccount
tableName
=
{
form
.
getFieldValue
(
'TableName'
)}
eventNames
=
{
businessArr
.
length
?
businessArr
[
0
].
root
:
[]}
tableData
=
{
tableData
.
current
}
visible
=
{
viewModal
}
msg
=
{
viewMsg
}
modalType
=
{
modalType
}
handleCancel
=
{()
=>
setViewModal
(
false
)}
onSubumit
=
{
saveView
}
// tableField={tableField}
addIndex
=
{
tableData
.
current
&&
tableData
.
current
.
length
}
/
>
<
/Drawer
>
);
};
...
...
src/pages/bsmanager/workOrder/incident/incident.jsx
View file @
d1aac0ea
...
...
@@ -57,6 +57,7 @@ import AddModal from './AddModal';
import
ProcessModal
from
'./ProcessModal'
;
import
SortModal
from
'./SortModal'
;
import
ViewModal
from
'./ViewModal'
;
import
{
LoadEventFields
}
from
'@/services/tablemanager/tablemanager'
;
const
{
Search
}
=
Input
;
...
...
@@ -706,6 +707,7 @@ const incident = () => {
selectData={select}
callBackSubmit={onSubmit}
placement="right"
businessArr={keepIdValue.filter(item => item.businessType === '
通用事件
')}
/>
<SortModal
title="调整顺序"
...
...
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