Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
play_office
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
play_office
Commits
4e95eaab
Commit
4e95eaab
authored
Nov 06, 2024
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 未转换完的提示
parent
28370039
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
15 deletions
+60
-15
index-DbUpgpuo.js
play/assets/index-DbUpgpuo.js
+12
-12
index-UTAcNXk5.css
play/assets/index-UTAcNXk5.css
+1
-0
index.html
play/index.html
+2
-1
App.vue
vue-proj/vue-project/src/App.vue
+45
-2
No files found.
play/assets/index-
CQb5JtTP
.js
→
play/assets/index-
DbUpgpuo
.js
View file @
4e95eaab
This diff is collapsed.
Click to expand it.
play/assets/index-UTAcNXk5.css
0 → 100644
View file @
4e95eaab
.error-message
[
data-v-27deeb3e
]
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
height
:
100%
;
font-size
:
16px
;
color
:
#666
}
play/index.html
View file @
4e95eaab
...
...
@@ -4,7 +4,8 @@
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<script
type=
"text/javascript"
src=
"//staging-teach.cdn.ireadabc.com/h5template/h5-static-lib/js/air.js"
></script>
<script
type=
"module"
crossorigin
src=
"assets/index-CQb5JtTP.js"
></script>
<script
type=
"module"
crossorigin
src=
"assets/index-DbUpgpuo.js"
></script>
<link
rel=
"stylesheet"
crossorigin
href=
"assets/index-UTAcNXk5.css"
>
</head>
<body>
<div
id=
"app"
></div>
...
...
vue-proj/vue-project/src/App.vue
View file @
4e95eaab
...
...
@@ -4,10 +4,42 @@ import VueOfficePdf from "@vue-office/pdf";
import
VueOfficeDocx
from
"
@vue-office/docx
"
;
const
url
=
ref
(
''
);
const
ppt_html
=
ref
(
''
);
window
.
courseware
.
getData
((
dt
)
=>
{
// 添加一个状态来控制错误提示
const
showErrorMsg
=
ref
(
false
);
// 检查 URL 是否可访问
async
function
checkUrl
(
url
)
{
try
{
const
response
=
await
fetch
(
url
);
const
text
=
await
response
.
text
();
// 检查返回内容是否包含错误 XML
if
(
text
.
includes
(
'
<Error>
'
)
&&
text
.
includes
(
'
<Code>NoSuchKey</Code>
'
))
{
showErrorMsg
.
value
=
true
;
window
.
air
.
hideAirClassLoading
(
'
play_office
'
,
null
);
return
false
;
}
return
true
;
}
catch
(
error
)
{
console
.
error
(
'
检查URL时出错:
'
,
error
);
showErrorMsg
.
value
=
true
;
window
.
air
.
hideAirClassLoading
(
'
play_office
'
,
null
);
return
false
;
}
}
window
.
courseware
.
getData
(
async
(
dt
)
=>
{
url
.
value
=
dt
?.
url
;
ppt_html
.
value
=
dt
?.
ppt_html
;
if
(
ppt_html
.
value
)
{
// 如果是 PPT,先检查 URL 是否可访问
if
(
url
.
value
.
toLowerCase
().
includes
(
'
.ppt
'
))
{
const
isAccessible
=
await
checkUrl
(
ppt_html
.
value
);
if
(
!
isAccessible
)
{
return
;
}
}
window
.
air
.
hideAirClassLoading
(
'
play_office
'
,
null
);
}
},
'
play_office
'
);
...
...
@@ -28,10 +60,21 @@ function errorHandler () {}
</
template
>
<
template
v-if=
"url.indexOf(`.ppt`) > 0 || url.indexOf(`.PPT`) > 0 || url.indexOf(`.pptx`) > 0 || url.indexOf(`.PPTX`) > 0"
>
<div
style=
"height: 100vh"
>
<iframe
frameborder=
"0"
width=
"100%"
height=
"100%"
:src=
"ppt_html"
></iframe>
<div
v-if=
"showErrorMsg"
class=
"error-message"
>
课件正在生成中,请过一会儿再尝试
</div>
<iframe
v-else
frameborder=
"0"
width=
"100%"
height=
"100%"
:src=
"ppt_html"
></iframe>
</div>
</
template
>
</template>
<
style
scoped
>
.error-message
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
height
:
100%
;
font-size
:
16px
;
color
:
#666
;
}
</
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