Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mt-education-mobile
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
王旭
mt-education-mobile
Commits
aabe0d5c
Commit
aabe0d5c
authored
Jan 07, 2020
by
wangjiankun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ppt pdf word 页数显示不正确问题
parent
61b7a5d8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
17 deletions
+31
-17
MtPdf.vue
src/components/MtPdf.vue
+17
-11
MtPdfPpt.vue
src/components/MtPdfPpt.vue
+7
-3
MtWord.vue
src/components/MtWord.vue
+7
-3
No files found.
src/components/MtPdf.vue
View file @
aabe0d5c
...
@@ -85,7 +85,8 @@ export default {
...
@@ -85,7 +85,8 @@ export default {
fullState
:
false
,
fullState
:
false
,
loading
:
false
,
loading
:
false
,
loadTask
:
''
,
loadTask
:
''
,
toolBarShow
:
false
toolBarShow
:
false
,
saveMaxHeight
:
0
}
}
},
},
watch
:
{
watch
:
{
...
@@ -186,8 +187,13 @@ export default {
...
@@ -186,8 +187,13 @@ export default {
$
(
'.tool-bar'
).
css
(
'display'
,
'none'
)
$
(
'.tool-bar'
).
css
(
'display'
,
'none'
)
this
.
toolBarShow
=
false
this
.
toolBarShow
=
false
}
}
const
itemHeight
=
$
(
$
(
'.pdfItem'
)[
0
]).
outerHeight
(
true
),
// $('.pdfList').height()/this.numPages;
let
itemHeight
=
0
scrolled
=
$
(
'.pdf'
)[
0
].
scrollTop
$
(
'.pdfItem'
).
each
(
function
()
{
const
h
=
$
(
this
).
outerHeight
()
itemHeight
=
itemHeight
<
h
?
h
:
itemHeight
})
// $('.pdfList').height()/this.numPages;
const
scrolled
=
$
(
'.pdf'
)[
0
].
scrollTop
this
.
page
=
parseInt
((
scrolled
+
itemHeight
)
/
(
itemHeight
))
+
Math
.
ceil
(
$
(
'.pdf'
).
height
()
/
itemHeight
)
-
1
this
.
page
=
parseInt
((
scrolled
+
itemHeight
)
/
(
itemHeight
))
+
Math
.
ceil
(
$
(
'.pdf'
).
height
()
/
itemHeight
)
-
1
},
},
toFullScreen
()
{
toFullScreen
()
{
...
...
src/components/MtPdfPpt.vue
View file @
aabe0d5c
...
@@ -188,9 +188,13 @@ export default {
...
@@ -188,9 +188,13 @@ export default {
$
(
'.tool-bar'
).
css
(
'display'
,
'none'
)
$
(
'.tool-bar'
).
css
(
'display'
,
'none'
)
this
.
toolBarShow
=
false
this
.
toolBarShow
=
false
}
}
const
itemHeight
=
$
(
'.pdfItem'
).
height
(),
// $('.pdfList').height()/this.numPages;
let
itemHeight
=
0
scrolled
=
$
(
'.pdf'
)[
0
].
scrollTop
$
(
'.pdfItem'
).
each
(
function
()
{
console
.
log
(
$
(
'.pdf'
)[
0
].
scrollTop
,
$
(
'.pdfItem'
).
height
())
const
h
=
$
(
this
).
outerHeight
()
itemHeight
=
itemHeight
<
h
?
h
:
itemHeight
})
// $('.pdfList').height()/this.numPages;
const
scrolled
=
$
(
'.pdf'
)[
0
].
scrollTop
this
.
page
=
parseInt
((
scrolled
+
itemHeight
)
/
(
itemHeight
))
+
parseInt
(
$
(
'.pdf'
).
height
()
/
itemHeight
)
-
1
this
.
page
=
parseInt
((
scrolled
+
itemHeight
)
/
(
itemHeight
))
+
parseInt
(
$
(
'.pdf'
).
height
()
/
itemHeight
)
-
1
},
},
toFullScreen
()
{
toFullScreen
()
{
...
...
src/components/MtWord.vue
View file @
aabe0d5c
...
@@ -186,10 +186,14 @@ export default {
...
@@ -186,10 +186,14 @@ export default {
$
(
'.tool-bar'
).
css
(
'display'
,
'none'
)
$
(
'.tool-bar'
).
css
(
'display'
,
'none'
)
this
.
toolBarShow
=
false
this
.
toolBarShow
=
false
}
}
const
itemHeight
=
$
(
'.pdfItem'
).
outerHeight
(
true
),
// $('.pdfList').height()/this.numPages;
let
itemHeight
=
0
scrolled
=
$
(
'.pdf'
)[
0
].
scrollTop
$
(
'.pdfItem'
).
each
(
function
()
{
const
h
=
$
(
this
).
outerHeight
()
itemHeight
=
itemHeight
<
h
?
h
:
itemHeight
})
// $('.pdfList').height()/this.numPages;
const
scrolled
=
$
(
'.pdf'
)[
0
].
scrollTop
this
.
page
=
parseInt
((
scrolled
+
itemHeight
)
/
(
itemHeight
))
+
Math
.
ceil
(
$
(
'.pdf'
).
height
()
/
itemHeight
)
-
1
this
.
page
=
parseInt
((
scrolled
+
itemHeight
)
/
(
itemHeight
))
+
Math
.
ceil
(
$
(
'.pdf'
).
height
()
/
itemHeight
)
-
1
console
.
log
((
scrolled
+
itemHeight
),
itemHeight
,
Math
.
ceil
(
$
(
'.pdf'
).
height
()
/
itemHeight
))
},
},
toFullScreen
()
{
toFullScreen
()
{
const
that
=
this
const
that
=
this
...
...
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