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
363e7591
Commit
363e7591
authored
Jun 08, 2022
by
leon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix pull down refresh
parent
2a5ad7e6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
5 deletions
+50
-5
details.vue
pages/details/details.vue
+40
-2
index.vue
pages/index/index.vue
+5
-0
reports.vue
pages/reports/reports.vue
+5
-3
No files found.
pages/details/details.vue
View file @
363e7591
...
...
@@ -71,6 +71,7 @@
pageSize
:
0
,
timename
:
null
,
pageScrollTop
:
0
,
stickyTables
:
[],
// 设置了吸顶的table
horizontalBarHeight
:
0
}
},
...
...
@@ -198,6 +199,7 @@
}
}
that
.
reportInfo
=
res
.
data
.
Result
that
.
getStickyTables
()
}
},
/**
...
...
@@ -235,6 +237,15 @@
}
},
getStickyTables
()
{
this
.
reportInfo
.
list
.
forEach
(
item
=>
{
// 后端会增加一个表头吸顶的配置,headerSticky=true
if
(
item
.
type
===
'NormalTable'
&&
item
.
table
.
tableHeader
.
headerSticky
)
{
this
.
stickyTables
.
push
(
item
)
}
})
},
/**
* 点击向左切换按钮
*/
...
...
@@ -278,7 +289,7 @@
var
pageNumber
=
parseInt
((
this
.
idList
.
length
-
1
)
/
this
.
pageSize
)
+
2
var
list
=
[]
const
that
=
this
var
param
=
{
"pageSize"
:
that
.
pageSize
,
"pageNumber"
:
pageNumber
,
"folderId"
:
"62
1db7710668d7e647d5f4cc
"
,
"superAdmin"
:
true
}
var
param
=
{
"pageSize"
:
that
.
pageSize
,
"pageNumber"
:
pageNumber
,
"folderId"
:
"62
837a79bfa93100013596c1
"
,
"superAdmin"
:
true
}
let
res
=
await
that
.
$u
.
api
.
getReportList
(
param
)
const
{
Status
,
Result
}
=
res
.
data
if
(
Status
===
'true'
)
{
...
...
@@ -298,11 +309,38 @@
}
},
onPullDownRefresh
()
{
// 让list数据做下改变,下拉刷新后才能触发页面的渲染,让组件里面的接口调用
this
.
reportInfo
.
list
=
this
.
reportInfo
.
list
.
map
(
item
=>
{
item
.
value
=
"2022"
return
item
})
this
.
getReportCharts
()
},
onPageScroll
(
res
)
{
if
(
res
.
scrollTop
>
this
.
pageScrollTop
)
{
// 向上滑动
this
.
stickyTables
.
forEach
(
item
=>
{
if
(
res
.
scrollTop
>=
item
.
top
*
this
.
scale
)
{
uni
.
$emit
(
item
.
id
,{
sticky
:
true
})
}
if
(
res
.
scrollTop
>=
item
.
top
*
this
.
scale
+
item
.
height
*
this
.
scale
)
{
uni
.
$emit
(
item
.
id
,{
sticky
:
false
})
}
})
}
else
{
this
.
stickyTables
.
forEach
(
item
=>
{
if
(
res
.
scrollTop
<
item
.
top
*
this
.
scale
+
item
.
height
*
this
.
scale
)
{
uni
.
$emit
(
item
.
id
,{
sticky
:
true
})
}
if
(
res
.
scrollTop
<
item
.
top
*
this
.
scale
)
{
uni
.
$emit
(
item
.
id
,{
sticky
:
false
})
}
})
}
this
.
pageScrollTop
=
res
.
scrollTop
}
},
}
</
script
>
...
...
pages/index/index.vue
View file @
363e7591
...
...
@@ -270,6 +270,11 @@
},
onPullDownRefresh
()
{
// 让list数据做下改变,下拉刷新后才能触发页面的渲染,让组件里面的接口调用
this
.
reportInfo
.
list
=
this
.
reportInfo
.
list
.
map
(
item
=>
{
item
.
value
=
"2022"
return
item
})
this
.
getReportCharts
()
},
onPageScroll
(
res
)
{
...
...
pages/reports/reports.vue
View file @
363e7591
...
...
@@ -37,9 +37,10 @@
pageSize
:
10
,
totalPages
:
0
,
totals
:
0
,
folderId
:
'62
1db7710668d7e647d5f4cc
'
,
folderId
:
'62
837a79bfa93100013596c1
'
,
superAdmin
:
true
}
},
}
},
onLoad
()
{
...
...
@@ -76,7 +77,8 @@
uni
.
navigateTo
({
url
:
url
})
}
},
},
onPullDownRefresh
()
{
this
.
reportList
=
[]
...
...
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