Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AmosBankPatrolView
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
bank
AmosBankPatrolView
Commits
91e763fb
Commit
91e763fb
authored
Dec 10, 2020
by
吴俊凯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
巡检增加业务报表导出功能
parent
8d497755
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
105 additions
and
83 deletions
+105
-83
amos.config.js
amos.config.js
+3
-0
urlConsts.js
src/consts/urlConsts.js
+0
-0
CatalogTreeTable.js
src/view/patrol/catalogTree/CatalogTreeTable.js
+20
-29
CheckTable.js
src/view/patrol/check/CheckTable.js
+53
-41
index.js
src/view/patrol/check/index.js
+29
-13
No files found.
amos.config.js
View file @
91e763fb
...
...
@@ -14,6 +14,9 @@
securityBaseURI
:
'http://172.16.10.72:10005/'
,
//APP图片
picURI
:
'http://172.16.11.20:8080'
,
//业务表导出地址
ureportURI
:
' http://172.16.11.41:8099/renren-admin/ureport/excel'
,
},
// websocket 地址
wsURI
:
{
...
...
src/consts/urlConsts.js
View file @
91e763fb
This diff is collapsed.
Click to expand it.
src/view/patrol/catalogTree/CatalogTreeTable.js
View file @
91e763fb
...
...
@@ -6,13 +6,13 @@ import { browserHistory } from 'amos-react-router';
import
PropTypes
from
'prop-types'
;
import
{
pathMapping
}
from
'./../../../routes/customRoutes'
;
import
ToolBar
from
'./../../component/toolbar'
;
import
{
batDelCatalogTreeAction
,
btnAuthAction
}
from
'../../../services/checkService'
;
import
{
batDelCatalogTreeAction
,
btnAuthAction
}
from
'../../../services/checkService'
;
const
inputUrl
=
()
=>
pathMapping
.
catalogTreeInput
;
const
dropnavs1
=
{
key
:
'1'
,
text
:
'添加'
,
icon
:
'add'
,
href
:
'jacascript::void(0)'
,
permissionCode
:
'catalogtree'
,
isWriteable
:
true
};
const
dropnavs2
=
{
key
:
'2'
,
text
:
'修改'
,
icon
:
'edit'
,
href
:
'jacascript::void(0)'
,
permissionCode
:
'catalogtree'
,
isWriteable
:
true
};
const
dropnavs3
=
{
key
:
'3'
,
text
:
'删除'
,
icon
:
'delete'
,
href
:
'jacascript::void(0)'
,
permissionCode
:
'catalogtree'
,
isWriteable
:
true
};
const
dropnavs1
=
{
key
:
'1'
,
text
:
'添加'
,
icon
:
'add'
,
href
:
'jacascript::void(0)'
,
permissionCode
:
'catalogtree'
,
isWriteable
:
true
};
const
dropnavs2
=
{
key
:
'2'
,
text
:
'修改'
,
icon
:
'edit'
,
href
:
'jacascript::void(0)'
,
permissionCode
:
'catalogtree'
,
isWriteable
:
true
};
const
dropnavs3
=
{
key
:
'3'
,
text
:
'删除'
,
icon
:
'delete'
,
href
:
'jacascript::void(0)'
,
permissionCode
:
'catalogtree'
,
isWriteable
:
true
};
const
getColumns
=
()
=>
{
return
[
...
...
@@ -80,7 +80,7 @@ class CheckTable extends Component {
selectedRows
:
[],
selectedRowKeys
:
[],
data
:
[],
dropnavs
:[]
dropnavs
:
[]
};
}
...
...
@@ -89,34 +89,26 @@ class CheckTable extends Component {
*/
componentWillMount
=
()
=>
{
this
.
reloadButtonAuth
();
};
reloadButtonAuth
=
()
=>
{
// const _path = this.calcRoutes();
btnAuthAction
(
'/main/patrol/catalogtree'
).
then
(
data
=>
{
let
{
dropnavs
}
=
this
.
state
;
if
(
data
){
if
(
"tj"
in
data
&&
data
.
tj
.
hasPermission
){
dropnavs
.
push
(
dropnavs1
);
}
if
(
"xg"
in
data
&&
data
.
xg
.
hasPermission
){
dropnavs
.
push
(
dropnavs2
);
}
if
(
"sc"
in
data
&&
data
.
sc
.
hasPermission
){
dropnavs
.
push
(
dropnavs3
);
if
(
data
)
{
if
(
'tj'
in
data
&&
data
.
tj
.
hasPermission
)
{
dropnavs
.
push
(
dropnavs1
);
}
if
(
'xg'
in
data
&&
data
.
xg
.
hasPermission
)
{
dropnavs
.
push
(
dropnavs2
);
}
if
(
'sc'
in
data
&&
data
.
sc
.
hasPermission
)
{
dropnavs
.
push
(
dropnavs3
);
}
}
}
this
.
setState
({
dropnavs
});
this
.
setState
({
dropnavs
});
});
}
}
;
/**
* 分页设置参数
*/
...
...
@@ -182,8 +174,7 @@ class CheckTable extends Component {
// 确定删除
batDelCatalogTreeAction
(
ids
).
then
(
data
=>
{
debugger
if
(
data
===
null
){
if
(
data
===
null
)
{
AmosAlert
.
success
(
'提示'
,
'删除成功'
);
}
else
{
AmosAlert
.
error
(
'提示'
,
'删除分类失败:请先删除子节点'
);
...
...
@@ -238,7 +229,7 @@ class CheckTable extends Component {
};
render
()
{
let
{
pagination
,
isChecked
,
modal
,
selectedRowKeys
,
dropnavs
}
=
this
.
state
;
let
{
pagination
,
isChecked
,
modal
,
selectedRowKeys
,
dropnavs
}
=
this
.
state
;
let
{
dataList
,
fetchData
,
count
}
=
this
.
props
;
let
defaultPageConfig
=
this
.
pageConfig
;
return
(
...
...
src/view/patrol/check/CheckTable.js
View file @
91e763fb
...
...
@@ -11,8 +11,6 @@ import { patrolUrls } from './../../../consts/urlConsts';
import
ToolBar
from
'./../../component/toolbar'
;
import
{
batchDeCheckAction
,
queryCheckDetailAction
,
btnAuthAction
}
from
'../../../services/checkService'
;
const
ls
=
_amosTool
.
Store
.
lsTool
;
const
apiKey
=
SysConsts
.
api_key
;
const
token
=
SysConsts
.
token
;
...
...
@@ -36,6 +34,7 @@ const dropnavs3 = {
{
key
:
'3-4'
,
text
:
'导出全部图片'
,
href
:
'jacascript::void(0)'
,
permissionCode
:
'check'
,
isWriteable
:
false
}
]
};
const
dropnavs4
=
{
key
:
'4'
,
text
:
'业务报表'
,
icon
:
'file'
,
href
:
'jacascript::void(0)'
,
permissionCode
:
'check'
,
isWriteable
:
true
};
const
getColumns
=
()
=>
{
return
[
...
...
@@ -155,11 +154,11 @@ const getHeaders = () => {
'Content-Type'
:
'application/json; charset=utf-8'
,
'X-Api-Key'
:
_amosTool
.
Store
.
getCookieByName
(
apiKey
),
'X-Access-Token'
:
ls
.
read
(
token
),
'token'
:
ls
.
read
(
token
),
'appKey'
:
'YH-PATROL'
,
'product'
:
'YH-PATROL_WEB'
}
}
token
:
ls
.
read
(
token
),
appKey
:
'YH-PATROL'
,
product
:
'YH-PATROL_WEB'
}
;
}
;
/**
* 计划执行
...
...
@@ -202,7 +201,6 @@ class CheckTable extends Component {
this
.
reloadButtonAuth
();
};
/****按钮权限 */
reloadButtonAuth
=
()
=>
{
...
...
@@ -210,20 +208,23 @@ class CheckTable extends Component {
btnAuthAction
(
'/main/patrol/check'
).
then
(
data
=>
{
let
{
dropnavs
}
=
this
.
state
;
if
(
data
)
{
if
(
"jiancha"
in
data
&&
data
.
jiancha
.
hasPermission
)
{
if
(
'jiancha'
in
data
&&
data
.
jiancha
.
hasPermission
)
{
dropnavs
.
push
(
dropnavs1
);
}
if
(
"delete"
in
data
&&
data
.
delete
.
hasPermission
)
{
if
(
'delete'
in
data
&&
data
.
delete
.
hasPermission
)
{
dropnavs
.
push
(
dropnavs2
);
}
if
(
"user"
in
data
&&
data
.
user
.
hasPermission
)
{
if
(
'user'
in
data
&&
data
.
user
.
hasPermission
)
{
dropnavs
.
push
(
dropnavs3
);
}
if
(
'ureport'
in
data
&&
data
.
ureport
.
hasPermission
)
{
dropnavs
.
push
(
dropnavs4
);
}
}
this
.
setState
({
dropnavs
});
});
}
}
;
/**
* 分页设置参数
...
...
@@ -316,6 +317,8 @@ class CheckTable extends Component {
this
.
exportSelectImgs
();
}
else
if
(
type
===
'3-4'
)
{
this
.
exportAllDataImgs
();
}
else
if
(
type
===
'4'
)
{
this
.
onClickIcon
(
'check'
);
}
window
.
setLoading
&&
window
.
setLoading
(
false
);
};
...
...
@@ -331,18 +334,19 @@ class CheckTable extends Component {
fetch
(
url
,
{
method
:
'get'
,
headers
:
getHeaders
()
}).
then
(
e
=>
{
e
.
blob
().
then
(
blob
=>
{
const
a
=
window
.
document
.
createElement
(
'a'
);
const
downUrl
=
window
.
URL
.
createObjectURL
(
blob
);
let
currDate
=
new
Date
();
const
filename
=
[
currDate
.
getTime
(),
'xls'
];
a
.
href
=
downUrl
;
a
.
download
=
`
${
decodeURI
(
filename
[
0
])}
.
${
filename
[
1
]}
`
;
a
.
click
();
window
.
URL
.
revokeObjectURL
(
downUrl
);
});
})
.
then
(
e
=>
{
e
.
blob
().
then
(
blob
=>
{
const
a
=
window
.
document
.
createElement
(
'a'
);
const
downUrl
=
window
.
URL
.
createObjectURL
(
blob
);
let
currDate
=
new
Date
();
const
filename
=
[
currDate
.
getTime
(),
'xls'
];
a
.
href
=
downUrl
;
a
.
download
=
`
${
decodeURI
(
filename
[
0
])}
.
${
filename
[
1
]}
`
;
a
.
click
();
window
.
URL
.
revokeObjectURL
(
downUrl
);
});
})
.
catch
(
e
=>
{
_amosTool
.
Log
.
error
(
e
.
message
);
});
...
...
@@ -359,18 +363,19 @@ class CheckTable extends Component {
fetch
(
url
,
{
method
:
'get'
,
headers
:
getHeaders
()
}).
then
(
e
=>
{
e
.
blob
().
then
(
blob
=>
{
const
a
=
window
.
document
.
createElement
(
'a'
);
const
downUrl
=
window
.
URL
.
createObjectURL
(
blob
);
let
currDate
=
new
Date
();
const
filename
=
[
currDate
.
getTime
(),
'zip'
];
a
.
href
=
downUrl
;
a
.
download
=
`
${
decodeURI
(
filename
[
0
])}
.
${
filename
[
1
]}
`
;
a
.
click
();
window
.
URL
.
revokeObjectURL
(
downUrl
);
});
})
.
then
(
e
=>
{
e
.
blob
().
then
(
blob
=>
{
const
a
=
window
.
document
.
createElement
(
'a'
);
const
downUrl
=
window
.
URL
.
createObjectURL
(
blob
);
let
currDate
=
new
Date
();
const
filename
=
[
currDate
.
getTime
(),
'zip'
];
a
.
href
=
downUrl
;
a
.
download
=
`
${
decodeURI
(
filename
[
0
])}
.
${
filename
[
1
]}
`
;
a
.
click
();
window
.
URL
.
revokeObjectURL
(
downUrl
);
});
})
.
catch
(
e
=>
{
_amosTool
.
Log
.
error
(
e
.
message
);
});
...
...
@@ -476,12 +481,14 @@ class CheckTable extends Component {
// });
};
onClickIcon
=
(
value
)
=>
{
onClickIcon
=
value
=>
{
const
{
showType
}
=
this
.
state
;
if
(
showType
===
value
){
value
=
''
;}
if
(
showType
===
value
)
{
value
=
''
;
}
this
.
props
.
setShowType
(
value
);
this
.
setState
({
showType
:
value
});
}
}
;
render
()
{
let
{
pagination
,
dropnavs
,
isChecked
,
selectedRowKeys
}
=
this
.
state
;
...
...
@@ -491,12 +498,18 @@ class CheckTable extends Component {
return
(
<
div
className
=
"patrol-page-table"
>
<
ToolBar
dropnavs
=
{
dropnavs
}
callBack
=
{
this
.
onClickBootBar
}
/
>
<
div
className
=
'right-btn'
>
<
div
className
=
"right-btn"
>
{
/* <div className="row-btn">
<img src="/src/assets/fsc/check/export.png" onClick={() => this.onClickIcon('check')} />
<span> 业务报表</span>
</div> */
}
<
div
className
=
"row-btn"
>
<
img
src
=
"/src/assets/fsc/check/export.png"
onClick
=
{()
=>
this
.
onClickIcon
(
'export'
)}
/><span> 报表生成</
span
>
<
img
src
=
"/src/assets/fsc/check/export.png"
onClick
=
{()
=>
this
.
onClickIcon
(
'export'
)}
/
>
<
span
>&
nbsp
;
&
nbsp
;
报表生成
<
/span
>
<
/div
>
<
div
className
=
"row-btn"
>
<
img
src
=
"/src/assets/fsc/check/filter.png"
onClick
=
{()
=>
this
.
onClickIcon
(
'search'
)}
/><span> 筛选条件</
span
>
<
img
src
=
"/src/assets/fsc/check/filter.png"
onClick
=
{()
=>
this
.
onClickIcon
(
'search'
)}
/
>
<
span
>&
nbsp
;
&
nbsp
;
筛选条件
<
/span
>
<
/div
>
<
/div
>
<
AmosGridTable
...
...
@@ -524,5 +537,4 @@ CheckTable.propTypes = {
setShowType
:
PropTypes
.
func
};
export
default
CheckTable
;
src/view/patrol/check/index.js
View file @
91e763fb
...
...
@@ -3,6 +3,8 @@ import moment from 'moment';
import
CheckTable
from
'./CheckTable'
;
import
CheckSearch
from
'./CheckSearch'
;
import
ExportSearch
from
'./ExportSearch'
;
import
ExportCheckSearch
from
'./ExportCheckSearch'
;
import
{
queryCheckInfoAction
}
from
'../../../services/checkService'
;
import
SplitterLayout
from
'./SplitLayout'
;
...
...
@@ -37,7 +39,7 @@ class Check extends Component {
}
if
(
pointNo
)
{
searchParam
.
push
({
name
:
'pointNo'
,
value
:
pointNo
});
this
.
setState
({
searchParam
,
pointNo
});
this
.
setState
({
searchParam
,
pointNo
});
}
};
...
...
@@ -75,24 +77,38 @@ class Check extends Component {
});
}
setShowType
=
(
value
)
=>
{
setShowType
=
value
=>
{
this
.
setState
({
showType
:
value
});
}
}
;
render
()
{
let
{
statisticsData
,
totalCount
,
planId
,
pointNo
,
searchParam
,
showType
}
=
this
.
state
;
console
.
log
(
showType
);
return
(
<
div
className
=
"patrol-page-content"
>
{
showType
===
'search'
&&
<
SplitterLayout
title
=
'查询条件'
>
<
CheckSearch
search
=
{
this
.
onSearchDataSyn
}
planId
=
{
planId
}
pointNo
=
{
pointNo
}
/
>
<
/SplitterLayout>
}
{
showType
===
'export'
&&
<
SplitterLayout
title
=
'报表生成'
>
<
ExportSearch
search
=
{
this
.
onSearchDataSyn
}
planId
=
{
planId
}
pointNo
=
{
pointNo
}
/
>
<
/SplitterLayout
>
}
<
CheckTable
count
=
{
totalCount
}
fetchData
=
{
this
.
questStatistiscData
}
searchParam
=
{
searchParam
}
dataList
=
{
statisticsData
}
planId
=
{
planId
}
setShowType
=
{
this
.
setShowType
}
/
>
{
showType
===
'search'
&&
(
<
SplitterLayout
title
=
"查询条件"
>
<
CheckSearch
search
=
{
this
.
onSearchDataSyn
}
planId
=
{
planId
}
pointNo
=
{
pointNo
}
/
>
<
/SplitterLayout
>
)}
{
showType
===
'export'
&&
(
<
SplitterLayout
title
=
"报表生成"
>
<
ExportSearch
search
=
{
this
.
onSearchDataSyn
}
planId
=
{
planId
}
pointNo
=
{
pointNo
}
/
>
<
/SplitterLayout
>
)}
{
showType
===
'check'
&&
(
<
SplitterLayout
title
=
"业务报表"
>
<
ExportCheckSearch
/>
<
/SplitterLayout
>
)}
<
CheckTable
count
=
{
totalCount
}
fetchData
=
{
this
.
questStatistiscData
}
searchParam
=
{
searchParam
}
dataList
=
{
statisticsData
}
planId
=
{
planId
}
setShowType
=
{
this
.
setShowType
}
/
>
<
/div
>
);
}
...
...
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