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
e8b788bd
Commit
e8b788bd
authored
Feb 08, 2023
by
邓超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 事件添加导入导出功能
parent
2eb39a36
Pipeline
#67194
passed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
5 deletions
+77
-5
incident.jsx
src/pages/bsmanager/workOrder/incident/incident.jsx
+58
-3
api.js
src/services/standingBook/api.js
+19
-2
No files found.
src/pages/bsmanager/workOrder/incident/incident.jsx
View file @
e8b788bd
...
...
@@ -24,6 +24,7 @@ import {
Input
,
message
,
Tag
,
Upload
,
}
from
'antd'
;
import
{
...
...
@@ -37,6 +38,8 @@ import {
ApartmentOutlined
,
DesktopOutlined
,
FormOutlined
,
ImportOutlined
,
ExportOutlined
,
}
from
'@ant-design/icons'
;
import
{
GetCM_Event_LoadEventTable
,
...
...
@@ -44,6 +47,9 @@ import {
CM_Event_ReOrder
,
GetCM_Event_LoadEventTypeTable
,
CM_Event_EditBusinessType
,
CheckImportEventConfig
,
ImportEventConfig
,
ExportEventConfig
,
}
from
'@/services/standingBook/api'
;
import
classnames
from
'classnames'
;
import
styles
from
'./incident.less'
;
...
...
@@ -79,6 +85,7 @@ const incident = () => {
const
[
keepIdValue
,
setKeepIdValue
]
=
useState
([]);
const
[
editBusinessVisible
,
setEditBusinessVisible
]
=
useState
(
false
);
const
[
addForm
]
=
Form
.
useForm
();
const
[
file
,
setFile
]
=
useState
();
// 上传文件信息
const
columns
=
[
{
...
...
@@ -256,6 +263,12 @@ const incident = () => {
<
Tooltip
title=
"编辑事件类型"
>
<
EditTwoTone
onClick=
{
()
=>
editEventType
(
record
)
}
style=
{
{
fontSize
:
'16px'
}
}
/>
</
Tooltip
>
<
Tooltip
title=
"导出事件"
>
<
ExportOutlined
onClick=
{
()
=>
hadelExport
(
record
)
}
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
/>
</
Tooltip
>
<
Tooltip
title=
"受理流程"
>
<
ApartmentOutlined
onClick=
{
()
=>
process1
(
record
)
}
...
...
@@ -366,6 +379,41 @@ const incident = () => {
}
});
},
[]);
const
beforeUpload
=
val
=>
{
setFile
(
val
);
const
formData
=
new
FormData
();
formData
.
append
(
'_files'
,
val
);
CheckImportEventConfig
(
formData
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
Modal
.
confirm
({
title
:
'提示'
,
icon
:
''
,
content
:
<
div
style=
{
{
whiteSpace
:
'pre-wrap'
}
}
>
{
res
.
data
}
</
div
>,
onOk
()
{
console
.
log
(
'OK'
);
ImportEventConfig
(
formData
).
then
(
response
=>
{
if
(
response
.
code
===
0
)
{
message
.
success
(
'导入成功'
);
}
else
{
message
.
error
(
response
.
msg
);
}
});
},
okText
:
'确认'
,
cancelText
:
'取消'
,
});
}
else
{
message
.
error
(
res
.
msg
);
}
});
return
false
;
};
// 导出
const
hadelExport
=
record
=>
{
window
.
location
.
href
=
ExportEventConfig
({
eventTypeId
:
record
.
ID
,
});
};
const
formateArrDataA
=
(
initialArr
,
name
)
=>
{
console
.
log
(
initialArr
);
console
.
log
(
name
);
...
...
@@ -619,14 +667,21 @@ const incident = () => {
<
FormOutlined
className=
{
styles
.
iconSize
}
onClick=
{
editBusiness
}
/>
</
Tooltip
>
</
span
>
<
span
style=
{
{
float
:
'right'
,
marginRight
:
'10px'
}
}
>
<
span
style=
{
{
float
:
'right'
,
marginRight
:
'10px'
,
marginTop
:
'10px'
}
}
>
<
Upload
showUploadList=
{
false
}
accept=
".json"
beforeUpload=
{
beforeUpload
}
>
<
Button
style=
{
{
marginLeft
:
'10px'
}
}
type=
"primary"
ghost
>
<
div
style=
{
{
display
:
'flex'
,
alignItems
:
'center'
}
}
>
<
ImportOutlined
style=
{
{
marginRight
:
'5px'
}
}
/>
<
div
>
导入
</
div
>
</
div
>
</
Button
>
</
Upload
>
<
Button
icon=
{
<
OrderedListOutlined
className=
{
styles
.
icon
}
/>
}
onClick=
{
sort
}
style=
{
{
marginLeft
:
'
3
0px'
,
marginLeft
:
'
1
0px'
,
verticalAlign
:
'middle'
,
marginTop
:
'10px'
,
}
}
>
调序
...
...
src/services/standingBook/api.js
View file @
e8b788bd
...
...
@@ -3,8 +3,8 @@
* @Description:
* @Author: leizhe
* @Date: 2021-07-23 10:42:58
* @LastEditTime: 202
2-08-17 10:11:11
* @LastEditors:
leizhe
* @LastEditTime: 202
3-02-08 17:02:25
* @LastEditors:
dengchao 754083046@qq.com
*/
import
{
CITY_SERVICE
,
get
,
PUBLISH_SERVICE
,
post
,
postForm
}
from
'../index'
;
...
...
@@ -102,3 +102,20 @@ export const GetEventExtendPage = query =>
// 删除事件辅助视图配置
export
const
CM_Event_RemoveEventExtendPage
=
query
=>
get
(
`
${
PUBLISH_SERVICE
}
/WorkOrderCenter/CM_Event_RemoveEventExtendPage`
,
query
);
// 事件导入检查
export
const
CheckImportEventConfig
=
query
=>
post
(
`
${
PUBLISH_SERVICE
}
/WorkOrderCenter/CheckImportEventConfig`
,
query
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data;charset=UTF-8'
,
},
});
// 事件导入
export
const
ImportEventConfig
=
query
=>
post
(
`
${
PUBLISH_SERVICE
}
/WorkOrderCenter/ImportEventConfig`
,
query
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data;charset=UTF-8'
,
},
});
// 导出
export
const
ExportEventConfig
=
query
=>
`
${
PUBLISH_SERVICE
}
/WorkOrderCenter/ExportEventConfig?eventTypeId=
${
query
.
eventTypeId
}
`
;
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