Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
ec-report-refactor
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
lihuizhen
ec-report-refactor
Commits
23dfc763
Commit
23dfc763
authored
Feb 21, 2022
by
leon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:add reports list
parent
4114eed3
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
156 additions
and
10 deletions
+156
-10
http.api.js
common/http.api.js
+8
-4
http.interceptor.js
common/http.interceptor.js
+3
-2
pages.json
pages.json
+26
-1
index.vue
pages/index/index.vue
+6
-3
reports.vue
pages/reports/reports.vue
+113
-0
No files found.
common/http.api.js
View file @
23dfc763
const
baseUrl
=
'https://api.charleskeith.cn/api'
// 请求的本域名
// 请求的本域名
const
reportUrl
=
'http://192.168.138.55:8081/api'
const
baseUrl
=
'https://api.charleskeith.cn/api'
// 正式环境
const
reportUrl
=
'http://192.168.138.55:8081/api'
// 测试环境
// const reportUrl = 'http://47.101.191.49:8083/api' // 外网测试环境
const
install
=
(
Vue
,
vm
)
=>
{
const
install
=
(
Vue
,
vm
)
=>
{
let
getHttp
=
(
url
,
params
,
config
)
=>
vm
.
$http
.
get
(
url
,
{
params
},
config
)
let
getHttp
=
(
url
,
params
,
config
)
=>
vm
.
$http
.
get
(
url
,
{
params
},
config
)
let
postHttp
=
(
url
,
params
,
config
)
=>
vm
.
$http
.
post
(
url
,
params
,
config
)
let
postHttp
=
(
url
,
params
,
config
)
=>
vm
.
$http
.
post
(
url
,
params
,
config
)
...
@@ -10,7 +11,9 @@ const install = (Vue, vm) => {
...
@@ -10,7 +11,9 @@ const install = (Vue, vm) => {
// 注册
// 注册
let
register
=
params
=>
postHttp
(
`
${
baseUrl
}
/report/user/register`
,
params
)
let
register
=
params
=>
postHttp
(
`
${
baseUrl
}
/report/user/register`
,
params
)
// 报表列表
// 报表列表
const
getReportList
=
params
=>
getHttp
(
`
${
reportUrl
}
/report/chart/getList`
,
params
)
const
getReportList
=
params
=>
getHttp
(
`
${
reportUrl
}
/report/screen/getList`
,
params
)
// 报表组件列表
const
getReportCharts
=
params
=>
getHttp
(
`
${
reportUrl
}
/report/chart/getList`
,
params
)
// 数据集
// 数据集
const
dataSetPreview
=
params
=>
postHttp
(
`
${
reportUrl
}
/report/dataset/preview`
,
params
,
{
const
dataSetPreview
=
params
=>
postHttp
(
`
${
reportUrl
}
/report/dataset/preview`
,
params
,
{
custom
:
{
custom
:
{
...
@@ -36,6 +39,7 @@ const install = (Vue, vm) => {
...
@@ -36,6 +39,7 @@ const install = (Vue, vm) => {
quickLogin
,
quickLogin
,
register
,
register
,
getReportList
,
getReportList
,
getReportCharts
,
dataSetPreview
,
dataSetPreview
,
getAuthorized
,
getAuthorized
,
getUserListCount
,
getUserListCount
,
...
...
common/http.interceptor.js
View file @
23dfc763
...
@@ -3,8 +3,9 @@ const http = new Request();
...
@@ -3,8 +3,9 @@ const http = new Request();
const
install
=
(
Vue
,
vm
)
=>
{
const
install
=
(
Vue
,
vm
)
=>
{
http
.
setConfig
(
config
=>
{
http
.
setConfig
(
config
=>
{
// config.baseURL = 'https://api.charleskeith.cn'
// config.baseURL = 'https://api.charleskeith.cn' // 正式环境
config
.
baseURL
=
'http://192.168.138.55:8081'
// config.baseURL = 'http://47.101.191.49:8083' // 外网测试环境
config
.
baseURL
=
'http://192.168.138.55:8081'
// 测试环境
config
.
custom
=
{
config
.
custom
=
{
loading
:
true
loading
:
true
},
},
...
...
pages.json
View file @
23dfc763
...
@@ -6,7 +6,8 @@
...
@@ -6,7 +6,8 @@
{
{
"path"
:
"pages/index/index"
,
"path"
:
"pages/index/index"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"首页"
"navigationBarTitleText"
:
"首页"
,
"enablePullDownRefresh"
:
true
}
}
},
{
},
{
"path"
:
"pages/center/index"
,
"path"
:
"pages/center/index"
,
...
@@ -59,6 +60,25 @@
...
@@ -59,6 +60,25 @@
}
}
}
}
,{
"path"
:
"pages/reports/reports"
,
"style"
:
{
"navigationBarTitleText"
:
"小程序报表"
,
"enablePullDownRefresh"
:
true
,
"onReachBottomDistance"
:
50
}
}
,{
"path"
:
"pages/reports/detail"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
true
}
}
],
],
"globalStyle"
:
{
"globalStyle"
:
{
"navigationBarTextStyle"
:
"black"
,
"navigationBarTextStyle"
:
"black"
,
...
@@ -76,6 +96,11 @@
...
@@ -76,6 +96,11 @@
"iconPath"
:
"static/icon/user_report_normal.png"
,
"iconPath"
:
"static/icon/user_report_normal.png"
,
"selectedIconPath"
:
"static/icon/user_report_selected.png"
,
"selectedIconPath"
:
"static/icon/user_report_selected.png"
,
"text"
:
"实时数据"
"text"
:
"实时数据"
},
{
"pagePath"
:
"pages/reports/reports"
,
"iconPath"
:
"static/icon/admin_normal.png"
,
"selectedIconPath"
:
"static/icon/admin_selected.png"
,
"text"
:
"报表"
},
{
},
{
"pagePath"
:
"pages/center/index"
,
"pagePath"
:
"pages/center/index"
,
"iconPath"
:
"static/icon/admin_normal.png"
,
"iconPath"
:
"static/icon/admin_normal.png"
,
...
...
pages/index/index.vue
View file @
23dfc763
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
},
},
onLoad
()
{
onLoad
()
{
this
.
userAuthCheck
()
this
.
userAuthCheck
()
this
.
getReport
List
()
this
.
getReport
Charts
()
/**
/**
* 组件交互 - 参数
* 组件交互 - 参数
*/
*/
...
@@ -146,9 +146,9 @@
...
@@ -146,9 +146,9 @@
/**
/**
* 获取页面报表配置
* 获取页面报表配置
*/
*/
async
getReport
List
()
{
async
getReport
Charts
()
{
clearInterval
(
this
.
timename
)
clearInterval
(
this
.
timename
)
let
res
=
await
this
.
$u
.
api
.
getReport
List
({
id
:
'61cd2ba1c06bffbdae442c4f'
})
let
res
=
await
this
.
$u
.
api
.
getReport
Charts
({
id
:
'61cd2ba1c06bffbdae442c4f'
})
const
{
Status
,
Result
:
{
info
,
list
}
}
=
res
.
data
const
{
Status
,
Result
:
{
info
,
list
}
}
=
res
.
data
if
(
Status
===
'true'
)
{
if
(
Status
===
'true'
)
{
if
(
info
.
dataUrl
)
{
if
(
info
.
dataUrl
)
{
...
@@ -198,6 +198,9 @@
...
@@ -198,6 +198,9 @@
},
},
onReachBottom
()
{
onReachBottom
()
{
},
onPullDownRefresh
()
{
this
.
getReportCharts
()
}
}
}
}
</
script
>
</
script
>
...
...
pages/reports/reports.vue
0 → 100644
View file @
23dfc763
<
template
>
<view>
<u-waterfall
v-model=
"reportList"
>
<template
v-slot:left=
"
{leftList}">
<view
class=
"water-list"
v-for=
"(item, index) in leftList"
:key=
"index"
@
click=
"onClick(item)"
>
<u-lazy-load
class=
"water-image"
img-mode=
"aspectFit"
threshold=
"-450"
height=
"150"
border-radius=
"10"
:image=
"item.previewImg"
:index=
"index"
></u-lazy-load>
<view
class=
"water-name"
>
{{
item
.
name
}}
</view>
<view
class=
"water-name"
>
{{
item
.
updateTime
}}
</view>
</view>
</
template
>
<
template
v-slot:right=
"{rightList}"
>
<view
class=
"water-list"
v-for=
"(item, index) in rightList"
:key=
"index"
@
click=
"onClick(item)"
>
<u-lazy-load
class=
"water-image"
img-mode=
"aspectFit"
threshold=
"-450"
height=
"150"
border-radius=
"10"
:image=
"item.previewImg"
:index=
"index"
></u-lazy-load>
<view
class=
"water-name"
>
{{
item
.
name
}}
</view>
<view
class=
"water-name"
>
{{
item
.
updateTime
}}
</view>
</view>
</
template
>
</u-waterfall>
</view>
</template>
<
script
>
export
default
{
data
()
{
return
{
reportList
:
[],
params
:
{
pageNumber
:
1
,
pageSize
:
10
,
totalPages
:
0
,
totals
:
0
,
folderId
:
'61cd45a8c06bffbdae442d09'
,
superAdmin
:
true
}
}
},
onLoad
()
{
this
.
getReportList
()
},
methods
:
{
/**
* 获取页面报表配置
*/
async
getReportList
()
{
let
res
=
await
this
.
$u
.
api
.
getReportList
(
this
.
params
)
const
{
Status
,
Result
}
=
res
.
data
if
(
Status
===
'true'
)
{
if
(
this
.
params
.
pageNumber
===
1
)
{
this
.
reportList
=
Result
.
content
}
else
{
this
.
reportList
=
this
.
reportList
.
concat
(
Result
.
content
)
}
this
.
params
.
totals
=
Result
.
total
this
.
params
.
totalPages
=
Result
.
totalPages
}
},
// 点击查看
onClick
(
item
)
{
const
url
=
"/pages/reports/detail?id="
+
item
.
id
uni
.
navigateTo
({
url
:
url
})
}
},
onPullDownRefresh
()
{
this
.
getReportList
()
},
onReachBottom
()
{
if
(
this
.
params
.
pageNumber
<
this
.
params
.
totalPages
)
{
this
.
params
.
pageNumber
+=
1
this
.
getReportList
()
}
}
}
</
script
>
<
style
>
/* page不能写带scope的style标签中,否则无效 */
page
{
background-color
:
rgb
(
240
,
240
,
240
);
}
</
style
>
<
style
lang=
"scss"
scoped
>
.water-list
{
border-radius
:
8px
;
margin
:
5px
;
background-color
:
#ffffff
;
padding
:
8px
;
position
:
relative
;
}
.water-image
{
width
:
100%
;
border-radius
:
4px
;
}
.water-name
{
font-size
:
30rpx
;
margin-top
:
5px
;
}
</
style
>
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