liveProjectDetailKH.vue 73 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561
  1. <template>
  2. <div
  3. style="
  4. background: rgb(230, 234, 240);
  5. width: 100%;
  6. margin: 0;
  7. position: relate;
  8. height: 100%;
  9. "
  10. >
  11. <div class="blackBottom">
  12. <div
  13. style="
  14. display: flex;
  15. flex-direction: row;
  16. flex-wrap: nowrap;
  17. align-items: stretch;
  18. padding-left: 10px;
  19. "
  20. >
  21. <div class="logoLive">
  22. <img src="../assets/icon/logo.png" alt />
  23. </div>
  24. <div style="color: #fff; line-height: 45px; padding-left: 15px">
  25. introduce a festival (Final)
  26. </div>
  27. </div>
  28. </div>
  29. <div class="isNoOther">
  30. <div
  31. class="imgMiddle"
  32. :class="isBlock > 0 ? 'imghalf' : 'imgMiddle'"
  33. v-show="!full"
  34. >
  35. <pdf
  36. :pdfUrl="pdfUrl"
  37. style="width: 100%; height: 100%"
  38. :ppage="ppage"
  39. @getPageTotal="getPageTotal"
  40. @getWidth="getWidth"
  41. ></pdf>
  42. <div
  43. class="workd_media"
  44. style="height: 100%"
  45. v-if="videoBlock == 6"
  46. :style="{ width: Vwidth }"
  47. >
  48. <video-player
  49. class="video-player vjs-custom-skin"
  50. :playsinline="true"
  51. :options="playerO[0]"
  52. ref="zVideo"
  53. @play="onPlayerPlay($event)"
  54. style="width: 100%; height: 100%"
  55. ></video-player>
  56. </div>
  57. <div class="video_wrapper" v-if="videoBlock == 6"></div>
  58. </div>
  59. <div
  60. style="
  61. background: #d0d6e4;
  62. width: 40%;
  63. height: 100%;
  64. max-width: 40%;
  65. overflow: auto;
  66. "
  67. :class="{ fullStyle: full }"
  68. v-if="isBlock > 0"
  69. >
  70. <div
  71. style="
  72. background: #fff;
  73. width: 96%;
  74. margin: 10px auto;
  75. height: 96%;
  76. position: relative;
  77. "
  78. >
  79. <div
  80. style="color: #bfbfbf; padding: 15px 0 15px 25px; font-size: 20px"
  81. v-if="isBlock == 3"
  82. >
  83. 课堂评价
  84. </div>
  85. <div
  86. style="color: #bfbfbf; padding: 15px 0 15px 25px; font-size: 20px"
  87. v-if="isBlock == 8"
  88. >
  89. 根据题目选择对应的答案
  90. </div>
  91. <div
  92. style="
  93. margin-left: 25px;
  94. border-bottom: 3px solid #2c83ee;
  95. width: 70px;
  96. padding-bottom: 3px;
  97. text-align: center;
  98. padding-top: 15px;
  99. "
  100. v-if="isBlock == 1"
  101. >
  102. 开始答题
  103. </div>
  104. <div class="answerBox" v-if="isBlock == 1">
  105. <div class="answerBox">
  106. <div
  107. style="
  108. display: flex;
  109. flex-direction: column;
  110. flex-wrap: wrap;
  111. align-items: center;
  112. justify-content: center;
  113. "
  114. v-for="item in 1"
  115. :key="item"
  116. >
  117. <div class="choose_style">
  118. <span
  119. @click="isChooseActive(1)"
  120. :class="typeC.indexOf(1) != -1 ? 'isChoose' : ''"
  121. v-if="
  122. tools[ppage - 1].choice && tools[ppage - 1].choice > 0
  123. "
  124. >A</span
  125. >
  126. <span
  127. @click="isChooseActive(2)"
  128. :class="typeC.indexOf(2) != -1 ? 'isChoose' : ''"
  129. v-if="
  130. tools[ppage - 1].choice && tools[ppage - 1].choice > 1
  131. "
  132. >B</span
  133. >
  134. <span
  135. @click="isChooseActive(3)"
  136. :class="typeC.indexOf(3) != -1 ? 'isChoose' : ''"
  137. v-if="
  138. tools[ppage - 1].choice && tools[ppage - 1].choice > 2
  139. "
  140. >C</span
  141. >
  142. <span
  143. @click="isChooseActive(4)"
  144. :class="typeC.indexOf(4) != -1 ? 'isChoose' : ''"
  145. v-if="
  146. tools[ppage - 1].choice && tools[ppage - 1].choice > 3
  147. "
  148. >D</span
  149. >
  150. </div>
  151. <el-button style="margin: 0 auto" @click="showMember(item)"
  152. >提交</el-button
  153. >
  154. </div>
  155. </div>
  156. </div>
  157. <div
  158. class="answerBox tools_box"
  159. v-if="isBlock == 4"
  160. style="padding: 10px 0 0 25px; width: 100%; max-width: 100%"
  161. >
  162. <div style="color: #d1d1d1; font-size: 24px">课堂实践</div>
  163. <div
  164. style="
  165. margin: 20px 0 20px 0;
  166. border-bottom: 4px solid #3e86f3;
  167. width: 75px;
  168. text-align: center;
  169. padding-bottom: 3px;
  170. "
  171. >
  172. 选择工具
  173. </div>
  174. <div
  175. style="
  176. display: flex;
  177. flex-direction: row;
  178. flex-wrap: wrap;
  179. width: 100%;
  180. justify-content: flex-start;
  181. align-items: center;
  182. "
  183. >
  184. <div
  185. v-if="
  186. tools[ppage - 1].tools &&
  187. tools[ppage - 1].tools.indexOf(1) != -1
  188. "
  189. @click="checkTools(1)"
  190. class="toolCss"
  191. >
  192. <div class="toolImg">
  193. <img src="../assets/icon/secondToolList/whiteBoard.png" alt />
  194. <div>电子白板</div>
  195. </div>
  196. </div>
  197. <div
  198. v-if="
  199. tools[ppage - 1].tools &&
  200. tools[ppage - 1].tools.indexOf(3) != -1
  201. "
  202. @click="checkTools(3)"
  203. class="toolCss"
  204. >
  205. <div class="toolImg">
  206. <img
  207. src="../assets/icon/secondToolList/mindMapping.png"
  208. alt
  209. />
  210. <div>思维导图</div>
  211. </div>
  212. </div>
  213. <div
  214. v-if="
  215. tools[ppage - 1].tools &&
  216. tools[ppage - 1].tools.indexOf(28) != -1
  217. "
  218. @click="checkTools(28)"
  219. class="toolCss"
  220. >
  221. <div class="toolImg">
  222. <img src="../assets/icon/thirdToolList/translation.png" alt />
  223. <div>翻译</div>
  224. </div>
  225. </div>
  226. <div
  227. v-if="
  228. tools[ppage - 1].tools &&
  229. tools[ppage - 1].tools.indexOf(4) != -1
  230. "
  231. @click="checkTools(4)"
  232. class="toolCss"
  233. >
  234. <div class="toolImg">
  235. <img src="../assets/icon/thirdToolList/ask.png" alt />
  236. <div>问卷调查</div>
  237. </div>
  238. </div>
  239. <div
  240. v-if="
  241. tools[ppage - 1].tools &&
  242. tools[ppage - 1].tools.indexOf(6) != -1
  243. "
  244. @click="checkTools(6)"
  245. class="toolCss"
  246. >
  247. <div class="toolImg">
  248. <img src="../assets/icon/secondToolList/doc.png" alt />
  249. <div>协同文档</div>
  250. </div>
  251. </div>
  252. <div
  253. v-if="
  254. tools[ppage - 1].tools &&
  255. tools[ppage - 1].tools.indexOf(7) != -1
  256. "
  257. @click="checkTools(7)"
  258. class="toolCss"
  259. >
  260. <div class="toolImg">
  261. <img
  262. src="../assets/icon/secondToolList/mindNetwork.png"
  263. alt
  264. />
  265. <div>思维网格</div>
  266. </div>
  267. </div>
  268. <div
  269. v-if="
  270. tools[ppage - 1].tools &&
  271. tools[ppage - 1].tools.indexOf(16) != -1
  272. "
  273. @click="addImg($event)"
  274. class="toolCss"
  275. >
  276. <div class="toolImg">
  277. <img src="../assets/icon/firstToolList/myMessage.png" alt />
  278. <div>
  279. 上传文件
  280. <input
  281. type="file"
  282. accept="image/*"
  283. capture="camera"
  284. style="display: none"
  285. @change="beforeUpload1($event, 1)"
  286. />
  287. </div>
  288. </div>
  289. </div>
  290. <div
  291. v-if="
  292. tools[ppage - 1].tools &&
  293. tools[ppage - 1].tools.indexOf(29) != -1
  294. "
  295. @click="addImg($event)"
  296. class="toolCss"
  297. >
  298. <div class="toolImg">
  299. <img src="../assets/icon/firstToolList/myMessage.png" alt />
  300. <div>
  301. 上传视频
  302. <input
  303. type="file"
  304. accept="video/mp4, video/quicktime, video/x-msvideo"
  305. capture="camera"
  306. style="display: none"
  307. @change="beforeUpload1($event, 2)"
  308. />
  309. </div>
  310. </div>
  311. </div>
  312. </div>
  313. </div>
  314. <div
  315. class="answerBox"
  316. style="height: 100%"
  317. v-if="isBlock == 2"
  318. ref="qrcodePicture"
  319. >
  320. <div style="height: 100%; width: 100%">
  321. <div v-if="toolCount == 1" class="tools_child_box">
  322. <div class="tools_title">
  323. <span>电子白板</span>
  324. <div>
  325. <img
  326. src="../assets/full.png"
  327. class="full"
  328. @click="fullTools"
  329. />
  330. </div>
  331. </div>
  332. <iframe
  333. webkitallowfullscreen
  334. mozallowfullscreen
  335. allowfullscreen
  336. style="width: 100%; height: 100%; border: none"
  337. src="https://iwb.cocorobo.cn/"
  338. ref="whiteBoard"
  339. ></iframe>
  340. </div>
  341. <div v-if="toolCount == 3" class="tools_child_box">
  342. <div class="tools_title">
  343. <span>思维导图</span>
  344. <div>
  345. <img
  346. src="../assets/full.png"
  347. class="full"
  348. @click="fullTools"
  349. />
  350. </div>
  351. </div>
  352. <iframe
  353. webkitallowfullscreen
  354. mozallowfullscreen
  355. allowfullscreen
  356. style="width: 100%; height: 100%; border: none"
  357. src="//cloud.cocorobo.cn/kityminder-editor/dist/index.html"
  358. ref="mind"
  359. ></iframe>
  360. </div>
  361. <div v-if="toolCount == 28" class="tools_child_box">
  362. <div class="tools_title">
  363. <span>翻译</span>
  364. <div>
  365. <img
  366. src="../assets/full.png"
  367. class="full"
  368. @click="fullTools"
  369. />
  370. </div>
  371. </div>
  372. <iframe
  373. webkitallowfullscreen
  374. mozallowfullscreen
  375. allowfullscreen
  376. style="width: 100%; height: 100%; border: none"
  377. src="//dict.youdao.com/"
  378. ref="mind"
  379. ></iframe>
  380. </div>
  381. <div v-if="toolCount == 6" class="tools_child_box">
  382. <div class="tools_title">
  383. <span>协同文档</span>
  384. <div>
  385. <img
  386. src="../assets/full.png"
  387. class="full"
  388. @click="fullTools"
  389. />
  390. </div>
  391. </div>
  392. <iframe
  393. webkitallowfullscreen
  394. mozallowfullscreen
  395. allowfullscreen
  396. style="width: 100%; height: 100%; border: none"
  397. src="https://cloud.cocorobo.cn/Office/Word/WordEditArea.htm"
  398. ></iframe>
  399. </div>
  400. <div v-if="toolCount == 7" class="tools_child_box">
  401. <div class="tools_title">
  402. <span>思维网格</span>
  403. <div>
  404. <img
  405. src="../assets/full.png"
  406. class="full"
  407. @click="fullTools"
  408. />
  409. </div>
  410. </div>
  411. <iframe
  412. webkitallowfullscreen
  413. mozallowfullscreen
  414. allowfullscreen
  415. style="width: 100%; height: 100%; border: none"
  416. src="https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/Grid"
  417. ref="grid"
  418. ></iframe>
  419. </div>
  420. <div
  421. id="shishi_loading"
  422. style="
  423. width: 100%;
  424. height: 100%;
  425. background: #0000008f;
  426. position: absolute;
  427. top: 0;
  428. left: 0;
  429. z-index: 99999999999999;
  430. display: none;
  431. justify-content: center;
  432. align-items: center;
  433. "
  434. >
  435. <div
  436. style="
  437. color: #fff;
  438. padding: 15px;
  439. background: #00000070;
  440. border-radius: 5px;
  441. font-size: 18px;
  442. display: flex;
  443. align-items: center;
  444. "
  445. >
  446. <img
  447. src="https://pbl.cocorobo.cn/pbl-student-table/dist/js/loading.gif"
  448. alt
  449. style="width: 26px; margin-right: 10px"
  450. />
  451. <span>上传中...</span>
  452. </div>
  453. </div>
  454. <!-- <div class="nextStepBox">
  455. <div class="nextStepOne" @click="(isBlock = 4), (full = false)">
  456. 返回
  457. </div>
  458. </div> -->
  459. <div
  460. class="nextStepOne"
  461. style="float: right"
  462. @click="addJtWork(4)"
  463. v-if="toolCount == 1 || toolCount == 3 || toolCount == 7"
  464. >
  465. 截图
  466. </div>
  467. <!-- <div
  468. class="nextStepOne"
  469. style="float: right"
  470. @click="addImg($event)"
  471. v-if="toolCount == 1 || toolCount == 3 || toolCount == 7"
  472. >
  473. 上传文件
  474. <input
  475. type="file"
  476. accept="image/png, image/gif, image/jpeg"
  477. style="display: none"
  478. @change="beforeUpload1($event, 1)"
  479. />
  480. </div>-->
  481. </div>
  482. </div>
  483. <div
  484. class="answerBox"
  485. v-if="
  486. isBlock == 3 &&
  487. tools[ppage - 1].tools &&
  488. tools[ppage - 1].tools.indexOf(14) != -1
  489. "
  490. style="padding: 0 0 0 25px"
  491. >
  492. <div>
  493. <div
  494. class="score_box"
  495. v-for="(ra, raIndex) in tools[ppage - 1].rateArray"
  496. :key="raIndex"
  497. >
  498. <span>{{ ra }} </span>
  499. <el-rate v-model="rateList[raIndex]"></el-rate>
  500. </div>
  501. </div>
  502. <span
  503. slot="footer"
  504. class="dialog-footer sztFooter"
  505. style="
  506. padding: 0 0 30px 0px;
  507. position: absolute;
  508. right: 20px;
  509. bottom: 0;
  510. "
  511. >
  512. <!-- <el-button @click="isBlock = 0">取消</el-button> -->
  513. <el-button type="primary" @click="addWork(6)">确定</el-button>
  514. </span>
  515. </div>
  516. <div
  517. class="answerBox"
  518. v-if="
  519. isBlock == 8 &&
  520. tools[ppage - 1].tools &&
  521. tools[ppage - 1].tools.indexOf(27) != -1
  522. "
  523. style="padding: 0 0 0 25px"
  524. >
  525. <div>
  526. <div
  527. v-for="(tk, tIndex) in tools[ppage - 1].choice"
  528. :key="tIndex"
  529. class="tkCss"
  530. >
  531. <div style="margin-right: 10px; font-size: 18px">
  532. {{ tIndex + 1 }}、
  533. </div>
  534. <el-select v-model="tkAnswer[tIndex]" placeholder="请选择答案">
  535. <el-option
  536. v-for="(tkA, tkAIndex) in tools[ppage - 1].tkAnswerBox"
  537. :key="tkAIndex"
  538. :label="tkA"
  539. :value="tkA"
  540. ></el-option>
  541. </el-select>
  542. <span
  543. v-if="tiankongAnswer.length && isNoHomeWork"
  544. class="tiankongAnswer"
  545. :class="{
  546. tfalse: tiankongAnswer[tIndex] != tkAnswer[tIndex],
  547. }"
  548. >正确答案:{{ tiankongAnswer[tIndex] }}</span
  549. >
  550. </div>
  551. </div>
  552. <span
  553. slot="footer"
  554. class="dialog-footer sztFooter"
  555. style="
  556. padding: 0 0 30px 0px;
  557. position: absolute;
  558. right: 20px;
  559. bottom: 0;
  560. "
  561. >
  562. <!-- <el-button @click="isBlock = 0">取消</el-button> -->
  563. <el-button type="primary" @click="addWork(5)">提交</el-button>
  564. </span>
  565. </div>
  566. <div
  567. class="answerBox"
  568. v-if="isBlock == 5"
  569. style="padding: 10px 0 0 25px"
  570. >
  571. <div style="color: #d1d1d1; font-size: 24px">课堂实践</div>
  572. <div
  573. style="
  574. margin: 20px 0 20px 0;
  575. border-bottom: 4px solid #3e86f3;
  576. width: 75px;
  577. text-align: center;
  578. padding-bottom: 3px;
  579. "
  580. >
  581. 选择附件
  582. </div>
  583. <div
  584. style="
  585. display: flex;
  586. flex-direction: row;
  587. flex-wrap: wrap;
  588. width: 100%;
  589. justify-content: flex-start;
  590. align-items: center;
  591. "
  592. >
  593. <div
  594. v-if="tools[ppage - 1].file && tools[ppage - 1].file.length"
  595. class="fileBox"
  596. >
  597. <div
  598. class="fileListCss"
  599. v-for="(v, vIndex) in videoList"
  600. :key="vIndex"
  601. >
  602. <div class="fileCss" @click="playVideo(v.src, vIndex)">
  603. <img src="../assets/uploadMp4.png" alt />
  604. </div>
  605. <div>{{ v.name }}</div>
  606. </div>
  607. <div
  608. class="fileListCss"
  609. v-for="(f, fIndex) in fileList"
  610. :key="fIndex"
  611. >
  612. <div class="fileCss" @click="openFile(f.src)">
  613. <img src="../assets/file.png" alt />
  614. </div>
  615. <div>{{ f.name }}</div>
  616. </div>
  617. </div>
  618. </div>
  619. <!-- <div class="nextStepBox">
  620. <div class="nextStepOne" @click="isBlock = 0">关闭</div>
  621. </div>-->
  622. </div>
  623. <!-- <div class="answerBox" :class="{ fullStyle: full }" v-if="isBlock == 6">
  624. <div style="height: 70%; width: 100%">
  625. <div class="wheel">
  626. <div class="workd_media" style="height: 100%">
  627. <video-player
  628. class="video-player vjs-custom-skin"
  629. :playsinline="true"
  630. :options="playerO[0]"
  631. @play="onPlayerPlay($event)"
  632. style="width: 90%; height: 100%; margin: 0 0 0 30px"
  633. ></video-player>
  634. </div>
  635. </div>
  636. </div>
  637. </div>-->
  638. <div
  639. class="answerBox"
  640. style="height: 100%"
  641. :class="{ fullStyle: full }"
  642. v-if="isBlock == 7"
  643. >
  644. <div style="height: 70%; width: 100%">
  645. <div class="wheel" style="height: 520px; width: 100%">
  646. <iframe
  647. style="width: 100%; height: 100%; border: none"
  648. :src="pptImgUrl"
  649. ></iframe>
  650. </div>
  651. <div class="nextStepBox" style="margin-top: 5%">
  652. <div class="nextStepOne" @click="isBlock = 5">返回</div>
  653. </div>
  654. </div>
  655. </div>
  656. <div
  657. class="answerBox"
  658. :class="{ fullStyle: full }"
  659. v-if="isBlock == 9"
  660. >
  661. <div style="height: 70%; width: 100%">
  662. <div class="wheel">
  663. <div style="height: 100%">
  664. <audio
  665. style="margin: 0 auto; display: block"
  666. :src="audioUrl"
  667. controls="controls"
  668. ref="audio"
  669. >
  670. Your browser does not support the audio element.
  671. </audio>
  672. </div>
  673. </div>
  674. <!-- <div class="nextStepBox" style="margin-top: 5%">
  675. <div class="nextStepOne" @click="isBlock = 0">关闭</div>
  676. </div>-->
  677. </div>
  678. </div>
  679. <div
  680. class="answerBox"
  681. :class="{ fullStyle: full }"
  682. v-if="isBlock == 10"
  683. >
  684. <div style="height: 70%; width: 100%">
  685. <div class="wheel">
  686. <div style="height: 100%">
  687. <el-button type="primary" @click="startRecorder()">{{
  688. !isRecord ? "开始录音" : "结束录音"
  689. }}</el-button>
  690. <el-button type="primary" @click="playRecorder()">{{
  691. !isPlayerRecord ? "录音播放" : "停止播放"
  692. }}</el-button>
  693. <el-button type="primary" @click="getMp3Data()"
  694. >上传录音</el-button
  695. >
  696. <div
  697. style="
  698. margin: 10px auto 0;
  699. display: flex;
  700. align-items: center;
  701. "
  702. v-if="LuAudioUrl"
  703. >
  704. <span>已上传录音:</span>
  705. <audio :src="LuAudioUrl" controls="controls" ref="audio">
  706. Your browser does not support the audio element.
  707. </audio>
  708. </div>
  709. </div>
  710. </div>
  711. <!-- <div class="nextStepBox" style="margin-top: 5%">
  712. <div class="nextStepOne" @click="isBlock = 0">关闭</div>
  713. </div>-->
  714. </div>
  715. </div>
  716. </div>
  717. </div>
  718. </div>
  719. <div class="blackBottomB" v-if="false">
  720. <!-- <div
  721. class="nextStepOne"
  722. style="float: right"
  723. @click="addImg($event)"
  724. v-if="tools[ppage - 1].tools && tools[ppage - 1].tools.indexOf(16) != -1"
  725. >
  726. 上传文件
  727. <input
  728. type="file"
  729. accept="image/png, image/gif, image/jpeg"
  730. style="display: none"
  731. @change="beforeUpload1($event, 1)"
  732. />
  733. </div>
  734. <div
  735. class="nextStepOne"
  736. style="float: right"
  737. @click="addImg($event)"
  738. v-if="tools[ppage - 1].tools && tools[ppage - 1].tools.indexOf(29) != -1"
  739. >
  740. 上传视频
  741. <input
  742. type="file"
  743. accept="video/mp4, video/quicktime, video/x-msvideo"
  744. style="display: none"
  745. @change="beforeUpload1($event, 2)"
  746. />
  747. </div>-->
  748. </div>
  749. <div v-if="proVisible" class="mask">
  750. <div class="progressBox">
  751. <div class="lbox">
  752. <img src="../assets/loading.gif" />上传中,请稍后
  753. </div>
  754. <el-progress
  755. :text-inside="true"
  756. :stroke-width="20"
  757. :percentage="progress"
  758. style="width: 80%"
  759. ></el-progress>
  760. </div>
  761. </div>
  762. <el-dialog
  763. :visible.sync="dialogVisible"
  764. :append-to-body="true"
  765. width="500px"
  766. :before-close="handleClose"
  767. class="dialog_diy"
  768. >
  769. <div style="text-align: center; padding: 20px 0 50px 0; font-size: 18px">
  770. 提交成功
  771. </div>
  772. <div
  773. style="
  774. width: 200px;
  775. background: #4d8ae0;
  776. height: 35px;
  777. margin: 0 auto;
  778. text-align: center;
  779. line-height: 35px;
  780. color: #fff;
  781. border-radius: 5px;
  782. cursor: pointer;
  783. "
  784. @click="dialogVisible = false"
  785. >
  786. 确定
  787. </div>
  788. </el-dialog>
  789. <el-dialog
  790. :visible.sync="dialogVisiblePick"
  791. :append-to-body="true"
  792. width="500px"
  793. class="dialog_diy"
  794. :close-on-click-modal="false"
  795. >
  796. <div style="text-align: center; padding: 20px 0 50px 0; font-size: 18px">
  797. 你被老师点名起来回答了!!!
  798. </div>
  799. <div
  800. style="
  801. width: 200px;
  802. background: #4d8ae0;
  803. height: 35px;
  804. margin: 0 auto;
  805. text-align: center;
  806. line-height: 35px;
  807. color: #fff;
  808. border-radius: 5px;
  809. cursor: pointer;
  810. "
  811. @click="pick2"
  812. >
  813. 确定
  814. </div>
  815. </el-dialog>
  816. <div v-html="iframeInnerHtml" ref="iframeIh" class="iframeBox"></div>
  817. </div>
  818. </template>
  819. <script>
  820. import pdf from "./components/pdf";
  821. import html2canvas from "html2canvas";
  822. import Recorder from "js-audio-recorder";
  823. const lamejs = require("lamejs");
  824. const recorder = new Recorder({
  825. sampleBits: 16, // 采样位数,支持 8 或 16,默认是16
  826. sampleRate: 48000, // 采样率,支持 11025、16000、22050、24000、44100、48000,根据浏览器默认值,我的chrome是48000
  827. numChannels: 1, // 声道,支持 1 或 2, 默认是1
  828. // compiling: false,(0.x版本中生效,1.x增加中) // 是否边录边转换,默认是false
  829. });
  830. // 绑定事件-打印的是当前录音数据
  831. recorder.onprogress = function (params) {
  832. // console.log('--------------START---------------')
  833. // console.log('录音时长(秒)', params.duration);
  834. // console.log('录音大小(字节)', params.fileSize);
  835. // console.log('录音音量百分比(%)', params.vol);
  836. // console.log('当前录音的总数据([DataView, DataView...])', params.data);
  837. // console.log('--------------END---------------')
  838. };
  839. export default {
  840. components: {
  841. pdf,
  842. },
  843. data() {
  844. return {
  845. iframeInnerHtml: "",
  846. pdfUrl:
  847. "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E4%B8%8A%E8%AF%BE%E8%AF%BE%E4%BB%B6---%E4%BA%94%E4%B8%8Bintroduce%20a%20festival%20%28Final%20%29%281%291661829428281.pdf",
  848. pptImgUrl: "",
  849. ppage: 2,
  850. full: false,
  851. pageTotal: 0,
  852. howTools: 0,
  853. toolsList: [],
  854. timer: null,
  855. isLoading: false,
  856. formLabelWidth: "100px",
  857. userid: this.$route.query.userid,
  858. cid: this.$route.query.courseId,
  859. oid: this.$route.query.oid,
  860. mr: require("../assets/kc1.png"),
  861. timu: [],
  862. dialogVisible: false,
  863. dialogVisiblePick: false,
  864. answerBox: "",
  865. isNoHomeWork: false,
  866. answer: [
  867. { name: "A.1568" },
  868. { name: "B.720" },
  869. { name: "C.1728" },
  870. { name: "D.480" },
  871. ],
  872. steps: 0,
  873. isBlock: 0,
  874. isNext: false,
  875. isAnswer: false,
  876. upload: [
  877. {
  878. url: "",
  879. },
  880. ],
  881. noneBtnImg: false,
  882. proVisible: false,
  883. progress: 0,
  884. typeC: [],
  885. toolCount: 0,
  886. tools: [
  887. {}, //tools: [30]
  888. // {
  889. // file: [
  890. // {
  891. // name: "音频1.MP3",
  892. // src: "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E6%9F%B3%E8%BD%BB%E9%A2%82%20-%20%E6%BA%AF%EF%BC%88%E9%92%A2%E7%90%B4%E7%89%88%EF%BC%891661673251415.mp3",
  893. // },
  894. // ],
  895. // }
  896. "",
  897. {
  898. file: [
  899. {
  900. name: "视频1.mp4",
  901. src: "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%AA%92%E4%BD%9311661413782505.mp4",
  902. },
  903. ],
  904. },
  905. "", //问答题
  906. { tools: [9], choice: 3, answer: [2, 3] },
  907. { tools: [9], choice: 3, answer: [2] }, //协同文档
  908. { tools: [9], choice: 3, answer: [3] }, //思维导图
  909. { tools: [9], choice: 3, answer: [1] },
  910. { tools: [9], choice: 3, answer: [2] },
  911. { tools: [12] },
  912. {
  913. tools: [27],
  914. answer: [
  915. "Time",
  916. "Weather",
  917. "Activities before the festival",
  918. "Activities during the festival",
  919. "Food",
  920. "Reason",
  921. "Feelings",
  922. ],
  923. choice: 7,
  924. tkAnswerBox: [
  925. "Feelings",
  926. "Weather",
  927. "Activities before the festival",
  928. "Origin",
  929. "Food",
  930. "Time",
  931. "Activities during the festival",
  932. "Reason",
  933. ],
  934. },
  935. {
  936. file: [
  937. {
  938. name: "视频2.mp4",
  939. src: "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%AA%92%E4%BD%9321661413797366.mp4",
  940. },
  941. ],
  942. },
  943. { tools: [9] },
  944. { tools: [3] },
  945. { tools: [16] },
  946. {
  947. tools: [14],
  948. rateArray: [
  949. "聚焦主题",
  950. "有开头结尾",
  951. "语言正确,流畅",
  952. "书写规范,美观",
  953. ],
  954. },
  955. "",
  956. "",
  957. { tools: [29] },
  958. "",
  959. "",
  960. //1、电子白板 2、便签 3、思维导图 4、问卷调查 5、量规评分 6、协同文档 7、思维网格 8、素材库 9、选择题 10、倒计时 11、问答题 12、选人回答 13、分小组 14、老师对提交作业进行评价 15、问答 16、作业提交 17、学习资料 18、训练平台 19、目标管理 20、课程设计 21、编程平台 22、AI体验 23、python 24、AI平台
  961. ],
  962. rateList: [],
  963. tkAnswerBox: [],
  964. tkAnswer: [],
  965. imgUrl: "",
  966. imgFile: "",
  967. imgFileUp: [],
  968. videoList: [],
  969. videoList2: [],
  970. audioUrl: "",
  971. fileList: [],
  972. playerOptions: {
  973. playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度
  974. autoplay: false, //如果true,浏览器准备好时开始回放。
  975. muted: false, // 默认情况下将会消除任何音频。
  976. loop: false, // 导致视频一结束就重新开始。
  977. preload: "auto", // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持)
  978. language: "zh-CN",
  979. aspectRatio: "16:9", // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3")
  980. fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。
  981. sources: [
  982. {
  983. type: "video/mp4", //这里的种类支持很多种:基本视频格式、直播、流媒体等,具体可以参看git网址项目 || "video/ogg"|| "video/webm"
  984. src: "", //url地址require("../../assets/media/aaa.mp4")
  985. },
  986. ],
  987. // poster: require("../../assets/tu31.png"), //你的封面地址
  988. // poster: dataRes.imgUrl, //你的封面地址
  989. notSupportedMessage: "此视频暂无法播放,请稍后再试", //允许覆盖Video.js无法播放媒体源时显示的默认信息。
  990. controlBar: {
  991. timeDivider: true, //当前时间和持续时间的分隔符
  992. durationDisplay: true, //显示持续时间
  993. remainingTimeDisplay: false, //是否显示剩余时间功能
  994. fullscreenToggle: true, //全屏按钮
  995. },
  996. },
  997. playerO: {},
  998. videoindex: 0,
  999. videoBlock: 0,
  1000. Vwidth: 0,
  1001. tiankongAnswer: [],
  1002. LuAudioUrl: "",
  1003. isRecord: false,
  1004. isPlayerRecord: false,
  1005. handle: {},
  1006. };
  1007. },
  1008. methods: {
  1009. // 开始录音
  1010. startRecorder() {
  1011. let _this = this;
  1012. if (!_this.isRecord) {
  1013. recorder.destroy(); // 销毁录音
  1014. _this.isRecord = true;
  1015. recorder.start().then(
  1016. () => {},
  1017. (error) => {
  1018. _this.$message.error(`${error.name} : ${error.message}`);
  1019. // 出错了
  1020. console.log(`${error.name} : ${error.message}`);
  1021. }
  1022. );
  1023. } else {
  1024. _this.isRecord = false;
  1025. recorder.stop(); // 结束录音
  1026. }
  1027. },
  1028. // 录音播放
  1029. playRecorder() {
  1030. if (!recorder.fileSize) {
  1031. return;
  1032. }
  1033. if (!this.isPlayerRecord) {
  1034. this.isPlayerRecord = true;
  1035. recorder.play();
  1036. } else {
  1037. this.isPlayerRecord = false;
  1038. recorder.stopPlay(); // 停止录音播放
  1039. }
  1040. recorder.onplayend = () => {
  1041. this.isPlayerRecord = false;
  1042. console.log("onplayend");
  1043. };
  1044. },
  1045. /**
  1046. * 文件格式转换 wav-map3
  1047. * */
  1048. getMp3Data() {
  1049. if (!recorder.fileSize) {
  1050. this.$message.error("请录音后在上传语音");
  1051. return;
  1052. }
  1053. const mp3Blob = this.convertToMp3(recorder.getWAV());
  1054. let audioFile = this.dataURLtoAudio(mp3Blob, "音频");
  1055. console.log(audioFile);
  1056. this.beforeUpload1(audioFile, 3);
  1057. // recorder.download(mp3Blob, "recorder", "mp3");
  1058. },
  1059. convertToMp3(wavDataView) {
  1060. // 获取wav头信息
  1061. const wav = lamejs.WavHeader.readHeader(wavDataView); // 此处其实可以不用去读wav头信息,毕竟有对应的config配置
  1062. const { channels, sampleRate } = wav;
  1063. const mp3enc = new lamejs.Mp3Encoder(channels, sampleRate, 128);
  1064. // 获取左右通道数据
  1065. const result = recorder.getChannelData();
  1066. const buffer = [];
  1067. const leftData =
  1068. result.left &&
  1069. new Int16Array(result.left.buffer, 0, result.left.byteLength / 2);
  1070. const rightData =
  1071. result.right &&
  1072. new Int16Array(result.right.buffer, 0, result.right.byteLength / 2);
  1073. const remaining = leftData.length + (rightData ? rightData.length : 0);
  1074. const maxSamples = 1152;
  1075. for (let i = 0; i < remaining; i += maxSamples) {
  1076. const left = leftData.subarray(i, i + maxSamples);
  1077. let right = null;
  1078. let mp3buf = null;
  1079. if (channels === 2) {
  1080. right = rightData.subarray(i, i + maxSamples);
  1081. mp3buf = mp3enc.encodeBuffer(left, right);
  1082. } else {
  1083. mp3buf = mp3enc.encodeBuffer(left);
  1084. }
  1085. if (mp3buf.length > 0) {
  1086. buffer.push(mp3buf);
  1087. }
  1088. }
  1089. const enc = mp3enc.flush();
  1090. if (enc.length > 0) {
  1091. buffer.push(enc);
  1092. }
  1093. return new Blob(buffer, { type: "audio/mp3" });
  1094. },
  1095. dataURLtoAudio(blob, filename) {
  1096. return new File([blob], filename, { type: "audio/mp3" });
  1097. },
  1098. change(val) {
  1099. console.log(val);
  1100. },
  1101. goTo(path) {
  1102. this.$router.push(path);
  1103. },
  1104. tableRowClassName({ row, rowIndex }) {
  1105. if ((rowIndex + 1) % 2 === 0) {
  1106. return "even_row";
  1107. } else {
  1108. return "";
  1109. }
  1110. },
  1111. jump(cid) {
  1112. window.parent.postMessage({ cid: cid, type: "1" }, "*");
  1113. },
  1114. handleCurrentChange(val) {
  1115. // console.log(`当前页: ${val}`);
  1116. this.page = val;
  1117. },
  1118. init() {},
  1119. handleClose(done) {
  1120. done();
  1121. },
  1122. handleRemove(file, fileList) {
  1123. console.log(file, fileList);
  1124. },
  1125. onExceed() {
  1126. this.$message.error("课程海报仅支持上传一张,请删除后再进行上传");
  1127. },
  1128. //uuid生成
  1129. guid() {
  1130. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
  1131. /[xy]/g,
  1132. function (c) {
  1133. var r = (Math.random() * 16) | 0,
  1134. v = c == "x" ? r : (r & 0x3) | 0x8;
  1135. return v.toString(16);
  1136. }
  1137. );
  1138. },
  1139. time() {
  1140. if (!this.now) {
  1141. this.now = new Date().getTime();
  1142. return true;
  1143. } else {
  1144. let time = new Date().getTime();
  1145. if (time - this.now > 3000) {
  1146. this.now = time;
  1147. return true;
  1148. } else {
  1149. return false;
  1150. }
  1151. }
  1152. },
  1153. // answerWork() {
  1154. // this.steps++;
  1155. // },
  1156. addTool(t) {
  1157. if (t == 1) {
  1158. window.parent.postMessage({ tools: "1" }, "*");
  1159. } else if (t == 3) {
  1160. window.parent.postMessage({ tools: "3" }, "*");
  1161. } else if (t == 7) {
  1162. window.parent.postMessage({ tools: "7" }, "*");
  1163. }
  1164. },
  1165. answerQue() {
  1166. this.dialogVisible = true;
  1167. },
  1168. isChooseActive(t) {
  1169. if (this.typeC.length == 0) {
  1170. this.typeC.push(t);
  1171. } else {
  1172. if (this.typeC.indexOf(t) != -1) {
  1173. this.typeC.splice(this.typeC.indexOf(t), 1);
  1174. } else {
  1175. this.typeC.push(t);
  1176. }
  1177. }
  1178. },
  1179. showMember(i) {
  1180. if (this.typeC.length > 0) {
  1181. this.addWork(1);
  1182. } else {
  1183. this.$message.error("至少选择一个答案!");
  1184. }
  1185. },
  1186. clean(type) {
  1187. if (type == 1) {
  1188. this.upload[0].url.splice(0, 1);
  1189. } else if (type == 2) {
  1190. this.upload[0].upVedio.splice(0, 1);
  1191. }
  1192. },
  1193. addImg(e) {
  1194. var el = e.currentTarget;
  1195. el.getElementsByTagName("input")[0].click();
  1196. },
  1197. imgChange(file, fileList, type) {
  1198. if (type == 1) {
  1199. var _tmp = this.upload[0].url;
  1200. } else if (type == 2) {
  1201. // var _tmp = this.upload[0].upVedio;
  1202. var _tmp = this.upload[0].url;
  1203. } else if (type == 100) {
  1204. var _tmp = this.imgFileUp;
  1205. }
  1206. this.noneBtnImg = _tmp.length >= 1;
  1207. },
  1208. beforeUpload1(event, type) {
  1209. var file;
  1210. if (type == 3) {
  1211. file = event;
  1212. } else {
  1213. file = event.target.files[0];
  1214. }
  1215. var credentials = {
  1216. accessKeyId: "AKIATLPEDU37QV5CHLMH",
  1217. secretAccessKey: "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",
  1218. }; //秘钥形式的登录上传
  1219. window.AWS.config.update(credentials);
  1220. window.AWS.config.region = "cn-northwest-1"; //设置区域
  1221. var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
  1222. var _this = this;
  1223. if (file) {
  1224. _this.progress = 0;
  1225. _this.proVisible = true;
  1226. var params = {
  1227. Key:
  1228. file.name.split(".")[0] +
  1229. new Date().getTime() +
  1230. "." +
  1231. file.name.split(".")[file.name.split(".").length - 1],
  1232. ContentType: file.type,
  1233. Body: file,
  1234. "Access-Control-Allow-Credentials": "*",
  1235. ACL: "public-read",
  1236. }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
  1237. var options = {
  1238. partSize: 2048 * 1024 * 1024,
  1239. queueSize: 2,
  1240. leavePartsOnError: true,
  1241. };
  1242. bucket
  1243. .upload(params, options)
  1244. .on("httpUploadProgress", function (evt) {
  1245. //这里可以写进度条
  1246. // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
  1247. _this.progress = parseInt((evt.loaded * 80) / evt.total);
  1248. })
  1249. .send(function (err, data) {
  1250. _this.progress = 100;
  1251. setTimeout(() => {
  1252. _this.proVisible = false;
  1253. }, 1000);
  1254. if (err) {
  1255. var a = _this.$refs.upload1.uploadFiles;
  1256. a.splice(a.length - 1, a.length);
  1257. _this.$message.error("上传失败");
  1258. } else {
  1259. _this.upload[0].url = "";
  1260. if (type == 1) {
  1261. _this.upload[0].url = data.Location;
  1262. _this.imgChange(null, null, type);
  1263. _this.addWork(4);
  1264. } else if (type == 2) {
  1265. _this.upload[0].url = data.Location;
  1266. _this.imgChange(null, null, type);
  1267. _this.addWork(7);
  1268. } else if (type == 3) {
  1269. _this.LuAudioUrl = data.Location;
  1270. _this.addWork(8);
  1271. }
  1272. console.log(data.Location);
  1273. }
  1274. });
  1275. }
  1276. },
  1277. beforeUpload2(event) {
  1278. var file = event;
  1279. var credentials = {
  1280. accessKeyId: "AKIATLPEDU37QV5CHLMH",
  1281. secretAccessKey: "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",
  1282. }; //秘钥形式的登录上传
  1283. window.AWS.config.update(credentials);
  1284. window.AWS.config.region = "cn-northwest-1"; //设置区域
  1285. var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
  1286. var _this = this;
  1287. _this.progress = 0;
  1288. _this.proVisible = true;
  1289. if (file) {
  1290. var params = {
  1291. Key: file.name.split(".")[0] + new Date().getTime() + "." + "png",
  1292. ContentType: file.type,
  1293. Body: file,
  1294. "Access-Control-Allow-Credentials": "*",
  1295. ACL: "public-read",
  1296. }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
  1297. var options = {
  1298. partSize: 2048 * 1024 * 1024,
  1299. queueSize: 2,
  1300. leavePartsOnError: true,
  1301. };
  1302. bucket
  1303. .upload(params, options)
  1304. .on("httpUploadProgress", function (evt) {
  1305. //这里可以写进度条
  1306. // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
  1307. _this.progress = parseInt((evt.loaded * 80) / evt.total);
  1308. })
  1309. .send(function (err, data) {
  1310. _this.progress = 100;
  1311. setTimeout(() => {
  1312. _this.proVisible = false;
  1313. }, 1000);
  1314. if (err) {
  1315. var a = _this.$refs.upload1.uploadFiles;
  1316. a.splice(a.length - 1, a.length);
  1317. _this.$message.error("上传失败");
  1318. } else {
  1319. _this.imgFileUp.push({
  1320. name: file.name,
  1321. url: data.Location,
  1322. uid: file.uid,
  1323. });
  1324. _this.imgChange(null, null, type);
  1325. console.log(data.Location);
  1326. }
  1327. });
  1328. }
  1329. },
  1330. addJtWork(type) {
  1331. if (this.isNoHomeWork == true || this.isAnswer == true) {
  1332. this.$confirm(
  1333. "您已经提交了该作业了,如果您再提交将覆盖上次提交的作业!",
  1334. "提示",
  1335. {
  1336. confirmButtonText: "确定",
  1337. cancelButtonText: "取消",
  1338. type: "warning",
  1339. }
  1340. )
  1341. .then(() => {
  1342. this.getImg();
  1343. this.addSWork(type);
  1344. })
  1345. .catch(() => {});
  1346. } else {
  1347. this.getImg();
  1348. // this.addSWork(type);
  1349. }
  1350. },
  1351. addWork(type) {
  1352. if (type == 5) {
  1353. if (this.tkAnswer.length == 0) {
  1354. this.$message.error("请选择对应的答案");
  1355. return;
  1356. }
  1357. }
  1358. // else if (this.upload[0].upVedio.length == 0) {
  1359. // this.$message.error("请上传视频");
  1360. // return;
  1361. // }
  1362. // else if (this.upload[0].upIntro == "") {
  1363. // this.$message.error("请填写简要描述");
  1364. // return;
  1365. // }
  1366. var _str = "";
  1367. if (type == 6) {
  1368. _str = "您已经提交了评价了,如果您再提交将覆盖上次提交的评价!";
  1369. } else {
  1370. _str = "您已经提交了该作业了,如果您再提交将覆盖上次提交的作业!";
  1371. }
  1372. if (this.isNoHomeWork == true || this.isAnswer == true) {
  1373. this.$confirm(_str, "提示", {
  1374. confirmButtonText: "确定",
  1375. cancelButtonText: "取消",
  1376. type: "warning",
  1377. })
  1378. .then(() => {
  1379. this.addSWork(type);
  1380. })
  1381. .catch(() => {});
  1382. } else {
  1383. this.addSWork(type);
  1384. }
  1385. },
  1386. addSWork(type) {
  1387. var a;
  1388. if (type == 4 || type == 7) {
  1389. a = this.upload[0].url;
  1390. } else if (type == 6) {
  1391. a = JSON.stringify(this.rateList);
  1392. } else if (type == 1) {
  1393. a = JSON.stringify(this.typeC);
  1394. } else if (type == 5) {
  1395. a = JSON.stringify(this.tkAnswer);
  1396. } else {
  1397. a = this.LuAudioUrl;
  1398. }
  1399. let params = {
  1400. uid: this.userid,
  1401. cid: this.cid,
  1402. p: this.ppage - 1,
  1403. t: type,
  1404. upload: a,
  1405. // upload: JSON.stringify(this.imgFileUp),
  1406. };
  1407. this.ajax
  1408. .get(this.$store.state.api + "insertSWork", params)
  1409. .then((res) => {
  1410. // this.isNoHomeWork = true;
  1411. // this.dialogVisible = true;
  1412. // this.upload = res.data[0][0].upload;
  1413. this.$message({
  1414. message: "提交成功",
  1415. type: "success",
  1416. });
  1417. this.selectSWork();
  1418. if (this.tools[this.ppage - 1].tools.indexOf(12) != -1) {
  1419. this.pick();
  1420. this.isBlock = 0;
  1421. }
  1422. })
  1423. .catch((err) => {
  1424. this.$message.error("提交成功");
  1425. console.error(err);
  1426. });
  1427. },
  1428. selectSWork() {
  1429. let _type = 0;
  1430. if (this.tools[this.ppage - 1].tools) {
  1431. if (
  1432. this.tools[this.ppage - 1].tools.indexOf(1) != -1 ||
  1433. this.tools[this.ppage - 1].tools.indexOf(3) != -1 ||
  1434. this.tools[this.ppage - 1].tools.indexOf(6) != -1 ||
  1435. this.tools[this.ppage - 1].tools.indexOf(7) != -1 ||
  1436. this.tools[this.ppage - 1].tools.indexOf(10) != -1 ||
  1437. this.tools[this.ppage - 1].tools.indexOf(16) != -1 ||
  1438. this.tools[this.ppage - 1].tools.indexOf(13) != -1
  1439. ) {
  1440. _type = 4;
  1441. } else if (this.tools[this.ppage - 1].tools.indexOf(9) != -1) {
  1442. _type = 1;
  1443. } else if (this.tools[this.ppage - 1].tools.indexOf(27) != -1) {
  1444. _type = 5;
  1445. } else if (this.tools[this.ppage - 1].tools.indexOf(14) != -1) {
  1446. _type = 6;
  1447. } else if (this.tools[this.ppage - 1].tools.indexOf(29) != -1) {
  1448. _type = 7;
  1449. } else if (
  1450. this.tools[this.ppage - 1].tools.indexOf(30) != -1 ||
  1451. this.tools[this.ppage - 1].tools.indexOf(12) != -1
  1452. ) {
  1453. _type = 8;
  1454. }
  1455. }
  1456. this.isAnswer = false;
  1457. this.isNoHomeWork = false;
  1458. let params = {
  1459. uid: this.userid,
  1460. cid: this.cid,
  1461. p: this.ppage - 1,
  1462. type: _type,
  1463. };
  1464. this.ajax
  1465. .get(this.$store.state.api + "selectSWork", params)
  1466. .then((res) => {
  1467. if (res.data[0].length > 0) {
  1468. if (res.data[0][0].type == 1) {
  1469. this.isAnswer = true;
  1470. this.typeC = JSON.parse(res.data[0][0].upload);
  1471. } else if (res.data[0][0].type == 5) {
  1472. this.isNoHomeWork = true;
  1473. this.tkAnswer = JSON.parse(res.data[0][0].upload);
  1474. } else if (res.data[0][0].type == 4 || res.data[0][0].type == 7) {
  1475. this.isNoHomeWork = true;
  1476. this.upload[0].url = res.data[0][0].upload;
  1477. } else if (res.data[0][0].type == 6) {
  1478. this.isNoHomeWork = true;
  1479. this.rateList = JSON.parse(res.data[0][0].upload);
  1480. } else if (res.data[0][0].type == 8) {
  1481. this.isNoHomeWork = true;
  1482. this.LuAudioUrl = res.data[0][0].upload;
  1483. }
  1484. }
  1485. })
  1486. .catch((err) => {
  1487. console.log("暂无作业");
  1488. console.error(err);
  1489. });
  1490. },
  1491. getImg() {
  1492. var iframeHtml;
  1493. let iframeBody;
  1494. if (this.toolCount == 1) {
  1495. iframeHtml = this.$refs.whiteBoard;
  1496. } else if (this.toolCount == 3) {
  1497. iframeHtml = this.$refs.mind;
  1498. } else if (this.toolCount == 7) {
  1499. iframeHtml = this.$refs.grid;
  1500. }
  1501. iframeBody = iframeHtml.contentWindow.document.body;
  1502. this.iframeInnerHtml = iframeBody.innerHTML;
  1503. var iframeIh = this.$refs.iframeIh;
  1504. iframeIh.innerHTML = this.iframeInnerHtml;
  1505. this.$forceUpdate();
  1506. console.log(iframeIh);
  1507. // var iframeHtml = this.$refs.whiteBoard;
  1508. document.getElementById("shishi_loading").style.display = "flex";
  1509. var _ajs = iframeHtml.contentWindow.document.createElement("script");
  1510. _ajs.type = "text/javascript";
  1511. _ajs.innerHTML =
  1512. 'var _js = document.createElement("script");\n' +
  1513. '_js.type="text/javascript";\n' +
  1514. '_js.src="https://html2canvas.hertzen.com/dist/html2canvas.min.js";\n' +
  1515. "_js.onload = function(){\n" +
  1516. ' var a = document.getElementsByTagName("img")\n' +
  1517. ' for(var i = 0;i<a.length;i++){a[i].crossOrigin="anonymous"}\n' +
  1518. " html2canvas(document.body).then(canvas => {\n" +
  1519. ' var base64Url = canvas.toDataURL("image/png");\n' +
  1520. 'var base64 = "<img src=" + base64Url + " />"\n' +
  1521. 'var file = dataURLtoFile_shishi(base64Url, "截图")\n' +
  1522. "beforeUpload_shishi(file," +
  1523. "'" +
  1524. this.userid +
  1525. "'" +
  1526. ", " +
  1527. "'" +
  1528. this.cid +
  1529. "'" +
  1530. ", " +
  1531. "'" +
  1532. (this.ppage - 1) +
  1533. "'" +
  1534. ", " +
  1535. "'4'" +
  1536. ")\n" +
  1537. " });\n" +
  1538. "}\n" +
  1539. "document.head.appendChild(_js);\n";
  1540. iframeHtml.contentWindow.document.head.appendChild(_ajs);
  1541. // iframeHtml.contentWindow.jietu_shishi(this.userid, this.cid);
  1542. // 第一个参数是需要生成截图的元素,第二个是自己需要配置的参数,宽高等
  1543. // html2canvas(iframeBody, {
  1544. // allowTaint: true,
  1545. // backgroundColor: null, //画出来的图片有白色的边框,不要可设置背景为透明色(null)
  1546. // useCORS: true, //支持图片跨域
  1547. // scale: 1, //设置放大的倍数
  1548. // }).then((canvas) => {
  1549. // // 把生成的base64位图片上传到服务器,生成在线图片地址
  1550. // let url = canvas.toDataURL("image/png"); // toDataURL: 图片格式转成 base64
  1551. // this.imgUrl = url; //将图片下载到本地
  1552. // let a = document.createElement("a"); // 生成一个a元素
  1553. // let event = new MouseEvent("click"); // 创建一个单击事件
  1554. // a.download = "作业"; // 设置图片名称没有设置则为默认
  1555. // a.href = this.imgUrl; // 将生成的URL设置为a.href属性
  1556. // a.dispatchEvent(event); // 触发a的单击事件
  1557. // let file = this.dataURLtoFile(url, "作业");
  1558. // this.imgFile = file;
  1559. // this.beforeUpload2(this.imgFile);
  1560. // this.addSWork();
  1561. // console.log(this.imgFile);
  1562. // });
  1563. },
  1564. dataURLtoFile(dataurl, filename) {
  1565. let arr = dataurl.split(","),
  1566. mime = arr[0].match(/:(.*?);/)[1],
  1567. bstr = atob(arr[1]),
  1568. n = bstr.length,
  1569. u8arr = new Uint8Array(n);
  1570. while (n--) {
  1571. u8arr[n] = bstr.charCodeAt(n);
  1572. }
  1573. return new File([u8arr], filename, { type: mime });
  1574. },
  1575. search() {},
  1576. selectFile() {
  1577. this.fileList = [];
  1578. this.videoList = [];
  1579. this.videoList2 = [];
  1580. var a = ["PDF", "DOC", "DOCX", "PPT", "PPTX", "XLSX", "XLS"];
  1581. var b = this.tools[this.ppage - 1].file;
  1582. for (var i = 0; i < b.length; i++) {
  1583. if (
  1584. a.indexOf(
  1585. b[i].src
  1586. .split(".")
  1587. [b[i].src.split(".").length - 1].toLocaleUpperCase()
  1588. ) != -1
  1589. ) {
  1590. this.fileList.push(b[i]);
  1591. } else if (
  1592. b[i].src
  1593. .split(".")
  1594. [b[i].src.split(".").length - 1].toLocaleUpperCase() == "MP3"
  1595. ) {
  1596. this.videoList2.push(b[i]);
  1597. } else {
  1598. this.videoList.push(b[i]);
  1599. }
  1600. }
  1601. if (this.videoList.length) {
  1602. this.playVideo();
  1603. } else if (this.videoList2.length) {
  1604. this.playVideo2();
  1605. } else {
  1606. this.videoBlock = 0;
  1607. }
  1608. },
  1609. openFile(u) {
  1610. this.pptImgUrl = "https://view.officeapps.live.com/op/view.aspx?src=" + u;
  1611. this.isBlock = 7;
  1612. },
  1613. playVideo() {
  1614. var d = JSON.parse(JSON.stringify(this.playerOptions));
  1615. // for (var i = 0; i < this.videoList.length; i++) {
  1616. d.sources[0].src = this.videoList[0].src;
  1617. this.playerO[0] = d;
  1618. // this.videoindex = i;
  1619. // }
  1620. // this.isBlock = 6;
  1621. this.videoBlock = 6;
  1622. },
  1623. playVideo2() {
  1624. this.audioUrl = this.videoList2[0].src;
  1625. this.isBlock = 9;
  1626. },
  1627. switchVideo(media) {
  1628. this.playerO = {};
  1629. this.playerOptions.poster = "";
  1630. this.playerOptions.sources[0].src = media;
  1631. this.playerO = this.playerOptions;
  1632. },
  1633. onPlayerPlay() {},
  1634. howPage(page) {
  1635. if (!this.pageTotal) {
  1636. return;
  1637. }
  1638. if (page == this.pageTotal) {
  1639. // this.isBlock = 3;
  1640. } else {
  1641. this.isBlock = 0;
  1642. if (
  1643. this.tools[page - 1].tools &&
  1644. this.tools[page - 1].tools.indexOf(9) != -1
  1645. ) {
  1646. this.isBlock = 1;
  1647. }
  1648. // if (this.ppage > 3) {
  1649. // this.isBlock = 2;
  1650. // }
  1651. this.full = false;
  1652. this.howTools = 0;
  1653. this.toolCount = 0;
  1654. if (this.tools[page - 1].tools && this.tools[page - 1].tools[0] == 12) {
  1655. this.isBlock = 0;
  1656. }
  1657. if (
  1658. this.tools[page - 1].tools &&
  1659. (this.tools[page - 1].tools.indexOf(1) != -1 ||
  1660. this.tools[page - 1].tools.indexOf(3) != -1 ||
  1661. this.tools[page - 1].tools.indexOf(7) != -1)
  1662. ) {
  1663. this.isBlock = 4;
  1664. }
  1665. if (
  1666. this.tools[page - 1].tools &&
  1667. this.tools[page - 1].tools.length > 1
  1668. ) {
  1669. this.isBlock = 4;
  1670. }
  1671. if (this.tools[page - 1].tools && !this.tools[page - 1].tools.length) {
  1672. this.isBlock = 0;
  1673. }
  1674. if (
  1675. this.tools[this.ppage - 1].tools &&
  1676. this.tools[this.ppage - 1].tools.indexOf(14) != -1
  1677. ) {
  1678. this.isBlock = 3;
  1679. } else if (
  1680. this.tools[this.ppage - 1].tools &&
  1681. (this.tools[this.ppage - 1].tools.indexOf(3) != -1 ||
  1682. this.tools[this.ppage - 1].tools.indexOf(3) != -1 ||
  1683. this.tools[this.ppage - 1].tools.indexOf(6) != -1 ||
  1684. this.tools[this.ppage - 1].tools.indexOf(7) != -1 ||
  1685. this.tools[this.ppage - 1].tools.indexOf(10) != -1 ||
  1686. this.tools[this.ppage - 1].tools.indexOf(16) != -1 ||
  1687. this.tools[this.ppage - 1].tools.indexOf(29) != -1 ||
  1688. this.tools[this.ppage - 1].tools.indexOf(13) != -1)
  1689. ) {
  1690. if (this.tools[this.ppage - 1].tools.indexOf(1) != -1) {
  1691. // this.toolCount = 1;
  1692. this.checkTools(1);
  1693. } else if (this.tools[this.ppage - 1].tools.indexOf(3) != -1) {
  1694. this.checkTools(3);
  1695. } else if (this.tools[this.ppage - 1].tools.indexOf(28) != -1) {
  1696. this.checkTools(28);
  1697. } else if (this.tools[this.ppage - 1].tools.indexOf(4) != -1) {
  1698. this.checkTools(4);
  1699. } else if (this.tools[this.ppage - 1].tools.indexOf(6) != -1) {
  1700. this.checkTools(6);
  1701. } else if (this.tools[this.ppage - 1].tools.indexOf(7) != -1) {
  1702. this.checkTools(7);
  1703. }
  1704. // this.isBlock = 2;
  1705. } else if (
  1706. this.tools[this.ppage - 1].file &&
  1707. this.tools[this.ppage - 1].file.length
  1708. ) {
  1709. this.selectFile();
  1710. } else if (
  1711. this.tools[this.ppage - 1].tools &&
  1712. this.tools[this.ppage - 1].tools.indexOf(27) != -1
  1713. ) {
  1714. if (this.tools[this.ppage - 1].answer) {
  1715. this.tiankongAnswer = this.tools[this.ppage - 1].answer;
  1716. }
  1717. this.isBlock = 8;
  1718. }
  1719. if (this.tools[page - 1].tools && this.tools[page - 1].tools[0] == 30) {
  1720. this.isBlock = 10;
  1721. }
  1722. if (
  1723. this.tools[this.ppage - 1].file &&
  1724. this.tools[this.ppage - 1].file.length
  1725. ) {
  1726. } else {
  1727. this.videoBlock = 0;
  1728. }
  1729. }
  1730. this.selectSWork();
  1731. },
  1732. pick() {
  1733. this.handle.type = 0;
  1734. this.handle.userid = "";
  1735. let params = [
  1736. {
  1737. h: JSON.stringfy(this.handle),
  1738. cid: this.cid,
  1739. },
  1740. ];
  1741. this.ajax
  1742. .post(this.$store.state.api + "updatePptPage", params)
  1743. .then((res) => {
  1744. // this.dialogVisiblePick = false;
  1745. let mindinfo = this.setInfo(
  1746. this.cid,
  1747. "us.mindNetwork",
  1748. this.handle,
  1749. "update",
  1750. this.userid
  1751. );
  1752. this.updateSocket(mindinfo);
  1753. })
  1754. .catch((err) => {
  1755. console.error(err);
  1756. });
  1757. },
  1758. pick2() {
  1759. this.dialogVisiblePick = false;
  1760. this.isBlock = 10;
  1761. },
  1762. setPage() {
  1763. let params = {
  1764. id: this.cid,
  1765. };
  1766. this.ajax
  1767. .get(this.$store.state.api + "selectPptPage", params)
  1768. .then((res) => {
  1769. if (res.data[0].length > 0) {
  1770. let _res = JSON.parse(res.data[0][0].page);
  1771. this.handle = _res;
  1772. if (
  1773. _res.type == 2 &&
  1774. _res.userid == this.userid &&
  1775. this.isBlock != 10 &&
  1776. this.tools[_res.page - 1].tools.indexOf(12) != -1
  1777. ) {
  1778. this.dialogVisiblePick = true;
  1779. }
  1780. if (_res.type == 1 && this.videoList.length) {
  1781. let handle = _res;
  1782. let a = this.$refs.zVideo;
  1783. if (handle.isPlay == 1) {
  1784. a.player.play();
  1785. } else if (handle.isPlay == 2) {
  1786. a.player.pause();
  1787. }
  1788. } else if (this.$refs.zVideo) {
  1789. this.$refs.zVideo.player.pause();
  1790. }
  1791. if (this.ppage == _res.page && this.isBlock !== 0) {
  1792. return;
  1793. } else {
  1794. this.ppage = _res.page;
  1795. // this.ppage = 1;
  1796. // this.ppage = 11;
  1797. this.typeC = [];
  1798. this.isAnswer = false;
  1799. this.howPage(this.ppage);
  1800. }
  1801. }
  1802. })
  1803. .catch((err) => {
  1804. // this.$message.error("查询失败");
  1805. console.error(err);
  1806. });
  1807. },
  1808. getPageTotal(total) {
  1809. this.pageTotal = total;
  1810. },
  1811. getWidth(total) {
  1812. this.Vwidth = total;
  1813. },
  1814. fullTools() {
  1815. this.full = !this.full;
  1816. },
  1817. checkTools(tcount) {
  1818. this.isBlock = 2;
  1819. this.toolCount = tcount;
  1820. let _this = this;
  1821. _this.$nextTick(() => {
  1822. setTimeout(() => {
  1823. const script1 = document.createElement("script");
  1824. script1.type = "text/javascript";
  1825. script1.src =
  1826. "https://pbl.cocorobo.cn/pbl-student-table/dist/js/jquery-3.6.0.min.js";
  1827. const script2 = document.createElement("script");
  1828. script2.type = "text/javascript";
  1829. script2.src =
  1830. "https://pbl.cocorobo.cn/pbl-student-table/dist/js/aws-sdk-2.235.1.min.js";
  1831. const script3 = document.createElement("script");
  1832. script3.type = "text/javascript";
  1833. script3.src =
  1834. "https://html2canvas.hertzen.com/dist/js/html2canvas.min.js";
  1835. const script4 = document.createElement("script");
  1836. script4.type = "text/javascript";
  1837. script4.src =
  1838. "https://pbl.cocorobo.cn/pbl-student-table/dist/js/jietu.js";
  1839. if (_this.toolCount == 1) {
  1840. _this.$refs.whiteBoard.onload = () => {
  1841. _this.$refs.whiteBoard.contentWindow.document.body.appendChild(
  1842. script1
  1843. );
  1844. _this.$refs.whiteBoard.contentWindow.document.body.appendChild(
  1845. script2
  1846. );
  1847. // _this.$refs.whiteBoard.contentWindow.document.body.appendChild(script3);
  1848. _this.$refs.whiteBoard.contentWindow.document.body.appendChild(
  1849. script4
  1850. );
  1851. };
  1852. } else if (_this.toolCount == 3) {
  1853. _this.$refs.mind.onload = () => {
  1854. _this.$refs.mind.contentWindow.document.body.appendChild(script1);
  1855. _this.$refs.mind.contentWindow.document.body.appendChild(script2);
  1856. // _this.$refs.mind.contentWindow.document.body.appendChild(script3);
  1857. _this.$refs.mind.contentWindow.document.body.appendChild(script4);
  1858. };
  1859. } else if (_this.toolCount == 7) {
  1860. _this.$refs.grid.onload = () => {
  1861. _this.$refs.grid.contentWindow.document.body.appendChild(script1);
  1862. _this.$refs.grid.contentWindow.document.body.appendChild(script2);
  1863. // _this.$refs.grid.contentWindow.document.body.appendChild(script3);
  1864. _this.$refs.grid.contentWindow.document.body.appendChild(script4);
  1865. };
  1866. }
  1867. }, 0);
  1868. });
  1869. },
  1870. getData() {
  1871. let params = {
  1872. id: this.cid,
  1873. };
  1874. this.ajax
  1875. .get(this.$store.state.api + "getRealTimeClassById", params)
  1876. .then((r) => {
  1877. let res = r.data[0][0];
  1878. this.pdfUrl = res.url;
  1879. this.tools = JSON.parse(res.content);
  1880. })
  1881. .catch((err) => {
  1882. // this.$message.error("查询失败");
  1883. console.error(err);
  1884. });
  1885. },
  1886. setData() {
  1887. let _this = this;
  1888. this.timer = setInterval(() => {
  1889. _this.setPage();
  1890. }, 1000);
  1891. },
  1892. getRealTimeClass() {
  1893. let params = [
  1894. {
  1895. type: "getRealTimeClass",
  1896. docid: this.cid,
  1897. pageid: window.parent.US.pageId,
  1898. userid: this.userid,
  1899. post: "1",
  1900. },
  1901. ];
  1902. this.ajax
  1903. .post(this.$store.state.socket, params)
  1904. .then((res) => {
  1905. if (res.data[0].length) {
  1906. let _res = {};
  1907. try {
  1908. _res = JSON.parse(res.data[0][0].page);
  1909. } catch (error) {
  1910. _res = res.data[0][0].page;
  1911. }
  1912. this.setPptData(_res)
  1913. }
  1914. console.log(res);
  1915. })
  1916. .catch((err) => {
  1917. console.error(err);
  1918. });
  1919. },
  1920. setPptData(res) {
  1921. let _res = res
  1922. this.handle = _res;
  1923. if (
  1924. _res.type == 2 &&
  1925. _res.userid == this.userid &&
  1926. this.isBlock != 10 &&
  1927. this.tools[_res.page - 1].tools.indexOf(12) != -1
  1928. ) {
  1929. this.dialogVisiblePick = true;
  1930. }
  1931. if (_res.type == 1 && this.videoList.length) {
  1932. let handle = _res;
  1933. let a = this.$refs.zVideo;
  1934. if (handle.isPlay == 1) {
  1935. a.player.play();
  1936. } else if (handle.isPlay == 2) {
  1937. a.player.pause();
  1938. }
  1939. } else if (this.$refs.zVideo) {
  1940. this.$refs.zVideo.player.pause();
  1941. }
  1942. if (this.ppage == _res.page && this.isBlock !== 0) {
  1943. return;
  1944. } else {
  1945. this.ppage = _res.page;
  1946. // this.ppage = 1;
  1947. // this.ppage = 11;
  1948. this.typeC = [];
  1949. this.isAnswer = false;
  1950. this.howPage(this.ppage);
  1951. }
  1952. },
  1953. setInfo(id, navid, content, type, userid) {
  1954. var _data = {
  1955. "us.realTimeClass": [
  1956. {
  1957. sendId: userid, //发送人id
  1958. receiveId: id, //文件id
  1959. type: navid, //消息类型
  1960. messageInfo: {
  1961. id: id, //操作ID
  1962. type: type, //类型
  1963. content: content, //内容
  1964. docId: id, //文档id
  1965. pageId: top.US.pageId, //当前页面id
  1966. },
  1967. },
  1968. ],
  1969. };
  1970. return _data;
  1971. },
  1972. updateSocket(mindinfo) {
  1973. let params = [
  1974. {
  1975. type: "send",
  1976. mindinfo: encodeURIComponent(
  1977. encodeURIComponent(JSON.stringify(mindinfo))
  1978. ),
  1979. post: 1,
  1980. },
  1981. ];
  1982. this.ajax
  1983. .post(this.$store.state.socket, params)
  1984. .then((res) => {
  1985. console.log(res);
  1986. })
  1987. .catch((err) => {
  1988. console.error(err);
  1989. });
  1990. },
  1991. },
  1992. beforeDestroy() {
  1993. clearInterval(this.timer);
  1994. this.timer = null;
  1995. window.removeEventListener("message");
  1996. },
  1997. created() {
  1998. this.getData();
  1999. this.getRealTimeClass()
  2000. let _this = this;
  2001. window.addEventListener("message", function (e) {
  2002. // 监听 message 事件
  2003. if (
  2004. e.data.type &&
  2005. e.data.type == "realTimeClass_update" &&
  2006. e.data.info.docId == _this.cid
  2007. ) {
  2008. // _this.data[e.data.info.id] = e.data.info.content;
  2009. this.setPptData(e.data.info.content)
  2010. }
  2011. _this.$forceUpdate();
  2012. });
  2013. },
  2014. };
  2015. </script>
  2016. <style scoped>
  2017. .dialog_diy >>> .el-dialog__header {
  2018. background: #3d67bc !important;
  2019. padding: 15px 20px;
  2020. }
  2021. .dialog_diy >>> .el-dialog__title {
  2022. color: #fff;
  2023. }
  2024. .dialog_diy >>> .el-dialog__headerbtn {
  2025. top: 9px;
  2026. }
  2027. .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
  2028. color: #fff;
  2029. }
  2030. .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
  2031. color: #fff;
  2032. }
  2033. .blackBottom {
  2034. background: rgb(0, 0, 0);
  2035. height: 45px;
  2036. width: 100%;
  2037. display: flex;
  2038. flex-direction: row;
  2039. flex-wrap: nowrap;
  2040. align-items: center;
  2041. justify-content: space-between;
  2042. }
  2043. .imgMiddle {
  2044. width: 100%;
  2045. position: relative;
  2046. height: 100%;
  2047. }
  2048. .imgMiddle > img,
  2049. .imghalf > img,
  2050. .szt > img,
  2051. .uploadImg > img,
  2052. .uploadVedio > img,
  2053. .uploadImgPic > img,
  2054. .logoLive > img,
  2055. .close > img,
  2056. .deleteWord > img {
  2057. width: 100%;
  2058. height: 100%;
  2059. }
  2060. .deleteWord {
  2061. width: 22px !important;
  2062. height: 22px;
  2063. position: absolute;
  2064. right: -5px;
  2065. top: -5px;
  2066. cursor: pointer;
  2067. }
  2068. .blackBottomB {
  2069. position: sticky;
  2070. bottom: 0px;
  2071. left: 0px;
  2072. display: flex;
  2073. flex-direction: row;
  2074. flex-wrap: wrap;
  2075. align-content: center;
  2076. justify-content: space-between;
  2077. align-items: center;
  2078. background: rgb(0, 0, 0);
  2079. height: 45px;
  2080. width: 100%;
  2081. }
  2082. .blackBottomB > div:nth-child(1) {
  2083. margin-left: 10px !important;
  2084. }
  2085. .blackButton {
  2086. color: #fff;
  2087. background: #066ebe;
  2088. width: 100px;
  2089. height: 30px;
  2090. line-height: 30px;
  2091. text-align: center;
  2092. margin: 0 25px;
  2093. border-radius: 5px;
  2094. font-size: 15px;
  2095. cursor: pointer;
  2096. }
  2097. .isNoOther {
  2098. width: 100%;
  2099. display: flex;
  2100. height: calc(100% - 45px);
  2101. }
  2102. .imghalf {
  2103. width: 60% !important;
  2104. }
  2105. .answerBox {
  2106. padding: 25px;
  2107. overflow: auto;
  2108. height: 70%;
  2109. box-sizing: border-box;
  2110. }
  2111. .answerTimuBox {
  2112. display: flex;
  2113. flex-direction: row;
  2114. flex-wrap: nowrap;
  2115. align-items: center;
  2116. justify-content: space-between;
  2117. padding-bottom: 15px;
  2118. }
  2119. .memberBox {
  2120. display: flex;
  2121. flex-direction: row;
  2122. flex-wrap: wrap;
  2123. align-items: center;
  2124. }
  2125. .memberBox > div {
  2126. background: rgb(240, 185, 204);
  2127. width: 120px;
  2128. color: #fff;
  2129. height: 40px;
  2130. text-align: center;
  2131. line-height: 40px;
  2132. border-radius: 5px;
  2133. margin: 0 15px 15px 0;
  2134. cursor: pointer;
  2135. }
  2136. .viewSta {
  2137. background: rgb(97, 97, 97);
  2138. color: #bebebe;
  2139. margin: 20% auto 20px;
  2140. width: 300px;
  2141. height: 40px;
  2142. text-align: center;
  2143. line-height: 40px;
  2144. border-radius: 5px;
  2145. cursor: pointer;
  2146. }
  2147. .szt {
  2148. width: 450px;
  2149. margin: 20px auto;
  2150. }
  2151. .sztFooter {
  2152. padding: 20px 10px 50px 0;
  2153. display: flex;
  2154. flex-direction: row;
  2155. flex-wrap: nowrap;
  2156. justify-content: flex-end;
  2157. align-items: center;
  2158. }
  2159. .timuButton {
  2160. background: #649ef2;
  2161. width: 75px;
  2162. height: 27px;
  2163. line-height: 27px;
  2164. text-align: center;
  2165. border-radius: 5px;
  2166. color: #fff;
  2167. margin-right: 20px;
  2168. display: inline-block;
  2169. }
  2170. .anserBoxCss {
  2171. margin: 30px 0 20px 0;
  2172. }
  2173. .anserBoxCss >>> .el-radio__label {
  2174. font-size: 18px;
  2175. }
  2176. .anserBoxCss >>> .el-radio__inner {
  2177. border-radius: 0px !important;
  2178. }
  2179. .nextStepBox {
  2180. display: flex;
  2181. justify-content: center;
  2182. margin-top: 10px;
  2183. }
  2184. .nextStepOne {
  2185. background: #6b92c9;
  2186. color: #fff;
  2187. width: 110px;
  2188. text-align: center;
  2189. height: 35px;
  2190. line-height: 35px;
  2191. font-size: 14px;
  2192. border-radius: 5px;
  2193. cursor: pointer;
  2194. }
  2195. .nextStepOne,
  2196. .nextStepOne {
  2197. margin-left: 10px;
  2198. }
  2199. .toolList {
  2200. display: flex;
  2201. flex-direction: row;
  2202. flex-wrap: wrap;
  2203. justify-content: flex-start;
  2204. align-items: center;
  2205. }
  2206. .tools {
  2207. display: flex;
  2208. flex-direction: column;
  2209. align-items: center;
  2210. margin-right: 20px;
  2211. }
  2212. .tools > div:nth-child(1) {
  2213. width: 60px;
  2214. }
  2215. .tools > div:nth-child(1) > img {
  2216. width: 100%;
  2217. height: 100%;
  2218. }
  2219. .uploadImg {
  2220. width: 100px;
  2221. margin: 10px 0 0 15px;
  2222. cursor: pointer;
  2223. }
  2224. .upImg {
  2225. display: flex;
  2226. flex-direction: column;
  2227. flex-wrap: nowrap;
  2228. align-items: center;
  2229. justify-content: center;
  2230. color: rgb(182, 182, 182);
  2231. font-size: 20px;
  2232. }
  2233. .binfo_input {
  2234. font: inherit;
  2235. color: currentColor;
  2236. width: 100%;
  2237. margin: 0;
  2238. padding: 15px 14px;
  2239. display: block;
  2240. min-width: 0;
  2241. outline: none;
  2242. box-sizing: content-box;
  2243. background: none;
  2244. -webkit-tap-highlight-color: transparent;
  2245. border: 1px solid rgba(0, 0, 0, 0.23);
  2246. border-radius: 4px;
  2247. box-sizing: border-box;
  2248. resize: none;
  2249. }
  2250. .binfo_input:focus-visible {
  2251. border: 1px solid rgba(61, 103, 188);
  2252. }
  2253. .hengCss {
  2254. display: flex;
  2255. flex-direction: row;
  2256. flex-wrap: wrap;
  2257. align-items: center;
  2258. padding: 5px 0 0 20px;
  2259. }
  2260. .uploadImgPic {
  2261. width: 100px;
  2262. height: 100px;
  2263. position: relative;
  2264. margin: 0 20px 0 0;
  2265. }
  2266. .uploadImgPic > div {
  2267. width: 100px;
  2268. white-space: nowrap;
  2269. overflow: hidden;
  2270. text-overflow: ellipsis;
  2271. }
  2272. .mask {
  2273. background-color: rgba(0, 0, 0, 0);
  2274. position: fixed;
  2275. top: 0;
  2276. left: 0;
  2277. width: 100%;
  2278. height: 100%;
  2279. z-index: 20000;
  2280. display: flex;
  2281. align-items: center;
  2282. justify-content: center;
  2283. }
  2284. .progressBox {
  2285. width: 500px;
  2286. height: 180px;
  2287. background: #fff;
  2288. border-radius: 10px;
  2289. box-shadow: 0 0 6px 1px #bfbfbf;
  2290. display: flex;
  2291. align-items: center;
  2292. justify-content: center;
  2293. flex-direction: column;
  2294. }
  2295. .progressBox .lbox {
  2296. height: 100px;
  2297. font-size: 19px;
  2298. display: flex;
  2299. align-items: center;
  2300. }
  2301. .progressBox .lbox img {
  2302. width: 40px;
  2303. margin-right: 20px;
  2304. }
  2305. .progressBox >>> .el-progress-bar__outer {
  2306. background-color: #d1dfff !important;
  2307. }
  2308. .progressBox .lbox {
  2309. height: 100px;
  2310. font-size: 19px;
  2311. display: flex;
  2312. align-items: center;
  2313. }
  2314. .progressBox .lbox img {
  2315. width: 40px;
  2316. margin-right: 20px;
  2317. }
  2318. .logoLive {
  2319. width: 35px;
  2320. }
  2321. .choose_style {
  2322. display: flex;
  2323. justify-content: center;
  2324. align-items: center;
  2325. width: 100%;
  2326. margin: 10px 0 30px;
  2327. }
  2328. .choose_style span {
  2329. background: #f8f9ff;
  2330. color: #677fff;
  2331. border: 1px solid #95b5ff;
  2332. padding: 15px 20px;
  2333. font-size: 25px;
  2334. border-radius: 18px;
  2335. cursor: pointer;
  2336. }
  2337. .choose_style span + span {
  2338. margin-left: 25px;
  2339. }
  2340. .isChoose {
  2341. color: #fff !important;
  2342. background: #5e78fa !important;
  2343. }
  2344. .close {
  2345. position: absolute;
  2346. right: 10px;
  2347. top: 10px;
  2348. width: 20px;
  2349. cursor: pointer;
  2350. }
  2351. .score_box {
  2352. font-size: 14px;
  2353. }
  2354. .score_box >>> .el-rate {
  2355. margin: 10px 0 20px 0;
  2356. }
  2357. .score_box >>> .el-rate__icon {
  2358. font-size: 23px;
  2359. }
  2360. .bz >>> .el-textarea__inner {
  2361. width: 80%;
  2362. background: #f9f9f9;
  2363. border: 1px solid #afafaf;
  2364. border-radius: 0px;
  2365. }
  2366. .tools_title {
  2367. background: #000;
  2368. position: absolute;
  2369. width: 100%;
  2370. top: 0;
  2371. left: 0;
  2372. display: flex;
  2373. align-items: center;
  2374. height: 40px;
  2375. justify-content: space-between;
  2376. padding: 0 15px;
  2377. box-sizing: border-box;
  2378. }
  2379. .tools_title span {
  2380. color: #fff;
  2381. }
  2382. .tools_title div {
  2383. display: flex;
  2384. align-items: center;
  2385. }
  2386. .full,
  2387. .closeImg {
  2388. height: 22px;
  2389. cursor: pointer;
  2390. }
  2391. .tools_title img,
  2392. img {
  2393. margin-left: 10px;
  2394. }
  2395. .tools_box {
  2396. width: 38.5%;
  2397. max-width: 38.5%;
  2398. overflow: auto;
  2399. background: rgb(255, 255, 255);
  2400. height: 91.5%;
  2401. position: relative;
  2402. margin: 10px 15px;
  2403. }
  2404. .tools_child_box {
  2405. width: 100%;
  2406. height: calc(90% - 40px);
  2407. padding-top: 40px;
  2408. }
  2409. .fullStyle {
  2410. width: 100% !important;
  2411. max-width: 100% !important;
  2412. }
  2413. .toolCss {
  2414. display: flex;
  2415. flex-direction: column;
  2416. flex-wrap: wrap;
  2417. width: calc(100% / 6);
  2418. align-items: center;
  2419. text-align: center;
  2420. }
  2421. .toolImg {
  2422. width: 70px;
  2423. height: 70px;
  2424. cursor: pointer;
  2425. }
  2426. .toolImg > img {
  2427. width: 100%;
  2428. height: 100%;
  2429. margin: 0 !important;
  2430. }
  2431. .toolImg > div {
  2432. font-size: 14px;
  2433. }
  2434. .iframeBox {
  2435. overflow: auto;
  2436. position: absolute;
  2437. top: 0;
  2438. z-index: -2;
  2439. width: 100%;
  2440. height: 100%;
  2441. }
  2442. .fileBox {
  2443. display: flex;
  2444. flex-direction: row;
  2445. flex-wrap: wrap;
  2446. align-items: center;
  2447. justify-content: flex-start;
  2448. align-content: center;
  2449. width: 100%;
  2450. }
  2451. .fileListCss {
  2452. display: flex;
  2453. flex-direction: column;
  2454. flex-wrap: nowrap;
  2455. align-items: center;
  2456. margin: 0 15px 15px 0;
  2457. }
  2458. .fileCss {
  2459. width: 70px;
  2460. height: 70px;
  2461. cursor: pointer;
  2462. margin: 0 0 10px 0;
  2463. }
  2464. .fileCss > img {
  2465. width: 100%;
  2466. height: 100%;
  2467. margin: 0;
  2468. }
  2469. .wheel {
  2470. width: 100%;
  2471. height: 100%;
  2472. }
  2473. .video-player >>> .video-js {
  2474. height: 100%;
  2475. }
  2476. .tkCss {
  2477. display: flex;
  2478. flex-direction: row;
  2479. align-items: center;
  2480. flex-wrap: nowrap;
  2481. margin-bottom: 15px;
  2482. }
  2483. .workd_media {
  2484. /* width: 1497.42px; */
  2485. /* width: auto; */
  2486. height: 100%;
  2487. position: absolute;
  2488. top: 0;
  2489. left: 50%;
  2490. transform: translateX(-50%);
  2491. z-index: 999;
  2492. }
  2493. .tiankongAnswer {
  2494. margin-left: 10px;
  2495. color: #1834c0;
  2496. }
  2497. .tfalse {
  2498. color: rgb(189, 30, 30) !important;
  2499. }
  2500. .video_wrapper {
  2501. width: 100%;
  2502. height: 100%;
  2503. position: absolute;
  2504. z-index: 99999;
  2505. background: #fff;
  2506. background: transparent;
  2507. top: 0;
  2508. }
  2509. </style>