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
d9682a2b
Commit
d9682a2b
authored
Nov 12, 2024
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat
parent
4d6dd087
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
14 deletions
+14
-14
index-DxwsA9db.css
play/assets/index-DxwsA9db.css
+1
-1
index-LG8DS8SY.js
play/assets/index-LG8DS8SY.js
+1
-1
index.html
play/index.html
+2
-2
App.vue
vue-proj/vue-project/src/App.vue
+10
-10
No files found.
play/assets/index-D
5frsKoS
.css
→
play/assets/index-D
xwsA9db
.css
View file @
d9682a2b
.thumbnail-container
{
position
:
fixed
;
bottom
:
-150px
;
left
:
0
;
right
:
0
;
height
:
140px
;
background-color
:
#505050
e6
;
transition
:
bottom
.3s
ease
;
z-index
:
999
}
.thumbnail-container.show
{
bottom
:
0
}
.thumbnail-list
{
display
:
flex
;
overflow-x
:
auto
;
padding
:
10px
;
gap
:
10px
;
height
:
100%
}
.thumbnail-item
{
flex
:
0
0
auto
;
width
:
160px
;
height
:
120px
;
position
:
relative
;
cursor
:
pointer
;
transition
:
all
.2s
ease
;
padding
:
2px
;
border-radius
:
4px
;
background-color
:
transparent
}
.thumbnail-item
img
{
width
:
100%
;
height
:
100%
;
object-fit
:
cover
;
border-radius
:
4px
;
border
:
2px
solid
transparent
;
transition
:
all
.2s
ease
}
.thumbnail-item.active
{
background-color
:
#ffffff4
d
;
transform
:
scale
(
1.05
);
box-shadow
:
0
0
10px
#ffffff80
}
.thumbnail-item.active
img
{
border-color
:
#fff
}
.thumbnail-item
:hover:not
(
.active
)
{
transform
:
scale
(
1.05
);
background-color
:
#ffffff1
a
}
.thumbnail-item
.page-number
{
position
:
absolute
;
bottom
:
5px
;
left
:
50%
;
transform
:
translate
(
-50%
);
background-color
:
#000000
b3
;
color
:
#fff
;
padding
:
2px
8px
;
border-radius
:
10px
;
font-size
:
12px
}
.thumbnail-list
::-webkit-scrollbar
{
height
:
8px
}
.thumbnail-list
::-webkit-scrollbar-track
{
background
:
#0000001
a
;
border-radius
:
4px
}
.thumbnail-list
::-webkit-scrollbar-thumb
{
background
:
#ffffff4
d
;
border-radius
:
4px
}
.thumbnail-list
::-webkit-scrollbar-thumb:hover
{
background
:
#ffffff80
}
.error-message
[
data-v-
5e90ea40
]
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
height
:
100%
;
font-size
:
16px
;
color
:
#666
}
.page-buttons-container
[
data-v-5e90ea40
]
{
position
:
fixed
;
bottom
:
20px
;
right
:
20px
;
display
:
flex
;
gap
:
15px
;
z-index
:
1000
}
.page-button
[
data-v-5e90ea40
]
{
width
:
50px
;
height
:
50px
;
background-color
:
#50505099
;
border-radius
:
25px
;
border
:
1px
solid
rgba
(
255
,
255
,
255
,
.3
);
color
:
#ffffff
e6
;
font-size
:
24px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
cursor
:
pointer
;
transition
:
all
.3s
ease
;
box-shadow
:
0
2px
6px
#00000026
}
.page-button
[
data-v-5e90ea40
]
:hover
{
background-color
:
#3c3c3c
cc
;
transform
:
scale
(
1.1
)}
.page-button
[
data-v-5e90ea40
]
:active
{
transform
:
scale
(
.95
)}
.arrow
[
data-v-5e90ea40
]
{
border
:
solid
white
;
border-width
:
0
2px
2px
0
;
display
:
inline-block
;
padding
:
4px
}
.left
[
data-v-5e90ea40
]
{
transform
:
rotate
(
135deg
);
margin-left
:
4px
}
.right
[
data-v-5e90ea40
]
{
transform
:
rotate
(
-45deg
);
margin-right
:
4px
}
.menu-icon
[
data-v-5e90ea40
]
{
width
:
18px
;
height
:
14px
;
position
:
relative
;
border-top
:
2px
solid
white
;
border-bottom
:
2px
solid
white
}
.menu-icon
[
data-v-5e90ea40
]
:before
{
content
:
""
;
position
:
absolute
;
top
:
50%
;
left
:
0
;
width
:
100%
;
height
:
2px
;
background-color
:
#fff
;
transform
:
translateY
(
-50%
)}
.thumbnail-container
[
data-v-5e90ea40
]
{
position
:
fixed
;
bottom
:
-150px
;
left
:
0
;
right
:
0
;
height
:
140px
;
background-color
:
#505050
e6
;
transition
:
bottom
.3s
ease
;
z-index
:
999
}
.thumbnail-container.show
[
data-v-5e90ea40
]
{
bottom
:
0
}
.thumbnail-list
[
data-v-5e90ea40
]
{
display
:
flex
;
overflow-x
:
auto
;
padding
:
10px
;
gap
:
10px
;
height
:
100%
}
.thumbnail-item
[
data-v-5e90ea40
]
{
flex
:
0
0
auto
;
width
:
100px
;
height
:
120px
;
position
:
relative
;
cursor
:
pointer
;
transition
:
all
.2s
ease
;
padding
:
2px
;
border-radius
:
4px
}
.thumbnail-item
img
[
data-v-5e90ea40
]
{
width
:
100%
;
height
:
100%
;
object-fit
:
cover
;
border-radius
:
4px
;
border
:
2px
solid
transparent
;
transition
:
all
.2s
ease
}
.thumbnail-item.active
[
data-v-5e90ea40
]
{
background-color
:
#ffffff4
d
;
transform
:
scale
(
1.05
);
box-shadow
:
0
0
10px
#ffffff80
}
.thumbnail-item.active
img
[
data-v-5e90ea40
]
{
border-color
:
#fff
}
.thumbnail-item
.page-number
[
data-v-5e90ea40
]
{
position
:
absolute
;
bottom
:
5px
;
left
:
50%
;
transform
:
translate
(
-50%
);
background-color
:
#000000
b3
;
color
:
#fff
;
padding
:
2px
8px
;
border-radius
:
10px
;
font-size
:
12px
}
.thumbnail-item
[
data-v-5e90ea40
]
:hover:not
(
.active
)
{
transform
:
scale
(
1.05
);
background-color
:
#ffffff1
a
}
.thumbnail-list
[
data-v-5e90ea40
]
::-webkit-scrollbar
{
height
:
8px
}
.thumbnail-list
[
data-v-5e90ea40
]
::-webkit-scrollbar-track
{
background
:
#0000001
a
;
border-radius
:
4px
}
.thumbnail-list
[
data-v-5e90ea40
]
::-webkit-scrollbar-thumb
{
background
:
#ffffff4
d
;
border-radius
:
4px
}
.thumbnail-list
[
data-v-5e90ea40
]
::-webkit-scrollbar-thumb:hover
{
background
:
#ffffff80
}
.thumbnail-container
{
position
:
fixed
;
bottom
:
-150px
;
left
:
0
;
right
:
0
;
height
:
140px
;
background-color
:
#505050
e6
;
transition
:
bottom
.3s
ease
;
z-index
:
999
}
.thumbnail-container.show
{
bottom
:
0
}
.thumbnail-list
{
display
:
flex
;
overflow-x
:
auto
;
padding
:
10px
;
gap
:
10px
;
height
:
100%
}
.thumbnail-item
{
flex
:
0
0
auto
;
width
:
160px
;
height
:
120px
;
position
:
relative
;
cursor
:
pointer
;
transition
:
all
.2s
ease
;
padding
:
2px
;
border-radius
:
4px
;
background-color
:
transparent
}
.thumbnail-item
img
{
width
:
100%
;
height
:
100%
;
object-fit
:
cover
;
border-radius
:
4px
;
border
:
2px
solid
transparent
;
transition
:
all
.2s
ease
}
.thumbnail-item.active
{
background-color
:
#ffffff4
d
;
transform
:
scale
(
1.05
);
box-shadow
:
0
0
10px
#ffffff80
}
.thumbnail-item.active
img
{
border-color
:
#fff
}
.thumbnail-item
:hover:not
(
.active
)
{
transform
:
scale
(
1.05
);
background-color
:
#ffffff1
a
}
.thumbnail-item
.page-number
{
position
:
absolute
;
bottom
:
5px
;
left
:
50%
;
transform
:
translate
(
-50%
);
background-color
:
#000000
b3
;
color
:
#fff
;
padding
:
2px
8px
;
border-radius
:
10px
;
font-size
:
12px
}
.thumbnail-list
::-webkit-scrollbar
{
height
:
8px
}
.thumbnail-list
::-webkit-scrollbar-track
{
background
:
#0000001
a
;
border-radius
:
4px
}
.thumbnail-list
::-webkit-scrollbar-thumb
{
background
:
#ffffff4
d
;
border-radius
:
4px
}
.thumbnail-list
::-webkit-scrollbar-thumb:hover
{
background
:
#ffffff80
}
.error-message
[
data-v-
f9602698
]
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
height
:
100%
;
font-size
:
16px
;
color
:
#666
}
.page-buttons-container
[
data-v-f9602698
]
{
position
:
fixed
;
bottom
:
20px
;
right
:
20px
;
display
:
flex
;
gap
:
15px
;
z-index
:
1000
}
.page-button
[
data-v-f9602698
]
{
width
:
50px
;
height
:
50px
;
background-color
:
#50505099
;
border-radius
:
25px
;
border
:
1px
solid
rgba
(
255
,
255
,
255
,
.3
);
color
:
#ffffff
e6
;
font-size
:
24px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
cursor
:
pointer
;
transition
:
all
.3s
ease
;
box-shadow
:
0
2px
6px
#00000026
}
.page-button
[
data-v-f9602698
]
:hover
{
background-color
:
#3c3c3c
cc
;
transform
:
scale
(
1.1
)}
.page-button
[
data-v-f9602698
]
:active
{
transform
:
scale
(
.95
)}
.arrow
[
data-v-f9602698
]
{
border
:
solid
white
;
border-width
:
0
2px
2px
0
;
display
:
inline-block
;
padding
:
4px
}
.left
[
data-v-f9602698
]
{
transform
:
rotate
(
135deg
);
margin-left
:
4px
}
.right
[
data-v-f9602698
]
{
transform
:
rotate
(
-45deg
);
margin-right
:
4px
}
.menu-icon
[
data-v-f9602698
]
{
width
:
18px
;
height
:
14px
;
position
:
relative
;
border-top
:
2px
solid
white
;
border-bottom
:
2px
solid
white
}
.menu-icon
[
data-v-f9602698
]
:before
{
content
:
""
;
position
:
absolute
;
top
:
50%
;
left
:
0
;
width
:
100%
;
height
:
2px
;
background-color
:
#fff
;
transform
:
translateY
(
-50%
)}
.thumbnail-container
[
data-v-f9602698
]
{
position
:
fixed
;
bottom
:
-150px
;
left
:
0
;
right
:
0
;
height
:
140px
;
background-color
:
#505050
e6
;
transition
:
bottom
.3s
ease
;
z-index
:
999
}
.thumbnail-container.show
[
data-v-f9602698
]
{
bottom
:
0
}
.thumbnail-list
[
data-v-f9602698
]
{
display
:
flex
;
overflow-x
:
auto
;
padding
:
10px
;
gap
:
10px
;
height
:
100%
}
.thumbnail-item
[
data-v-f9602698
]
{
flex
:
0
0
auto
;
width
:
100px
;
height
:
120px
;
position
:
relative
;
cursor
:
pointer
;
transition
:
all
.2s
ease
;
padding
:
2px
;
border-radius
:
4px
}
.thumbnail-item
img
[
data-v-f9602698
]
{
width
:
100%
;
height
:
100%
;
object-fit
:
cover
;
border-radius
:
4px
;
border
:
2px
solid
transparent
;
transition
:
all
.2s
ease
}
.thumbnail-item.active
[
data-v-f9602698
]
{
background-color
:
#ffffff4
d
;
transform
:
scale
(
1.05
);
box-shadow
:
0
0
10px
#ffffff80
}
.thumbnail-item.active
img
[
data-v-f9602698
]
{
border-color
:
#fff
}
.thumbnail-item
.page-number
[
data-v-f9602698
]
{
position
:
absolute
;
bottom
:
5px
;
left
:
50%
;
transform
:
translate
(
-50%
);
background-color
:
#000000
b3
;
color
:
#fff
;
padding
:
2px
8px
;
border-radius
:
10px
;
font-size
:
12px
}
.thumbnail-item
[
data-v-f9602698
]
:hover:not
(
.active
)
{
transform
:
scale
(
1.05
);
background-color
:
#ffffff1
a
}
.thumbnail-list
[
data-v-f9602698
]
::-webkit-scrollbar
{
height
:
8px
}
.thumbnail-list
[
data-v-f9602698
]
::-webkit-scrollbar-track
{
background
:
#0000001
a
;
border-radius
:
4px
}
.thumbnail-list
[
data-v-f9602698
]
::-webkit-scrollbar-thumb
{
background
:
#ffffff4
d
;
border-radius
:
4px
}
.thumbnail-list
[
data-v-f9602698
]
::-webkit-scrollbar-thumb:hover
{
background
:
#ffffff80
}
play/assets/index-
D6v_bxe
Y.js
→
play/assets/index-
LG8DS8S
Y.js
View file @
d9682a2b
...
...
@@ -58,4 +58,4 @@ section.${a}>footer { z-index: 1; }
`}numberingCounter(a,n){return`${this.className}-num-${a}-${n}`}levelTextToContent(a,n,s,u){var h;const y={tab:"\\9",space:"\\a0"};var g=a.replace(/%\d*/g,S=>{let O=parseInt(S.substring(1),10)-1;return`"counter(${this.numberingCounter(s,O)}, ${u})"`});return`"${g}${(h=y[n])!=null?h:""}"`}numFormatToCssValue(a){var n,s={none:"none",bullet:"disc",decimal:"decimal",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",decimalZero:"decimal-leading-zero",aiueo:"katakana",aiueoFullWidth:"katakana",chineseCounting:"simp-chinese-informal",chineseCountingThousand:"simp-chinese-informal",chineseLegalSimplified:"simp-chinese-formal",chosung:"hangul-consonant",ideographDigital:"cjk-ideographic",ideographTraditional:"cjk-heavenly-stem",ideographLegalTraditional:"trad-chinese-formal",ideographZodiac:"cjk-earthly-branch",iroha:"katakana-iroha",irohaFullWidth:"katakana-iroha",japaneseCounting:"japanese-informal",japaneseDigitalTenThousand:"cjk-decimal",japaneseLegal:"japanese-formal",thaiNumbers:"thai",koreanCounting:"korean-hangul-formal",koreanDigital:"korean-hangul-formal",koreanDigital2:"korean-hanja-informal",hebrew1:"hebrew",hebrew2:"hebrew",hindiNumbers:"devanagari",ganada:"hangul",taiwaneseCounting:"cjk-ideographic",taiwaneseCountingThousand:"cjk-ideographic",taiwaneseDigital:"cjk-decimal"};return(n=s[a])!=null?n:a}refreshTabStops(){this.options.experimental&&(clearTimeout(this.tabsTimeout),this.tabsTimeout=setTimeout(()=>{const a=Rs();for(let n of this.currentTabs)Ls(n.span,n.stops,this.defaultTabSize,a)},500))}later(a){this.postRenderTasks.push(a)}}function hn(m,a,n){return Rt(void 0,m,a,n)}function ha(m,a,n){return Rt(ht.svg,m,a,n)}function Rt(m,a,n,s){var u=m?document.createElementNS(m,a):document.createElement(a);return Object.assign(u,n),s&&On(u,s),u}function ji(m){m.innerHTML=""}function On(m,a){a.forEach(n=>m.appendChild(ua(n)?document.createTextNode(n):n))}function dn(m){return hn("style",{innerHTML:m})}function Kn(m,a){m.appendChild(document.createComment(a))}function Ns(m,a){for(var n=m.parent;n!=null&&n.type!=a;)n=n.parent;return n}const Mi={ignoreHeight:!1,ignoreWidth:!1,ignoreFonts:!1,breakPages:!0,debug:!1,experimental:!1,className:"docx",inWrapper:!0,trimXmlDeclaration:!0,ignoreLastRenderedPageBreak:!0,renderHeaders:!0,renderFooters:!0,renderFootnotes:!0,renderEndnotes:!0,useBase64URL:!1,renderChanges:!1,renderComments:!1};function Bs(m,a){const n=N(N({},Mi),a);return Na.load(m,new Is(n),n)}function Us(m,a,n,s){return se(this,null,function*(){const u=N(N({},Mi),s),h=new Ds(window.document);return h.render(m,a,n,u),Promise.allSettled(h.tasks)})}function Hs(m,a,n,s){return se(this,null,function*(){const u=yield Bs(m,s);return yield Us(u,a,n,s),u})}const $s={ignoreLastRenderedPageBreak:!1};function Xs(m,a={}){return typeof m=="string"?zs(m,a):Promise.resolve(m)}function zs(m,a){return fetch(m,a).then(n=>n.status!==200?Promise.reject(n):n)}function Gs(m){return se(this,null,function*(){let a;return m instanceof Blob?a=m:m instanceof Response?a=yield m.blob():m instanceof ArrayBuffer&&(a=new Blob([m])),a})}function qs(m,a,n={}){if(!m)return a.innerHTML="",Promise.resolve();let s;return m instanceof Blob?s=m:m instanceof Response?s=m.blob():m instanceof ArrayBuffer&&(s=new Blob([m])),Hs(s,a,a,N(N({},$s),n))}const Cn={getData:Xs,render:qs,getBlob:Gs};function Ws(m,a){return se(this,null,function*(){a&&(a instanceof ArrayBuffer&&(a=new Blob([a])),Vs(m,URL.createObjectURL(a)))})}function Vs(m,a){let n=document.createElement("a");n.download=m,n.style.display="none",n.href=a,document.body.appendChild(n),n.click(),document.body.removeChild(n)}const Ks=(m,a)=>{const n=m.__vccOpts||m;for(const[s,u]of a)n[s]=u;return n},Ys=r.defineComponent({name:"VueOfficeDocx",props:{src:[String,ArrayBuffer,Blob],requestOptions:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})}},emits:["rendered","error"],setup(m,{emit:a}){const n=r.ref(null);let s=null;function u(){let y=n.value;Cn.getData(m.src,m.requestOptions).then(g=>se(this,null,function*(){s=yield Cn.getBlob(g),Cn.render(s,y,m.options).then(()=>{a("rendered")}).catch(S=>{Cn.render("",y,m.options),a("error",S)})})).catch(g=>{Cn.render("",y,m.options),a("error",g)})}r.onMounted(()=>{m.src&&u()}),r.watch(()=>m.src,()=>{m.src?u():Cn.render("",n.value,m.options).then(()=>{a("rendered")})});function h(y){Ws(y||`vue-office-docx-${new Date().getTime()}.docx`,s)}return{rootRef:n,save:h}}}),Js={class:"vue-office-docx"},Zs={class:"vue-office-docx-main",ref:"rootRef"};function Qs(m,a,n,s,u,h){return o.openBlock(),o.createElementBlock("div",Js,[o.createElementVNode("div",Zs,null,512)])}const da=Ks(Ys,[["render",Qs]]);return da.install=function(m){m.component(da.name,da)},da})})(Wp);var Ux=Wp.exports;const Hx=zp(Ux),$x=(e,t)=>{const r=e.__vccOpts||e;for(const[o,l]of t)r[o]=l;return r},Xx={key:2,style:{height:"100vh",position:"relative"}},zx={key:0,class:"error-message"},Gx=["src"],qx={__name:"App",setup(e){const t=Jr(""),r=Jr(""),o=Jr(null),l=Jr(!1),f=Jr(1),v=Jr(0);function w(){const ne=document.querySelector(".thumbnail-container");if(ne.classList.toggle("show"),ne.classList.contains("show")){const H=o.value.contentWindow.GetCurPg(),z=document.querySelector(`.thumbnail-item:nth-child(${H+1})`);z&&setTimeout(()=>{z.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},100)}}function _(){try{if(o.value){const ne=o.value.contentDocument.getElementById("main");ne&&(v.value=ne.children.length,U())}}catch(ne){console.error("无法访问 iframe 内容:",ne)}}function U(){if(!r.value)return;const ne=r.value.replace("index.html","thum/"),H=document.querySelector(".thumbnail-list");H.innerHTML="";const z=o.value.contentWindow.GetCurPg()||0;z===0&&o.value.contentWindow.syncExec(0,-1,-1,!1);for(let ie=1;ie<=v.value;ie++){const be=document.createElement("div");be.className=`thumbnail-item ${ie===z+1?"active":""}`,be.innerHTML=`
<img src="${ne}${ie}.jpg" alt="Page ${ie}">
<div class="page-number">${ie}</div>
`,be.addEventListener("click",()=>{N(ie)}),H.appendChild(be)}M(z+1)}function M(ne){f.value=ne,document.querySelectorAll(".thumbnail-item").forEach((z,ie)=>{ie+1===ne?z.classList.add("active"):z.classList.remove("active")})}function N(ne){const H=o.value.contentWindow.GetCurPg();H!=ne-1&&(o.value.contentWindow.resetPage(H),o.value.contentWindow.syncExec(ne-1,-1,-1,!1),M(ne)),w()}function K(){if(o.value){o.value.contentWindow.ExecGoBack();const ne=o.value.contentWindow.GetCurPg();M(ne+1)}}function se(){if(o.value){o.value.contentWindow.ExecNext();const ne=o.value.contentWindow.GetCurPg();M(ne+1)}}Ca(o,ne=>{ne&&setTimeout(()=>{_(),o.value.contentDocument.addEventListener("gopageEvent",()=>{const H=o.value.contentWindow.GetCurPg();M(H+1)}),window.air.hideAirClassLoading("play_office",null)},1e3)});async function ve(ne){try{const z=await(await fetch(ne)).text();return z.includes("<Error>")&&z.includes("<Code>NoSuchKey</Code>")?(l.value=!0,window.air.hideAirClassLoading("play_office",null),!1):!0}catch(H){return console.error("检查URL时出错:",H),l.value=!0,window.air.hideAirClassLoading("play_office",null),!1}}window.courseware.getData(async ne=>{t.value=ne==null?void 0:ne.url,r.value=ne==null?void 0:ne.ppt_html,r.value&&t.value.toLowerCase().includes(".ppt")&&await ve(r.value)},"play_office");function xe(){window.air.hideAirClassLoading("play_office",null)}function Ke(){}const Xe=ne=>{try{const H=new URL(ne);return`
/ppt${H.pathname}${H.search}${H.hash}`}catch{return ne}};return(ne,H)=>(Zr(),Ja(er,null,[t.value.indexOf(".pdf")>0||t.value.indexOf(".PDF")>0?(Zr(),Ia(Ta(Bx),{key:0,src:t.value,style:{height:"100vh"},onRendered:xe,onError:Ke},null,8,["src"])):bo("",!0),t.value.indexOf(".docx")>0||t.value.indexOf(".DOCX")>0?(Zr(),Ia(Ta(Hx),{key:1,src:t.value,style:{height:"100vh"},onRendered:xe,onError:Ke},null,8,["src"])):bo("",!0),t.value.indexOf(".ppt")>0||t.value.indexOf(".PPT")>0||t.value.indexOf(".pptx")>0||t.value.indexOf(".PPTX")>0?(Zr(),Ja("div",Xx,[l.value?(Zr(),Ja("div",zx," 课件正在生成中,请过一会儿再尝试 ")):(Zr(),Ja("iframe",{key:1,ref_key:"ppt_iframe",ref:o,frameborder:"0",width:"100%",height:"100%",src:Xe(r.value)},null,8,Gx)),Hr("div",{class:"page-buttons-container"},[Hr("button",{class:"page-button thumbnail-button",onClick:w},H[0]||(H[0]=[Hr("span",{class:"menu-icon"},null,-1)])),Hr("button",{class:"page-button prev-button",onClick:K},H[1]||(H[1]=[Hr("span",{class:"arrow left"},null,-1)])),Hr("button",{class:"page-button next-button",onClick:se},H[2]||(H[2]=[Hr("span",{class:"arrow right"},null,-1)]))]),H[3]||(H[3]=Hr("div",{class:"thumbnail-container"},[Hr("div",{class:"thumbnail-list"})],-1))])):bo("",!0)],64))}},Wx=$x(qx,[["__scopeId","data-v-5e90ea40
"]]);Lo(Wx).mount("#app");
`,be.addEventListener("click",()=>{N(ie)}),H.appendChild(be)}M(z+1)}function M(ne){f.value=ne,document.querySelectorAll(".thumbnail-item").forEach((z,ie)=>{ie+1===ne?z.classList.add("active"):z.classList.remove("active")})}function N(ne){const H=o.value.contentWindow.GetCurPg();H!=ne-1&&(o.value.contentWindow.resetPage(H),o.value.contentWindow.syncExec(ne-1,-1,-1,!1),M(ne)),w()}function K(){if(o.value){o.value.contentWindow.ExecGoBack();const ne=o.value.contentWindow.GetCurPg();M(ne+1)}}function se(){if(o.value){o.value.contentWindow.ExecNext();const ne=o.value.contentWindow.GetCurPg();M(ne+1)}}Ca(o,ne=>{ne&&setTimeout(()=>{_(),o.value.contentDocument.addEventListener("gopageEvent",()=>{const H=o.value.contentWindow.GetCurPg();M(H+1)}),window.air.hideAirClassLoading("play_office",null)},1e3)});async function ve(ne){try{const z=await(await fetch(ne)).text();return z.includes("<Error>")&&z.includes("<Code>NoSuchKey</Code>")?(l.value=!0,window.air.hideAirClassLoading("play_office",null),!1):!0}catch(H){return console.error("检查URL时出错:",H),l.value=!0,window.air.hideAirClassLoading("play_office",null),!1}}window.courseware.getData(async ne=>{t.value=ne==null?void 0:ne.url,r.value=ne==null?void 0:ne.ppt_html,r.value&&t.value.toLowerCase().includes(".ppt")&&await ve(r.value)},"play_office");function xe(){window.air.hideAirClassLoading("play_office",null)}function Ke(){}const Xe=ne=>{try{const H=new URL(ne);return`
${H.pathname}${H.search}${H.hash}`}catch{return ne}};return(ne,H)=>(Zr(),Ja(er,null,[t.value.indexOf(".pdf")>0||t.value.indexOf(".PDF")>0?(Zr(),Ia(Ta(Bx),{key:0,src:t.value,style:{height:"100vh"},onRendered:xe,onError:Ke},null,8,["src"])):bo("",!0),t.value.indexOf(".docx")>0||t.value.indexOf(".DOCX")>0?(Zr(),Ia(Ta(Hx),{key:1,src:t.value,style:{height:"100vh"},onRendered:xe,onError:Ke},null,8,["src"])):bo("",!0),t.value.indexOf(".ppt")>0||t.value.indexOf(".PPT")>0||t.value.indexOf(".pptx")>0||t.value.indexOf(".PPTX")>0?(Zr(),Ja("div",Xx,[l.value?(Zr(),Ja("div",zx," 课件正在生成中,请过一会儿再尝试 ")):(Zr(),Ja("iframe",{key:1,ref_key:"ppt_iframe",ref:o,frameborder:"0",width:"100%",height:"100%",src:Xe(r.value)},null,8,Gx)),Hr("div",{class:"page-buttons-container"},[Hr("button",{class:"page-button thumbnail-button",onClick:w},H[0]||(H[0]=[Hr("span",{class:"menu-icon"},null,-1)])),Hr("button",{class:"page-button prev-button",onClick:K},H[1]||(H[1]=[Hr("span",{class:"arrow left"},null,-1)])),Hr("button",{class:"page-button next-button",onClick:se},H[2]||(H[2]=[Hr("span",{class:"arrow right"},null,-1)]))]),H[3]||(H[3]=Hr("div",{class:"thumbnail-container"},[Hr("div",{class:"thumbnail-list"})],-1))])):bo("",!0)],64))}},Wx=$x(qx,[["__scopeId","data-v-f9602698
"]]);Lo(Wx).mount("#app");
play/index.html
View file @
d9682a2b
...
...
@@ -4,8 +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-
D6v_bxe
Y.js"
></script>
<link
rel=
"stylesheet"
crossorigin
href=
"assets/index-D
5frsKoS
.css"
>
<script
type=
"module"
crossorigin
src=
"assets/index-
LG8DS8S
Y.js"
></script>
<link
rel=
"stylesheet"
crossorigin
href=
"assets/index-D
xwsA9db
.css"
>
</head>
<body>
<div
id=
"app"
></div>
...
...
vue-proj/vue-project/src/App.vue
View file @
d9682a2b
...
...
@@ -180,24 +180,24 @@ function renderedHandler() {
}
function
errorHandler
()
{
}
const
getProxiedUrl
=
(
url
)
=>
{
try
{
const
urlObj
=
new
URL
(
url
);
return
`/ppt
${
urlObj
.
pathname
}${
urlObj
.
search
}${
urlObj
.
hash
}
`
;
}
catch
(
e
)
{
return
url
;
}
}
// const getProxiedUrl = (url) => {
// try {
// const urlObj = new URL(url);
// return `${urlObj.pathname}${urlObj.search}${urlObj.hash}`;
// return `
/ppt
${urlObj.pathname}${urlObj.search}${urlObj.hash}`;
// } catch (e) {
// return url;
// }
// }
const
getProxiedUrl
=
(
url
)
=>
{
try
{
const
urlObj
=
new
URL
(
url
);
return
`
${
urlObj
.
pathname
}${
urlObj
.
search
}${
urlObj
.
hash
}
`
;
}
catch
(
e
)
{
return
url
;
}
}
</
script
>
<
template
>
...
...
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