Preview.vue 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862
  1. <!-- -->
  2. <template>
  3. <div
  4. v-if="cur"
  5. class="NPC-Big-Book-preview adult-book-preview-sty"
  6. :class="['NPC-Big-Book-preview-' + themeColor]"
  7. >
  8. <div class="NNPE-title">
  9. <!-- 页眉 -->
  10. <div class="NNPE-title-left">
  11. <div
  12. v-for="(item, index) in cur.detailList"
  13. :key="index"
  14. class="NNPE-title-item"
  15. >
  16. <template
  17. v-if="
  18. item.detail &&
  19. item.detail.wordsList &&
  20. item.detail.wordsList.length == 0
  21. "
  22. >
  23. <p
  24. v-if="item.detail.sentence"
  25. :class="[
  26. 'content-con',
  27. /^[\u4e00-\u9fa5]/.test(item.detail.sentence) ? 'hasCn' : '',
  28. ]"
  29. v-html="item.detail.sentence"
  30. />
  31. </template>
  32. <template v-else>
  33. <div v-if="item.detail && item.detail.resArr" class="con-box">
  34. <div
  35. v-for="(itemCon, indexCon) in item.detail.resArr"
  36. v-show="itemCon.isShow"
  37. :key="indexCon"
  38. :class="['con-item', indexCon === 0 ? 'con-item-0' : '']"
  39. >
  40. <template
  41. v-if="
  42. item.detail &&
  43. item.detail.wordsList &&
  44. item.detail.wordsList[indexCon + 1] &&
  45. item.detail.wordsList[indexCon + 1].chs &&
  46. chsFhList.indexOf(item.detail.wordsList[indexCon + 1].chs) >
  47. -1
  48. "
  49. >
  50. <div class="synthesis-box">
  51. <div>
  52. <span
  53. class="pinyin"
  54. :class="[
  55. noFont.indexOf(itemCon.pinyin) > -1 ? 'noFont' : '',
  56. ]"
  57. v-if="itemCon.pinyin"
  58. >{{ itemCon.pinyin }}</span
  59. >
  60. <span class="content-con" :class="[/^[0-9]*$/.test(itemCon.chs)]?/^[\u4e00-\u9fa5]/.test(itemCon.chs)?'hanzi':'en':''">{{ itemCon.chs }}</span>
  61. </div>
  62. <div
  63. v-if="item.detail.wordsList[indexCon + 1]"
  64. style="text-align: left"
  65. >
  66. <span
  67. class="pinyin"
  68. :class="[
  69. noFont.indexOf(
  70. item.detail.wordsList[indexCon + 1].pinyin
  71. ) > -1
  72. ? 'noFont'
  73. : '',
  74. ]"
  75. v-if="item.detail.wordsList[indexCon + 1].pinyin"
  76. >{{ item.detail.wordsList[indexCon + 1].pinyin }}</span
  77. >
  78. <span class="content-con" :class="[/^[0-9]*$/.test(item.detail.wordsList[indexCon + 1].chs)]?/^[\u4e00-\u9fa5]/.test(item.detail.wordsList[indexCon + 1].chs)?'hanzi':'en':''">{{
  79. item.detail.wordsList[indexCon + 1].chs
  80. }}</span>
  81. </div>
  82. </div>
  83. </template>
  84. <template v-else>
  85. <span
  86. class="pinyin"
  87. :class="[
  88. noFont.indexOf(itemCon.pinyin) > -1 ? 'noFont' : '',
  89. ]"
  90. v-if="
  91. item.detail &&
  92. !(
  93. item.detail.wordsList &&
  94. item.detail.wordsList[indexCon - 1] &&
  95. item.detail.wordsList[indexCon - 1].chs &&
  96. chsFhList.indexOf(
  97. item.detail.wordsList[indexCon - 1].chs
  98. ) == -1 &&
  99. chsFhList.indexOf(itemCon.chs) > -1
  100. ) &&
  101. itemCon.pinyin
  102. "
  103. >{{ itemCon.pinyin }}</span
  104. >
  105. <span
  106. class="content-con"
  107. v-if="
  108. item.detail &&
  109. !(
  110. item.detail.wordsList &&
  111. item.detail.wordsList[indexCon - 1] &&
  112. item.detail.wordsList[indexCon - 1].chs &&
  113. chsFhList.indexOf(
  114. item.detail.wordsList[indexCon - 1].chs
  115. ) == -1 &&
  116. chsFhList.indexOf(itemCon.chs) > -1
  117. )
  118. "
  119. :class="[/^[0-9]*$/.test(itemCon.chs)]?/^[\u4e00-\u9fa5]/.test(itemCon.chs)?'hanzi':'en':''"
  120. >{{ itemCon.chs }}</span
  121. >
  122. </template>
  123. </div>
  124. </div>
  125. </template>
  126. <p class="NNPE-title-item-en" v-html="item.en" />
  127. </div>
  128. </div>
  129. <div v-if="isShowTitle" class="NNPE-operate">
  130. <a
  131. class="btn-prev"
  132. :class="[preClick ? '' : 'btn-prev-disabled']"
  133. @click="handleNNPEprev"
  134. />
  135. <a
  136. class="btn-next"
  137. :class="[nextClick ? '' : 'btn-next-disabled']"
  138. @click="handleNNPEnext"
  139. />
  140. </div>
  141. </div>
  142. <div
  143. v-if="
  144. cur.classTopic && cur.classTopic.length > 0 && cur.classTopic[0].con
  145. "
  146. class="classTopic-box"
  147. >
  148. <span
  149. v-for="(item, index) in cur.classTopic"
  150. :key="index"
  151. :class="item.font"
  152. >
  153. {{ item.con }}
  154. </span>
  155. </div>
  156. <div v-if="cur" class="NNPE-Book-content-inner">
  157. <div
  158. v-for="(item, index) in cur.cur_fn_data"
  159. :key="index"
  160. class="title-box-preview"
  161. :class="[
  162. !previewType ||
  163. previewType == 'previewCheck' ||
  164. (previewType == 'previewCheckShow' && item.previewShow) ||
  165. JSON.parse(previewGroupId).length == 0
  166. ? 'NNPE-Book-content-item'
  167. : '',
  168. ]"
  169. >
  170. <div v-for="(itemJ, indexJ) in judgeAnswersList" :key="indexJ">
  171. <el-checkbox
  172. class="NNPE-Book-content-item-checkbox"
  173. :label="item.group_id"
  174. v-if="previewType && previewType == 'previewCheck' && item.group_id"
  175. v-model="groupCheckList[index]"
  176. @change="forupdata(index)"
  177. ><br
  178. /></el-checkbox>
  179. <template
  180. v-if="
  181. !previewType ||
  182. previewType == 'previewCheck' ||
  183. (previewType == 'previewCheckShow' && item.previewShow) ||
  184. JSON.parse(previewGroupId).length == 0
  185. "
  186. >
  187. <template v-if="itemJ != 'standardAnswer'">
  188. <div
  189. v-if="item.number || item.z_title || item.f_title"
  190. class="title-big"
  191. >
  192. <b v-if="item.number">{{ item.number }}</b>
  193. <div
  194. class="title-box-right"
  195. :class="[item.is_textIndex ? 'title-box-right-index' : '']"
  196. >
  197. <h2 v-if="item.z_title" v-html="item.z_title" />
  198. <h3
  199. v-if="item.f_title"
  200. :style="{ marginTop: item.z_title ? '8px' : '0' }"
  201. v-html="item.f_title"
  202. />
  203. </div>
  204. </div>
  205. <div
  206. class="title-little"
  207. :class="[
  208. item.little_title_number || item.little_title
  209. ? 'marginTop'
  210. : '',
  211. ]"
  212. >
  213. <b v-html="item.little_title_number" />
  214. <p v-html="item.little_title" />
  215. </div>
  216. </template>
  217. <div
  218. :class="[
  219. 'NNPE-tableList',
  220. item.is_bg ? 'NNPE-tableList-hasBg' : '',
  221. ]"
  222. >
  223. <h6
  224. v-if="itemJ == 'userAnswer' || itemJ == 'studentAnswer'"
  225. class="standardTitle"
  226. >
  227. {{ itemJ == "userAnswer" ? "Your answer" : "Student answers" }}
  228. </h6>
  229. <h6
  230. v-if="itemJ == 'standardAnswer' && item.ShowstandardAnswer"
  231. class="standardTitle"
  232. >
  233. Standard answer
  234. </h6>
  235. <div
  236. v-for="(items, indexs) in item.table_list"
  237. :key="indexs"
  238. class="NNPE-tableList-tr"
  239. :class="[
  240. indexs === item.table_list.length - 1
  241. ? 'NNPE-tableList-tr-last'
  242. : '',
  243. ]"
  244. >
  245. <div
  246. v-for="(itemss, indexss) in items"
  247. :key="indexss"
  248. :class="[
  249. 'NNPE-tableList-item',
  250. items.length == 1
  251. ? 'NNPE-tableList-item-noMargin'
  252. : 'NNPE-tableList-item' + items.length,
  253. ]"
  254. >
  255. <template v-if="itemss.data">
  256. <template v-if="itemss.type == 'ligature_chs'">
  257. <Ligature
  258. :cur-que="itemss.data"
  259. :theme-color="themeColor"
  260. :task-model="TaskModel"
  261. :number="
  262. index +
  263. '_' +
  264. indexs +
  265. '_' +
  266. indexss +
  267. '_' +
  268. currentTreeID
  269. "
  270. :judgeAnswer="itemJ"
  271. />
  272. </template>
  273. <template v-if="itemss.data.type == 'image'">
  274. <Picture
  275. v-if="refresh"
  276. :cur-que="itemss.data"
  277. :child-type="itemss.type"
  278. :theme-color="themeColor"
  279. :task-model="TaskModel"
  280. :judgeAnswer="itemJ"
  281. />
  282. </template>
  283. <template
  284. v-if="
  285. itemss.type == 'phrase_chs' && itemJ != 'standardAnswer'
  286. "
  287. >
  288. <WordPhrase
  289. v-if="refresh"
  290. :cur-que="itemss.data"
  291. :theme-color="themeColor"
  292. :task-model="TaskModel"
  293. :indexStr="
  294. index +
  295. '_' +
  296. indexs +
  297. '_' +
  298. indexss +
  299. '_' +
  300. currentTreeID
  301. "
  302. :judgeAnswer="itemJ"
  303. />
  304. </template>
  305. <template
  306. v-if="
  307. itemss.type == 'NewWord_chs' &&
  308. itemJ != 'standardAnswer'
  309. "
  310. >
  311. <WordPhrase
  312. v-if="refresh"
  313. :cur-que="itemss.data"
  314. :theme-color="themeColor"
  315. :current-tree-i-d="currentTreeID"
  316. :indexs="indexs"
  317. :indexss="indexss"
  318. :task-model="TaskModel"
  319. :indexStr="
  320. index +
  321. '_' +
  322. indexs +
  323. '_' +
  324. indexss +
  325. '_' +
  326. currentTreeID
  327. "
  328. :judgeAnswer="itemJ"
  329. />
  330. </template>
  331. <template
  332. v-if="
  333. itemss.type == 'annotation_chs' &&
  334. itemJ != 'standardAnswer'
  335. "
  336. >
  337. <WordPhrase
  338. v-if="refresh"
  339. :cur-que="itemss.data"
  340. :theme-color="themeColor"
  341. :task-model="TaskModel"
  342. :indexStr="
  343. index +
  344. '_' +
  345. indexs +
  346. '_' +
  347. indexss +
  348. '_' +
  349. currentTreeID
  350. "
  351. :judgeAnswer="itemJ"
  352. />
  353. </template>
  354. <template
  355. v-if="
  356. itemss.type == 'notes_chs' && itemJ != 'standardAnswer'
  357. "
  358. >
  359. <Notes
  360. v-if="refresh"
  361. :cur-que="itemss.data"
  362. :theme-color="themeColor"
  363. :task-model="TaskModel"
  364. :judgeAnswer="itemJ"
  365. />
  366. </template>
  367. <template
  368. v-if="
  369. itemss.type == 'article_chs' &&
  370. itemJ != 'standardAnswer'
  371. "
  372. >
  373. <ArticleTemChs
  374. v-if="refresh"
  375. :cur-que="itemss.data"
  376. :n-n-p-e-new-word-list="NNPENewWordList"
  377. :n-n-p-e-new-phrase-list="NNPENewPhraseList"
  378. :n-n-p-e-annotation-list="NNPEAnnotationList"
  379. :theme-color="themeColor"
  380. :current-tree-i-d="currentTreeID"
  381. :task-model="TaskModel"
  382. :judgeAnswer="itemJ"
  383. :colLength="items.length"
  384. />
  385. </template>
  386. <!-- <template v-if="itemss.type == 'sentence_segword_chs'">
  387. <SentenceSegWordViewChs
  388. :cur-que="itemss.data"
  389. :theme-color="themeColor"
  390. v-if="refresh"
  391. />
  392. </template> -->
  393. <template
  394. v-if="
  395. itemss.type == 'dialogue_article_chs' &&
  396. itemJ != 'standardAnswer'
  397. "
  398. >
  399. <DialogueArticleViewChs
  400. v-if="refresh"
  401. :cur-que="itemss.data"
  402. :n-n-p-e-new-word-list="NNPENewWordList"
  403. :n-n-p-e-new-phrase-list="NNPENewPhraseList"
  404. :n-n-p-e-annotation-list="NNPEAnnotationList"
  405. :color-box="colorBox"
  406. :theme-color="themeColor"
  407. :current-tree-i-d="currentTreeID"
  408. :task-model="TaskModel"
  409. :judgeAnswer="itemJ"
  410. :colLength="items.length"
  411. />
  412. </template>
  413. <template v-if="itemss.type == 'dialogue_answer_chs'">
  414. <DialogueAnswerViewChs
  415. v-if="refresh"
  416. :cur-que="itemss.data"
  417. :color-box="colorBox"
  418. :theme-color="themeColor"
  419. :task-model="TaskModel"
  420. :judgeAnswer="itemJ"
  421. />
  422. </template>
  423. <template v-if="itemss.type == 'input_record_chs'">
  424. <InputHasRecord
  425. v-if="refresh"
  426. :cur-que="itemss.data"
  427. :theme-color="themeColor"
  428. :task-model="TaskModel"
  429. :judgeAnswer="itemJ"
  430. />
  431. </template>
  432. <template v-if="itemss.type == 'recordHZ_inputPY_chs'">
  433. <TextInputRecord
  434. v-if="refresh"
  435. :cur-que="itemss.data"
  436. :theme-color="themeColor"
  437. :task-model="TaskModel"
  438. :judgeAnswer="itemJ"
  439. />
  440. </template>
  441. <template
  442. v-if="
  443. itemss.type == 'inputItem_chs' ||
  444. itemss.type == 'sentence_input_chs' ||
  445. itemss.type == 'sentence_judge_chs' ||
  446. itemss.type == 'sentence_record_chs' ||
  447. itemss.type == 'sentence_input_record_chs'
  448. "
  449. >
  450. <SentenceInput
  451. v-if="refresh"
  452. :cur-que="itemss.data"
  453. :theme-color="themeColor"
  454. :task-model="TaskModel"
  455. :judgeAnswer="itemJ"
  456. />
  457. </template>
  458. <template v-if="itemss.type == 'NumberCombination_chs'">
  459. <NumberSelectHasRecord
  460. v-if="refresh"
  461. :cur-que="itemss.data"
  462. :theme-color="themeColor"
  463. :task-model="TaskModel"
  464. :judgeAnswer="itemJ"
  465. />
  466. </template>
  467. <template
  468. v-if="
  469. itemss.type === 'voice_matrix' &&
  470. itemJ != 'standardAnswer'
  471. "
  472. >
  473. <voice-matrix
  474. v-if="refresh"
  475. :cur-que="itemss.data"
  476. :theme-color="themeColor"
  477. :task-model="TaskModel"
  478. :judgeAnswer="itemJ"
  479. />
  480. </template>
  481. <template v-if="itemss.type === 'select_drag'">
  482. <select-drag
  483. v-if="refresh"
  484. :cur-que="itemss.data"
  485. :theme-color="themeColor"
  486. :task-model="TaskModel"
  487. :judgeAnswer="itemJ"
  488. />
  489. </template>
  490. <template v-if="itemss.type === 'fill_drag'">
  491. <fill-drag
  492. v-if="refresh"
  493. :cur-que="itemss.data"
  494. :theme-color="themeColor"
  495. :task-model="TaskModel"
  496. :judgeAnswer="itemJ"
  497. />
  498. </template>
  499. <template v-if="itemss.type === 'config_table'">
  500. <configurable-table
  501. v-if="refresh"
  502. :cur-que="itemss.data"
  503. :theme-color="themeColor"
  504. :task-model="TaskModel"
  505. :judgeAnswer="itemJ"
  506. />
  507. </template>
  508. <template v-if="itemss.type === 'header_separate'">
  509. <header-separate
  510. v-if="refresh"
  511. :cur-que="itemss.data"
  512. :theme-color="themeColor"
  513. :task-model="TaskModel"
  514. :judgeAnswer="itemJ"
  515. />
  516. </template>
  517. <template v-if="itemss.type == 'toneSelect_chs'">
  518. <SelectTone
  519. v-if="refresh"
  520. :cur-que="itemss.data"
  521. :theme-color="themeColor"
  522. :task-model="TaskModel"
  523. :judgeAnswer="itemJ"
  524. />
  525. </template>
  526. <template v-if="itemss.type == 'sudoku_chs'">
  527. <Soduko
  528. v-if="refresh"
  529. :cur-que="itemss.data"
  530. :theme-color="themeColor"
  531. :task-model="TaskModel"
  532. :judgeAnswer="itemJ"
  533. />
  534. </template>
  535. <template v-if="itemss.type == 'single_chs'">
  536. <Single
  537. v-if="refresh"
  538. :cur-que="itemss.data"
  539. :theme-color="themeColor"
  540. :task-model="TaskModel"
  541. :judgeAnswer="itemJ"
  542. />
  543. </template>
  544. <template v-if="itemss.type == 'text_problem_chs'">
  545. <TextProblem
  546. v-if="refresh"
  547. :cur-que="itemss.data"
  548. :theme-color="themeColor"
  549. :task-model="TaskModel"
  550. :judgeAnswer="itemJ"
  551. />
  552. </template>
  553. <template
  554. v-if="
  555. itemss.type == 'newWord_preview_chs' &&
  556. itemJ != 'standardAnswer'
  557. "
  558. >
  559. <NewWordShow
  560. v-if="refresh"
  561. :cur-que="itemss.data"
  562. :theme-color="themeColor"
  563. :index-str="index + '_' + indexs + '_' + indexss"
  564. :task-model="TaskModel"
  565. :judgeAnswer="itemJ"
  566. />
  567. </template>
  568. <template
  569. v-if="itemss.type == 'listen_record_single_syllable_chs'"
  570. >
  571. <SelectYinjie
  572. v-if="refresh"
  573. :cur-que="itemss.data"
  574. :theme-color="themeColor"
  575. :task-model="TaskModel"
  576. :judgeAnswer="itemJ"
  577. />
  578. </template>
  579. <template v-if="itemss.type == 'sentence_listen_read_chs'">
  580. <SentenceListenRead
  581. v-if="refresh"
  582. :cur-que="itemss.data"
  583. :theme-color="themeColor"
  584. :task-model="TaskModel"
  585. :judgeAnswer="itemJ"
  586. />
  587. </template>
  588. <template v-if="itemss.type == 'sort_chs'">
  589. <SentenceSortQP
  590. v-if="refresh"
  591. :cur-que="itemss.data"
  592. :theme-color="themeColor"
  593. :task-model="TaskModel"
  594. :judgeAnswer="itemJ"
  595. />
  596. </template>
  597. <template
  598. v-if="itemss.type == 'checkbox_self_assessment_chs'"
  599. >
  600. <Checkbox
  601. v-if="refresh"
  602. :cur-que="itemss.data"
  603. :theme-color="themeColor"
  604. :task-model="TaskModel"
  605. :judgeAnswer="itemJ"
  606. />
  607. </template>
  608. <template
  609. v-if="
  610. (itemss.type == 'record_control_mini' ||
  611. itemss.type == 'record_control_normal' ||
  612. itemss.type == 'record_control_pro' ||
  613. itemss.type == 'record_control_promax') &&
  614. itemJ != 'standardAnswer'
  615. "
  616. >
  617. <RecordModule
  618. v-if="refresh"
  619. :cur-que="itemss.data"
  620. :theme-color="themeColor"
  621. :task-model="TaskModel"
  622. :judgeAnswer="itemJ"
  623. />
  624. </template>
  625. <template
  626. v-if="
  627. (itemss.type == 'upload_control_chs' ||
  628. itemss.type == 'upload_control_preview_chs') &&
  629. itemJ != 'standardAnswer'
  630. "
  631. >
  632. <UploadControlView
  633. v-if="refresh"
  634. :cur-que="itemss.data"
  635. :type="itemss.type"
  636. :theme-color="themeColor"
  637. :task-model="TaskModel"
  638. :judgeAnswer="itemJ"
  639. />
  640. </template>
  641. <template
  642. v-if="
  643. itemss.type == 'CourseStart_chs' &&
  644. itemJ != 'standardAnswer'
  645. "
  646. >
  647. <CourseStart
  648. v-if="refresh"
  649. :cur-que="itemss.data"
  650. :handle-n-n-p-enext="handleNNPEnext"
  651. :theme-color="themeColor"
  652. :task-model="TaskModel"
  653. :judgeAnswer="itemJ"
  654. />
  655. </template>
  656. <template
  657. v-if="
  658. itemss.type == 'tinydemo_chs' &&
  659. itemJ != 'standardAnswer'
  660. "
  661. >
  662. <Tinydemo
  663. v-if="refresh"
  664. :cur-que="itemss.data"
  665. :theme-color="themeColor"
  666. :task-model="TaskModel"
  667. :judgeAnswer="itemJ"
  668. />
  669. </template>
  670. <template
  671. v-if="
  672. itemss.type == 'video_chs' && itemJ != 'standardAnswer'
  673. "
  674. >
  675. <VideoControl
  676. v-if="refresh"
  677. :cur-que="itemss.data"
  678. :type="itemss.type"
  679. :theme-color="themeColor"
  680. :index-str="
  681. index +
  682. '_' +
  683. indexs +
  684. '_' +
  685. indexss +
  686. '_' +
  687. currentTreeID
  688. "
  689. :task-model="TaskModel"
  690. :judgeAnswer="itemJ"
  691. />
  692. </template>
  693. <template v-if="itemss.type == 'table_chs'">
  694. <TableView
  695. v-if="refresh"
  696. :cur-que="itemss.data"
  697. :type="itemss.type"
  698. :theme-color="themeColor"
  699. :task-model="TaskModel"
  700. :judgeAnswer="itemJ"
  701. />
  702. </template>
  703. <template v-if="itemss.type == 'play_record_chs'">
  704. <PlayRecordView
  705. v-if="refresh"
  706. :cur-que="itemss.data"
  707. :type="itemss.type"
  708. :theme-color="themeColor"
  709. :task-model="TaskModel"
  710. :judgeAnswer="itemJ"
  711. />
  712. </template>
  713. <template
  714. v-if="
  715. itemss.type == 'upload_pdf_chs' &&
  716. itemJ != 'standardAnswer'
  717. "
  718. >
  719. <PdfView
  720. v-if="refresh"
  721. :cur-que="itemss.data"
  722. :type="itemss.type"
  723. :theme-color="themeColor"
  724. :task-model="TaskModel"
  725. :judgeAnswer="itemJ"
  726. />
  727. </template>
  728. <template v-if="itemss.type == 'sentence_segtemp_chs'">
  729. <SentenceModule
  730. v-if="refresh"
  731. :cur-que="itemss.data"
  732. :type="itemss.type"
  733. :theme-color="themeColor"
  734. :task-model="TaskModel"
  735. :judgeAnswer="itemJ"
  736. />
  737. </template>
  738. <template
  739. v-if="
  740. itemss.type == 'options_list_chs' &&
  741. itemJ != 'standardAnswer'
  742. "
  743. >
  744. <OptionsList
  745. v-if="refresh"
  746. :cur-que="itemss.data"
  747. :theme-color="themeColor"
  748. :index-str="index + '_' + indexs + '_' + indexss"
  749. :task-model="TaskModel"
  750. :judgeAnswer="itemJ"
  751. />
  752. </template>
  753. <template v-if="itemss.type == 'sentence_single_chs'">
  754. <SentenceMulModule
  755. v-if="refresh"
  756. :cur-que="itemss.data"
  757. :type="itemss.type"
  758. :theme-color="themeColor"
  759. :task-model="TaskModel"
  760. :judgeAnswer="itemJ"
  761. />
  762. </template>
  763. </template>
  764. </div>
  765. </div>
  766. <div
  767. style="text-align: right; padding: 10px 0px 40px 0"
  768. v-if="isAnswerItemShow && item.showSubmit"
  769. >
  770. <a class="submitLookAnswer" @click="submitLookAnswer(index)"
  771. >Submit</a
  772. >
  773. </div>
  774. </div>
  775. </template>
  776. </div>
  777. </div>
  778. </div>
  779. <div v-if="isShowSave || isShowTitle" class="NNPE-title NNPE-title-gray">
  780. <!-- 页眉 v-if="isShowSave"-->
  781. <a class="submitAnswer" v-if="isShowSave" @click="submitUserAnswerNPC">提交</a>
  782. <div v-if="isShowTitle" class="NNPE-operate">
  783. <a
  784. class="btn-prev"
  785. :class="[preClick ? '' : 'btn-prev-disabled']"
  786. @click="handleNNPEprev"
  787. />
  788. <a
  789. class="btn-next"
  790. :class="[nextClick ? '' : 'btn-next-disabled']"
  791. @click="handleNNPEnext"
  792. />
  793. </div>
  794. </div>
  795. <el-dialog
  796. title=""
  797. :close-on-click-modal="false"
  798. :modal-append-to-body="false"
  799. :show-close="false"
  800. append-to-body
  801. :visible.sync="visiblePreviewDialog"
  802. width="890px"
  803. height="80%"
  804. class="previewDialog"
  805. >
  806. <div class="previewDialog-title">
  807. <h2>Reference answer</h2>
  808. <a @click="visiblePreviewDialog = false"
  809. ><img src="../../assets/NPC/icon-close.png"
  810. /></a>
  811. </div>
  812. <PreviewDialogueNPC
  813. class="previewDialog-content"
  814. :context="contextData"
  815. :que-index="queIndex"
  816. :father-name="fatherName"
  817. :currentTreeID="currentTreeID"
  818. :FatherTreeData="FatherTreeData"
  819. :change-id="changeId"
  820. :themeColor="themeColor"
  821. :TaskModel="'ANSWER'"
  822. v-if="visiblePreviewDialog"
  823. />
  824. </el-dialog>
  825. </div>
  826. </template>
  827. <script>
  828. import Picture from "./preview/Picture.vue"; // 图片模板
  829. import Record from "./preview/Record.vue"; // 音频播放
  830. import Soundrecord from "./preview/Soundrecord.vue"; // 录音模板
  831. import ArticleTemChs from "./preview/ArticleViewChs/index.vue"; // 文章模板
  832. import DialogueArticleViewChs from "./preview/DialogueArticleViewChs/index.vue"; // 文章模板
  833. import SentenceSegWordViewChs from "./preview/SentenceSegWordViewChs.vue"; // 句子分词
  834. import WordPhrase from "./preview/WordPhrase.vue"; // 生词短语
  835. import Notes from "./preview/Notes.vue"; // 注释
  836. import Ligature from "./preview/Ligature.vue";
  837. import InputHasRecord from "./preview/InputHasRecord.vue"; // 输入加录音
  838. import TextInputRecord from "./preview/TextInputRecord.vue"; // 文本+输入+录音
  839. import SentenceInput from "./preview/SentenceInput.vue"; // 输入选项
  840. import NumberSelectHasRecord from "./preview/NumberSelectHasRecord.vue"; // 数字组合
  841. import SelectTone from "./preview/SelectTone.vue"; // 选择声调
  842. import Soduko from "./preview/Soduko.vue"; // 数独
  843. import Single from "./preview/Single.vue"; // 单选
  844. import TextProblem from "./preview/TextProblem.vue"; // 课文上方的问题
  845. import NewWordShow from "./preview/NewWordShow.vue"; // 生字展示
  846. import SelectYinjie from "./preview/SelectYinjie.vue"; // 选择音节
  847. import SentenceListenRead from "./preview/SentenceListenRead.vue"; // 听并朗读
  848. import SentenceSortQP from "./preview/SentenceSortQP.vue"; // 句子拖拽排序
  849. import Checkbox from "./preview/CheckBoxModule.vue"; // 问卷调查-多选题
  850. import VoiceMatrix from "./preview/VoiceMatrix.vue"; // 语音矩阵
  851. import SelectDrag from "./preview/SelectDrag.vue"; // 选择 -> 拖拽
  852. import FillDrag from "./preview/FillDrag.vue"; // 填空 -> 拖拽
  853. import ConfigurableTable from "./preview/ConfigurableTable.vue"; // 可配置表格
  854. import HeaderSeparate from "./preview/HeaderSparate/index.vue"; // 表头分离表格
  855. import RecordModule from "./preview/RecordModule.vue"; // 录音组件
  856. import UploadControlView from "./preview/UploadControlView.vue"; // 预览控件
  857. import DialogueAnswerViewChs from "./preview/DialogueArticleViewChs/DialogueAnswerViewChs.vue"; // 文章模板
  858. import CourseStart from "./preview/CourseStart.vue"; // 封面
  859. import Tinydemo from "./preview/TinyModule.vue"; // 富文本
  860. import VideoControl from "./preview/VideoControl.vue"; // 视频控件
  861. import TableView from "./preview/TableView.vue"; // 视频控件
  862. import PdfView from "./preview/PdfView.vue"; // 视频控件
  863. import SentenceModule from "./preview/SentenceModule.vue"; // 图片模板
  864. import PlayRecordView from "./preview/PlayRecordView.vue";
  865. import OptionsList from "./preview/OptionsList.vue"; // 选项模板
  866. import SentenceMulModule from "./preview/SentenceMulModule.vue" // 多题干模板
  867. import PreviewDialogueNPC from "./preview/PreviewDialogueNPC.vue"; // 选项模板
  868. import { getToken } from "../../utils/auth";
  869. export default {
  870. name: "Booknpc",
  871. components: {
  872. Picture,
  873. Record,
  874. Soundrecord,
  875. ArticleTemChs,
  876. DialogueArticleViewChs,
  877. SentenceSegWordViewChs,
  878. WordPhrase,
  879. Notes,
  880. Ligature,
  881. InputHasRecord,
  882. TextInputRecord,
  883. SentenceInput,
  884. NumberSelectHasRecord,
  885. SelectTone,
  886. Soduko,
  887. Single,
  888. TextProblem,
  889. NewWordShow,
  890. SelectYinjie,
  891. SentenceListenRead,
  892. SentenceSortQP,
  893. Checkbox,
  894. VoiceMatrix,
  895. FillDrag,
  896. SelectDrag,
  897. ConfigurableTable,
  898. HeaderSeparate,
  899. RecordModule,
  900. UploadControlView,
  901. DialogueAnswerViewChs,
  902. CourseStart,
  903. Tinydemo,
  904. VideoControl,
  905. TableView,
  906. PdfView,
  907. PlayRecordView,
  908. SentenceModule,
  909. OptionsList,
  910. PreviewDialogueNPC,
  911. SentenceMulModule
  912. },
  913. props: [
  914. "context",
  915. "fatherName",
  916. "currentTreeID",
  917. "FatherTreeData",
  918. "changeId",
  919. "themeColor",
  920. "isShowTitle",
  921. "bookAnswerContent",
  922. "TaskModel",
  923. "isShowSave",
  924. "previewType",
  925. "previewGroupId",
  926. "isAnswerItemShow",
  927. ],
  928. data() {
  929. return {
  930. contextData: null,
  931. answerData: [], // 获取的答案数据
  932. queIndex: -1, // 题目的索引
  933. cur: null, // 当前的题目
  934. watchIndex: -1, // 监听的值
  935. queList: [],
  936. queTotal: 0, // 题目总数
  937. NNPENewWordList: [], // 存放文章的生词
  938. NNPENewPhraseList: [], // 存放文章的短语
  939. NNPEAnnotationList: [], // 存放文章注释
  940. height: "", // 总体的高度
  941. colorBox: [
  942. {
  943. touxiang: "#72B51D",
  944. bg: "#E9F0DF",
  945. },
  946. {
  947. touxiang: "#DE4444",
  948. bg: "rgba(222, 68, 68, 0.1)",
  949. },
  950. {
  951. touxiang: "#A7A7A7",
  952. bg: "#ffffff",
  953. },
  954. {
  955. touxiang: "#4D91F6",
  956. bg: "#F1F7FF",
  957. },
  958. {
  959. touxiang: "#FF8A00",
  960. bg: "rgba(255, 138, 0, 0.1)",
  961. },
  962. ],
  963. chsFhList: [",", "。", "“", ":", "》", "《", "?", "!", ";"],
  964. noFont: ["~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")"], // 对应不要拼音字体
  965. idArr: [], // 当前的pid
  966. oldCurrentTreeID: "",
  967. refresh: true,
  968. preClick: false, // 上一页是否可点
  969. nextClick: false, // 下一页是否可点
  970. answerTime: 0,
  971. answerTimeInterval: null, // 计时器
  972. groupIndexList: [], // 勾选groupid数组
  973. groupCheckList: [], // checkbox 是否选中
  974. judgeAnswersList: [],
  975. visiblePreviewDialog: false,
  976. };
  977. },
  978. computed: {},
  979. watch: {
  980. context: {
  981. handler(val, oldVal) {
  982. const _this = this;
  983. _this.refresh = false;
  984. if (val) {
  985. _this.initContextData();
  986. if (_this.FatherTreeData) {
  987. _this.idArr = [];
  988. _this.FatherTreeData.forEach((item, itemIndex) => {
  989. this.seekCurrentTree(item);
  990. });
  991. }
  992. _this.handleTitleData();
  993. if (_this.queIndex == _this.queTotal - 1) {
  994. this.idArr.forEach((item, i) => {
  995. if (item == _this.currentTreeID) {
  996. if (i == 0) {
  997. _this.preClick = false;
  998. _this.nextClick = true;
  999. } else if (i == this.idArr.length - 1) {
  1000. _this.nextClick = false;
  1001. _this.preClick = true;
  1002. } else {
  1003. _this.nextClick = true;
  1004. _this.preClick = true;
  1005. }
  1006. }
  1007. });
  1008. }
  1009. _this.$nextTick(() => {
  1010. // 重新渲染组件
  1011. _this.refresh = true;
  1012. });
  1013. }
  1014. },
  1015. // 深度观察监听
  1016. deep: true,
  1017. },
  1018. },
  1019. // 生命周期 - 创建完成(可以访问当前this实例)
  1020. created() {
  1021. console.log("2023-03-03");
  1022. },
  1023. // 生命周期 - 挂载完成(可以访问DOM元素)
  1024. mounted() {
  1025. const _this = this;
  1026. if (_this.context) {
  1027. _this.initContextData();
  1028. _this.handleTitleData();
  1029. }
  1030. if (_this.FatherTreeData) {
  1031. _this.idArr = [];
  1032. _this.FatherTreeData.forEach((item, itemIndex) => {
  1033. this.seekCurrentTree(item);
  1034. });
  1035. if (_this.queIndex == _this.queTotal - 1) {
  1036. this.idArr.forEach((item, i) => {
  1037. if (item == _this.currentTreeID) {
  1038. if (i == 0) {
  1039. _this.preClick = false;
  1040. _this.nextClick = true;
  1041. } else if (i == this.idArr.length - 1) {
  1042. _this.nextClick = false;
  1043. _this.preClick = true;
  1044. } else {
  1045. _this.nextClick = true;
  1046. _this.preClick = true;
  1047. }
  1048. }
  1049. });
  1050. }
  1051. }
  1052. },
  1053. beforeCreate() {}, // 生命周期 - 创建之前
  1054. beforeMount() {}, // 生命周期 - 挂载之前
  1055. beforeUpdate() {}, // 生命周期 - 更新之前
  1056. updated() {}, // 生命周期 - 更新之后
  1057. beforeDestroy() {}, // 生命周期 - 销毁之前
  1058. destroyed() {}, // 生命周期 - 销毁完成
  1059. activated() {},
  1060. // 方法集合
  1061. methods: {
  1062. // 处理数据
  1063. handleTitleData() {
  1064. let _this = this;
  1065. let curQue = JSON.parse(JSON.stringify(this.cur));
  1066. curQue.detailList.forEach((dItem, dIndex) => {
  1067. let paraArr = [];
  1068. if (dItem.detail) {
  1069. dItem.detail.wordsList.forEach((sItem, sIndex) => {
  1070. let obj = {
  1071. pinyin: sItem.pinyin,
  1072. chs: sItem.chs,
  1073. isShow: true,
  1074. };
  1075. paraArr.push(obj);
  1076. });
  1077. this.$set(_this.cur.detailList[dIndex].detail, "resArr", paraArr);
  1078. }
  1079. });
  1080. },
  1081. initContextData() {
  1082. const _this = this;
  1083. // _this.$root.isRecording = false;
  1084. _this.contextData = JSON.parse(JSON.stringify(_this.context));
  1085. _this.queIndex = 0;
  1086. _this.NNPENewWordList = [];
  1087. _this.NNPENewPhraseList = [];
  1088. _this.NNPEAnnotationList = [];
  1089. _this.watchIndex = _this.queIndex + new Date().getTime();
  1090. this.groupCheckList = [];
  1091. let selectGropuIdList = this.previewGroupId
  1092. ? JSON.parse(this.previewGroupId)
  1093. : [];
  1094. this.groupCheckList = [];
  1095. if (_this.contextData) {
  1096. // const list = _this.contextData;
  1097. // if (list && list.length > 0) {
  1098. // _this.queList = list;
  1099. // _this.cur = list[_this.queIndex];
  1100. _this.queTotal = 1;
  1101. // _this.cur.cur_fn_data.forEach((item) => {
  1102. // item.table_list.forEach((items) => {
  1103. // items.forEach((itemss) => {
  1104. // if (itemss.data && itemss.data.type == "NewWord_chs") {
  1105. // _this.NNPENewWordList = _this.NNPENewWordList.concat(
  1106. // itemss.data.option
  1107. // );
  1108. // } else if (itemss.data && itemss.data.type == "notes_chs") {
  1109. // _this.NNPEAnnotationList = _this.NNPEAnnotationList.concat(
  1110. // itemss.data.option
  1111. // );
  1112. // }
  1113. // });
  1114. // });
  1115. // });
  1116. // }
  1117. _this.cur = _this.contextData;
  1118. _this.cur.cur_fn_data.forEach((item, index) => {
  1119. this.groupCheckList.push(false);
  1120. selectGropuIdList.forEach((itemId) => {
  1121. itemId.forEach((itemIds) => {
  1122. if (item.group_id && itemIds.indexOf(item.group_id[0]) > -1) {
  1123. item.previewShow = true;
  1124. }
  1125. });
  1126. });
  1127. item.showSubmit = false;
  1128. item.table_list.forEach((items, indexs) => {
  1129. items.forEach((itemss, indexss) => {
  1130. if (itemss.data && itemss.type) {
  1131. if (
  1132. this.previewType &&
  1133. this.previewType == "previewCheckShow" &&
  1134. (JSON.parse(this.previewGroupId).length == 0 ||
  1135. this.previewGroupId.indexOf(item.group_id[0]) > -1)||
  1136. !this.previewType
  1137. ) {
  1138. if(itemss.type!='article_nnpe'&&itemss.type!='dialogue_article_chs'&&itemss.type!='notes_chs'&&itemss.type!='NewWord_chs'&&itemss.type!='voice_matrix'&&itemss.type!='upload_control_chs'&&itemss.type!='upload_control_preview_chs'&&itemss.type!='record_control_mini'&&itemss.type!='record_control_normal'&&itemss.type!='record_control_pro'&&itemss.type!='record_control_promax'&&itemss.type!='text_problem_chs'&&itemss.type!='newWord_preview_chs'&&itemss.type!='CourseStart_chs'&&itemss.type!='tinydemo_chs'&&itemss.type!='video_chs'&&itemss.type!='play_record_chs'&&itemss.type!='upload_pdf_chs'&&itemss.type!='options_list_chs'&&itemss.type!='sentence_listen_read_chs'&&itemss.type!='imgage_image'){
  1139. item.showSubmit = true
  1140. }
  1141. }
  1142. // else if (
  1143. // !this.previewType ||
  1144. // this.previewType != "previewCheckShow"
  1145. // ) {
  1146. // item.showSubmit = true;
  1147. // }
  1148. }
  1149. if (itemss.data && itemss.data.type == "NewWord_chs") {
  1150. _this.NNPENewWordList = _this.NNPENewWordList.concat(
  1151. itemss.data.option
  1152. );
  1153. } else if (itemss.data && itemss.data.type == "notes_chs") {
  1154. _this.NNPEAnnotationList = _this.NNPEAnnotationList.concat(
  1155. itemss.data.option
  1156. );
  1157. }
  1158. let Bookanswer = this.bookAnswerContent;
  1159. if (Bookanswer) {
  1160. if (this.TaskModel == "ANSWER") {
  1161. let token = getToken();
  1162. let roleAnswer = "studentAnswer";
  1163. if (token) {
  1164. let userInfor = JSON.parse(token);
  1165. let user_type = userInfor.user_type;
  1166. if (user_type == "TEACHER") {
  1167. roleAnswer = "studentAnswer";
  1168. } else {
  1169. roleAnswer = "userAnswer";
  1170. }
  1171. }
  1172. _this.judgeAnswersList = [roleAnswer, "standardAnswer"];
  1173. } else {
  1174. _this.judgeAnswersList = [""];
  1175. }
  1176. let answerData = JSON.parse(Bookanswer);
  1177. if (answerData && itemss.data) {
  1178. let BookanswerRes =
  1179. answerData.length > 0 &&
  1180. answerData[index].table_list &&
  1181. answerData[index].table_list.length > 0 &&
  1182. answerData[index].table_list[indexs].length > 0 &&
  1183. answerData[index].table_list[indexs][indexss].data
  1184. ? answerData[index].table_list[indexs][indexss].data
  1185. .Bookanswer
  1186. : [];
  1187. _this.$set(itemss.data, "Bookanswer", BookanswerRes);
  1188. }
  1189. } else {
  1190. _this.judgeAnswersList = [""];
  1191. }
  1192. });
  1193. });
  1194. item.ShowstandardAnswer = JSON.stringify(item.table_list).match(
  1195. /\[JUDGE##F##JUDGE\]/g
  1196. )
  1197. ? true
  1198. : false;
  1199. });
  1200. }
  1201. this.$forceUpdate();
  1202. },
  1203. // 上一页
  1204. handleNNPEprev() {
  1205. let _this = this;
  1206. _this.puaseAudio();
  1207. if (_this.queIndex == 0) {
  1208. this.idArr.forEach((item, i) => {
  1209. if (item == _this.currentTreeID) {
  1210. if (i == 0) {
  1211. _this.preClick = false;
  1212. _this.nextClick = true;
  1213. } else {
  1214. _this.changeId(this.idArr[i - 1]);
  1215. _this.preClick = true;
  1216. _this.nextClick = true;
  1217. }
  1218. }
  1219. });
  1220. } else {
  1221. _this.queIndex -= 1;
  1222. _this.watchIndex = _this.queIndex + new Date().getTime();
  1223. _this.cur = _this.queList[_this.queIndex];
  1224. }
  1225. },
  1226. // 递归寻找相同的目录并保存目录的pid
  1227. seekCurrentTree(item) {
  1228. if (item.is_courseware == "true") {
  1229. this.idArr.push(item.id);
  1230. }
  1231. if (item.children) {
  1232. item.children.forEach((it, index) => {
  1233. if (it.is_courseware == "true") {
  1234. this.idArr.push(it.id);
  1235. }
  1236. if (it.children) {
  1237. this.seekCurrentTree(it);
  1238. }
  1239. });
  1240. }
  1241. },
  1242. puaseAudio() {
  1243. let audio = document.getElementsByTagName("audio");
  1244. if(audio&&audio.length>0&&window.location.href.indexOf('GCLS-Learn')==-1){
  1245. audio.forEach((item) => {
  1246. item.pause();
  1247. });
  1248. }
  1249. let video = document.getElementsByTagName("video");
  1250. if(video&&video.length>0&&window.location.href.indexOf('GCLS-Learn')==-1){
  1251. video.forEach((item) => {
  1252. item.pause();
  1253. });
  1254. }
  1255. },
  1256. // 下一页
  1257. handleNNPEnext() {
  1258. const _this = this;
  1259. _this.puaseAudio();
  1260. if (_this.queIndex == _this.queTotal - 1) {
  1261. this.idArr.forEach((item, i) => {
  1262. if (item == _this.currentTreeID) {
  1263. if (i == this.idArr.length - 1) {
  1264. _this.nextClick = false;
  1265. _this.preClick = true;
  1266. } else {
  1267. _this.changeId(this.idArr[i + 1]);
  1268. _this.nextClick = true;
  1269. _this.preClick = true;
  1270. }
  1271. }
  1272. });
  1273. } else {
  1274. _this.queIndex += 1;
  1275. _this.watchIndex = _this.queIndex + new Date().getTime();
  1276. _this.cur = _this.queList[_this.queIndex];
  1277. }
  1278. },
  1279. submitUserAnswerNPC() {
  1280. this.handleAnswerTimeEnd();
  1281. let contextDataStr = JSON.stringify(this.contextData);
  1282. if (!contextDataStr) {
  1283. return;
  1284. }
  1285. let userErrorNumberTotal = 0;
  1286. let userRightNumberTotal = 0;
  1287. let errReg = /\[JUDGE##F##JUDGE\]/g,
  1288. rightReg = /\[JUDGE##T##JUDGE\]/g;
  1289. if (errReg.test(contextDataStr)) {
  1290. let errorArr = contextDataStr.match(/\[JUDGE##F##JUDGE\]/g);
  1291. userErrorNumberTotal = errorArr.length;
  1292. }
  1293. if (rightReg.test(contextDataStr)) {
  1294. let rightArr = contextDataStr.match(/\[JUDGE##T##JUDGE\]/g);
  1295. userRightNumberTotal = rightArr.length;
  1296. }
  1297. let contextData = JSON.parse(contextDataStr);
  1298. let result = [];
  1299. contextData.cur_fn_data.forEach((item, index) => {
  1300. result[index] = {
  1301. table_list: [],
  1302. };
  1303. item.table_list.forEach((items, indexs) => {
  1304. result[index].table_list[indexs] = [];
  1305. items.forEach((itemss, indexss) => {
  1306. if (itemss.data) {
  1307. let Bookanswer = itemss.data.Bookanswer;
  1308. let obj = {
  1309. data: {
  1310. Bookanswer,
  1311. },
  1312. };
  1313. result[index].table_list[indexs][indexss] = obj;
  1314. } else {
  1315. result[index].table_list[indexs][indexss] = {
  1316. data: null,
  1317. };
  1318. }
  1319. });
  1320. });
  1321. });
  1322. this.$emit(
  1323. "finishTaskMaterial",
  1324. JSON.stringify(result),
  1325. this.answerTime,
  1326. userRightNumberTotal,
  1327. userErrorNumberTotal
  1328. );
  1329. },
  1330. // 开始计算答题用时
  1331. handleAnswerTimeStart() {
  1332. this.answerTime = 0;
  1333. window.clearInterval(this.answerTimeInterval);
  1334. this.answerTimeInterval = window.setInterval(() => {
  1335. this.answerTime++;
  1336. }, 1000);
  1337. },
  1338. // 结束计算答题用时
  1339. handleAnswerTimeEnd() {
  1340. window.clearInterval(this.answerTimeInterval);
  1341. },
  1342. // 提交选中groupid
  1343. submitPreviewGroupId() {
  1344. return JSON.stringify(this.groupIndexList);
  1345. },
  1346. forupdata(indexI) {
  1347. if (
  1348. this.groupIndexList
  1349. .toString()
  1350. .indexOf(this.cur.cur_fn_data[indexI].group_id.toString()) == -1
  1351. ) {
  1352. this.groupIndexList.push(this.cur.cur_fn_data[indexI].group_id);
  1353. } else {
  1354. this.groupIndexList.forEach((items, indexs) => {
  1355. if (
  1356. items.toString() == this.cur.cur_fn_data[indexI].group_id.toString()
  1357. ) {
  1358. this.groupIndexList.splice(indexs, 1);
  1359. return false;
  1360. }
  1361. });
  1362. }
  1363. this.groupCheckList.forEach((item, index) => {
  1364. this.groupCheckList[index] = false;
  1365. });
  1366. this.cur.cur_fn_data.forEach((item, index) => {
  1367. if (
  1368. this.groupIndexList.toString().indexOf(item.group_id.toString()) > -1
  1369. ) {
  1370. this.groupCheckList[index] = true;
  1371. }
  1372. });
  1373. this.$forceUpdate();
  1374. },
  1375. submitLookAnswer(ItemIndex) {
  1376. let contextData = this.contextData;
  1377. contextData.cur_fn_data.forEach((item, index) => {
  1378. if (index == ItemIndex) {
  1379. item.showPreview = true;
  1380. } else {
  1381. item.showPreview = false;
  1382. }
  1383. });
  1384. this.visiblePreviewDialog = true;
  1385. // this.submitUserAnswerNPC();
  1386. },
  1387. }, // 如果页面有keep-alive缓存功能,这个函数会触发
  1388. };
  1389. </script>
  1390. <style lang="scss" scoped>
  1391. //@import url(); 引入公共css类
  1392. .NPC-Big-Book-preview {
  1393. width: 860px;
  1394. margin: 0 auto;
  1395. position: relative;
  1396. padding-bottom: 120px;
  1397. .NNPE-title {
  1398. background: #e35454;
  1399. border-radius: 0px 0px 16px 16px;
  1400. padding: 7px 24px;
  1401. position: relative;
  1402. height: 64px;
  1403. display: flex;
  1404. align-items: center;
  1405. &.NNPE-title-gray {
  1406. background: #eeeeee;
  1407. border-radius: 0;
  1408. margin-top: 24px;
  1409. .NNPE-operate {
  1410. position: absolute;
  1411. top: 10px;
  1412. right: 20px;
  1413. a {
  1414. background: #fff url("../../assets/newImage/common/btn-pre-black.png")
  1415. center no-repeat;
  1416. background-size: 24px;
  1417. &.btn-next {
  1418. background: #fff
  1419. url("../../assets/newImage/common/btn-next-black.png") center
  1420. no-repeat;
  1421. background-size: 24px;
  1422. }
  1423. &:hover {
  1424. background-color: #fff;
  1425. }
  1426. &:active {
  1427. background-color: #fff;
  1428. }
  1429. &.btn-prev-disabled,
  1430. &.btn-next-disabled {
  1431. background-color: rgba(0, 0, 0, 0.25);
  1432. }
  1433. }
  1434. }
  1435. }
  1436. h1 {
  1437. color: #ffffff;
  1438. font-weight: bold;
  1439. font-size: 16px;
  1440. line-height: 150%;
  1441. margin: 0;
  1442. }
  1443. .NNPE-title-left {
  1444. display: flex;
  1445. color: #ffffff;
  1446. font-size: 18px;
  1447. line-height: 18px;
  1448. align-items: center;
  1449. .NNPE-title-item {
  1450. margin-right: 12px;
  1451. }
  1452. .content-con {
  1453. margin: 4px 0;
  1454. font-family: "robot";
  1455. &.hasCn,
  1456. &.hanzi {
  1457. font-family: "FZJCGFKTK";
  1458. }
  1459. &.en{
  1460. font-family: "robot";
  1461. }
  1462. }
  1463. .content-en {
  1464. font-weight: normal;
  1465. line-height: 18px;
  1466. font-family: "robot";
  1467. }
  1468. .NNPE-title-item-en {
  1469. font-weight: normal;
  1470. line-height: 12px;
  1471. font-family: "robot";
  1472. font-size: 12px;
  1473. margin: 0;
  1474. }
  1475. .con-box {
  1476. display: flex;
  1477. flex-flow: wrap;
  1478. justify-content: center;
  1479. align-items: flex-end;
  1480. .con-item {
  1481. text-align: center;
  1482. padding: 0 1px;
  1483. }
  1484. span {
  1485. display: block;
  1486. }
  1487. .pinyin {
  1488. font-family: "GB-PINYINOK-B";
  1489. font-size: 12px;
  1490. line-height: 12px;
  1491. height: 12px;
  1492. &.noFont {
  1493. font-family: initial;
  1494. }
  1495. }
  1496. .synthesis-box {
  1497. display: flex;
  1498. }
  1499. }
  1500. }
  1501. .NNPE-operate {
  1502. position: absolute;
  1503. top: 10px;
  1504. right: 20px;
  1505. a {
  1506. background: #e35454 url("../../assets/newImage/common/btn-pre.png")
  1507. center no-repeat;
  1508. background-size: 24px;
  1509. border-radius: 4px;
  1510. width: 44px;
  1511. height: 44px;
  1512. display: inline-block;
  1513. margin: 0 4px;
  1514. &.btn-next {
  1515. background: #e35454 url("../../assets/newImage/common/btn-next.png")
  1516. center no-repeat;
  1517. background-size: 24px;
  1518. }
  1519. &:hover {
  1520. background-color: #f76565;
  1521. }
  1522. &:active {
  1523. background-color: #d24444;
  1524. }
  1525. &.btn-prev-disabled,
  1526. &.btn-next-disabled {
  1527. background-color: rgba(0, 0, 0, 0.25);
  1528. cursor: not-allowed;
  1529. }
  1530. }
  1531. }
  1532. }
  1533. .classTopic-box {
  1534. background: #e35454;
  1535. border-radius: 8px;
  1536. width: 780px;
  1537. margin: 24px auto 0 auto;
  1538. text-align: center;
  1539. padding: 8px 24px;
  1540. span {
  1541. font-size: 16px;
  1542. line-height: 150%;
  1543. color: #ffffff;
  1544. padding: 0 1px;
  1545. &.cn {
  1546. font-family: "FZJCGFKTK";
  1547. }
  1548. &.en {
  1549. font-family: "robot";
  1550. }
  1551. &.pinyin {
  1552. font-family: "GB-PINYINOK-B";
  1553. }
  1554. }
  1555. }
  1556. .NNPE-Book-content-inner {
  1557. padding: 0 40px;
  1558. .NNPE-Book-content-item {
  1559. position: relative;
  1560. }
  1561. .NNPE-Book-content-item-checkbox {
  1562. position: absolute;
  1563. left: -30px;
  1564. top: 36px;
  1565. }
  1566. > div.title-box-preview {
  1567. padding-top: 32px;
  1568. .title-big {
  1569. display: flex;
  1570. b {
  1571. min-width: 39px;
  1572. height: 24px;
  1573. background: #e35454;
  1574. border-radius: 8px;
  1575. color: #ffffff;
  1576. font-family: "robot";
  1577. display: inline-block;
  1578. text-align: center;
  1579. font-size: 16px;
  1580. line-height: 150%;
  1581. margin-right: 12px;
  1582. padding: 0 4px;
  1583. }
  1584. h2 {
  1585. color: #e35454;
  1586. font-size: 16px;
  1587. line-height: 150%;
  1588. font-weight: bold;
  1589. white-space: pre-wrap;
  1590. word-break: break-word;
  1591. margin: 0;
  1592. }
  1593. h3 {
  1594. color: #000000;
  1595. font-size: 16px;
  1596. line-height: 150%;
  1597. font-weight: normal;
  1598. margin: 0;
  1599. white-space: pre-wrap;
  1600. word-break: break-word;
  1601. }
  1602. .title-box-right-index {
  1603. padding-left: 51px;
  1604. }
  1605. }
  1606. .title-little {
  1607. display: flex;
  1608. margin-bottom: 24px;
  1609. &.marginTop {
  1610. margin-top: 24px;
  1611. }
  1612. b,
  1613. p {
  1614. color: #000000;
  1615. font-size: 16px;
  1616. line-height: 150%;
  1617. font-weight: normal;
  1618. margin: 0;
  1619. white-space: pre-wrap;
  1620. word-break: break-word;
  1621. padding-right: 3px;
  1622. }
  1623. }
  1624. }
  1625. .NNPE-tableList {
  1626. background: #fff;
  1627. border-radius: 8px;
  1628. // padding: 12px 8px;
  1629. &.NNPE-tableList-hasBg {
  1630. background: #f7f7f7;
  1631. border: 1px solid rgba(0, 0, 0, 0.1);
  1632. box-sizing: border-box;
  1633. border-radius: 8px;
  1634. }
  1635. .NNPE-tableList-tr {
  1636. display: flex;
  1637. justify-content: space-between;
  1638. // flex-flow: wrap;
  1639. .NNPE-tableList-item {
  1640. width: 100%;
  1641. // margin: 12px 16px;
  1642. // padding: 16px;
  1643. // background: #FFFFFF;
  1644. // border-radius: 4px;
  1645. display: flex;
  1646. flex-flow: wrap;
  1647. justify-content: center;
  1648. &.NNPE-tableList-item-noMargin {
  1649. margin: 0;
  1650. }
  1651. &.NNPE-tableList-item2 {
  1652. width: 378px;
  1653. }
  1654. &.NNPE-tableList-item3 {
  1655. width: 244px;
  1656. }
  1657. &.NNPE-tableList-item4 {
  1658. width: 195px;
  1659. }
  1660. }
  1661. }
  1662. }
  1663. }
  1664. .submitAnswer {
  1665. width: 160px;
  1666. height: 44px;
  1667. border-radius: 4px;
  1668. font-size: 16px;
  1669. line-height: 44px;
  1670. text-align: center;
  1671. font-family: robot;
  1672. background: #e35454;
  1673. color: #fff;
  1674. margin-left: 16px;
  1675. &:hover {
  1676. background-color: #f76565;
  1677. }
  1678. &:active {
  1679. background-color: #d24444;
  1680. }
  1681. }
  1682. }
  1683. .submitLookAnswer {
  1684. color: #fff;
  1685. font-weight: 700;
  1686. font-size: 16px;
  1687. line-height: 24px;
  1688. width: 106px;
  1689. height: 40px;
  1690. background: #e35454;
  1691. border-radius: 8px;
  1692. display: inline-block;
  1693. line-height: 40px;
  1694. text-align: center;
  1695. font-family: "sourceR";
  1696. }
  1697. .NPC-Big-Book-preview-green {
  1698. .submitLookAnswer {
  1699. background: #24b99e;
  1700. }
  1701. .NNPE-title {
  1702. background: #24b99e;
  1703. .NNPE-operate {
  1704. a {
  1705. background: #24b99e url("../../assets/newImage/common/btn-pre.png")
  1706. center no-repeat;
  1707. background-size: 24px;
  1708. &.btn-next {
  1709. background: #24b99e url("../../assets/newImage/common/btn-next.png")
  1710. center no-repeat;
  1711. background-size: 24px;
  1712. }
  1713. &:hover {
  1714. background-color: #3dd4b8;
  1715. }
  1716. &:active {
  1717. background-color: #1fa189;
  1718. }
  1719. }
  1720. }
  1721. }
  1722. .submitAnswer {
  1723. background: #24b99e;
  1724. &:hover {
  1725. background-color: #3dd4b8;
  1726. }
  1727. &:active {
  1728. background-color: #1fa189;
  1729. }
  1730. }
  1731. .classTopic-box {
  1732. background: #24b99e;
  1733. }
  1734. .NNPE-Book-content-inner {
  1735. > div.title-box-preview {
  1736. .title-big {
  1737. b {
  1738. background: #24b99e;
  1739. }
  1740. h2 {
  1741. color: #24b99e;
  1742. }
  1743. }
  1744. }
  1745. }
  1746. }
  1747. .NPC-Big-Book-preview-brown {
  1748. .submitLookAnswer {
  1749. background: #bd8865;
  1750. }
  1751. .NNPE-title {
  1752. background: #bd8865;
  1753. .NNPE-operate {
  1754. a {
  1755. background: #bd8865 url("../../assets/newImage/common/btn-pre.png")
  1756. center no-repeat;
  1757. background-size: 24px;
  1758. &.btn-next {
  1759. background: #bd8865 url("../../assets/newImage/common/btn-next.png")
  1760. center no-repeat;
  1761. background-size: 24px;
  1762. }
  1763. &:hover {
  1764. background-color: #d6a687;
  1765. }
  1766. &:active {
  1767. background-color: #a37557;
  1768. }
  1769. }
  1770. }
  1771. }
  1772. .submitAnswer {
  1773. background: #bd8865;
  1774. &:hover {
  1775. background-color: #d6a687;
  1776. }
  1777. &:active {
  1778. background-color: #a37557;
  1779. }
  1780. }
  1781. .classTopic-box {
  1782. background: #bd8865;
  1783. }
  1784. .NNPE-Book-content-inner {
  1785. > div.title-box-preview {
  1786. .title-big {
  1787. b {
  1788. background: #bd8865;
  1789. }
  1790. h2 {
  1791. color: #bd8865;
  1792. }
  1793. }
  1794. }
  1795. }
  1796. }
  1797. </style>
  1798. <style lang="scss">
  1799. .NNPE-Book-content-item-checkbox {
  1800. .el-checkbox__inner {
  1801. border: 2px solid #4a99ea;
  1802. width: 24px;
  1803. height: 24px;
  1804. }
  1805. .el-checkbox__inner::after {
  1806. border-width: 2px;
  1807. height: 11px;
  1808. left: 8px;
  1809. top: 2px;
  1810. }
  1811. }
  1812. .previewDialog {
  1813. .el-dialog {
  1814. border-radius: 20px;
  1815. }
  1816. .el-dialog__body,
  1817. .el-dialog__header {
  1818. padding: 0;
  1819. }
  1820. .previewDialog-title {
  1821. padding: 26px 40px;
  1822. border-bottom: 1px solid rgba(51, 51, 51, 0.1);
  1823. position: relative;
  1824. h2 {
  1825. font-weight: 700;
  1826. font-size: 20px;
  1827. line-height: 28px;
  1828. margin: 0;
  1829. font-family: "D-DIN";
  1830. white-space: pre-wrap;
  1831. word-break: break-word;
  1832. }
  1833. a {
  1834. position: absolute;
  1835. width: 32px;
  1836. height: 32px;
  1837. right: 40px;
  1838. top: 26px;
  1839. img {
  1840. width: 100%;
  1841. height: 100%;
  1842. }
  1843. }
  1844. }
  1845. .previewDialog-content {
  1846. max-height: 70vh;
  1847. overflow-y: auto;
  1848. }
  1849. }
  1850. </style>