Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
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
罗超
confucius
Commits
fa096810
Commit
fa096810
authored
Aug 30, 2024
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复缩放滚动问题
parent
29123da1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
scrollBar.vue
src/components/common/scrollBar.vue
+2
-2
StudentProgress.vue
src/pages/stuMan/StudentProgress.vue
+16
-5
No files found.
src/components/common/scrollBar.vue
View file @
fa096810
...
...
@@ -40,9 +40,9 @@ export default {
const
box
=
document
.
querySelector
(
'#scrollBox'
)
const
tb
=
document
.
querySelector
(
`#
${
this
.
targetBox
}
`
)
const
tw
=
document
.
querySelector
(
`#
${
this
.
targetWrap
}
`
)
const
zoom
=
tw
.
style
.
zoom
?
tw
.
style
.
zoom
:
1
if
(
box
&&
tb
&&
tw
){
this
.
ratio
=
tw
.
offsetWidth
/
tb
.
offsetWidth
this
.
ratio
=
(
tw
.
offsetWidth
*
zoom
)
/
tb
.
offsetWidth
this
.
innerW
=
`
${
this
.
ratio
*
box
.
offsetWidth
}
px`
this
.
boxRatio
=
tb
.
offsetWidth
/
box
.
offsetWidth
}
...
...
src/pages/stuMan/StudentProgress.vue
View file @
fa096810
<
template
>
<!--
<div
class=
"page-body"
style=
"height:calc(100% - 30px);"
>
-->
<div
class=
"sptable-box"
id=
"sptable"
>
<div
class=
"sptable-wrap"
id=
"sptableWrap"
v-loading=
"loading"
:style=
"
{'zoom':zoom}
">
<table
class=
"sptable"
>
<div
class=
"sptable-wrap"
v-loading=
"loading
"
>
<table
class=
"sptable"
id=
"sptableWrap"
:style=
"
{'zoom':zoom}"
>
<thead>
<tr
class=
"sticky-header"
>
<th
class=
"sticky-column stubg"
>
学员
</th>
...
...
@@ -80,7 +80,12 @@
targetBox=
"sptable"
targetWrap=
"sptableWrap"
@
scrollChange=
"scrollHandle"
ref=
"scrollBar"
></scroll-bar>
<div
class=
"q-ml-md row items-center"
>
<span>
{{
Math
.
ceil
(
zoom
*
100
)
}}
%
</span>
<q-btn
@
click=
"resetZoom"
color=
"primary"
v-show=
"zoom!=1"
style=
"padding: 0; font-size: 11px !important;font-family: microsoft yahei !important; font-weight: 400;"
flat
label=
"重置"
/>
</div>
</div>
</div>
<!--
</div>
-->
...
...
@@ -120,7 +125,6 @@ export default {
},
methods
:
{
scrollHandle
(
e
)
{
console
.
log
(
e
);
const
box
=
document
.
querySelector
(
"#sptable"
);
box
.
scrollLeft
=
e
;
},
...
...
@@ -161,7 +165,6 @@ export default {
if
(
!
this
.
currentCourse
||
!
this
.
currentCourse
.
CourseId
)
return
this
.
loading
=
true
;
queryScheduleCourseStu
({
CourseRate
:
this
.
currentCourse
.
CourseRate
}).
then
(
r
=>
{
console
.
log
(
r
.
Data
)
this
.
students
=
r
.
Data
this
.
loading
=
false
;
this
.
assembleHandler
()
...
...
@@ -178,6 +181,9 @@ export default {
x
.
assemble
.
push
(
r
)
})
})
this
.
$nextTick
(()
=>
{
this
.
$refs
.
scrollBar
.
calcHandle
()
})
},
handleWheel
(
event
)
{
if
(
event
.
ctrlKey
===
true
||
event
.
metaKey
===
true
){
...
...
@@ -186,6 +192,7 @@ export default {
}
else
{
this
.
zoomIn
();
}
this
.
$refs
.
scrollBar
.
calcHandle
()
event
.
preventDefault
();
return
false
}
...
...
@@ -198,6 +205,10 @@ export default {
zoomOut
()
{
// 缩小逻辑
if
(
this
.
zoom
>
0.1
)
this
.
zoom
-=
0.05
},
resetZoom
(){
this
.
zoom
=
1
this
.
$refs
.
scrollBar
.
calcHandle
()
}
},
created
()
{
...
...
@@ -218,7 +229,7 @@ export default {
height
:
100%
;
overflow-y
:
auto
;
padding-bottom
:
20px
;
user-select
:
none
;
/* user-select: none; */
background
:
#fff
;
}
.sptable-box
.sptable-wrap
{
...
...
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