PhraseModelChs.vue 123 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939
  1. <!-- -->
  2. <template>
  3. <div v-if="curQue" class="NNPE-ArticleView">
  4. <div
  5. v-if="
  6. ((curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url) ||
  7. config.isHasPY ||
  8. config.isHasEN) &&
  9. curQue.property.mp3_position === 'top'
  10. "
  11. class="aduioLine-box aduioLine-practice-npc"
  12. >
  13. <div class="aduioLine-content">
  14. <template v-if="curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url">
  15. <AudioLine
  16. ref="audioLine"
  17. audio-id="artPhraseAudio"
  18. :mp3="curQue.mp3_list[0].url"
  19. :get-cur-time="getCurTime"
  20. :mp3-source="curQue.mp3_list[0].source"
  21. :width="colLength == 2 ? 200 : 700"
  22. :attrib="attrib"
  23. />
  24. </template>
  25. </div>
  26. <div class="aduioLine-right">
  27. <!-- <span
  28. :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
  29. @click="changePinyin"
  30. v-if="config.isHasPY"
  31. ></span>
  32. <span :class="['EN-16', config.isShowEN ? '' : 'disabled']" @click="changeEN" v-if="config.isHasEN"></span> -->
  33. <SvgIcon
  34. v-if="config.isHasPY"
  35. icon-class="pin-btn"
  36. size="16"
  37. :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
  38. :style="{ color: config.isShowPY ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
  39. @click="changePinyin"
  40. />
  41. <SvgIcon
  42. v-if="config.isHasEN"
  43. icon-class="en-btn"
  44. size="16"
  45. :class="['EN-16', config.isShowEN ? '' : 'disabled']"
  46. :style="{ color: config.isShowEN ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
  47. @click="changeEN"
  48. />
  49. </div>
  50. </div>
  51. <div
  52. :style="{
  53. height: curQue.property.content_height ? curQue.property.content_height + 'px' : '',
  54. overflow: 'auto',
  55. }"
  56. >
  57. <template v-if="!config.isHasEN || (config.isHasEN && !config.isShowEN)">
  58. <template v-if="resArr.length > 0">
  59. <div class="NPC-sentences-list">
  60. <div class="NPC-article-empty">
  61. <div
  62. :class="['empty-left', isHasRemark ? 'hasRemark' : '']"
  63. :style="{ width: curQue.property.remarkWidth ? 100 - curQue.property.remarkWidth * 1 + '%' : '' }"
  64. ></div>
  65. <div class="empty-right"></div>
  66. </div>
  67. <div
  68. v-for="(item, index) in resArr"
  69. :key="'detail' + index"
  70. :class="['NNPE-detail', item.isTitle ? 'NNPE-detail-title' : '']"
  71. >
  72. <div
  73. class="wordsList-box"
  74. :class="[
  75. curQue.detail[index].paragraphAttr
  76. ? 'wordsList-box-' + curQue.detail[index].paragraphAttr.paragraphAlign
  77. : '',
  78. 'article-content',
  79. isHasRemark ? 'hasRemark' : '',
  80. ]"
  81. :style="{
  82. width: isHasRemark && curQue.property.remarkWidth ? 100 - curQue.property.remarkWidth * 1 + '%' : '',
  83. }"
  84. >
  85. <template v-if="item.sourceList.length > 0 && item.sourcePosition === 'before'">
  86. <img
  87. v-if="item.sourceList[0] && item.sourceList[0].type === 'image'"
  88. :src="item.sourceList[0].file_url_open"
  89. :style="{
  90. width: item.widthNumber + 'px',
  91. height: item.heightNumber + 'px',
  92. }"
  93. />
  94. <video
  95. :src="item.sourceList[0].file_url_open"
  96. width="100%"
  97. height="400"
  98. controls
  99. controlsList="nodownload"
  100. v-else
  101. ></video>
  102. </template>
  103. <div :class="['para-' + item.paraAlign]">
  104. <div
  105. v-for="(pItem, pIndex) in item.wordsList"
  106. :key="'wordsList' + pIndex"
  107. class="NNPE-words"
  108. :class="[
  109. pItem.chs != '“' && pItem.wordIndex == 0 ? 'textLeft' : 'textCenter',
  110. pItem.chs == '“' ? 'textRight' : '',
  111. ]"
  112. @click="showWordDetail($event, pItem.chs, pItem.words)"
  113. >
  114. <template v-if="!pItem.width">
  115. <template v-if="pItem.isShow">
  116. <span
  117. v-if="
  118. item.wordsList[pIndex - 1] &&
  119. item.wordsList[pIndex - 1].chs &&
  120. firstFhlist.indexOf(item.wordsList[pIndex - 1].chs) > -1 &&
  121. item.wordsList[pIndex - 2] &&
  122. item.wordsList[pIndex - 2].chs &&
  123. firstFhlist.indexOf(item.wordsList[pIndex - 2].chs) > -1
  124. "
  125. class="NNPE-words-box"
  126. >
  127. <span
  128. v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
  129. :class="[
  130. 'NNPE-pinyin',
  131. noFont.indexOf(item.wordsList[pIndex - 2].pinyin) > -1 ? 'noFont' : '',
  132. ]"
  133. style="text-align: left"
  134. :style="{
  135. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  136. height:
  137. attrib && attrib.pinyin_size
  138. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  139. : '22px',
  140. }"
  141. @click.stop="
  142. viewNotes($event, item.wordsList[pIndex - 2].pinyin, '', item.wordsList[pIndex - 2])
  143. "
  144. >{{
  145. NumberList.indexOf(item.wordsList[pIndex - 2].pinyin) == -1
  146. ? item.wordsList[pIndex - 2].pinyin
  147. : ''
  148. }}</span
  149. >
  150. <el-tooltip
  151. popper-class="article-bubble"
  152. effect="light"
  153. placement="bottom-start"
  154. v-if="item.wordsList[pIndex - 2].matchNotesObj.con"
  155. >
  156. <div
  157. slot="content"
  158. :style="{
  159. color: attrib && attrib.text_color ? attrib.text_color : '#de4444',
  160. fontSize: attrib && attrib.font_size ? attrib.font_size : '',
  161. }"
  162. v-html="item.wordsList[pIndex - 2].matchNotesObj.con"
  163. ></div>
  164. <span
  165. class="NNPE-chs"
  166. style="text-align: left"
  167. :style="{
  168. fontFamily: item.wordsList[pIndex - 2].config.fontFamily,
  169. textDecoration: item.wordsList[pIndex - 2].config.textDecoration,
  170. borderBottom: item.wordsList[pIndex - 2].config.border === 'dotted' ? '1px dotted' : '',
  171. fontWeight: item.wordsList[pIndex - 2].config.fontWeight,
  172. color:
  173. item.wordsList[pIndex - 2].matchNotesObj.con &&
  174. item.wordsList[pIndex - 2].matchNotesObj.notesColor
  175. ? item.wordsList[pIndex - 2].matchNotesObj.notesColor
  176. : item.wordsList[pIndex - 2].config.color,
  177. height:
  178. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  179. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  180. lineHeight:
  181. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  182. width: item.wordsList[pIndex - 2].chs.trim() === '' ? '6px' : '',
  183. }"
  184. @click.stop="
  185. viewNotes(
  186. $event,
  187. item.wordsList[pIndex - 2].words
  188. ? item.wordsList[pIndex - 2].words
  189. : item.wordsList[pIndex - 2].chs,
  190. '',
  191. item.wordsList[pIndex - 2],
  192. )
  193. "
  194. >{{ convertText(item.wordsList[pIndex - 2].chs)
  195. }}<img
  196. v-if="
  197. item.wordsList[pIndex - 2].img &&
  198. item.wordsList[pIndex - 2].img.length > 0 &&
  199. item.wordsList[pIndex - 2].imgPosition === 'after'
  200. "
  201. :src="item.wordsList[pIndex - 2].img[0].file_url"
  202. :style="{
  203. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  204. }"
  205. /></span>
  206. </el-tooltip>
  207. <template v-else>
  208. <span
  209. class="NNPE-chs"
  210. style="text-align: left"
  211. :style="{
  212. fontFamily: item.wordsList[pIndex - 2].config.fontFamily,
  213. textDecoration: item.wordsList[pIndex - 2].config.textDecoration,
  214. borderBottom: item.wordsList[pIndex - 2].config.border === 'dotted' ? '1px dotted' : '',
  215. fontWeight: item.wordsList[pIndex - 2].config.fontWeight,
  216. color:
  217. item.wordsList[pIndex - 2].matchNotesObj.con &&
  218. item.wordsList[pIndex - 2].matchNotesObj.notesColor
  219. ? item.wordsList[pIndex - 2].matchNotesObj.notesColor
  220. : item.wordsList[pIndex - 2].config.color,
  221. height:
  222. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  223. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  224. lineHeight:
  225. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  226. width: item.wordsList[pIndex - 2].chs.trim() === '' ? '6px' : '',
  227. }"
  228. @click.stop="
  229. viewNotes(
  230. $event,
  231. item.wordsList[pIndex - 2].words
  232. ? item.wordsList[pIndex - 2].words
  233. : item.wordsList[pIndex - 2].chs,
  234. '',
  235. item.wordsList[pIndex - 2],
  236. )
  237. "
  238. >{{ convertText(item.wordsList[pIndex - 2].chs)
  239. }}<img
  240. v-if="
  241. item.wordsList[pIndex - 2].img &&
  242. item.wordsList[pIndex - 2].img.length > 0 &&
  243. item.wordsList[pIndex - 2].imgPosition === 'after'
  244. "
  245. :src="item.wordsList[pIndex - 2].img[0].file_url"
  246. :style="{
  247. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  248. }"
  249. /></span>
  250. </template>
  251. <span
  252. v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
  253. :class="[
  254. 'NNPE-pinyin',
  255. noFont.indexOf(item.wordsList[pIndex - 2].pinyin) > -1 ? 'noFont' : '',
  256. ]"
  257. style="text-align: left"
  258. :style="{
  259. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  260. height:
  261. attrib && attrib.pinyin_size
  262. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  263. : '22px',
  264. }"
  265. @click.stop="
  266. viewNotes($event, item.wordsList[pIndex - 2].pinyin, '', item.wordsList[pIndex - 2])
  267. "
  268. >{{
  269. NumberList.indexOf(item.wordsList[pIndex - 2].pinyin) == -1
  270. ? item.wordsList[pIndex - 2].pinyin
  271. : ''
  272. }}</span
  273. >
  274. </span>
  275. <span
  276. v-if="
  277. item.wordsList[pIndex - 1] &&
  278. item.wordsList[pIndex - 1].chs &&
  279. firstFhlist.indexOf(item.wordsList[pIndex - 1].chs) > -1
  280. "
  281. class="NNPE-words-box"
  282. >
  283. <span
  284. v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
  285. :class="[
  286. 'NNPE-pinyin',
  287. noFont.indexOf(item.wordsList[pIndex - 1].pinyin) > -1 ? 'noFont' : '',
  288. ]"
  289. style="text-align: left"
  290. :style="{
  291. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  292. height:
  293. attrib && attrib.pinyin_size
  294. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  295. : '22px',
  296. }"
  297. @click.stop="
  298. viewNotes($event, item.wordsList[pIndex - 1].pinyin, '', item.wordsList[pIndex - 2])
  299. "
  300. >{{
  301. NumberList.indexOf(item.wordsList[pIndex - 1].pinyin) == -1
  302. ? item.wordsList[pIndex - 1].pinyin
  303. : ''
  304. }}</span
  305. >
  306. <el-tooltip
  307. popper-class="article-bubble"
  308. effect="light"
  309. placement="bottom-start"
  310. v-if="item.wordsList[pIndex - 1].matchNotesObj.con"
  311. >
  312. <div
  313. slot="content"
  314. :style="{
  315. color: attrib && attrib.text_color ? attrib.text_color : '#de4444',
  316. fontSize: attrib && attrib.font_size ? attrib.font_size : '',
  317. }"
  318. v-html="item.wordsList[pIndex - 1].matchNotesObj.con"
  319. ></div>
  320. <span
  321. class="NNPE-chs"
  322. style="text-align: left"
  323. :style="{
  324. fontFamily: item.wordsList[pIndex - 1].config.fontFamily,
  325. textDecoration: item.wordsList[pIndex - 1].config.textDecoration,
  326. borderBottom: item.wordsList[pIndex - 1].config.border === 'dotted' ? '1px dotted' : '',
  327. fontWeight: item.wordsList[pIndex - 1].config.fontWeight,
  328. color:
  329. item.wordsList[pIndex - 1].matchNotesObj.con &&
  330. item.wordsList[pIndex - 1].matchNotesObj.notesColor
  331. ? item.wordsList[pIndex - 1].matchNotesObj.notesColor
  332. : item.wordsList[pIndex - 1].config.color,
  333. height:
  334. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  335. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  336. lineHeight:
  337. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  338. width: item.wordsList[pIndex - 1].chs.trim() === '' ? '6px' : '',
  339. }"
  340. @click.stop="
  341. viewNotes(
  342. $event,
  343. item.wordsList[pIndex - 1].words
  344. ? item.wordsList[pIndex - 1].words
  345. : item.wordsList[pIndex - 1].chs,
  346. '',
  347. item.wordsList[pIndex - 1],
  348. )
  349. "
  350. >{{ convertText(item.wordsList[pIndex - 1].chs)
  351. }}<img
  352. v-if="
  353. item.wordsList[pIndex - 1].img &&
  354. item.wordsList[pIndex - 1].img.length > 0 &&
  355. item.wordsList[pIndex - 1].imgPosition === 'after'
  356. "
  357. :src="item.wordsList[pIndex - 1].img[0].file_url"
  358. :style="{
  359. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  360. }"
  361. /></span>
  362. </el-tooltip>
  363. <template v-else>
  364. <span
  365. class="NNPE-chs"
  366. style="text-align: left"
  367. :style="{
  368. fontFamily: item.wordsList[pIndex - 1].config.fontFamily,
  369. textDecoration: item.wordsList[pIndex - 1].config.textDecoration,
  370. borderBottom: item.wordsList[pIndex - 1].config.border === 'dotted' ? '1px dotted' : '',
  371. fontWeight: item.wordsList[pIndex - 1].config.fontWeight,
  372. color:
  373. item.wordsList[pIndex - 1].matchNotesObj.con &&
  374. item.wordsList[pIndex - 1].matchNotesObj.notesColor
  375. ? item.wordsList[pIndex - 1].matchNotesObj.notesColor
  376. : item.wordsList[pIndex - 1].config.color,
  377. height:
  378. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  379. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  380. lineHeight:
  381. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  382. width: item.wordsList[pIndex - 1].chs.trim() === '' ? '6px' : '',
  383. }"
  384. @click.stop="
  385. viewNotes(
  386. $event,
  387. item.wordsList[pIndex - 1].words
  388. ? item.wordsList[pIndex - 1].words
  389. : item.wordsList[pIndex - 1].chs,
  390. '',
  391. item.wordsList[pIndex - 1],
  392. )
  393. "
  394. >{{ convertText(item.wordsList[pIndex - 1].chs)
  395. }}<img
  396. v-if="
  397. item.wordsList[pIndex - 1].img &&
  398. item.wordsList[pIndex - 1].img.length > 0 &&
  399. item.wordsList[pIndex - 1].imgPosition === 'after'
  400. "
  401. :src="item.wordsList[pIndex - 1].img[0].file_url"
  402. :style="{
  403. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  404. }"
  405. /></span>
  406. </template>
  407. <span
  408. v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
  409. :class="[
  410. 'NNPE-pinyin',
  411. noFont.indexOf(item.wordsList[pIndex - 1].pinyin) > -1 ? 'noFont' : '',
  412. ]"
  413. style="text-align: left"
  414. :style="{
  415. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  416. height:
  417. attrib && attrib.pinyin_size
  418. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  419. : '22px',
  420. }"
  421. @click.stop="
  422. viewNotes($event, item.wordsList[pIndex - 1].pinyin, '', item.wordsList[pIndex - 2])
  423. "
  424. >{{
  425. NumberList.indexOf(item.wordsList[pIndex - 1].pinyin) == -1
  426. ? item.wordsList[pIndex - 1].pinyin
  427. : ''
  428. }}</span
  429. >
  430. </span>
  431. <template
  432. v-if="
  433. item.wordsList[pIndex + 1] &&
  434. item.wordsList[pIndex + 1].chs &&
  435. (chsFhList.indexOf(item.wordsList[pIndex + 1].chs) > -1 ||
  436. NumberList.indexOf(item.wordsList[pIndex + 1].chs) > -1)
  437. "
  438. >
  439. <span class="NNPE-words-box">
  440. <span
  441. v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
  442. :class="[
  443. 'NNPE-pinyin',
  444. pItem.className ? pItem.className : '',
  445. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  446. ]"
  447. :style="{
  448. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  449. height:
  450. attrib && attrib.pinyin_size
  451. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  452. : '22px',
  453. }"
  454. @click.stop="viewNotes($event, pItem.pinyin, '', pItem)"
  455. >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
  456. >
  457. <el-tooltip
  458. popper-class="article-bubble"
  459. effect="light"
  460. placement="bottom-start"
  461. v-if="pItem.matchNotesObj.con"
  462. >
  463. <div
  464. slot="content"
  465. :style="{
  466. color: attrib && attrib.text_color ? attrib.text_color : '#de4444',
  467. fontSize: attrib && attrib.font_size ? attrib.font_size : '',
  468. }"
  469. v-html="pItem.matchNotesObj.con"
  470. ></div>
  471. <span
  472. :class="[
  473. 'NNPE-chs',
  474. newWordList.indexOf(pItem.chs) > -1 ? 'active' : '',
  475. pItem.words ? 'active' : '',
  476. ]"
  477. :style="{
  478. fontFamily: pItem.config.fontFamily,
  479. textDecoration: pItem.config.textDecoration,
  480. borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
  481. fontWeight: pItem.config.fontWeight,
  482. height:
  483. attrib && attrib.font_size
  484. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  485. : '28px',
  486. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  487. lineHeight:
  488. attrib && attrib.font_size
  489. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  490. : '28px',
  491. color:
  492. newWordList.indexOf(pItem.chs) > -1 || pItem.words
  493. ? attrib
  494. ? attrib.topic_color
  495. : pItem.config.color
  496. : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
  497. ? pItem.matchNotesObj.notesColor
  498. : pItem.config.color,
  499. }"
  500. ><span
  501. v-for="(wItem, wIndex) in pItem.leg"
  502. :key="'ci' + wIndex + pIndex + index"
  503. :class="[
  504. pItem.chstimeList &&
  505. pItem.chstimeList[wIndex] &&
  506. curTime >= pItem.chstimeList[wIndex].wordBg &&
  507. curTime < item.timeList[pItem.sentIndex].ed
  508. ? 'wordActive'
  509. : '',
  510. ]"
  511. :style="{
  512. color:
  513. newWordList.indexOf(pItem.chs) > -1 || pItem.words
  514. ? attrib
  515. ? attrib.topic_color
  516. : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
  517. ? pItem.matchNotesObj.notesColor
  518. : pItem.config.color
  519. : pItem.config.color,
  520. }"
  521. @click.stop="viewNotes($event, pItem.chs[wIndex], pItem.chs, pItem)"
  522. >{{ convertText(pItem.chs[wIndex]) }}</span
  523. ><img
  524. v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
  525. :src="pItem.img[0].file_url"
  526. :style="{
  527. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  528. }"
  529. /></span>
  530. </el-tooltip>
  531. <template v-else>
  532. <span
  533. :class="[
  534. 'NNPE-chs',
  535. newWordList.indexOf(pItem.chs) > -1 ? 'active' : '',
  536. pItem.words ? 'active' : '',
  537. ]"
  538. :style="{
  539. fontFamily: pItem.config.fontFamily,
  540. textDecoration: pItem.config.textDecoration,
  541. borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
  542. fontWeight: pItem.config.fontWeight,
  543. height:
  544. attrib && attrib.font_size
  545. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  546. : '28px',
  547. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  548. lineHeight:
  549. attrib && attrib.font_size
  550. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  551. : '28px',
  552. color:
  553. newWordList.indexOf(pItem.chs) > -1 || pItem.words
  554. ? attrib
  555. ? attrib.topic_color
  556. : pItem.config.color
  557. : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
  558. ? pItem.matchNotesObj.notesColor
  559. : pItem.config.color,
  560. }"
  561. ><span
  562. v-for="(wItem, wIndex) in pItem.leg"
  563. :key="'ci' + wIndex + pIndex + index"
  564. :class="[
  565. pItem.chstimeList &&
  566. pItem.chstimeList[wIndex] &&
  567. curTime >= pItem.chstimeList[wIndex].wordBg &&
  568. curTime < item.timeList[pItem.sentIndex].ed
  569. ? 'wordActive'
  570. : '',
  571. ]"
  572. :style="{
  573. color:
  574. newWordList.indexOf(pItem.chs) > -1 || pItem.words
  575. ? attrib
  576. ? attrib.topic_color
  577. : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
  578. ? pItem.matchNotesObj.notesColor
  579. : pItem.config.color
  580. : pItem.config.color,
  581. }"
  582. @click.stop="viewNotes($event, pItem.chs[wIndex], pItem.chs, pItem)"
  583. >{{ convertText(pItem.chs[wIndex]) }}</span
  584. ><img
  585. v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
  586. :src="pItem.img[0].file_url"
  587. :style="{
  588. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  589. }"
  590. /></span>
  591. </template>
  592. <span
  593. v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
  594. :class="[
  595. 'NNPE-pinyin',
  596. pItem.className ? pItem.className : '',
  597. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  598. ]"
  599. :style="{
  600. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  601. height:
  602. attrib && attrib.pinyin_size
  603. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  604. : '22px',
  605. }"
  606. @click.stop="viewNotes($event, pItem.pinyin, '', pItem)"
  607. >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
  608. >
  609. </span>
  610. <span class="NNPE-words-box">
  611. <span
  612. v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
  613. :class="[
  614. 'NNPE-pinyin',
  615. noFont.indexOf(item.wordsList[pIndex + 1].pinyin) > -1 ? 'noFont' : '',
  616. ]"
  617. style="text-align: left"
  618. :style="{
  619. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  620. height:
  621. attrib && attrib.pinyin_size
  622. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  623. : '22px',
  624. }"
  625. @click.stop="
  626. viewNotes($event, item.wordsList[pIndex + 1].pinyin, '', item.wordsList[pIndex + 1])
  627. "
  628. >{{
  629. NumberList.indexOf(item.wordsList[pIndex + 1].pinyin) == -1
  630. ? item.wordsList[pIndex + 1].pinyin
  631. : ''
  632. }}</span
  633. >
  634. <el-tooltip
  635. popper-class="article-bubble"
  636. effect="light"
  637. placement="bottom-start"
  638. v-if="item.wordsList[pIndex + 1].matchNotesObj.con"
  639. >
  640. <div
  641. slot="content"
  642. :style="{
  643. color: attrib && attrib.text_color ? attrib.text_color : '#de4444',
  644. fontSize: attrib && attrib.font_size ? attrib.font_size : '',
  645. }"
  646. v-html="item.wordsList[pIndex + 1].matchNotesObj.con"
  647. ></div>
  648. <span
  649. class="NNPE-chs"
  650. style="text-align: left"
  651. :style="{
  652. fontFamily: item.wordsList[pIndex + 1].config.fontFamily,
  653. textDecoration: item.wordsList[pIndex + 1].config.textDecoration,
  654. borderBottom:
  655. item.wordsList[pIndex + 1].config.border === 'dotted' ? '1px dotted' : '',
  656. fontWeight: item.wordsList[pIndex + 1].config.fontWeight,
  657. color:
  658. item.wordsList[pIndex + 1].matchNotesObj.con &&
  659. item.wordsList[pIndex + 1].matchNotesObj.notesColor
  660. ? item.wordsList[pIndex + 1].matchNotesObj.notesColor
  661. : item.wordsList[pIndex + 1].config.color,
  662. height:
  663. attrib && attrib.font_size
  664. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  665. : '28px',
  666. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  667. width: item.wordsList[pIndex + 1].chs.trim() === '' ? '6px' : '',
  668. lineHeight:
  669. attrib && attrib.font_size
  670. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  671. : '28px',
  672. }"
  673. @click.stop="
  674. viewNotes(
  675. $event,
  676. item.wordsList[pIndex + 1].words
  677. ? item.wordsList[pIndex + 1].words
  678. : item.wordsList[pIndex + 1].chs,
  679. '',
  680. item.wordsList[pIndex + 1],
  681. )
  682. "
  683. >{{ convertText(item.wordsList[pIndex + 1].chs) }}
  684. <img
  685. v-if="
  686. item.wordsList[pIndex + 1].img &&
  687. item.wordsList[pIndex + 1].img.length > 0 &&
  688. item.wordsList[pIndex + 1].imgPosition === 'after'
  689. "
  690. :src="item.wordsList[pIndex + 1].img[0].file_url"
  691. :style="{
  692. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  693. }"
  694. /></span>
  695. </el-tooltip>
  696. <template v-else>
  697. <span
  698. class="NNPE-chs"
  699. style="text-align: left"
  700. :style="{
  701. fontFamily: item.wordsList[pIndex + 1].config.fontFamily,
  702. textDecoration: item.wordsList[pIndex + 1].config.textDecoration,
  703. borderBottom:
  704. item.wordsList[pIndex + 1].config.border === 'dotted' ? '1px dotted' : '',
  705. fontWeight: item.wordsList[pIndex + 1].config.fontWeight,
  706. color:
  707. item.wordsList[pIndex + 1].matchNotesObj.con &&
  708. item.wordsList[pIndex + 1].matchNotesObj.notesColor
  709. ? item.wordsList[pIndex + 1].matchNotesObj.notesColor
  710. : item.wordsList[pIndex + 1].config.color,
  711. height:
  712. attrib && attrib.font_size
  713. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  714. : '28px',
  715. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  716. lineHeight:
  717. attrib && attrib.font_size
  718. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  719. : '28px',
  720. width: item.wordsList[pIndex + 1].chs.trim() === '' ? '6px' : '',
  721. }"
  722. @click.stop="
  723. viewNotes(
  724. $event,
  725. item.wordsList[pIndex + 1].words
  726. ? item.wordsList[pIndex + 1].words
  727. : item.wordsList[pIndex + 1].chs,
  728. '',
  729. item.wordsList[pIndex + 1],
  730. )
  731. "
  732. >{{ convertText(item.wordsList[pIndex + 1].chs) }}
  733. <img
  734. v-if="
  735. item.wordsList[pIndex + 1].img &&
  736. item.wordsList[pIndex + 1].img.length > 0 &&
  737. item.wordsList[pIndex + 1].imgPosition === 'after'
  738. "
  739. :src="item.wordsList[pIndex + 1].img[0].file_url"
  740. :style="{
  741. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  742. }"
  743. /></span>
  744. </template>
  745. <span
  746. v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
  747. :class="[
  748. 'NNPE-pinyin',
  749. noFont.indexOf(item.wordsList[pIndex + 1].pinyin) > -1 ? 'noFont' : '',
  750. ]"
  751. style="text-align: left"
  752. :style="{
  753. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  754. height:
  755. attrib && attrib.pinyin_size
  756. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  757. : '22px',
  758. }"
  759. @click.stop="
  760. viewNotes($event, item.wordsList[pIndex + 1].pinyin, '', item.wordsList[pIndex + 1])
  761. "
  762. >{{
  763. NumberList.indexOf(item.wordsList[pIndex + 1].pinyin) == -1
  764. ? item.wordsList[pIndex + 1].pinyin
  765. : ''
  766. }}</span
  767. >
  768. </span>
  769. <span
  770. v-if="
  771. item.wordsList[pIndex + 2] &&
  772. item.wordsList[pIndex + 2].chs &&
  773. (chsFhList.indexOf(item.wordsList[pIndex + 2].chs) > -1 ||
  774. NumberList.indexOf(item.wordsList[pIndex + 2].chs) > -1)
  775. "
  776. class="NNPE-words-box"
  777. >
  778. <span
  779. v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
  780. :class="[
  781. 'NNPE-pinyin',
  782. noFont.indexOf(item.wordsList[pIndex + 1].pinyin) > -1 ? 'noFont' : '',
  783. ]"
  784. style="text-align: left"
  785. :style="{
  786. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  787. height:
  788. attrib && attrib.pinyin_size
  789. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  790. : '22px',
  791. }"
  792. @click.stop="
  793. viewNotes($event, item.wordsList[pIndex + 2].pinyin, '', item.wordsList[pIndex + 2])
  794. "
  795. >{{
  796. NumberList.indexOf(item.wordsList[pIndex + 2].pinyin) == -1
  797. ? item.wordsList[pIndex + 2].pinyin
  798. : ''
  799. }}</span
  800. >
  801. <el-tooltip
  802. popper-class="article-bubble"
  803. effect="light"
  804. placement="bottom-start"
  805. v-if="item.wordsList[pIndex + 2].matchNotesObj.con"
  806. >
  807. <div
  808. slot="content"
  809. :style="{
  810. color: attrib && attrib.text_color ? attrib.text_color : '#de4444',
  811. fontSize: attrib && attrib.font_size ? attrib.font_size : '',
  812. }"
  813. v-html="item.wordsList[pIndex + 2].matchNotesObj.con"
  814. ></div>
  815. <span
  816. class="NNPE-chs"
  817. style="text-align: left"
  818. :style="{
  819. fontFamily: item.wordsList[pIndex + 2].config.fontFamily,
  820. textDecoration: item.wordsList[pIndex + 2].config.textDecoration,
  821. borderBottom:
  822. item.wordsList[pIndex + 2].config.border === 'dotted' ? '1px dotted' : '',
  823. fontWeight: item.wordsList[pIndex + 2].config.fontWeight,
  824. color:
  825. item.wordsList[pIndex + 2].matchNotesObj.con &&
  826. item.wordsList[pIndex + 2].matchNotesObj.notesColor
  827. ? item.wordsList[pIndex + 2].matchNotesObj.notesColor
  828. : item.wordsList[pIndex + 2].config.color,
  829. height:
  830. attrib && attrib.font_size
  831. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  832. : '28px',
  833. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  834. lineHeight:
  835. attrib && attrib.font_size
  836. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  837. : '28px',
  838. width: item.wordsList[pIndex + 2].chs.trim() === '' ? '6px' : '',
  839. }"
  840. @click.stop="
  841. viewNotes(
  842. $event,
  843. item.wordsList[pIndex + 2].words
  844. ? item.wordsList[pIndex + 2].words
  845. : item.wordsList[pIndex + 2].chs,
  846. '',
  847. item.wordsList[pIndex + 2],
  848. )
  849. "
  850. >{{ convertText(item.wordsList[pIndex + 2].chs)
  851. }}<img
  852. v-if="
  853. item.wordsList[pIndex + 2].img &&
  854. item.wordsList[pIndex + 2].img.length > 0 &&
  855. item.wordsList[pIndex + 2].imgPosition === 'after'
  856. "
  857. :src="item.wordsList[pIndex + 2].img[0].file_url"
  858. :style="{
  859. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  860. }"
  861. /></span>
  862. </el-tooltip>
  863. <template v-else>
  864. <span
  865. class="NNPE-chs"
  866. style="text-align: left"
  867. :style="{
  868. fontFamily: item.wordsList[pIndex + 2].config.fontFamily,
  869. textDecoration: item.wordsList[pIndex + 2].config.textDecoration,
  870. borderBottom:
  871. item.wordsList[pIndex + 2].config.border === 'dotted' ? '1px dotted' : '',
  872. fontWeight: item.wordsList[pIndex + 2].config.fontWeight,
  873. color:
  874. item.wordsList[pIndex + 2].matchNotesObj.con &&
  875. item.wordsList[pIndex + 2].matchNotesObj.notesColor
  876. ? item.wordsList[pIndex + 2].matchNotesObj.notesColor
  877. : item.wordsList[pIndex + 2].config.color,
  878. height:
  879. attrib && attrib.font_size
  880. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  881. : '28px',
  882. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  883. lineHeight:
  884. attrib && attrib.font_size
  885. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  886. : '28px',
  887. width: item.wordsList[pIndex + 2].chs.trim() === '' ? '6px' : '',
  888. }"
  889. @click.stop="
  890. viewNotes(
  891. $event,
  892. item.wordsList[pIndex + 2].words
  893. ? item.wordsList[pIndex + 2].words
  894. : item.wordsList[pIndex + 2].chs,
  895. '',
  896. item.wordsList[pIndex + 2],
  897. )
  898. "
  899. >{{ convertText(item.wordsList[pIndex + 2].chs)
  900. }}<img
  901. v-if="
  902. item.wordsList[pIndex + 2].img &&
  903. item.wordsList[pIndex + 2].img.length > 0 &&
  904. item.wordsList[pIndex + 2].imgPosition === 'after'
  905. "
  906. :src="item.wordsList[pIndex + 2].img[0].file_url"
  907. :style="{
  908. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  909. }"
  910. /></span>
  911. </template>
  912. <span
  913. v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
  914. :class="[
  915. 'NNPE-pinyin',
  916. noFont.indexOf(item.wordsList[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
  917. ]"
  918. style="text-align: left"
  919. :style="{
  920. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  921. height:
  922. attrib && attrib.pinyin_size
  923. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  924. : '22px',
  925. }"
  926. @click.stop="
  927. viewNotes($event, item.wordsList[pIndex + 2].pinyin, '', item.wordsList[pIndex + 2])
  928. "
  929. >{{
  930. NumberList.indexOf(item.wordsList[pIndex + 2].pinyin) == -1
  931. ? item.wordsList[pIndex + 2].pinyin
  932. : ''
  933. }}</span
  934. >
  935. </span>
  936. </template>
  937. <template v-else>
  938. <span class="NNPE-words-box">
  939. <span
  940. v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
  941. class="NNPE-pinyin"
  942. :class="[
  943. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  944. pItem.className ? pItem.className : '',
  945. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  946. ]"
  947. :style="{
  948. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  949. height:
  950. attrib && attrib.pinyin_size
  951. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  952. : '22px',
  953. }"
  954. @click.stop="viewNotes($event, pItem.pinyin, '', pItem)"
  955. >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
  956. >
  957. <el-tooltip
  958. popper-class="article-bubble"
  959. effect="light"
  960. placement="bottom-start"
  961. v-if="pItem.matchNotesObj.con"
  962. >
  963. <div
  964. slot="content"
  965. :style="{
  966. color: attrib && attrib.text_color ? attrib.text_color : '#de4444',
  967. fontSize: attrib && attrib.font_size ? attrib.font_size : '',
  968. }"
  969. v-html="pItem.matchNotesObj.con"
  970. ></div>
  971. <span
  972. class="NNPE-chs"
  973. :class="[
  974. pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
  975. newWordList.indexOf(pItem.chs) > -1 ? 'active' : '',
  976. pItem.words ? 'active' : '',
  977. ]"
  978. :style="{
  979. fontFamily: pItem.config.fontFamily,
  980. textDecoration: pItem.config.textDecoration,
  981. borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
  982. fontWeight: pItem.config.fontWeight,
  983. height:
  984. attrib && attrib.font_size
  985. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  986. : '28px',
  987. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  988. lineHeight:
  989. attrib && attrib.font_size
  990. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  991. : '28px',
  992. color:
  993. newWordList.indexOf(pItem.chs) > -1 || pItem.words
  994. ? attrib
  995. ? attrib.topic_color
  996. : pItem.config.color
  997. : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
  998. ? pItem.matchNotesObj.notesColor
  999. : pItem.config.color,
  1000. width: pItem.chs.trim() === '' ? '6px' : '',
  1001. }"
  1002. ><span
  1003. v-for="(wItem, wIndex) in pItem.leg"
  1004. :key="'ci' + wIndex + pIndex + index"
  1005. :class="[
  1006. pItem.chstimeList &&
  1007. pItem.chstimeList[wIndex] &&
  1008. curTime >= pItem.chstimeList[wIndex].wordBg &&
  1009. curTime < item.timeList[pItem.sentIndex].ed
  1010. ? 'wordActive'
  1011. : '',
  1012. ]"
  1013. :style="{
  1014. color:
  1015. newWordList.indexOf(pItem.chs) > -1 || pItem.words
  1016. ? attrib
  1017. ? attrib.topic_color
  1018. : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
  1019. ? pItem.matchNotesObj.notesColor
  1020. : pItem.config.color
  1021. : pItem.config.color,
  1022. }"
  1023. @click.stop="viewNotes($event, pItem.chs[wIndex], pItem.chs, pItem)"
  1024. >{{ convertText(pItem.chs[wIndex]) }}</span
  1025. >
  1026. <img
  1027. v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
  1028. :src="pItem.img[0].file_url"
  1029. :style="{
  1030. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  1031. }"
  1032. />
  1033. </span>
  1034. </el-tooltip>
  1035. <template v-else>
  1036. <span
  1037. class="NNPE-chs"
  1038. :class="[
  1039. pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
  1040. newWordList.indexOf(pItem.chs) > -1 ? 'active' : '',
  1041. pItem.words ? 'active' : '',
  1042. ]"
  1043. :style="{
  1044. fontFamily: pItem.config.fontFamily,
  1045. textDecoration: pItem.config.textDecoration,
  1046. borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
  1047. fontWeight: pItem.config.fontWeight,
  1048. height:
  1049. attrib && attrib.font_size
  1050. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  1051. : '28px',
  1052. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  1053. lineHeight:
  1054. attrib && attrib.font_size
  1055. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  1056. : '28px',
  1057. color:
  1058. newWordList.indexOf(pItem.chs) > -1 || pItem.words
  1059. ? attrib
  1060. ? attrib.topic_color
  1061. : pItem.config.color
  1062. : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
  1063. ? pItem.matchNotesObj.notesColor
  1064. : pItem.config.color,
  1065. width: pItem.chs.trim() === '' ? '6px' : '',
  1066. }"
  1067. ><span
  1068. v-for="(wItem, wIndex) in pItem.leg"
  1069. :key="'ci' + wIndex + pIndex + index"
  1070. :class="[
  1071. pItem.chstimeList &&
  1072. pItem.chstimeList[wIndex] &&
  1073. curTime >= pItem.chstimeList[wIndex].wordBg &&
  1074. curTime < item.timeList[pItem.sentIndex].ed
  1075. ? 'wordActive'
  1076. : '',
  1077. ]"
  1078. :style="{
  1079. color:
  1080. newWordList.indexOf(pItem.chs) > -1 || pItem.words
  1081. ? attrib
  1082. ? attrib.topic_color
  1083. : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
  1084. ? pItem.matchNotesObj.notesColor
  1085. : pItem.config.color
  1086. : pItem.config.color,
  1087. }"
  1088. @click.stop="viewNotes($event, pItem.chs[wIndex], pItem.chs, pItem)"
  1089. >{{ convertText(pItem.chs[wIndex]) }}</span
  1090. >
  1091. <img
  1092. v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
  1093. :src="pItem.img[0].file_url"
  1094. :style="{
  1095. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  1096. }"
  1097. />
  1098. </span>
  1099. </template>
  1100. <span
  1101. v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
  1102. class="NNPE-pinyin"
  1103. :class="[
  1104. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  1105. pItem.className ? pItem.className : '',
  1106. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  1107. ]"
  1108. :style="{
  1109. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  1110. height:
  1111. attrib && attrib.pinyin_size
  1112. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1113. : '22px',
  1114. }"
  1115. @click.stop="viewNotes($event, pItem.pinyin, '', pItem)"
  1116. >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
  1117. >
  1118. </span>
  1119. </template>
  1120. </template>
  1121. </template>
  1122. <template v-else>
  1123. <span
  1124. :style="{
  1125. height: pItem.height + 'px',
  1126. width: pItem.width + 'px',
  1127. }"
  1128. ></span>
  1129. </template>
  1130. </div>
  1131. </div>
  1132. <div
  1133. v-if="curQue.property.multilingual_position === 'para'"
  1134. class="multilingual-para"
  1135. :class="[item.isTitle ? 'multilingual-para-center' : '', 'multilingual-' + item.paraAlign]"
  1136. >
  1137. {{
  1138. curQue.detail[index].multilingualTextList && curQue.detail[index].multilingualTextList[multilingual]
  1139. ? curQue.detail[index].multilingualTextList[multilingual].join(' ')
  1140. : ''
  1141. }}
  1142. </div>
  1143. <template v-if="item.sourceList.length > 0 && item.sourcePosition === 'after'">
  1144. <img
  1145. v-if="item.sourceList[0] && item.sourceList[0].type === 'image'"
  1146. :src="item.sourceList[0].file_url_open"
  1147. :style="{
  1148. width: item.widthNumber + 'px',
  1149. height: item.heightNumber + 'px',
  1150. }"
  1151. />
  1152. <video
  1153. :src="item.sourceList[0].file_url_open"
  1154. width="100%"
  1155. height="400"
  1156. controls
  1157. controlsList="nodownload"
  1158. v-else
  1159. ></video>
  1160. </template>
  1161. </div>
  1162. <div v-if="item.remarkDetail" :class="['remarkBox', 'remark-top-8']">
  1163. <RemarkChs :remark-detail="item.remarkDetail" :margin-top="8" />
  1164. </div>
  1165. </div>
  1166. <!-- <div class="multilingual" v-for="(items, indexs) in multilingualTextList" :key="indexs">
  1167. {{ items }}
  1168. </div> -->
  1169. </div>
  1170. </template>
  1171. </template>
  1172. <template v-else>
  1173. <template v-if="resObj">
  1174. <!-- 段落对齐方式和备注在此模式里没有写,如果段落里添加了英文后需要在此添加段落对齐和备注 -->
  1175. <div class="NPC-sentences-list">
  1176. <div v-for="(item, index) in resObj.sentList" :key="'detail' + index" :class="['NNPE-detail-box']">
  1177. <div :class="['NNPE-details']">
  1178. <div
  1179. v-if="item.enwords && config.isShowEN && curQue.enPosition && curQue.enPosition == 'top'"
  1180. :class="['enwords', sentIndex == index ? 'wordBlank' : '']"
  1181. >
  1182. {{ item.enwords }}
  1183. </div>
  1184. <div style="overflow: hidden; clear: both"></div>
  1185. <div
  1186. v-for="(pItem, pIndex) in item.sentArr"
  1187. :key="'wordsList' + pIndex"
  1188. class="NNPE-words"
  1189. :class="[
  1190. pItem.chs != '“' && pItem.wordIndex == 0 ? 'textLeft' : 'textCenter',
  1191. pItem.chs == '“' ? 'textRight' : '',
  1192. ]"
  1193. @click="showWordDetail($event, pItem.chs, pItem.words)"
  1194. >
  1195. <template v-if="!pItem.width">
  1196. <template v-if="pItem.isShow">
  1197. <template
  1198. v-if="
  1199. item.sentArr[pIndex + 1] &&
  1200. item.sentArr[pIndex + 1].chs &&
  1201. (chsFhList.indexOf(item.sentArr[pIndex + 1].chs) > -1 ||
  1202. NumberList.indexOf(item.sentArr[pIndex + 1].chs) > -1)
  1203. "
  1204. >
  1205. <span class="NNPE-words-box">
  1206. <template v-if="curQue.property.pinyin_position == 'top'">
  1207. <span
  1208. v-if="config.isShowPY"
  1209. class="NNPE-pinyin"
  1210. :class="[
  1211. pItem.className ? pItem.className : '',
  1212. sentIndex == index ? 'wordBlank' : '',
  1213. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  1214. ]"
  1215. :style="{
  1216. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  1217. height:
  1218. attrib && attrib.pinyin_size
  1219. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1220. : '22px',
  1221. }"
  1222. @click.stop="viewNotes($event, pItem.pinyin, '', pItem)"
  1223. >{{ pItem.pinyin }}</span
  1224. >
  1225. </template>
  1226. <span
  1227. class="NNPE-chs"
  1228. :class="[
  1229. pItem.padding && config.isShowPY ? 'padding' : '',
  1230. sentIndex == index ? 'wordBlank' : '',
  1231. newWordList.indexOf(pItem.chs) > -1 ? 'active' : '',
  1232. pItem.words ? 'active' : '',
  1233. ]"
  1234. >
  1235. <template v-for="(wItem, wIndex) in pItem.leg">
  1236. <span
  1237. :key="'ci' + wIndex + pIndex + index"
  1238. :class="[]"
  1239. :style="{
  1240. fontFamily: pItem.config.fontFamily,
  1241. textDecoration: pItem.config.textDecoration,
  1242. borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
  1243. fontWeight: pItem.config.fontWeight,
  1244. color: pItem.notesColor ? pItem.notesColor : pItem.config.color,
  1245. height:
  1246. attrib && attrib.font_size
  1247. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  1248. : '28px',
  1249. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  1250. lineHeight:
  1251. attrib && attrib.font_size
  1252. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  1253. : '28px',
  1254. width: pItem.chs[wIndex].trim() === '' ? '6px' : '',
  1255. }"
  1256. @click.stop="
  1257. viewNotes($event, pItem.words ? pItem.words : pItem.chs[wIndex], pItem.chs, pItem)
  1258. "
  1259. >{{ pItem.chs[wIndex] }}</span
  1260. >
  1261. </template>
  1262. </span>
  1263. <template v-if="curQue.property.pinyin_position == 'bottom'">
  1264. <span
  1265. v-if="config.isShowPY"
  1266. class="NNPE-pinyin"
  1267. :class="[
  1268. pItem.className ? pItem.className : '',
  1269. sentIndex == index ? 'wordBlank' : '',
  1270. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  1271. ]"
  1272. :style="{
  1273. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  1274. height:
  1275. attrib && attrib.pinyin_size
  1276. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1277. : '22px',
  1278. }"
  1279. @click.stop="viewNotes($event, pItem.pinyin, '', pItem)"
  1280. >{{ pItem.pinyin }}</span
  1281. >
  1282. </template>
  1283. </span>
  1284. <span class="NNPE-words-box">
  1285. <template v-if="curQue.property.pinyin_position == 'top'">
  1286. <span
  1287. v-if="config.isShowPY"
  1288. :class="[
  1289. 'NNPE-pinyin',
  1290. sentIndex == index ? 'wordBlank' : '',
  1291. noFont.indexOf(item.sentArr[pIndex + 1].pinyin) > -1 ? 'noFont' : '',
  1292. ]"
  1293. style="text-align: left"
  1294. :style="{
  1295. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  1296. height:
  1297. attrib && attrib.pinyin_size
  1298. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1299. : '22px',
  1300. }"
  1301. @click.stop="
  1302. viewNotes($event, item.sentArr[pIndex + 1].pinyin, '', item.sentArr[pIndex + 1])
  1303. "
  1304. >{{ item.sentArr[pIndex + 1].pinyin }}</span
  1305. >
  1306. </template>
  1307. <span class="NNPE-chs" style="text-align: left">
  1308. <span
  1309. :class="[]"
  1310. :style="{
  1311. fontFamily: item.sentArr[pIndex + 1].config.fontFamily,
  1312. textDecoration: item.sentArr[pIndex + 1].config.textDecoration,
  1313. borderBottom: item.sentArr[pIndex + 1].config.border === 'dotted' ? '1px dotted' : '',
  1314. fontWeight: item.sentArr[pIndex + 1].config.fontWeight,
  1315. color: item.sentArr[pIndex + 1].config.color,
  1316. height:
  1317. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1318. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  1319. lineHeight:
  1320. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1321. width: item.sentArr[pIndex + 1].chs.trim() === '' ? '6px' : '',
  1322. }"
  1323. @click.stop="
  1324. viewNotes(
  1325. $event,
  1326. item.sentArr[pIndex + 1].words
  1327. ? item.sentArr[pIndex + 1].words
  1328. : item.sentArr[pIndex + 1].chs,
  1329. '',
  1330. item.sentArr[pIndex + 1],
  1331. )
  1332. "
  1333. >
  1334. {{
  1335. NumberList.indexOf(item.sentArr[pIndex + 1].pinyin) == -1
  1336. ? item.sentArr[pIndex + 1].chs
  1337. : ''
  1338. }}</span
  1339. >
  1340. </span>
  1341. <template v-if="curQue.property.pinyin_position == 'bottom'">
  1342. <span
  1343. v-if="config.isShowPY"
  1344. :class="[
  1345. 'NNPE-pinyin',
  1346. sentIndex == index ? 'wordBlank' : '',
  1347. noFont.indexOf(item.sentArr[pIndex + 1].pinyin) > -1 ? 'noFont' : '',
  1348. ]"
  1349. style="text-align: left"
  1350. :style="{
  1351. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  1352. height:
  1353. attrib && attrib.pinyin_size
  1354. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1355. : '22px',
  1356. }"
  1357. @click.stop="
  1358. viewNotes($event, item.sentArr[pIndex + 1].pinyin, '', item.sentArr[pIndex + 1])
  1359. "
  1360. >{{ item.sentArr[pIndex + 1].pinyin }}</span
  1361. >
  1362. </template>
  1363. </span>
  1364. <span
  1365. v-if="
  1366. item.sentArr[pIndex + 2] &&
  1367. item.sentArr[pIndex + 2].chs &&
  1368. chsFhList.indexOf(item.sentArr[pIndex + 2].chs) > -1
  1369. "
  1370. class="NNPE-words-box"
  1371. >
  1372. <template v-if="curQue.property.pinyin_position == 'top'">
  1373. <span
  1374. v-if="config.isShowPY"
  1375. :class="[
  1376. 'NNPE-pinyin',
  1377. sentIndex == index ? 'wordBlank' : '',
  1378. noFont.indexOf(item.sentArr[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
  1379. ]"
  1380. style="text-align: left"
  1381. :style="{
  1382. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  1383. height:
  1384. attrib && attrib.pinyin_size
  1385. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1386. : '22px',
  1387. }"
  1388. @click.stop="
  1389. viewNotes($event, item.sentArr[pIndex + 2].pinyin, '', item.sentArr[pIndex + 2])
  1390. "
  1391. >{{ item.sentArr[pIndex + 2].pinyin }}</span
  1392. >
  1393. </template>
  1394. <span class="NNPE-chs" style="text-align: left">
  1395. <span
  1396. :class="[]"
  1397. :style="{
  1398. fontFamily: item.sentArr[pIndex + 2].config.fontFamily,
  1399. textDecoration: item.sentArr[pIndex + 2].config.textDecoration,
  1400. borderBottom: item.sentArr[pIndex + 2].config.border === 'dotted' ? '1px dotted' : '',
  1401. fontWeight: item.sentArr[pIndex + 2].config.fontWeight,
  1402. color: item.sentArr[pIndex + 2].config.color,
  1403. height:
  1404. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1405. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  1406. lineHeight:
  1407. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1408. width: item.sentArr[pIndex + 2].chs.trim() === '' ? '6px' : '',
  1409. }"
  1410. @click.stop="
  1411. viewNotes(
  1412. $event,
  1413. item.sentArr[pIndex + 2].words
  1414. ? item.sentArr[pIndex + 2].words
  1415. : item.sentArr[pIndex + 2].chs,
  1416. '',
  1417. item.sentArr[pIndex + 2],
  1418. )
  1419. "
  1420. >
  1421. {{
  1422. NumberList.indexOf(item.sentArr[pIndex + 2].pinyin) == -1
  1423. ? item.sentArr[pIndex + 2].chs
  1424. : ''
  1425. }}</span
  1426. >
  1427. </span>
  1428. <template v-if="curQue.property.pinyin_position == 'bottom'">
  1429. <span
  1430. v-if="config.isShowPY"
  1431. :class="[
  1432. 'NNPE-pinyin',
  1433. sentIndex == index ? 'wordBlank' : '',
  1434. noFont.indexOf(item.sentArr[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
  1435. ]"
  1436. style="text-align: left"
  1437. :style="{
  1438. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  1439. height:
  1440. attrib && attrib.pinyin_size
  1441. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1442. : '22px',
  1443. }"
  1444. @click.stop="
  1445. viewNotes($event, item.sentArr[pIndex + 1].pinyin, '', item.sentArr[pIndex + 1])
  1446. "
  1447. >{{ item.sentArr[pIndex + 2].pinyin }}</span
  1448. >
  1449. </template>
  1450. </span>
  1451. </template>
  1452. <template v-else>
  1453. <template v-if="curQue.property.pinyin_position == 'top'">
  1454. <span
  1455. v-if="config.isShowPY"
  1456. class="NNPE-pinyin"
  1457. :class="[
  1458. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  1459. pItem.className ? pItem.className : '',
  1460. sentIndex == index ? 'wordBlank' : '',
  1461. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  1462. ]"
  1463. :style="{
  1464. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  1465. height:
  1466. attrib && attrib.pinyin_size
  1467. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1468. : '22px',
  1469. }"
  1470. @click.stop="viewNotes($event, pItem.pinyin, '', pItem)"
  1471. >{{ pItem.pinyin }}</span
  1472. >
  1473. </template>
  1474. <span
  1475. class="NNPE-chs"
  1476. :class="[
  1477. pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
  1478. sentIndex == index ? 'wordBlank' : '',
  1479. newWordList.indexOf(pItem.chs) > -1 ? 'active' : '',
  1480. pItem.words ? 'active' : '',
  1481. ]"
  1482. >
  1483. <template v-for="(wItem, wIndex) in pItem.leg">
  1484. <span
  1485. :key="'ci' + wIndex + pIndex + index"
  1486. :class="[]"
  1487. :style="{
  1488. fontFamily: pItem.config.fontFamily,
  1489. textDecoration: pItem.config.textDecoration,
  1490. borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
  1491. fontWeight: pItem.config.fontWeight,
  1492. color: pItem.notesColor
  1493. ? pItem.notesColor
  1494. : annotationList.indexOf(pItem.chs) > -1
  1495. ? NNPEAnnotationList.find(
  1496. (item) => item.con.replace(/<[^>]*>?/gm, '') === pItem.chs,
  1497. ).notesColor
  1498. : pItem.config.color,
  1499. height:
  1500. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1501. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  1502. lineHeight:
  1503. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1504. width: pItem.chs[wIndex].trim() === '' ? '6px' : '',
  1505. }"
  1506. @click.stop="
  1507. viewNotes($event, pItem.words ? pItem.words : pItem.chs[wIndex], pItem.chs, pItem)
  1508. "
  1509. >{{ pItem.chs[wIndex] }}</span
  1510. >
  1511. </template>
  1512. </span>
  1513. <template v-if="curQue.property.pinyin_position == 'bottom'">
  1514. <span
  1515. v-if="config.isShowPY"
  1516. class="NNPE-pinyin"
  1517. :class="[
  1518. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  1519. pItem.className ? pItem.className : '',
  1520. sentIndex == index ? 'wordBlank' : '',
  1521. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  1522. ]"
  1523. :style="{
  1524. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  1525. height:
  1526. attrib && attrib.pinyin_size
  1527. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1528. : '22px',
  1529. }"
  1530. @click.stop="viewNotes($event, pItem.pinyin, '', pItem)"
  1531. >{{ pItem.pinyin }}</span
  1532. >
  1533. </template>
  1534. </template>
  1535. </template>
  1536. </template>
  1537. <template v-else>
  1538. <span
  1539. :style="{
  1540. height: pItem.height + 'px',
  1541. width: pItem.width + 'px',
  1542. }"
  1543. ></span>
  1544. </template>
  1545. </div>
  1546. <div style="overflow: hidden; clear: both"></div>
  1547. <div
  1548. v-if="
  1549. item.enwords &&
  1550. config.isShowEN &&
  1551. (!curQue.enPosition || (curQue.enPosition && curQue.enPosition == 'bottom'))
  1552. "
  1553. :class="['enwords', sentIndex == index ? 'wordBlank' : '']"
  1554. >
  1555. {{ item.enwords }}
  1556. </div>
  1557. <div
  1558. v-if="curQue.property.multilingual_position === 'para'"
  1559. class="multilingual-para"
  1560. :class="[item.isTitle ? 'multilingual-para-center' : '', 'multilingual-' + item.paraAlign]"
  1561. >
  1562. {{
  1563. curQue.detail[index].multilingualTextList[multilingual]
  1564. ? curQue.detail[index].multilingualTextList[multilingual].join(' ')
  1565. : ''
  1566. }}
  1567. </div>
  1568. </div>
  1569. </div>
  1570. <!-- <div class="multilingual" v-for="(items, indexs) in multilingualTextList" :key="indexs">
  1571. {{ items }}
  1572. </div> -->
  1573. </div>
  1574. </template>
  1575. </template>
  1576. <template v-for="(items, indexs) in curQue.detail">
  1577. <div
  1578. v-if="
  1579. curQue.property.multilingual_position === 'all' &&
  1580. items.multilingualTextList &&
  1581. items.multilingualTextList[multilingual] &&
  1582. items.multilingualTextList[multilingual].length > 0
  1583. "
  1584. :key="indexs"
  1585. class="multilingual"
  1586. >
  1587. <div
  1588. class="multilingual-para"
  1589. :class="[items.isTitle ? 'multilingual-para-center' : '', 'multilingual-' + items.paraAlign]"
  1590. >
  1591. {{
  1592. items.multilingualTextList && items.multilingualTextList[multilingual]
  1593. ? items.multilingualTextList[multilingual].join(' ')
  1594. : ''
  1595. }}
  1596. </div>
  1597. </div>
  1598. </template>
  1599. </div>
  1600. <div
  1601. v-if="
  1602. ((curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url) ||
  1603. config.isHasPY ||
  1604. config.isHasEN) &&
  1605. curQue.property.mp3_position === 'bottom'
  1606. "
  1607. class="aduioLine-box aduioLine-practice-npc aduioLine-box-bottom"
  1608. >
  1609. <div class="aduioLine-content">
  1610. <template v-if="curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url">
  1611. <AudioLine
  1612. ref="audioLine"
  1613. audio-id="artPhraseAudio"
  1614. :mp3="curQue.mp3_list[0].url"
  1615. :get-cur-time="getCurTime"
  1616. :mp3-source="curQue.mp3_list[0].source"
  1617. :width="colLength == 2 ? 200 : 700"
  1618. :attrib="attrib"
  1619. />
  1620. </template>
  1621. </div>
  1622. <div class="aduioLine-right">
  1623. <!-- <span
  1624. :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
  1625. @click="changePinyin"
  1626. v-if="config.isHasPY"
  1627. ></span>
  1628. <span :class="['EN-16', config.isShowEN ? '' : 'disabled']" @click="changeEN" v-if="config.isHasEN"></span> -->
  1629. <SvgIcon
  1630. v-if="config.isHasPY"
  1631. icon-class="pin-btn"
  1632. size="16"
  1633. :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
  1634. :style="{ color: config.isShowPY ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
  1635. @click="changePinyin"
  1636. />
  1637. <SvgIcon
  1638. v-if="config.isHasEN"
  1639. icon-class="en-btn"
  1640. size="16"
  1641. :class="['EN-16', config.isShowEN ? '' : 'disabled']"
  1642. :style="{ color: config.isShowEN ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
  1643. @click="changeEN"
  1644. />
  1645. </div>
  1646. </div>
  1647. <template v-if="isShow">
  1648. <div
  1649. ref="wordcard"
  1650. class="NNPE-wordDetail"
  1651. :style="{
  1652. marginLeft:
  1653. word.detail.new_word.length === 1
  1654. ? '-152px'
  1655. : windowWidth > word.detail.new_word.length * 126 + 48
  1656. ? '-' + (word.detail.new_word.length * 63 + 24) + 'px'
  1657. : '0px',
  1658. left: windowWidth > word.detail.new_word.length * 126 + 48 ? '' : '0px',
  1659. }"
  1660. >
  1661. <Wordcard
  1662. :word="word"
  1663. :change-word-card="changeWordCard"
  1664. :theme-color="themeColor"
  1665. :current-tree-i-d="currentTreeID"
  1666. :TaskModel="TaskModel"
  1667. :write-list="curQue.Bookanswer.writeModel"
  1668. :mp3-url="activeWord ? activeWord.newWordMp3 || activeWord.audio_file_url : ''"
  1669. :bg="activeWord ? activeWord.audio_begin_time || activeWord.bg : null"
  1670. :ed="activeWord ? activeWord.audio_end_time || activeWord.ed : null"
  1671. :attrib="attrib"
  1672. :is-mobile="isMobile"
  1673. @changeCurQue="changeCurQue"
  1674. />
  1675. </div>
  1676. </template>
  1677. <template v-if="isNoteShow">
  1678. <div
  1679. ref="notecard"
  1680. class="NNPE-wordDetail"
  1681. :style="{
  1682. marginLeft: windowWidth > 642 ? '-321px' : '0px',
  1683. left: windowWidth > 642 ? '' : '0px',
  1684. width: isMobile ? '100%' : '',
  1685. }"
  1686. >
  1687. <Notecard :item="curNoteCon" :change-card="changeCard" :attrib="attrib" :is-mobile="isMobile" />
  1688. </div>
  1689. </template>
  1690. </div>
  1691. </template>
  1692. <script>
  1693. import AudioLine from '../voice_matrix/components/AudioLine.vue';
  1694. import Wordcard from './components/Wordcard.vue'; // 卡片
  1695. import Notecard from './components/Notecard.vue'; // 注释
  1696. import RemarkChs from '../dialogue_article/RemarkChs.vue';
  1697. export default {
  1698. name: 'PhraseModelChs',
  1699. components: {
  1700. AudioLine,
  1701. Wordcard,
  1702. Notecard,
  1703. RemarkChs,
  1704. },
  1705. props: [
  1706. 'curQue',
  1707. 'bodyLeft',
  1708. 'NNPENewWordList',
  1709. 'themeColor',
  1710. 'noFont',
  1711. 'currentTreeID',
  1712. 'config',
  1713. 'TaskModel',
  1714. 'NNPEAnnotationList',
  1715. 'colLength',
  1716. 'multilingual',
  1717. 'attrib',
  1718. 'isMobile',
  1719. ],
  1720. inject: ['convertText'],
  1721. data() {
  1722. return {
  1723. resArr: [],
  1724. resObj: null,
  1725. curTime: 0, // 单位s
  1726. chsFhList: [',', '。', '”', ':', '》', '?', '!', ';', '#', '、', '’', ')', '〕', '〕〕', '〉'],
  1727. enFhList: [',', '.', ';', '?', '!', ':', '>', '<'],
  1728. firstFhlist: ['(', '“', '‘', '〔', '〔〔', '〈', '《'],
  1729. NumberList: ['①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳'],
  1730. newWords: ['鱼', '辩礼义'],
  1731. oldHz: '',
  1732. hz: '',
  1733. clientY: 0,
  1734. top: 0,
  1735. left: 0,
  1736. articleImg: {}, // 文章图片
  1737. newWordList: [],
  1738. annotationList: [],
  1739. word: null,
  1740. isShow: false,
  1741. screenHeight: 0,
  1742. cardHeight: 0,
  1743. contentWidth: 732,
  1744. noteNum: '',
  1745. curNoteCon: null,
  1746. isNoteShow: false,
  1747. oldNoteNum: '',
  1748. clickType: '',
  1749. sentIndex: -1,
  1750. highWords: null,
  1751. highWordsArr: [],
  1752. highIndex: 0,
  1753. activeWord: null,
  1754. windowWidth: window.innerWidth,
  1755. isHasRemark: false,
  1756. };
  1757. },
  1758. computed: {},
  1759. watch: {
  1760. hz: {
  1761. handler(val) {
  1762. let _this = this;
  1763. if (val) {
  1764. _this.handleNewWords(val);
  1765. }
  1766. },
  1767. // 深度观察监听
  1768. deep: true,
  1769. },
  1770. isShow: {
  1771. handler(val) {
  1772. let _this = this;
  1773. if (val) {
  1774. setTimeout(() => {
  1775. _this.cardHeight = _this.$refs.wordcard.offsetHeight;
  1776. if (_this.screenHeight - _this.clientY > _this.cardHeight) {
  1777. _this.top = _this.clientY + 20;
  1778. } else {
  1779. _this.top = _this.clientY - _this.cardHeight - 30;
  1780. }
  1781. }, 0);
  1782. }
  1783. },
  1784. // 深度观察监听
  1785. deep: true,
  1786. },
  1787. noteNum: {
  1788. handler(val) {
  1789. let _this = this;
  1790. if (val) {
  1791. _this.handleNote(val);
  1792. }
  1793. },
  1794. // 深度观察监听
  1795. deep: true,
  1796. },
  1797. isNoteShow: {
  1798. handler(val) {
  1799. let _this = this;
  1800. if (val) {
  1801. setTimeout(() => {
  1802. _this.cardHeight = _this.$refs.notecard.offsetHeight;
  1803. if (_this.screenHeight - _this.clientY > _this.cardHeight) {
  1804. _this.top = _this.clientY + 20;
  1805. } else {
  1806. _this.top = _this.clientY - _this.cardHeight - 30;
  1807. }
  1808. }, 50);
  1809. }
  1810. },
  1811. // 深度观察监听
  1812. deep: true,
  1813. },
  1814. },
  1815. // 生命周期 - 创建完成(可以访问当前this实例)
  1816. created() {},
  1817. // 生命周期 - 挂载完成(可以访问DOM元素)
  1818. mounted() {
  1819. if (
  1820. (this.NNPENewWordList && this.NNPENewWordList.length > 0) ||
  1821. (this.NNPEAnnotationList && this.NNPEAnnotationList.length > 0)
  1822. ) {
  1823. this.handleNewword();
  1824. }
  1825. if (this.curQue) {
  1826. this.handleData();
  1827. }
  1828. window.addEventListener('resize', this.getScreenHeight);
  1829. this.getScreenHeight();
  1830. },
  1831. beforeCreate() {}, // 生命周期 - 创建之前
  1832. beforeMount() {}, // 生命周期 - 挂载之前
  1833. beforeUpdate() {}, // 生命周期 - 更新之前
  1834. updated() {}, // 生命周期 - 更新之后
  1835. beforeDestroy() {
  1836. window.removeEventListener('resize', this.getScreenHeight);
  1837. }, // 生命周期 - 销毁之前
  1838. destroyed() {}, // 生命周期 - 销毁完成
  1839. activated() {},
  1840. // 方法集合
  1841. methods: {
  1842. // 拼音的显示和隐藏
  1843. changePinyin() {
  1844. if (this.config.isHasPY) {
  1845. this.$emit('changeConfig', 'isShowPY');
  1846. }
  1847. },
  1848. // 英文的显示和隐藏
  1849. changeEN() {
  1850. if (this.config.isHasEN) {
  1851. this.$emit('changeConfig', 'isShowEN');
  1852. }
  1853. },
  1854. getCurTime(curTime) {
  1855. this.curTime = curTime;
  1856. },
  1857. handleData() {
  1858. let resArr = [];
  1859. let leg = this.curQue.detail.length;
  1860. let curQue = JSON.parse(JSON.stringify(this.curQue));
  1861. let dhaspinyin = false; // 每段是否有拼音
  1862. this.isHasRemark = false;
  1863. curQue.detail.forEach((dItem, dIndex) => {
  1864. dhaspinyin = false;
  1865. let remarkDetail = dItem.remark;
  1866. if (
  1867. remarkDetail &&
  1868. (remarkDetail.chs || remarkDetail.en || (remarkDetail.img_list && remarkDetail.img_list.length > 0))
  1869. ) {
  1870. this.isHasRemark = true;
  1871. }
  1872. let paraArr = [];
  1873. if (dItem.paraAlign !== 'center') {
  1874. paraArr = [
  1875. {
  1876. pinyin: '',
  1877. chs: '',
  1878. width: 20,
  1879. height: 20,
  1880. },
  1881. {
  1882. width: 20,
  1883. height: 20,
  1884. pinyin: '',
  1885. chs: '',
  1886. },
  1887. ];
  1888. }
  1889. dItem.wordsList.forEach((sItem, sIndex) => {
  1890. sItem.forEach((wItem, wIndex) => {
  1891. let sentence = dItem.sentences[sIndex];
  1892. // this.judgePad(sItem, wItem, wIndex);
  1893. this.mergeWordSymbol(sItem, wItem, wIndex);
  1894. let words = '';
  1895. if (this.newWordList.length > 0) {
  1896. if (!this.highWords) {
  1897. this.findLightWord(wItem, wIndex, sentence, sItem);
  1898. words = this.highWords ? this.highWords.words : '';
  1899. } else if (wIndex > this.highWords.endIndex - 1) {
  1900. this.highWords = null;
  1901. this.findLightWord(wItem, wIndex, sentence, sItem);
  1902. words = this.highWords ? this.highWords.words : '';
  1903. } else {
  1904. words = this.highWords ? this.highWords.words : '';
  1905. }
  1906. }
  1907. let obj = {
  1908. paraIndex: dIndex, // 段落索引
  1909. sentIndex: sIndex, // 在段落中句子索引
  1910. wordIndex: wIndex, // 单词的索引
  1911. pinyin:
  1912. curQue.pinyin_type === 'pinyin'
  1913. ? curQue.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true' && wIndex === 0
  1914. ? wItem.pinyin_up
  1915. : wItem.pinyin
  1916. : wItem.pinyin_tone,
  1917. chs: wItem.chs,
  1918. padding: true, // wItem.padding,
  1919. className: wItem.className,
  1920. isShow: wItem.isShow,
  1921. isNewWord: this.newWords.indexOf(wItem.chs) > -1,
  1922. words,
  1923. leg: wItem.chs.length,
  1924. config: {
  1925. fontFamily: wItem.fontFamily,
  1926. color: wItem.color,
  1927. textDecoration: wItem.textDecoration,
  1928. border: wItem.border,
  1929. fontWeight: wItem.fontWeight,
  1930. },
  1931. matchWords: wItem.matchWords,
  1932. matchNotes: wItem.matchNotes,
  1933. notesColor: wItem.notesColor,
  1934. matchNotesObj: wItem.matchNotesObj,
  1935. img: wItem.img,
  1936. imgPosition: wItem.imgPosition,
  1937. };
  1938. paraArr.push(obj);
  1939. if (wItem.pinyin) dhaspinyin = true;
  1940. });
  1941. });
  1942. let paraObj = {
  1943. wordsList: paraArr,
  1944. dhaspinyin,
  1945. isTitle: dItem.isTitle,
  1946. paraAlign: dItem.paraAlign,
  1947. remarkDetail,
  1948. sourceList: dItem.sourceList ? dItem.sourceList : [],
  1949. sourcePosition: dItem.sourcePosition,
  1950. widthNumber: dItem.widthNumber,
  1951. heightNumber: dItem.heightNumber,
  1952. };
  1953. resArr.push(paraObj);
  1954. });
  1955. this.resArr = resArr;
  1956. // 循环文章图片
  1957. if (curQue.img_list) {
  1958. curQue.img_list.forEach((item) => {
  1959. this.articleImg[item.imgNumber] = item.id;
  1960. });
  1961. }
  1962. let resArrs = [];
  1963. let sentArrTotal = [];
  1964. let timeArr = [];
  1965. let wordTimeList = curQue.wordTime;
  1966. curQue.detail.forEach((dItem, dIndex) => {
  1967. dItem.wordsList.forEach((sItem, sIndex) => {
  1968. let sentArr = [];
  1969. sItem.forEach((wItem, wIndex) => {
  1970. let startIndex = wIndex === 0 ? 0 : sentArr[wIndex - 1].startIndex + sentArr[wIndex - 1].chs.length;
  1971. let endIndex = wIndex === 0 ? wItem.chs.length : sentArr[wIndex - 1].endIndex + wItem.chs.length;
  1972. // this.judgePad(sItem, wItem, wIndex);
  1973. this.mergeWordSymbols(wItem);
  1974. let obj = {
  1975. paraIndex: dIndex, // 段落索引
  1976. sentIndex: sIndex, // 在段落中句子索引
  1977. wordIndex: wIndex, // 单词的索引
  1978. pinyin:
  1979. curQue.pinyin_type === 'pinyin'
  1980. ? curQue.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true' && wIndex === 0
  1981. ? wItem.pinyin_up
  1982. : wItem.pinyin
  1983. : wItem.pinyin_tone,
  1984. chs: wItem.chs,
  1985. padding: true,
  1986. className: wItem.className,
  1987. isShow: wItem.isShow,
  1988. startIndex,
  1989. endIndex,
  1990. leg: wItem.chs.length,
  1991. timeList: [],
  1992. config: {
  1993. fontFamily: wItem.fontFamily,
  1994. color: wItem.color,
  1995. textDecoration: wItem.textDecoration,
  1996. border: wItem.border,
  1997. fontWeight: wItem.fontWeight,
  1998. },
  1999. matchWords: wItem.matchWords,
  2000. matchNotes: wItem.matchNotes,
  2001. notesColor: wItem.notesColor,
  2002. img: wItem.img,
  2003. imgPosition: wItem.imgPosition,
  2004. };
  2005. sentArr.push(obj);
  2006. });
  2007. let objs = {
  2008. sentArr,
  2009. enwords: dItem.sentencesEn && dItem.sentencesEn[sIndex] && dItem.sentencesEn[sIndex].replace(/'/g, '’'),
  2010. paraAlign: dItem.paraAlign,
  2011. sourceList: dItem.sourceList ? dItem.sourceList : [],
  2012. sourcePosition: dItem.sourcePosition,
  2013. widthNumber: dItem.widthNumber,
  2014. heightNumber: dItem.heightNumber,
  2015. };
  2016. sentArrTotal.push(sentArr);
  2017. resArrs.push(objs);
  2018. });
  2019. timeArr.push(dItem.timeList);
  2020. });
  2021. if (wordTimeList && wordTimeList.length > 0) {
  2022. this.mergeWordTime(sentArrTotal, wordTimeList);
  2023. }
  2024. let timeList = [];
  2025. timeArr.forEach((item) => {
  2026. item.forEach((aItem) => {
  2027. if (timeList.indexOf(aItem) < 0) {
  2028. timeList.push(aItem);
  2029. }
  2030. });
  2031. });
  2032. this.resObj = { sentList: resArrs, timeList };
  2033. },
  2034. findLightWord(wItem, startIndex, sentence, sItem) {
  2035. let endIndex = 0;
  2036. let words = '';
  2037. this.newWordList.forEach((item) => {
  2038. if (item.length === 1) {
  2039. if (item === wItem.chs && !wItem.banLight) {
  2040. words = wItem.chs;
  2041. endIndex = startIndex + 1;
  2042. }
  2043. } else if (item[0] === wItem.chs && sentence.indexOf(item) > -1) {
  2044. let index = null;
  2045. let chsStr = '';
  2046. for (let i = startIndex; i < sItem.length + 1; i++) {
  2047. index = i;
  2048. if (chsStr.length === item.length) {
  2049. break;
  2050. } else {
  2051. chsStr += sItem[i] ? sItem[i].chs : '';
  2052. }
  2053. }
  2054. if (chsStr === item && !wItem.banLight) {
  2055. words = item;
  2056. endIndex = index;
  2057. }
  2058. } else if (wItem.new_word && wItem.new_word === item && !wItem.banLight) {
  2059. words = item;
  2060. endIndex = startIndex + 1;
  2061. }
  2062. });
  2063. if (words) {
  2064. this.highWords = { words, endIndex };
  2065. } else {
  2066. this.highWords = null;
  2067. }
  2068. },
  2069. // 词和标点合一起
  2070. mergeWordSymbol(sItem, wItem, curIndex) {
  2071. let leg = sItem.length;
  2072. if (wItem && wItem.chs) {
  2073. // let nextIndex = curIndex + 1;
  2074. // let chs = sItem[nextIndex].chs;
  2075. // let pinyin = sItem[nextIndex].pinyin;
  2076. // if (this.chsFhList.indexOf(chs) > -1) {
  2077. // wItem.chs = "<a>" + wItem.chs + "</a><a>" + chs + "</a>";
  2078. // wItem.pinyin = "<a>" + wItem.pinyin + "</a><a>" + pinyin + "</a>";
  2079. // }
  2080. if (
  2081. this.chsFhList.indexOf(wItem.chs) > -1 ||
  2082. this.NumberList.indexOf(wItem.chs) > -1 ||
  2083. this.firstFhlist.indexOf(wItem.chs) > -1
  2084. ) {
  2085. wItem.isShow = false;
  2086. } else {
  2087. wItem.isShow = true;
  2088. }
  2089. }
  2090. // if (this.enFhList.indexOf(wItem.pinyin) > -1) {
  2091. // wItem.className = "textLeft";
  2092. // }
  2093. },
  2094. mergeWordSymbols(wItem) {
  2095. if (
  2096. this.chsFhList.indexOf(wItem.chs) > -1 ||
  2097. this.NumberList.indexOf(wItem.chs) > -1 ||
  2098. this.firstFhlist.indexOf(wItem.chs) > -1
  2099. ) {
  2100. wItem.isShow = false;
  2101. } else {
  2102. wItem.isShow = true;
  2103. }
  2104. },
  2105. mergeWordTime(resArr, wordTimeList) {
  2106. resArr.forEach((item, index) => {
  2107. let wordsResultList = wordTimeList[index].wordsResultList;
  2108. item.forEach((wItem) => {
  2109. let startIndex = wItem.startIndex;
  2110. let endIndex = wItem.endIndex;
  2111. wItem.timeList = wordsResultList.slice(startIndex, endIndex);
  2112. });
  2113. });
  2114. },
  2115. // 判断是否有padding
  2116. judgePad(sItem, wItem, curIndex) {
  2117. let leg = sItem.length;
  2118. if (curIndex < leg - 1) {
  2119. let nextIndex = curIndex + 1;
  2120. let chs = sItem[nextIndex].chs;
  2121. if (this.chsFhList.indexOf(chs) > -1 || this.chsFhList.indexOf(wItem.chs) > -1) {
  2122. wItem.padding = false;
  2123. } else {
  2124. wItem.padding = true;
  2125. }
  2126. if (this.enFhList.indexOf(wItem.pinyin) > -1) {
  2127. wItem.className = 'textLeft';
  2128. }
  2129. }
  2130. },
  2131. // 转化时间
  2132. handleTimeList(list) {
  2133. let listRes = [];
  2134. list.forEach((item) => {
  2135. let res = this.timeStrToSen(item);
  2136. listRes.push(res);
  2137. });
  2138. return listRes;
  2139. },
  2140. // 分:秒转秒
  2141. timeStrToSen(time) {
  2142. if (!time) {
  2143. return -1;
  2144. }
  2145. let pos = time.indexOf(':');
  2146. let min = 0;
  2147. let sec = 0;
  2148. if (pos > 0) {
  2149. min = parseInt(time.substring(0, pos));
  2150. sec = parseFloat(time.substring(pos + 1));
  2151. }
  2152. return min * 60 + sec;
  2153. },
  2154. // 点击播放某个句子
  2155. handleChangeTime(time) {
  2156. this.curTime = time;
  2157. this.$refs.audioLine.onTimeupdateTime(time);
  2158. },
  2159. handleNewword() {
  2160. let NewWordList = [];
  2161. this.NNPENewWordList.forEach((wItem) => {
  2162. // item.forEach((wItem) => {
  2163. if (wItem.new_word) {
  2164. NewWordList.push(wItem.new_word);
  2165. } else if (wItem.detail && wItem.detail.sentence) {
  2166. NewWordList.push(wItem.detail.sentence);
  2167. }
  2168. // });
  2169. });
  2170. this.newWordList = JSON.parse(JSON.stringify(NewWordList));
  2171. let annotationList = [];
  2172. this.NNPEAnnotationList.forEach((wItem) => {
  2173. // item.forEach((wItem) => {
  2174. if (wItem.con) {
  2175. annotationList.push(wItem.con.replace(/<[^>]*>?/gm, ''));
  2176. }
  2177. // });
  2178. });
  2179. this.annotationList = JSON.parse(JSON.stringify(annotationList));
  2180. },
  2181. showWordDetail(e, word, words) {
  2182. let _this = this;
  2183. _this.highIndex = 0;
  2184. _this.highWordsArr = [];
  2185. if (word && this.newWordList.indexOf(word) > -1) {
  2186. this.highWordsArr.push(word);
  2187. }
  2188. if (words && word !== words && this.newWordList.indexOf(words) > -1) {
  2189. this.highWordsArr.push(words);
  2190. }
  2191. if (this.newWordList.indexOf(word) > -1 || this.newWordList.indexOf(words) > -1) {
  2192. if (word && this.newWordList.indexOf(word) > -1) {
  2193. if (_this.oldHz !== word) {
  2194. this.isShow = false;
  2195. setTimeout(() => {
  2196. _this.hz = word;
  2197. }, 50);
  2198. }
  2199. } else if (words && this.newWordList.indexOf(words) > -1) {
  2200. if (_this.oldHz !== words) {
  2201. this.isShow = false;
  2202. setTimeout(() => {
  2203. _this.hz = words;
  2204. }, 50);
  2205. }
  2206. }
  2207. _this.clientY = e.clientY;
  2208. let left = e.clientX;
  2209. let width = 0;
  2210. if (word.length === 1 || word.length === 2) {
  2211. width = 304;
  2212. } else if (word.length === 3 || word.length === 4) {
  2213. width = 432;
  2214. } else if (word.length > 3) {
  2215. width = 560;
  2216. }
  2217. if (left - this.bodyLeft > this.contentWidth / 2) {
  2218. _this.left = left - width + 10;
  2219. } else {
  2220. _this.left = left;
  2221. }
  2222. }
  2223. },
  2224. hideWordDetail() {
  2225. this.isShow = false;
  2226. },
  2227. changeWordCard(isShow) {
  2228. this.isShow = isShow;
  2229. this.oldHz = '';
  2230. this.hz = '';
  2231. },
  2232. // 处理分词数据
  2233. handleNewWords(val, top, left) {
  2234. this.isShow = true;
  2235. this.word = null;
  2236. for (let i = 0; i < this.NNPENewWordList.length; i++) {
  2237. let item = this.NNPENewWordList[i];
  2238. // for (let j = 0; j < pItem.length; j++) {
  2239. // let item = pItem[j];
  2240. if (item.new_word.trim() === val.trim()) {
  2241. let wordlist = val.split('');
  2242. this.word = { list: wordlist, detail: item, top, left };
  2243. break;
  2244. }
  2245. // }
  2246. }
  2247. this.oldHz = val;
  2248. },
  2249. getScreenHeight() {
  2250. this.screenHeight = window.innerHeight;
  2251. },
  2252. changeCurQue(answer) {
  2253. if (answer) {
  2254. let writeModel = this.curQue.Bookanswer.writeModel;
  2255. let hz = answer.hz;
  2256. if (writeModel.hasOwnProperty(hz)) {
  2257. writeModel[hz].push(answer);
  2258. } else {
  2259. writeModel[hz] = [answer];
  2260. }
  2261. }
  2262. },
  2263. viewNotes(e, noteNum, noteNums, words) {
  2264. let _this = this;
  2265. _this.clickType = 'note';
  2266. _this.activeWord = null;
  2267. let noteIndex = '';
  2268. if (_this.NumberList.indexOf(noteNum) > -1) {
  2269. for (let i = 0; i < _this.NumberList.length; i++) {
  2270. if (_this.NumberList[i] === noteNum) {
  2271. noteIndex = `${String(i)}`;
  2272. break;
  2273. }
  2274. }
  2275. this.showNoteDetail(e, noteIndex);
  2276. } else if (words.matchNotes) {
  2277. // 关联了注释
  2278. if (_this.NNPEAnnotationList && _this.NNPEAnnotationList.length > 0) {
  2279. _this.NNPEAnnotationList.forEach((item, indexs) => {
  2280. let textContent = item.con.replace(/<[^>]*>?/gm, '');
  2281. if (textContent === words.matchNotes.trim()) {
  2282. noteIndex = `${String(indexs)}`;
  2283. this.showNoteDetail(e, noteIndex);
  2284. }
  2285. });
  2286. }
  2287. // } else if (
  2288. // _this.NNPEAnnotationList &&
  2289. // _this.NNPEAnnotationList.length > 0 &&
  2290. // _this.annotationList.indexOf(words.chs) > -1
  2291. // ) {
  2292. // _this.NNPEAnnotationList.forEach((item, indexs) => {
  2293. // let textContent = item.con.replace(/<[^>]*>?/gm, '');
  2294. // if (textContent === words.chs.trim()) {
  2295. // noteIndex = `${String(indexs)}`;
  2296. // this.showNoteDetail(e, noteIndex);
  2297. // }
  2298. // });
  2299. } else if (this.newWordList.indexOf(noteNum) > -1) {
  2300. if (_this.oldHz !== noteNum) {
  2301. this.isShow = false;
  2302. _this.NNPENewWordList.forEach((items) => {
  2303. // item.forEach((items) => {
  2304. if (items.new_word === noteNum) {
  2305. this.activeWord = items;
  2306. }
  2307. // });
  2308. });
  2309. setTimeout(() => {
  2310. _this.hz = noteNum;
  2311. }, 50);
  2312. }
  2313. _this.clientY = e.clientY;
  2314. let left = e.clientX;
  2315. let width = 0;
  2316. if (noteNum.length === 1 || noteNum.length === 2) {
  2317. width = 304;
  2318. } else if (noteNum.length === 3 || noteNum.length === 4) {
  2319. width = 432;
  2320. } else if (noteNum.length > 3) {
  2321. width = 560;
  2322. }
  2323. if (left - this.bodyLeft > this.contentWidth / 2) {
  2324. _this.left = left - width + 10;
  2325. } else {
  2326. _this.left = left;
  2327. }
  2328. } else if (noteNums && this.newWordList.indexOf(noteNums) > -1) {
  2329. if (_this.oldHz !== noteNums) {
  2330. this.isShow = false;
  2331. _this.NNPENewWordList.forEach((items) => {
  2332. // item.forEach((items) => {
  2333. if (items.new_word === noteNums) {
  2334. this.activeWord = items;
  2335. }
  2336. // });
  2337. });
  2338. setTimeout(() => {
  2339. _this.hz = noteNums;
  2340. }, 50);
  2341. }
  2342. _this.clientY = e.clientY;
  2343. let left = e.clientX;
  2344. let width = 0;
  2345. if (noteNums.length === 1 || noteNums.length === 2) {
  2346. width = 304;
  2347. } else if (noteNums.length === 3 || noteNums.length === 4) {
  2348. width = 432;
  2349. } else if (noteNums.length > 3) {
  2350. width = 560;
  2351. }
  2352. if (left - this.bodyLeft > this.contentWidth / 2) {
  2353. _this.left = left - width + 10;
  2354. } else {
  2355. _this.left = left;
  2356. }
  2357. } else if (words.matchWords && this.newWordList.indexOf(words.matchWords) > -1) {
  2358. // 关联了生词
  2359. if (_this.oldHz !== words.matchWords) {
  2360. this.isShow = false;
  2361. _this.NNPENewWordList.forEach((items) => {
  2362. // item.forEach((items) => {
  2363. if (items.new_word === words.matchWords) {
  2364. this.activeWord = items;
  2365. }
  2366. // });
  2367. });
  2368. setTimeout(() => {
  2369. _this.hz = words.matchWords;
  2370. }, 50);
  2371. }
  2372. _this.clientY = e.clientY;
  2373. let left = e.clientX;
  2374. let width = 0;
  2375. if (words.matchWords.length === 1 || words.matchWords.length === 2) {
  2376. width = 304;
  2377. } else if (words.matchWords.length === 3 || words.matchWords.length === 4) {
  2378. width = 432;
  2379. } else if (words.matchWords.length > 3) {
  2380. width = 560;
  2381. }
  2382. if (left - this.bodyLeft > this.contentWidth / 2) {
  2383. _this.left = left - width + 10;
  2384. } else {
  2385. _this.left = left;
  2386. }
  2387. }
  2388. },
  2389. showNoteDetail(e, noteNum) {
  2390. let _this = this;
  2391. if (_this.oldNoteNum !== noteNum) {
  2392. this.isNoteShow = false;
  2393. setTimeout(() => {
  2394. _this.noteNum = noteNum;
  2395. }, 50);
  2396. }
  2397. _this.clientY = e.clientY;
  2398. let left = e.clientX;
  2399. let width = 642;
  2400. if (left - this.bodyLeft > this.contentWidth / 2) {
  2401. _this.left = left - width + 10;
  2402. } else if (left - 200 > 500) {
  2403. _this.left = 500;
  2404. } else {
  2405. _this.left = left - 200;
  2406. }
  2407. },
  2408. // 处理注释数据
  2409. handleNote(val) {
  2410. let _this = this;
  2411. _this.isNoteShow = true;
  2412. _this.oldNoteNum = val;
  2413. let noteIndex = Number(val);
  2414. if (_this.NNPEAnnotationList && _this.NNPEAnnotationList.length > 0) {
  2415. _this.curNoteCon = _this.NNPEAnnotationList[noteIndex] ? _this.NNPEAnnotationList[noteIndex] : null;
  2416. }
  2417. },
  2418. changeCard(isShow) {
  2419. let _this = this;
  2420. _this.isNoteShow = isShow;
  2421. _this.oldNoteNum = '';
  2422. _this.noteNum = '';
  2423. },
  2424. }, // 如果页面有keep-alive缓存功能,这个函数会触发
  2425. };
  2426. </script>
  2427. <style lang="scss" scoped>
  2428. .NNPE-ArticleView {
  2429. width: 100%;
  2430. .aduioLine-practice-npc {
  2431. display: flex;
  2432. align-items: center;
  2433. justify-content: flex-start;
  2434. .aduioLine-content {
  2435. flex: 1;
  2436. }
  2437. .aduioLine-right {
  2438. box-sizing: border-box;
  2439. display: flex;
  2440. align-items: center;
  2441. justify-content: space-between;
  2442. width: 69px;
  2443. height: 40px;
  2444. padding: 0 12px;
  2445. border-left: 1px solid rgba(0, 0, 0, 10%);
  2446. > span {
  2447. width: 16px;
  2448. height: 16px;
  2449. cursor: pointer;
  2450. }
  2451. }
  2452. }
  2453. .NPC-sentences-list {
  2454. // padding: 24px 0;
  2455. overflow: auto;
  2456. .NPC-article-empty {
  2457. display: flex;
  2458. align-items: flex-start;
  2459. justify-content: flex-start;
  2460. > div {
  2461. height: 24px;
  2462. &.empty-left {
  2463. box-sizing: border-box;
  2464. width: 100%;
  2465. &.hasRemark {
  2466. box-sizing: border-box;
  2467. width: 70%;
  2468. border-right: 1px rgba(0, 0, 0, 10%) solid;
  2469. }
  2470. }
  2471. &.empty-right {
  2472. flex: 1;
  2473. }
  2474. }
  2475. &-bottom {
  2476. > div {
  2477. height: 40px;
  2478. }
  2479. }
  2480. }
  2481. }
  2482. .multilingual {
  2483. padding: 6px 24px 12px;
  2484. word-break: break-word;
  2485. }
  2486. .NNPE-detail {
  2487. // overflow: hidden; // 为了不遮挡备注内容
  2488. display: flex;
  2489. align-items: flex-start;
  2490. justify-content: flex-start;
  2491. clear: both;
  2492. color: rgba(0, 0, 0, 100%);
  2493. .para-center {
  2494. display: flex;
  2495. flex-flow: wrap;
  2496. justify-content: center;
  2497. width: 100%;
  2498. }
  2499. .para-right {
  2500. display: flex;
  2501. flex-flow: wrap;
  2502. justify-content: end;
  2503. width: 100%;
  2504. }
  2505. .NNPE-words {
  2506. float: left;
  2507. padding-bottom: 5px;
  2508. &-box {
  2509. float: left;
  2510. > span {
  2511. display: block;
  2512. &.NNPE-pinyin {
  2513. height: 22px;
  2514. font-family: 'League';
  2515. font-size: 14px;
  2516. font-weight: normal;
  2517. line-height: 1.5;
  2518. &.noFont {
  2519. font-family: initial;
  2520. }
  2521. &.textLeft {
  2522. text-align: left;
  2523. }
  2524. }
  2525. &.NNPE-chs {
  2526. display: flex;
  2527. flex-flow: wrap;
  2528. align-items: center;
  2529. font-family: '楷体';
  2530. font-size: 20px;
  2531. line-height: 1.4;
  2532. &.active {
  2533. color: #de4444;
  2534. }
  2535. }
  2536. &.padding {
  2537. padding: 0 3px;
  2538. }
  2539. }
  2540. }
  2541. &.textLeft {
  2542. text-align: left;
  2543. }
  2544. &.textCenter {
  2545. text-align: center;
  2546. .NNPE-chs {
  2547. justify-content: center;
  2548. }
  2549. }
  2550. &.textRight {
  2551. text-align: right;
  2552. }
  2553. > span {
  2554. display: block;
  2555. &.NNPE-pinyin {
  2556. height: 22px;
  2557. font-family: 'League';
  2558. font-size: 14px;
  2559. font-weight: normal;
  2560. line-height: 1.5;
  2561. &.noFont {
  2562. font-family: initial;
  2563. }
  2564. &.textLeft {
  2565. text-align: left;
  2566. }
  2567. }
  2568. &.NNPE-chs {
  2569. display: flex;
  2570. flex-flow: wrap;
  2571. align-items: center;
  2572. font-family: '楷体';
  2573. font-size: 20px;
  2574. line-height: 1.4;
  2575. &.active {
  2576. color: #de4444;
  2577. }
  2578. }
  2579. &.padding {
  2580. padding: 0 3px;
  2581. }
  2582. }
  2583. }
  2584. &.NNPE-detail-title {
  2585. .wordsList-box {
  2586. > div {
  2587. display: flex;
  2588. flex-flow: wrap;
  2589. justify-content: center;
  2590. width: 100%;
  2591. }
  2592. }
  2593. }
  2594. .index {
  2595. box-sizing: border-box;
  2596. width: 48px;
  2597. padding: 8px;
  2598. text-align: right;
  2599. border-right: 1px solid rgba(0, 0, 0, 10%);
  2600. b {
  2601. font-weight: 400;
  2602. line-height: 1.5;
  2603. color: #000;
  2604. }
  2605. }
  2606. .wordsList-box {
  2607. // display: flex;
  2608. width: 100%;
  2609. padding: 6px 24px 12px;
  2610. &-left {
  2611. justify-content: flex-start;
  2612. }
  2613. &-center {
  2614. justify-content: center;
  2615. }
  2616. &-right {
  2617. justify-content: flex-end;
  2618. }
  2619. > div {
  2620. overflow: hidden;
  2621. clear: both;
  2622. }
  2623. > img {
  2624. display: block;
  2625. max-width: 100%;
  2626. margin: 0 auto;
  2627. }
  2628. }
  2629. }
  2630. .article-content {
  2631. box-sizing: border-box;
  2632. // display: flex;
  2633. // align-items: flex-start;
  2634. // justify-content: flex-start;
  2635. width: 100%;
  2636. &.hasRemark {
  2637. width: 70%;
  2638. padding: 8px 0 8px 23px;
  2639. border-right: 1px rgba(0, 0, 0, 10%) solid;
  2640. }
  2641. &.paraLast {
  2642. padding-bottom: 24px;
  2643. }
  2644. }
  2645. .remarkBox {
  2646. position: relative;
  2647. display: flex;
  2648. flex: 1;
  2649. align-items: center;
  2650. justify-content: center;
  2651. &.remark72 {
  2652. padding-top: 72px;
  2653. }
  2654. &.remark-top {
  2655. padding-top: 44px;
  2656. }
  2657. &.remark-top-8 {
  2658. padding-top: 8px;
  2659. }
  2660. }
  2661. .NNPE-wordDetail {
  2662. position: fixed;
  2663. top: 50%;
  2664. left: 50%;
  2665. z-index: 116;
  2666. max-width: 100%;
  2667. margin-top: -196px;
  2668. overflow: auto;
  2669. // box-shadow: 0 4px 16px rgba(0, 0, 0, 15%);
  2670. // width: 260px;
  2671. // height: 200px;
  2672. // background: #cc0;
  2673. }
  2674. .NNPE-detail-box {
  2675. box-sizing: border-box;
  2676. width: 100%;
  2677. padding: 8px 24px;
  2678. margin-bottom: 8px;
  2679. &.active {
  2680. background: rgba(222, 68, 68, 15%);
  2681. }
  2682. }
  2683. .NNPE-details {
  2684. overflow: hidden;
  2685. clear: both;
  2686. .NNPE-words {
  2687. float: left;
  2688. &-box {
  2689. float: left;
  2690. > span {
  2691. display: block;
  2692. &.NNPE-pinyin {
  2693. height: 20px;
  2694. font-family: 'League';
  2695. font-size: 14px;
  2696. font-weight: normal;
  2697. line-height: 20px;
  2698. color: rgba(0, 0, 0, 65%);
  2699. &.noFont {
  2700. font-family: initial;
  2701. }
  2702. &.textLeft {
  2703. text-align: left;
  2704. }
  2705. &.wordBlank {
  2706. color: rgba(0, 0, 0, 65%);
  2707. }
  2708. }
  2709. &.NNPE-chs {
  2710. display: flex;
  2711. flex-flow: wrap;
  2712. align-items: center;
  2713. font-family: '楷体';
  2714. font-size: 20px;
  2715. line-height: 28px;
  2716. color: rgba(0, 0, 0, 65%);
  2717. &.active {
  2718. color: #de4444;
  2719. }
  2720. &.wordBlank {
  2721. color: rgba(0, 0, 0, 65%);
  2722. }
  2723. }
  2724. // &.padding {
  2725. // padding-right: 6px;
  2726. // }
  2727. }
  2728. }
  2729. &.textLeft {
  2730. text-align: left;
  2731. }
  2732. &.textCenter {
  2733. text-align: center;
  2734. .NNPE-chs {
  2735. justify-content: center;
  2736. }
  2737. }
  2738. &.textRight {
  2739. text-align: right;
  2740. }
  2741. > span {
  2742. display: block;
  2743. &.NNPE-pinyin {
  2744. height: 20px;
  2745. font-family: 'League';
  2746. font-size: 14px;
  2747. font-weight: normal;
  2748. line-height: 20px;
  2749. color: rgba(0, 0, 0, 65%);
  2750. &.noFont {
  2751. font-family: initial;
  2752. }
  2753. &.textLeft {
  2754. text-align: left;
  2755. }
  2756. &.wordBlank {
  2757. color: rgba(0, 0, 0, 65%);
  2758. }
  2759. }
  2760. &.NNPE-chs {
  2761. display: flex;
  2762. flex-flow: wrap;
  2763. align-items: center;
  2764. font-family: '楷体';
  2765. font-size: 20px;
  2766. line-height: 28px;
  2767. color: rgba(0, 0, 0, 65%);
  2768. &.active {
  2769. color: #de4444;
  2770. }
  2771. &.wordBlank {
  2772. color: rgba(0, 0, 0, 65%);
  2773. }
  2774. }
  2775. &.padding {
  2776. padding: 0 3px;
  2777. }
  2778. }
  2779. }
  2780. }
  2781. .enwords {
  2782. padding-left: 3px;
  2783. font-family: 'Helvetica';
  2784. font-size: 14px;
  2785. font-weight: normal;
  2786. line-height: 22px;
  2787. color: rgba(0, 0, 0, 65%);
  2788. word-break: break-word;
  2789. &.wordBlank {
  2790. color: rgba(0, 0, 0, 65%);
  2791. }
  2792. }
  2793. .multilingual-para {
  2794. text-indent: 40px;
  2795. word-break: break-word;
  2796. &-center,
  2797. &.multilingual-center {
  2798. text-align: center;
  2799. text-indent: 0;
  2800. }
  2801. &.multilingual-right {
  2802. text-align: right;
  2803. }
  2804. }
  2805. }
  2806. </style>
  2807. <style lang="scss">
  2808. .article-bubble.el-tooltip__popper.is-light {
  2809. max-width: 530px;
  2810. border-color: #fff;
  2811. box-shadow: 0 4px 16px rgba(0, 0, 0, 15%);
  2812. }
  2813. .article-bubble.el-tooltip__popper .popper__arrow,
  2814. .article-bubble.el-tooltip__popper .popper__arrow::before {
  2815. border-bottom-color: transparent !important;
  2816. }
  2817. </style>