NormalModelChs.vue 95 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334
  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="artNormalAudio"
  18. :mp3="curQue.mp3_list[0].url"
  19. :get-cur-time="getCurTime"
  20. :duration="curQue.mp3_list[0].media_duration"
  21. :mp3-source="curQue.mp3_list[0].source"
  22. :width="colLength == 2 ? 200 : 700"
  23. :ed="ed"
  24. type="audioLine"
  25. :attrib="attrib"
  26. @emptyEd="emptyEd"
  27. />
  28. </template>
  29. </div>
  30. <div class="aduioLine-right">
  31. <SvgIcon
  32. v-if="config.isHasPY"
  33. icon-class="pin-btn"
  34. size="16"
  35. :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
  36. :style="{ color: config.isShowPY ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
  37. @click="changePinyin"
  38. />
  39. <SvgIcon
  40. v-if="config.isHasEN"
  41. icon-class="en-btn"
  42. size="16"
  43. :class="['EN-16', config.isShowEN ? '' : 'disabled']"
  44. :style="{ color: config.isShowEN ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
  45. @click="changeEN"
  46. />
  47. </div>
  48. </div>
  49. <div
  50. :style="{
  51. height: curQue.property.content_height ? curQue.property.content_height + 'px' : '',
  52. overflow: 'auto',
  53. }"
  54. >
  55. <template v-if="!config.isHasEN || (config.isHasEN && !config.isShowEN)">
  56. <template v-if="resArr.length > 0">
  57. <div class="NPC-sentences-list">
  58. <div class="NPC-article-empty">
  59. <div
  60. :class="['empty-left', isHasRemark ? 'hasRemark' : '']"
  61. :style="{ width: curQue.property.remarkWidth ? 100 - curQue.property.remarkWidth * 1 + '%' : '' }"
  62. ></div>
  63. <div class="empty-right"></div>
  64. </div>
  65. <div
  66. v-for="(item, index) in resArr"
  67. :key="'detail' + index"
  68. :class="['NNPE-detail', item.isTitle ? 'NNPE-detail-title' : '']"
  69. >
  70. <div
  71. class="wordsList-box"
  72. :class="[
  73. curQue.detail[index].paragraphAttr
  74. ? 'wordsList-box-' + curQue.detail[index].paragraphAttr.paragraphAlign
  75. : '',
  76. 'article-content',
  77. isHasRemark ? 'hasRemark' : '',
  78. ]"
  79. :style="{
  80. width: isHasRemark && curQue.property.remarkWidth ? 100 - curQue.property.remarkWidth * 1 + '%' : '',
  81. }"
  82. >
  83. <template v-if="item.sourceList.length > 0 && item.sourcePosition === 'before'">
  84. <img
  85. v-if="item.sourceList[0] && item.sourceList[0].type === 'image'"
  86. :src="item.sourceList[0].file_url_open"
  87. :style="{
  88. width: item.widthNumber + 'px',
  89. height: item.heightNumber + 'px',
  90. }"
  91. />
  92. <video
  93. :src="item.sourceList[0].file_url_open"
  94. width="100%"
  95. height="400"
  96. controls
  97. controlsList="nodownload"
  98. v-else
  99. ></video>
  100. </template>
  101. <div :class="[item.isTitle ? 'NNPE-title' : '', 'para-' + item.paraAlign]">
  102. <div
  103. v-for="(pItem, pIndex) in item.wordsList"
  104. :key="'wordsList' + pIndex"
  105. class="NNPE-words"
  106. :class="[
  107. pItem.chs != '“' && pItem.wordIndex == 0 ? 'textLeft' : 'textCenter',
  108. pItem.chs == '“' ? 'textRight' : '',
  109. ]"
  110. @click="
  111. handleChangeTime(
  112. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  113. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  114. pItem.articleSentIndex,
  115. )
  116. "
  117. @mouseover="handleMouseover(pItem)"
  118. @mouseleave="handleMouseleave"
  119. >
  120. <template v-if="!pItem.width">
  121. <template v-if="pItem.isShow">
  122. <template
  123. v-if="
  124. item.wordsList[pIndex + 1] &&
  125. item.wordsList[pIndex + 1].chs &&
  126. (chsFhList.indexOf(item.wordsList[pIndex + 1].chs) > -1 ||
  127. NumberList.indexOf(item.wordsList[pIndex + 1].chs) > -1)
  128. "
  129. >
  130. <span v-if="pItem.leg > 0" class="NNPE-words-box">
  131. <span
  132. v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
  133. :class="[
  134. 'NNPE-pinyin',
  135. pItem.className ? pItem.className : '',
  136. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  137. ]"
  138. :style="{
  139. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  140. height:
  141. attrib && attrib.pinyin_size
  142. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  143. : '22px',
  144. }"
  145. @click.stop="
  146. viewNotes(
  147. $event,
  148. pItem.pinyin,
  149. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  150. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  151. pItem.articleSentIndex,
  152. pItem,
  153. )
  154. "
  155. >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
  156. >
  157. <span
  158. class="NNPE-chs"
  159. :class="[
  160. item.timeList &&
  161. item.timeList[pItem.sentIndex] &&
  162. curTime >= item.timeList[pItem.sentIndex].bg &&
  163. curTime <= item.timeList[pItem.sentIndex].ed &&
  164. curTime
  165. ? 'active'
  166. : '',
  167. pItem.paraIndex == paraIndex && pItem.sentIndex == sentIndex ? 'overActive' : '',
  168. ]"
  169. :style="{
  170. fontFamily: pItem.config.fontFamily,
  171. textDecoration: pItem.config.textDecoration,
  172. borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
  173. fontWeight: pItem.config.fontWeight,
  174. height:
  175. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  176. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  177. lineHeight:
  178. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  179. backgroundColor:
  180. item.timeList &&
  181. item.timeList[pItem.sentIndex] &&
  182. curTime >= item.timeList[pItem.sentIndex].bg &&
  183. curTime <= item.timeList[pItem.sentIndex].ed &&
  184. curTime &&
  185. attrib
  186. ? attrib.assist_color
  187. : '',
  188. }"
  189. >
  190. <template>
  191. <span
  192. v-for="(wItem, wIndex) in pItem.leg"
  193. :key="'ci' + wIndex + pIndex + index"
  194. :class="[
  195. pItem.chstimeList &&
  196. pItem.chstimeList[wIndex] &&
  197. curTime >= pItem.chstimeList[wIndex].wordBg &&
  198. curTime < item.timeList[pItem.sentIndex].ed
  199. ? 'wordActive'
  200. : '',
  201. ]"
  202. :style="{
  203. color:
  204. pItem.chstimeList &&
  205. pItem.chstimeList[wIndex] &&
  206. curTime >= pItem.chstimeList[wIndex].wordBg &&
  207. curTime < item.timeList[pItem.sentIndex].ed &&
  208. attrib
  209. ? attrib.topic_color
  210. : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
  211. ? pItem.matchNotesObj.notesColor
  212. : pItem.config.color,
  213. }"
  214. @click.stop="
  215. viewNotes(
  216. $event,
  217. pItem.chs[wIndex],
  218. item.timeList &&
  219. item.timeList[pItem.sentIndex] &&
  220. item.timeList[pItem.sentIndex].bg,
  221. item.timeList &&
  222. item.timeList[pItem.sentIndex] &&
  223. item.timeList[pItem.sentIndex].ed,
  224. pItem.articleSentIndex,
  225. pItem,
  226. )
  227. "
  228. >{{ convertText(pItem.chs[wIndex]) }}</span
  229. >
  230. <img
  231. v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
  232. :src="pItem.img[0].file_url"
  233. :style="{
  234. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  235. }"
  236. />
  237. </template>
  238. </span>
  239. <span
  240. v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
  241. :class="[
  242. 'NNPE-pinyin',
  243. pItem.className ? pItem.className : '',
  244. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  245. ]"
  246. :style="{
  247. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  248. height:
  249. attrib && attrib.pinyin_size
  250. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  251. : '22px',
  252. }"
  253. @click.stop="
  254. viewNotes(
  255. $event,
  256. pItem.pinyin,
  257. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  258. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  259. pItem.articleSentIndex,
  260. pItem,
  261. )
  262. "
  263. >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
  264. >
  265. </span>
  266. <span class="NNPE-words-box">
  267. <span
  268. v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
  269. :class="[
  270. 'NNPE-pinyin',
  271. noFont.indexOf(item.wordsList[pIndex + 1].pinyin) > -1 ? 'noFont' : '',
  272. ]"
  273. style="text-align: left"
  274. :style="{
  275. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  276. height:
  277. attrib && attrib.pinyin_size
  278. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  279. : '22px',
  280. }"
  281. @click.stop="
  282. viewNotes(
  283. $event,
  284. item.wordsList[pIndex + 1].pinyin,
  285. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  286. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  287. pItem.articleSentIndex,
  288. pItem,
  289. )
  290. "
  291. >{{
  292. NumberList.indexOf(item.wordsList[pIndex + 1].pinyin) == -1
  293. ? item.wordsList[pIndex + 1].pinyin
  294. : ''
  295. }}</span
  296. >
  297. <span
  298. class="NNPE-chs"
  299. style="text-align: left"
  300. :class="[
  301. item.timeList &&
  302. item.timeList[pItem.sentIndex] &&
  303. curTime >= item.timeList[pItem.sentIndex].bg &&
  304. curTime <= item.timeList[pItem.sentIndex].ed &&
  305. curTime
  306. ? 'active'
  307. : '',
  308. pItem.paraIndex == paraIndex && pItem.sentIndex == sentIndex ? 'overActive' : '',
  309. pItem.chstimeList &&
  310. pItem.chstimeList[pItem.leg - 1] &&
  311. curTime >= pItem.chstimeList[pItem.leg - 1].wordBg &&
  312. curQue.wordTime &&
  313. curTime <= item.timeList[pItem.sentIndex].ed
  314. ? 'wordActive'
  315. : '',
  316. ]"
  317. :style="{
  318. fontFamily: item.wordsList[pIndex + 1].config.fontFamily,
  319. textDecoration: item.wordsList[pIndex + 1].config.textDecoration,
  320. borderBottom: item.wordsList[pIndex + 1].config.border === 'dotted' ? '1px dotted' : '',
  321. fontWeight: item.wordsList[pIndex + 1].config.fontWeight,
  322. height:
  323. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  324. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  325. lineHeight:
  326. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  327. width: item.wordsList[pIndex + 1].chs.trim() === '' ? '6px' : '',
  328. backgroundColor:
  329. item.timeList &&
  330. item.timeList[pItem.sentIndex] &&
  331. curTime >= item.timeList[pItem.sentIndex].bg &&
  332. curTime <= item.timeList[pItem.sentIndex].ed &&
  333. curTime &&
  334. attrib
  335. ? attrib.assist_color
  336. : '',
  337. color:
  338. pItem.chstimeList &&
  339. pItem.chstimeList[pItem.leg - 1] &&
  340. curTime >= pItem.chstimeList[pItem.leg - 1].wordBg &&
  341. curQue.wordTime &&
  342. curTime <= item.timeList[pItem.sentIndex].ed &&
  343. attrib
  344. ? attrib.topic_color
  345. : item.wordsList[pIndex + 1].matchNotesObj.con &&
  346. item.wordsList[pIndex + 1].matchNotesObj.notesColor
  347. ? item.wordsList[pIndex + 1].matchNotesObj.notesColor
  348. : item.wordsList[pIndex + 1].config.color,
  349. }"
  350. @click.stop="
  351. viewNotes(
  352. $event,
  353. item.wordsList[pIndex + 1].chs,
  354. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  355. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  356. pItem.articleSentIndex,
  357. pItem,
  358. )
  359. "
  360. ><span>{{ convertText(item.wordsList[pIndex + 1].chs) }}</span
  361. ><img
  362. v-if="
  363. item.wordsList[pIndex + 1].img &&
  364. item.wordsList[pIndex + 1].img.length > 0 &&
  365. item.wordsList[pIndex + 1].imgPosition === 'after'
  366. "
  367. :src="item.wordsList[pIndex + 1].img[0].file_url"
  368. :style="{
  369. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  370. }"
  371. /></span>
  372. <span
  373. v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
  374. :class="[
  375. 'NNPE-pinyin',
  376. noFont.indexOf(item.wordsList[pIndex + 1].pinyin) > -1 ? 'noFont' : '',
  377. ]"
  378. style="text-align: left"
  379. :style="{
  380. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  381. height:
  382. attrib && attrib.pinyin_size
  383. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  384. : '22px',
  385. }"
  386. @click.stop="
  387. viewNotes(
  388. $event,
  389. item.wordsList[pIndex + 1].pinyin,
  390. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  391. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  392. pItem.articleSentIndex,
  393. pItem,
  394. )
  395. "
  396. >{{
  397. NumberList.indexOf(item.wordsList[pIndex + 1].pinyin) == -1
  398. ? item.wordsList[pIndex + 1].pinyin
  399. : ''
  400. }}</span
  401. >
  402. </span>
  403. <span
  404. v-if="
  405. item.wordsList[pIndex + 2] &&
  406. item.wordsList[pIndex + 2].chs &&
  407. (chsFhList.indexOf(item.wordsList[pIndex + 2].chs) > -1 ||
  408. NumberList.indexOf(item.wordsList[pIndex + 2].chs) > -1)
  409. "
  410. class="NNPE-words-box"
  411. >
  412. <span
  413. v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
  414. :class="[
  415. 'NNPE-pinyin',
  416. noFont.indexOf(item.wordsList[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
  417. ]"
  418. style="text-align: left"
  419. :style="{
  420. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  421. height:
  422. attrib && attrib.pinyin_size
  423. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  424. : '22px',
  425. }"
  426. @click.stop="
  427. viewNotes(
  428. $event,
  429. item.wordsList[pIndex + 2].pinyin,
  430. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  431. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  432. pItem.articleSentIndex,
  433. pItem,
  434. )
  435. "
  436. >{{
  437. NumberList.indexOf(item.wordsList[pIndex + 2].pinyin) == -1
  438. ? item.wordsList[pIndex + 2].pinyin
  439. : ''
  440. }}</span
  441. >
  442. <span
  443. class="NNPE-chs"
  444. style="text-align: left"
  445. :class="[
  446. item.timeList &&
  447. item.timeList[pItem.sentIndex] &&
  448. curTime >= item.timeList[pItem.sentIndex].bg &&
  449. curTime <= item.timeList[pItem.sentIndex].ed &&
  450. curTime
  451. ? 'active'
  452. : '',
  453. pItem.paraIndex == paraIndex && pItem.sentIndex == sentIndex ? 'overActive' : '',
  454. pItem.chstimeList &&
  455. pItem.chstimeList[pItem.leg - 1] &&
  456. curTime >= pItem.chstimeList[pItem.leg - 1].wordBg &&
  457. curQue.wordTime &&
  458. curTime <= item.timeList[pItem.sentIndex].ed
  459. ? 'wordActive'
  460. : '',
  461. ]"
  462. :style="{
  463. fontFamily: item.wordsList[pIndex + 2].config.fontFamily,
  464. textDecoration: item.wordsList[pIndex + 2].config.textDecoration,
  465. borderBottom: item.wordsList[pIndex + 2].config.border === 'dotted' ? '1px dotted' : '',
  466. fontWeight: item.wordsList[pIndex + 2].config.fontWeight,
  467. height:
  468. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  469. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  470. lineHeight:
  471. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  472. width: item.wordsList[pIndex + 2].chs.trim() === '' ? '6px' : '',
  473. backgroundColor:
  474. item.timeList &&
  475. item.timeList[pItem.sentIndex] &&
  476. curTime >= item.timeList[pItem.sentIndex].bg &&
  477. curTime <= item.timeList[pItem.sentIndex].ed &&
  478. curTime &&
  479. attrib
  480. ? attrib.assist_color
  481. : '',
  482. color:
  483. pItem.chstimeList &&
  484. pItem.chstimeList[pItem.leg - 1] &&
  485. curTime >= pItem.chstimeList[pItem.leg - 1].wordBg &&
  486. curQue.wordTime &&
  487. curTime <= item.timeList[pItem.sentIndex].ed &&
  488. attrib
  489. ? attrib.topic_color
  490. : item.wordsList[pIndex + 1].matchNotesObj.con &&
  491. item.wordsList[pIndex + 1].matchNotesObj.notesColor
  492. ? item.wordsList[pIndex + 2].matchNotesObj.notesColor
  493. : item.wordsList[pIndex + 2].config.color,
  494. }"
  495. @click.stop="
  496. viewNotes(
  497. $event,
  498. item.wordsList[pIndex + 2].chs,
  499. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  500. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  501. pItem.articleSentIndex,
  502. pItem,
  503. )
  504. "
  505. ><span>{{ convertText(item.wordsList[pIndex + 2].chs) }}</span
  506. ><img
  507. v-if="
  508. item.wordsList[pIndex + 2].img &&
  509. item.wordsList[pIndex + 2].img.length > 0 &&
  510. item.wordsList[pIndex + 2].imgPosition === 'after'
  511. "
  512. :src="item.wordsList[pIndex + 2].img[0].file_url"
  513. :style="{
  514. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  515. }"
  516. /></span>
  517. <span
  518. v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
  519. :class="[
  520. 'NNPE-pinyin',
  521. noFont.indexOf(item.wordsList[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
  522. ]"
  523. style="text-align: left"
  524. :style="{
  525. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  526. height:
  527. attrib && attrib.pinyin_size
  528. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  529. : '22px',
  530. }"
  531. @click.stop="
  532. viewNotes(
  533. $event,
  534. item.wordsList[pIndex + 2].pinyin,
  535. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  536. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  537. pItem.articleSentIndex,
  538. pItem,
  539. )
  540. "
  541. >{{
  542. NumberList.indexOf(item.wordsList[pIndex + 2].pinyin) == -1
  543. ? item.wordsList[pIndex + 2].pinyin
  544. : ''
  545. }}</span
  546. >
  547. </span>
  548. </template>
  549. <template v-else>
  550. <span
  551. v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
  552. class="NNPE-pinyin"
  553. :class="[
  554. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  555. pItem.className ? pItem.className : '',
  556. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  557. ]"
  558. :style="{
  559. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  560. height:
  561. attrib && attrib.pinyin_size
  562. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  563. : '22px',
  564. }"
  565. @click.stop="
  566. viewNotes(
  567. $event,
  568. pItem.pinyin,
  569. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  570. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  571. pItem.articleSentIndex,
  572. pItem,
  573. )
  574. "
  575. >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
  576. >
  577. <span
  578. class="NNPE-chs"
  579. :class="[
  580. item.timeList &&
  581. item.timeList[pItem.sentIndex] &&
  582. curTime >= item.timeList[pItem.sentIndex].bg &&
  583. curTime <= item.timeList[pItem.sentIndex].ed &&
  584. curTime
  585. ? 'active'
  586. : '',
  587. pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
  588. pItem.paraIndex == paraIndex && pItem.sentIndex == sentIndex ? 'overActive' : '',
  589. ]"
  590. :style="{
  591. backgroundColor:
  592. item.timeList &&
  593. item.timeList[pItem.sentIndex] &&
  594. curTime >= item.timeList[pItem.sentIndex].bg &&
  595. curTime <= item.timeList[pItem.sentIndex].ed &&
  596. curTime &&
  597. attrib
  598. ? attrib.assist_color
  599. : '',
  600. }"
  601. >
  602. <template v-for="(wItem, wIndex) in pItem.leg">
  603. <span
  604. :key="'ci' + wIndex + pIndex + index"
  605. :class="[
  606. pItem.chstimeList &&
  607. pItem.chstimeList[wIndex] &&
  608. curTime >= pItem.chstimeList[wIndex].wordBg &&
  609. curTime < item.timeList[pItem.sentIndex].ed
  610. ? 'wordActive'
  611. : '',
  612. ]"
  613. :style="{
  614. fontFamily: pItem.config.fontFamily,
  615. textDecoration: pItem.config.textDecoration,
  616. borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
  617. fontWeight: pItem.config.fontWeight,
  618. height:
  619. attrib && attrib.font_size
  620. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  621. : '28px',
  622. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  623. lineHeight:
  624. attrib && attrib.font_size
  625. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  626. : '28px',
  627. width: pItem.chs[wIndex].trim() === '' ? '6px' : '',
  628. color:
  629. pItem.chstimeList &&
  630. pItem.chstimeList[wIndex] &&
  631. curTime >= pItem.chstimeList[wIndex].wordBg &&
  632. curTime < item.timeList[pItem.sentIndex].ed &&
  633. attrib
  634. ? attrib.topic_color
  635. : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
  636. ? pItem.matchNotesObj.notesColor
  637. : pItem.config.color,
  638. }"
  639. @click.stop="
  640. viewNotes(
  641. $event,
  642. pItem.chs[wIndex],
  643. item.timeList &&
  644. item.timeList[pItem.sentIndex] &&
  645. item.timeList[pItem.sentIndex].bg,
  646. item.timeList &&
  647. item.timeList[pItem.sentIndex] &&
  648. item.timeList[pItem.sentIndex].ed,
  649. pItem.articleSentIndex,
  650. pItem,
  651. )
  652. "
  653. >{{ convertText(pItem.chs[wIndex]) }}</span
  654. >
  655. </template>
  656. <img
  657. v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
  658. :src="pItem.img[0].file_url"
  659. :style="{
  660. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  661. }"
  662. />
  663. </span>
  664. <span
  665. v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
  666. class="NNPE-pinyin"
  667. :class="[
  668. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  669. pItem.className ? pItem.className : '',
  670. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  671. ]"
  672. :style="{
  673. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  674. height:
  675. attrib && attrib.pinyin_size
  676. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  677. : '22px',
  678. }"
  679. @click.stop="
  680. viewNotes(
  681. $event,
  682. pItem.pinyin,
  683. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  684. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  685. pItem.articleSentIndex,
  686. pItem,
  687. )
  688. "
  689. >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
  690. >
  691. </template>
  692. </template>
  693. </template>
  694. <template v-else>
  695. <span
  696. :style="{
  697. height: pItem.height + 'px',
  698. width: pItem.width + 'px',
  699. }"
  700. ></span>
  701. </template>
  702. </div>
  703. </div>
  704. <div
  705. v-if="curQue.property.multilingual_position === 'para'"
  706. class="multilingual-para"
  707. :class="[item.isTitle ? 'multilingual-para-center' : '', 'multilingual-' + item.paraAlign]"
  708. >
  709. {{
  710. curQue.detail[index].multilingualTextList && curQue.detail[index].multilingualTextList[multilingual]
  711. ? curQue.detail[index].multilingualTextList[multilingual].join(' ')
  712. : ''
  713. }}
  714. </div>
  715. <template v-if="item.sourceList.length > 0 && item.sourcePosition === 'after'">
  716. <img
  717. v-if="item.sourceList[0] && item.sourceList[0].type === 'image'"
  718. :src="item.sourceList[0].file_url_open"
  719. :style="{
  720. width: item.widthNumber + 'px',
  721. height: item.heightNumber + 'px',
  722. }"
  723. />
  724. <video
  725. :src="item.sourceList[0].file_url_open"
  726. width="100%"
  727. height="400"
  728. controls
  729. controlsList="nodownload"
  730. v-else
  731. ></video>
  732. </template>
  733. </div>
  734. <div
  735. v-if="
  736. item.remarkDetail &&
  737. (item.remarkDetail.chs ||
  738. item.remarkDetail.en ||
  739. (item.remarkDetail.img_list && item.remarkDetail.img_list.length > 0))
  740. "
  741. :class="['remarkBox', 'remark-top-8']"
  742. >
  743. <RemarkChs :remark-detail="item.remarkDetail" :margin-top="8" />
  744. </div>
  745. </div>
  746. </div>
  747. </template>
  748. </template>
  749. <template v-else>
  750. <template v-if="resObj">
  751. <!-- 段落对齐方式和备注在此模式里没有写,如果段落里添加了英文后需要在此添加段落对齐和备注、大小图片、生词样式 -->
  752. <div class="NPC-sentences-list">
  753. <div
  754. v-for="(item, index) in resObj.sentList"
  755. :key="'detail' + index"
  756. :class="['NNPE-detail-box', sentIndex == index ? 'active' : '']"
  757. >
  758. <div
  759. :class="['NNPE-details']"
  760. @click="
  761. handleChangeTime(
  762. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  763. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  764. index,
  765. )
  766. "
  767. >
  768. <div
  769. v-if="item.enwords && config.isShowEN && curQue.enPosition && curQue.enPosition == 'top'"
  770. :class="['enwords', sentIndex == index ? 'wordBlank' : '']"
  771. >
  772. {{ item.enwords }}
  773. </div>
  774. <div style="overflow: hidden; clear: both"></div>
  775. <div
  776. v-for="(pItem, pIndex) in item.sentArr"
  777. :key="'wordsList' + pIndex"
  778. class="NNPE-words"
  779. :class="[
  780. pItem.chs != '“' && pItem.wordIndex == 0 ? 'textLeft' : 'textCenter',
  781. pItem.chs == '“' ? 'textRight' : '',
  782. ]"
  783. >
  784. <template v-if="!pItem.width">
  785. <template v-if="pItem.isShow">
  786. <template
  787. v-if="
  788. item.sentArr[pIndex + 1] &&
  789. item.sentArr[pIndex + 1].chs &&
  790. (chsFhList.indexOf(item.sentArr[pIndex + 1].chs) > -1 ||
  791. NumberList.indexOf(item.sentArr[pIndex + 1].chs) > -1)
  792. "
  793. >
  794. <span class="NNPE-words-box">
  795. <template v-if="curQue.property.pinyin_position == 'top'">
  796. <span
  797. v-if="config.isShowPY"
  798. class="NNPE-pinyin"
  799. :class="[
  800. pItem.className ? pItem.className : '',
  801. sentIndex == index ? 'wordBlank' : '',
  802. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  803. ]"
  804. :style="{
  805. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  806. height:
  807. attrib && attrib.pinyin_size
  808. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  809. : '22px',
  810. }"
  811. @click.stop="
  812. viewNotes(
  813. $event,
  814. pItem.pinyin,
  815. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  816. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  817. index,
  818. pItem,
  819. )
  820. "
  821. >{{ pItem.pinyin }}</span
  822. >
  823. </template>
  824. <span
  825. class="NNPE-chs"
  826. :class="[
  827. pItem.padding && config.isShowPY ? 'padding' : '',
  828. sentIndex == index ? 'wordBlank' : '',
  829. ]"
  830. >
  831. <template v-for="(wItem, wIndex) in pItem.leg">
  832. <span
  833. :key="'ci' + wIndex + pIndex + index"
  834. :class="[
  835. pItem.timeList[wIndex] &&
  836. curTime >= pItem.timeList[wIndex].wordBg &&
  837. curTime <= curQue.wordTime[index].ed &&
  838. curTime
  839. ? 'active'
  840. : '',
  841. sentIndex == index ? 'wordBlank' : '',
  842. ]"
  843. :style="{
  844. fontFamily: pItem.config.fontFamily,
  845. color: pItem.config.color,
  846. textDecoration: pItem.config.textDecoration,
  847. borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
  848. fontWeight: pItem.config.fontWeight,
  849. height:
  850. attrib && attrib.font_size
  851. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  852. : '28px',
  853. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  854. lineHeight:
  855. attrib && attrib.font_size
  856. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  857. : '28px',
  858. width: pItem.chs[wIndex].trim() === '' ? '6px' : '',
  859. }"
  860. @click.stop="
  861. viewNotes(
  862. $event,
  863. pItem.chs[wIndex],
  864. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  865. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  866. index,
  867. pItem,
  868. )
  869. "
  870. >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs[wIndex] : '' }}</span
  871. >
  872. </template>
  873. </span>
  874. <template v-if="curQue.property.pinyin_position == 'bottom'">
  875. <span
  876. v-if="config.isShowPY"
  877. class="NNPE-pinyin"
  878. :class="[
  879. pItem.className ? pItem.className : '',
  880. sentIndex == index ? 'wordBlank' : '',
  881. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  882. ]"
  883. :style="{
  884. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  885. height:
  886. attrib && attrib.pinyin_size
  887. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  888. : '22px',
  889. }"
  890. @click.stop="
  891. viewNotes(
  892. $event,
  893. pItem.pinyin,
  894. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  895. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  896. index,
  897. pItem,
  898. )
  899. "
  900. >{{ pItem.pinyin }}</span
  901. >
  902. </template>
  903. </span>
  904. <span class="NNPE-words-box">
  905. <template v-if="curQue.property.pinyin_position == 'top'">
  906. <span
  907. v-if="config.isShowPY"
  908. :class="[
  909. 'NNPE-pinyin',
  910. sentIndex == index ? 'wordBlank' : '',
  911. noFont.indexOf(item.sentArr[pIndex + 1].pinyin) > -1 ? 'noFont' : '',
  912. ]"
  913. style="text-align: left"
  914. :style="{
  915. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  916. height:
  917. attrib && attrib.pinyin_size
  918. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  919. : '22px',
  920. }"
  921. @click.stop="
  922. viewNotes(
  923. $event,
  924. item.sentArr[pIndex + 1].pinyin,
  925. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  926. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  927. index,
  928. item.sentArr[pIndex + 1],
  929. )
  930. "
  931. >{{ item.sentArr[pIndex + 1].pinyin }}</span
  932. >
  933. </template>
  934. <span
  935. class="NNPE-chs"
  936. style="text-align: left"
  937. :style="{
  938. height:
  939. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  940. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  941. lineHeight:
  942. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  943. }"
  944. >
  945. <span
  946. :class="[
  947. pItem.timeList[pItem.leg - 1] &&
  948. curQue.wordTime &&
  949. curTime >= pItem.timeList[pItem.leg - 1].wordBg &&
  950. curTime <= curQue.wordTime[index].ed &&
  951. curTime
  952. ? 'active'
  953. : '',
  954. sentIndex == index ? 'wordBlank' : '',
  955. ]"
  956. :style="{
  957. fontFamily: item.sentArr[pIndex + 1].config.fontFamily,
  958. color: item.sentArr[pIndex + 1].config.color,
  959. textDecoration: item.sentArr[pIndex + 1].config.textDecoration,
  960. borderBottom: item.sentArr[pIndex + 1].config.border === 'dotted' ? '1px dotted' : '',
  961. fontWeight: item.sentArr[pIndex + 1].config.fontWeight,
  962. height:
  963. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  964. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  965. lineHeight:
  966. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  967. width: item.sentArr[pIndex + 1].chs.trim() === '' ? '6px' : '',
  968. }"
  969. @click.stop="
  970. viewNotes(
  971. $event,
  972. item.sentArr[pIndex + 1].chs,
  973. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  974. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  975. index,
  976. item.sentArr[pIndex + 1],
  977. )
  978. "
  979. >
  980. {{
  981. NumberList.indexOf(item.sentArr[pIndex + 1].pinyin) == -1
  982. ? item.sentArr[pIndex + 1].chs
  983. : ''
  984. }}</span
  985. >
  986. </span>
  987. <template v-if="curQue.property.pinyin_position == 'bottom'">
  988. <span
  989. v-if="config.isShowPY"
  990. :class="[
  991. 'NNPE-pinyin',
  992. sentIndex == index ? 'wordBlank' : '',
  993. noFont.indexOf(item.sentArr[pIndex + 1].pinyin) > -1 ? 'noFont' : '',
  994. ]"
  995. style="text-align: left"
  996. :style="{
  997. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  998. height:
  999. attrib && attrib.pinyin_size
  1000. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1001. : '22px',
  1002. }"
  1003. @click.stop="
  1004. viewNotes(
  1005. $event,
  1006. item.sentArr[pIndex + 1].pinyin,
  1007. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  1008. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  1009. index,
  1010. item.sentArr[pIndex + 1],
  1011. )
  1012. "
  1013. >{{ item.sentArr[pIndex + 1].pinyin }}</span
  1014. >
  1015. </template>
  1016. </span>
  1017. <span
  1018. v-if="
  1019. item.sentArr[pIndex + 2] &&
  1020. item.sentArr[pIndex + 2].chs &&
  1021. chsFhList.indexOf(item.sentArr[pIndex + 2].chs) > -1
  1022. "
  1023. class="NNPE-words-box"
  1024. >
  1025. <template v-if="curQue.property.pinyin_position == 'top'">
  1026. <span
  1027. v-if="config.isShowPY"
  1028. :class="[
  1029. 'NNPE-pinyin',
  1030. sentIndex == index ? 'wordBlank' : '',
  1031. noFont.indexOf(item.sentArr[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
  1032. ]"
  1033. style="text-align: left"
  1034. :style="{
  1035. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  1036. height:
  1037. attrib && attrib.pinyin_size
  1038. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1039. : '22px',
  1040. }"
  1041. @click.stop="
  1042. viewNotes(
  1043. $event,
  1044. item.sentArr[pIndex + 2].pinyin,
  1045. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  1046. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  1047. index,
  1048. item.sentArr[pIndex + 2],
  1049. )
  1050. "
  1051. >{{ item.sentArr[pIndex + 2].pinyin }}</span
  1052. >
  1053. </template>
  1054. <span class="NNPE-chs" style="text-align: left">
  1055. <span
  1056. :class="[
  1057. pItem.timeList[pItem.leg - 1] &&
  1058. curQue.wordTime &&
  1059. curTime >= pItem.timeList[pItem.leg - 1].wordBg &&
  1060. curTime <= curQue.wordTime[index].ed &&
  1061. curTime
  1062. ? 'active'
  1063. : '',
  1064. sentIndex == index ? 'wordBlank' : '',
  1065. ]"
  1066. :style="{
  1067. fontFamily: item.sentArr[pIndex + 2].config.fontFamily,
  1068. color: item.sentArr[pIndex + 2].config.color,
  1069. textDecoration: item.sentArr[pIndex + 2].config.textDecoration,
  1070. borderBottom: item.sentArr[pIndex + 2].config.border === 'dotted' ? '1px dotted' : '',
  1071. fontWeight: item.sentArr[pIndex + 2].config.fontWeight,
  1072. height:
  1073. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1074. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  1075. lineHeight:
  1076. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1077. width: item.sentArr[pIndex + 2].chs.trim() === '' ? '6px' : '',
  1078. }"
  1079. @click.stop="
  1080. viewNotes(
  1081. $event,
  1082. item.sentArr[pIndex + 2].chs,
  1083. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  1084. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  1085. index,
  1086. item.sentArr[pIndex + 2],
  1087. )
  1088. "
  1089. >
  1090. {{
  1091. NumberList.indexOf(item.sentArr[pIndex + 2].pinyin) == -1
  1092. ? item.sentArr[pIndex + 2].chs
  1093. : ''
  1094. }}</span
  1095. >
  1096. </span>
  1097. <template v-if="curQue.property.pinyin_position == 'bottom'">
  1098. <span
  1099. v-if="config.isShowPY"
  1100. :class="[
  1101. 'NNPE-pinyin',
  1102. sentIndex == index ? 'wordBlank' : '',
  1103. noFont.indexOf(item.sentArr[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
  1104. ]"
  1105. style="text-align: left"
  1106. :style="{
  1107. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  1108. height:
  1109. attrib && attrib.pinyin_size
  1110. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1111. : '22px',
  1112. }"
  1113. @click.stop="
  1114. viewNotes(
  1115. $event,
  1116. item.sentArr[pIndex + 2].pinyin,
  1117. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  1118. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  1119. index,
  1120. item.sentArr[pIndex + 2],
  1121. )
  1122. "
  1123. >{{ item.sentArr[pIndex + 2].pinyin }}</span
  1124. >
  1125. </template>
  1126. </span>
  1127. </template>
  1128. <template v-else>
  1129. <template v-if="curQue.property.pinyin_position == 'top'">
  1130. <span
  1131. v-if="config.isShowPY"
  1132. class="NNPE-pinyin"
  1133. :class="[
  1134. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  1135. pItem.className ? pItem.className : '',
  1136. sentIndex == index ? 'wordBlank' : '',
  1137. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  1138. ]"
  1139. :style="{
  1140. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  1141. height:
  1142. attrib && attrib.pinyin_size
  1143. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1144. : '22px',
  1145. }"
  1146. @click.stop="
  1147. viewNotes(
  1148. $event,
  1149. pItem.pinyin,
  1150. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  1151. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  1152. index,
  1153. pItem,
  1154. )
  1155. "
  1156. >{{ pItem.pinyin }}</span
  1157. >
  1158. </template>
  1159. <span
  1160. class="NNPE-chs"
  1161. :class="[
  1162. pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
  1163. sentIndex == index ? 'wordBlank' : '',
  1164. ]"
  1165. :style="{
  1166. height:
  1167. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1168. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  1169. lineHeight:
  1170. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1171. }"
  1172. >
  1173. <template v-for="(wItem, wIndex) in pItem.leg">
  1174. <span
  1175. :key="'ci' + wIndex + pIndex + index"
  1176. :class="[
  1177. pItem.timeList[wIndex] &&
  1178. curQue.wordTime &&
  1179. curQue.wordTime[index] &&
  1180. curTime >= pItem.timeList[wIndex].wordBg &&
  1181. curTime <= curQue.wordTime[index].ed
  1182. ? 'active'
  1183. : '',
  1184. sentIndex == index ? 'wordBlank' : '',
  1185. ]"
  1186. :style="{
  1187. fontFamily: pItem.config.fontFamily,
  1188. color: pItem.config.color,
  1189. textDecoration: pItem.config.textDecoration,
  1190. borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
  1191. fontWeight: pItem.config.fontWeight,
  1192. height:
  1193. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1194. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  1195. lineHeight:
  1196. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1197. width: pItem.chs[wIndex].trim() === '' ? '6px' : '',
  1198. }"
  1199. @click.stop="
  1200. viewNotes(
  1201. $event,
  1202. pItem.chs[wIndex],
  1203. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  1204. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  1205. index,
  1206. pItem,
  1207. )
  1208. "
  1209. >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs[wIndex] : '' }}</span
  1210. >
  1211. </template>
  1212. </span>
  1213. <template v-if="curQue.property.pinyin_position == 'bottom'">
  1214. <span
  1215. v-if="config.isShowPY"
  1216. class="NNPE-pinyin"
  1217. :class="[
  1218. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  1219. pItem.className ? pItem.className : '',
  1220. sentIndex == index ? 'wordBlank' : '',
  1221. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  1222. ]"
  1223. :style="{
  1224. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  1225. height:
  1226. attrib && attrib.pinyin_size
  1227. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1228. : '22px',
  1229. }"
  1230. @click.stop="
  1231. viewNotes(
  1232. $event,
  1233. pItem.pinyin,
  1234. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  1235. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  1236. index,
  1237. pItem,
  1238. )
  1239. "
  1240. >{{ pItem.pinyin }}</span
  1241. >
  1242. </template>
  1243. </template>
  1244. </template>
  1245. </template>
  1246. <template v-else>
  1247. <span
  1248. :style="{
  1249. height: pItem.height + 'px',
  1250. width: pItem.width + 'px',
  1251. }"
  1252. ></span>
  1253. </template>
  1254. </div>
  1255. <div style="overflow: hidden; clear: both"></div>
  1256. <div
  1257. v-if="
  1258. item.enwords &&
  1259. config.isShowEN &&
  1260. (!curQue.enPosition || (curQue.enPosition && curQue.enPosition == 'bottom'))
  1261. "
  1262. :class="['enwords', sentIndex == index ? 'wordBlank' : '']"
  1263. >
  1264. {{ item.enwords }}
  1265. </div>
  1266. </div>
  1267. <div
  1268. v-if="curQue.property.multilingual_position === 'para'"
  1269. class="multilingual-para"
  1270. :class="[item.isTitle ? 'multilingual-para-center' : '', 'multilingual-' + item.paraAlign]"
  1271. >
  1272. {{ multilingualTextList[multilingual] ? multilingualTextList[multilingual].join(' ') : '' }}
  1273. </div>
  1274. </div>
  1275. </div>
  1276. </template>
  1277. </template>
  1278. <template v-for="(items, indexs) in curQue.detail">
  1279. <div
  1280. v-if="
  1281. curQue.property.multilingual_position === 'all' &&
  1282. items.multilingualTextList &&
  1283. items.multilingualTextList[multilingual] &&
  1284. items.multilingualTextList[multilingual].length > 0
  1285. "
  1286. :key="indexs"
  1287. class="multilingual"
  1288. >
  1289. <div
  1290. class="multilingual-para"
  1291. :class="[items.isTitle ? 'multilingual-para-center' : '', 'multilingual-' + items.paraAlign]"
  1292. >
  1293. {{
  1294. items.multilingualTextList && items.multilingualTextList[multilingual]
  1295. ? items.multilingualTextList[multilingual].join(' ')
  1296. : ''
  1297. }}
  1298. </div>
  1299. </div>
  1300. </template>
  1301. </div>
  1302. <div
  1303. v-if="
  1304. ((curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url) ||
  1305. config.isHasPY ||
  1306. config.isHasEN) &&
  1307. curQue.property.mp3_position === 'bottom'
  1308. "
  1309. class="aduioLine-box aduioLine-practice-npc aduioLine-box-bottom"
  1310. >
  1311. <div class="aduioLine-content">
  1312. <template v-if="curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url">
  1313. <AudioLine
  1314. ref="audioLine"
  1315. audio-id="artNormalAudio"
  1316. :mp3="curQue.mp3_list[0].url"
  1317. :get-cur-time="getCurTime"
  1318. :duration="curQue.mp3_list[0].media_duration"
  1319. :mp3-source="curQue.mp3_list[0].source"
  1320. :width="colLength == 2 ? 200 : 700"
  1321. :ed="ed"
  1322. type="audioLine"
  1323. :attrib="attrib"
  1324. @emptyEd="emptyEd"
  1325. />
  1326. </template>
  1327. </div>
  1328. <div class="aduioLine-right">
  1329. <SvgIcon
  1330. v-if="config.isHasPY"
  1331. icon-class="pin-btn"
  1332. size="16"
  1333. :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
  1334. :style="{ color: config.isShowPY ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
  1335. @click="changePinyin"
  1336. />
  1337. <SvgIcon
  1338. v-if="config.isHasEN"
  1339. icon-class="en-btn"
  1340. size="16"
  1341. :class="['EN-16', config.isShowEN ? '' : 'disabled']"
  1342. :style="{ color: config.isShowEN ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
  1343. @click="changeEN"
  1344. />
  1345. </div>
  1346. </div>
  1347. <template v-if="isNoteShow">
  1348. <div
  1349. ref="notecard"
  1350. class="NNPE-noteDetail"
  1351. :style="{
  1352. marginLeft: windowWidth > 642 ? '-321px' : '0px',
  1353. left: windowWidth > 642 ? '' : '0px',
  1354. width: isMobile ? '100%' : '',
  1355. }"
  1356. >
  1357. <Notecard :item="curNoteCon" :change-card="changeCard" :attrib="attrib" :is-mobile="isMobile" />
  1358. </div>
  1359. </template>
  1360. </div>
  1361. </template>
  1362. <script>
  1363. import AudioLine from '../voice_matrix/components/AudioLine.vue';
  1364. import Notecard from './components/Notecard.vue';
  1365. import RemarkChs from '../dialogue_article/RemarkChs.vue';
  1366. import { data } from 'vis-network';
  1367. export default {
  1368. name: 'NormalModelChs',
  1369. components: {
  1370. AudioLine,
  1371. Notecard,
  1372. RemarkChs,
  1373. },
  1374. props: [
  1375. 'curQue',
  1376. 'noFont',
  1377. 'config',
  1378. 'NNPEAnnotationList',
  1379. 'colLength',
  1380. 'themeColor',
  1381. 'multilingual',
  1382. 'attrib',
  1383. 'isMobile',
  1384. ],
  1385. inject: ['convertText'],
  1386. data() {
  1387. return {
  1388. resArr: [],
  1389. resObj: null,
  1390. curTime: 0, // 单位s
  1391. chsFhList: [',', '。', '”', ':', '》', '?', '!', ';', '#', '、'],
  1392. enFhList: [',', '.', ';', '?', '!', ':', '>', '<'],
  1393. NumberList: ['①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳'],
  1394. newWords: ['鱼', '辩礼义'],
  1395. oldHz: '',
  1396. hz: '',
  1397. top: 0,
  1398. left: 0,
  1399. articleImg: {}, // 文章图片
  1400. paraIndex: -1, // 段落索引
  1401. sentIndex: -1, // 句子索引
  1402. ed: undefined,
  1403. noteNum: '',
  1404. curNoteCon: null,
  1405. isNoteShow: false,
  1406. oldNoteNum: '',
  1407. clientY: 0,
  1408. contentWidth: 732,
  1409. windowWidth: window.innerWidth,
  1410. isHasRemark: false,
  1411. annotationList: [],
  1412. };
  1413. },
  1414. computed: {
  1415. isPlaying() {
  1416. let playing = false;
  1417. if (this.$refs.audioLine) {
  1418. playing = this.$refs.audioLine.audio.isPlaying;
  1419. }
  1420. return playing;
  1421. },
  1422. },
  1423. watch: {
  1424. noteNum: {
  1425. handler(val) {
  1426. let _this = this;
  1427. if (val) {
  1428. _this.handleNote(val);
  1429. }
  1430. },
  1431. // 深度观察监听
  1432. deep: true,
  1433. },
  1434. isNoteShow: {
  1435. handler(val) {
  1436. let _this = this;
  1437. if (val) {
  1438. setTimeout(() => {
  1439. _this.cardHeight = _this.$refs.notecard.offsetHeight;
  1440. if (_this.screenHeight - _this.clientY > _this.cardHeight) {
  1441. _this.top = _this.clientY + 20;
  1442. } else {
  1443. _this.top = _this.clientY - _this.cardHeight - 30;
  1444. }
  1445. }, 50);
  1446. }
  1447. },
  1448. // 深度观察监听
  1449. deep: true,
  1450. },
  1451. curQue: {
  1452. handler(val) {
  1453. if (val) {
  1454. this.handleData();
  1455. }
  1456. },
  1457. // 深度观察监听
  1458. deep: true,
  1459. },
  1460. },
  1461. // 生命周期 - 创建完成(可以访问当前this实例)
  1462. created() {},
  1463. // 生命周期 - 挂载完成(可以访问DOM元素)
  1464. mounted() {
  1465. if (this.NNPEAnnotationList && this.NNPEAnnotationList.length > 0) {
  1466. this.handleNewword();
  1467. }
  1468. if (this.curQue) {
  1469. this.handleData();
  1470. }
  1471. },
  1472. beforeCreate() {}, // 生命周期 - 创建之前
  1473. beforeMount() {}, // 生命周期 - 挂载之前
  1474. beforeUpdate() {}, // 生命周期 - 更新之前
  1475. updated() {}, // 生命周期 - 更新之后
  1476. beforeDestroy() {}, // 生命周期 - 销毁之前
  1477. destroyed() {}, // 生命周期 - 销毁完成
  1478. activated() {},
  1479. // 方法集合
  1480. methods: {
  1481. // 拼音的显示和隐藏
  1482. changePinyin() {
  1483. if (this.config.isHasPY) {
  1484. this.$emit('changeConfig', 'isShowPY');
  1485. }
  1486. },
  1487. // 英文的显示和隐藏
  1488. changeEN() {
  1489. if (this.config.isHasEN) {
  1490. this.$emit('changeConfig', 'isShowEN');
  1491. }
  1492. },
  1493. getCurTime(curTime) {
  1494. this.curTime = curTime * 1000;
  1495. this.getSentIndex(this.curTime);
  1496. },
  1497. getSentIndex(curTime) {
  1498. if (this.curQue.wordTime) {
  1499. for (let i = 0; i < this.curQue.wordTime.length; i++) {
  1500. let bg = this.curQue.wordTime[i].bg;
  1501. let ed = this.curQue.wordTime[i].ed;
  1502. if (curTime >= bg && curTime <= ed) {
  1503. this.sentIndex = i;
  1504. break;
  1505. }
  1506. }
  1507. }
  1508. },
  1509. handleData() {
  1510. let resArr = [];
  1511. let curQue = JSON.parse(JSON.stringify(this.curQue));
  1512. let wordTimeList = curQue.wordTime;
  1513. let asIndex = 0;
  1514. let dhaspinyin = false; // 每段是否有拼音
  1515. this.isHasRemark = false;
  1516. curQue.detail.forEach((dItem, dIndex) => {
  1517. dhaspinyin = false;
  1518. let remarkDetail = dItem.remark;
  1519. if (
  1520. remarkDetail &&
  1521. (remarkDetail.chs || remarkDetail.en || (remarkDetail.img_list && remarkDetail.img_list.length > 0))
  1522. ) {
  1523. this.isHasRemark = true;
  1524. }
  1525. let paraArr = [];
  1526. if (dItem.paraAlign !== 'center') {
  1527. paraArr = [
  1528. {
  1529. pinyin: '',
  1530. chs: '',
  1531. width: 20,
  1532. height: 20,
  1533. },
  1534. {
  1535. width: 20,
  1536. height: 20,
  1537. pinyin: '',
  1538. chs: '',
  1539. },
  1540. ];
  1541. }
  1542. dItem.wordsList.forEach((sItem, sIndex) => {
  1543. let sentArr = [];
  1544. sItem.forEach((wItem, wIndex) => {
  1545. let startIndex = wIndex === 0 ? 0 : sentArr[wIndex - 1].startIndex + sentArr[wIndex - 1].chs.length;
  1546. let endIndex = wIndex === 0 ? wItem.chs.length : sentArr[wIndex - 1].endIndex + wItem.chs.length;
  1547. this.mergeWordSymbol(wItem);
  1548. let obj = {
  1549. paraIndex: dIndex, // 段落索引
  1550. sentIndex: sIndex, // 在段落中句子索引
  1551. articleSentIndex: asIndex, // 在文章中句子索引
  1552. wordIndex: wIndex, // 单词的索引
  1553. pinyin:
  1554. curQue.pinyin_type === 'pinyin'
  1555. ? curQue.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true' && wIndex === 0
  1556. ? wItem.pinyin_up
  1557. : wItem.pinyin
  1558. : wItem.pinyin_tone,
  1559. chs: wItem.chs,
  1560. padding: true, // wItem.padding,
  1561. className: wItem.className,
  1562. isShow: wItem.isShow,
  1563. isNewWord: this.newWords.indexOf(wItem.chs) > -1,
  1564. startIndex,
  1565. endIndex,
  1566. leg: wItem.chs.length,
  1567. config: {
  1568. fontFamily: wItem.fontFamily,
  1569. color: wItem.color,
  1570. textDecoration: wItem.textDecoration,
  1571. border: wItem.border,
  1572. fontWeight: wItem.fontWeight,
  1573. },
  1574. matchWords: wItem.matchWords,
  1575. matchNotes: wItem.matchNotes,
  1576. notesColor: wItem.notesColor,
  1577. matchNotesObj: wItem.matchNotesObj,
  1578. img: wItem.img,
  1579. imgPosition: wItem.imgPosition,
  1580. };
  1581. if (wordTimeList && wordTimeList.length > 0) {
  1582. obj.chstimeList = wordTimeList[asIndex].wordsResultList.slice(startIndex, endIndex);
  1583. }
  1584. sentArr.push(obj);
  1585. paraArr.push(obj);
  1586. if (wIndex === sItem.length - 1) {
  1587. asIndex += 1;
  1588. }
  1589. if (wItem.pinyin) dhaspinyin = true;
  1590. });
  1591. });
  1592. let curSentencesLeg = dItem.sentences.length;
  1593. let startLeg = dIndex === 0 ? 0 : curQue.detail[dIndex - 1].endLeg;
  1594. let endLeg = startLeg + curSentencesLeg;
  1595. dItem.endLeg = endLeg;
  1596. let timeList = curQue.wordTime ? curQue.wordTime.slice(startLeg, endLeg) : [];
  1597. let paraObj = {
  1598. wordsList: paraArr,
  1599. timeList,
  1600. isTitle: dItem.isTitle,
  1601. dhaspinyin,
  1602. enwords: dItem.sentencesEn ? dItem.sentencesEn : [],
  1603. paraAlign: dItem.paraAlign,
  1604. remarkDetail,
  1605. sourceList: dItem.sourceList ? dItem.sourceList : [],
  1606. sourcePosition: dItem.sourcePosition,
  1607. widthNumber: dItem.widthNumber,
  1608. heightNumber: dItem.heightNumber,
  1609. };
  1610. resArr.push(paraObj);
  1611. });
  1612. this.resArr = resArr;
  1613. // 循环文章图片
  1614. if (curQue.img_list) {
  1615. curQue.img_list.forEach((item) => {
  1616. this.articleImg[item.imgNumber] = item.id;
  1617. });
  1618. }
  1619. let resArrs = [];
  1620. let sentArrTotal = [];
  1621. let timeArr = [];
  1622. curQue.detail.forEach((dItem, dIndex) => {
  1623. dItem.wordsList.forEach((sItem, sIndex) => {
  1624. let sentArr = [];
  1625. sItem.forEach((wItem, wIndex) => {
  1626. let startIndex = wIndex === 0 ? 0 : sentArr[wIndex - 1].startIndex + sentArr[wIndex - 1].chs.length;
  1627. let endIndex = wIndex === 0 ? wItem.chs.length : sentArr[wIndex - 1].endIndex + wItem.chs.length;
  1628. // this.judgePad(sItem, wItem, wIndex);
  1629. this.mergeWordSymbol(wItem);
  1630. let obj = {
  1631. paraIndex: dIndex, // 段落索引
  1632. sentIndex: sIndex, // 在段落中句子索引
  1633. wordIndex: wIndex, // 单词的索引
  1634. pinyin:
  1635. curQue.pinyin_type === 'pinyin'
  1636. ? curQue.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true' && wIndex === 0
  1637. ? wItem.pinyin_up
  1638. : wItem.pinyin
  1639. : wItem.pinyin_tone,
  1640. chs: wItem.chs,
  1641. padding: true,
  1642. className: wItem.className,
  1643. isShow: wItem.isShow,
  1644. startIndex,
  1645. endIndex,
  1646. leg: wItem.chs.length,
  1647. timeList: [],
  1648. };
  1649. sentArr.push(obj);
  1650. });
  1651. let objs = {
  1652. sentArr,
  1653. enwords: dItem.sentencesEn && dItem.sentencesEn[sIndex] && dItem.sentencesEn[sIndex].replace(/'/g, '’'),
  1654. paraAlign: dItem.paraAlign,
  1655. sourceList: dItem.sourceList ? dItem.sourceList : [],
  1656. sourcePosition: dItem.sourcePosition,
  1657. widthNumber: dItem.widthNumber,
  1658. heightNumber: dItem.heightNumber,
  1659. };
  1660. sentArrTotal.push(sentArr);
  1661. resArrs.push(objs);
  1662. });
  1663. timeArr.push(dItem.timeList);
  1664. });
  1665. if (wordTimeList && wordTimeList.length > 0) {
  1666. this.mergeWordTime(sentArrTotal, wordTimeList);
  1667. }
  1668. let timeList = [];
  1669. timeArr.forEach((item) => {
  1670. item.forEach((aItem) => {
  1671. if (timeList.indexOf(aItem) < 0) {
  1672. timeList.push(aItem);
  1673. }
  1674. });
  1675. });
  1676. this.resObj = { sentList: resArrs, timeList };
  1677. },
  1678. handleNewword() {
  1679. let annotationList = [];
  1680. this.NNPEAnnotationList.forEach((wItem) => {
  1681. // item.forEach((wItem) => {
  1682. if (wItem.con) {
  1683. annotationList.push(wItem.con.replace(/<[^>]*>?/gm, ''));
  1684. }
  1685. // });
  1686. });
  1687. this.annotationList = JSON.parse(JSON.stringify(annotationList));
  1688. },
  1689. mergeWordTime(resArr, wordTimeList) {
  1690. resArr.forEach((item, index) => {
  1691. let wordsResultList = wordTimeList[index].wordsResultList;
  1692. item.forEach((wItem) => {
  1693. let startIndex = wItem.startIndex;
  1694. let endIndex = wItem.endIndex;
  1695. wItem.timeList = wordsResultList.slice(startIndex, endIndex);
  1696. });
  1697. });
  1698. },
  1699. // 词和标点合一起
  1700. mergeWordSymbol(wItem) {
  1701. if (this.chsFhList.indexOf(wItem.chs) > -1 || this.NumberList.indexOf(wItem.chs) > -1) {
  1702. wItem.isShow = false;
  1703. } else {
  1704. wItem.isShow = true;
  1705. }
  1706. },
  1707. // 判断是否有padding
  1708. judgePad(sItem, wItem, curIndex) {
  1709. let leg = sItem.length;
  1710. if (curIndex < leg - 1) {
  1711. let nextIndex = curIndex + 1;
  1712. let chs = sItem[nextIndex].chs;
  1713. if (this.chsFhList.indexOf(chs) > -1 || this.chsFhList.indexOf(wItem.chs) > -1) {
  1714. wItem.padding = false;
  1715. } else {
  1716. wItem.padding = true;
  1717. }
  1718. if (this.enFhList.indexOf(wItem.pinyin) > -1) {
  1719. wItem.className = 'textLeft';
  1720. }
  1721. }
  1722. },
  1723. // 点击播放某个句子
  1724. handleChangeTime(time, ed, index) {
  1725. this.sentIndex = index;
  1726. if (time) {
  1727. this.curTime = time;
  1728. this.$refs.audioLine.onTimeupdateTime(time / 1000, true);
  1729. this.ed = ed;
  1730. }
  1731. },
  1732. emptyEd() {
  1733. this.ed = undefined;
  1734. },
  1735. // 经过每个词,高亮句子
  1736. handleMouseover(pItem) {
  1737. this.paraIndex = pItem.paraIndex;
  1738. this.sentIndex = pItem.sentIndex;
  1739. },
  1740. handleMouseleave() {
  1741. this.paraIndex = -1;
  1742. this.sentIndex = -1;
  1743. },
  1744. viewNotes(e, noteNum, time, ed, index, words) {
  1745. let _this = this;
  1746. let noteIndex = '';
  1747. if (_this.NumberList.indexOf(noteNum) > -1) {
  1748. for (let i = 0; i < _this.NumberList.length; i++) {
  1749. if (_this.NumberList[i] === noteNum) {
  1750. noteIndex = `${String(i)}`;
  1751. break;
  1752. }
  1753. }
  1754. } else if (words.matchNotes) {
  1755. // 关联了注释
  1756. if (_this.NNPEAnnotationList && _this.NNPEAnnotationList.length > 0) {
  1757. _this.NNPEAnnotationList.forEach((item, indexs) => {
  1758. let textContent = item.con.replace(/<[^>]*>?/gm, '');
  1759. if (textContent === words.matchNotes.trim() || item.number === words.matchNotes.trim()) {
  1760. noteIndex = `${String(indexs)}`;
  1761. }
  1762. });
  1763. }
  1764. } else if (
  1765. _this.NNPEAnnotationList &&
  1766. _this.NNPEAnnotationList.length > 0 &&
  1767. _this.annotationList.indexOf(words.chs) > -1
  1768. ) {
  1769. _this.NNPEAnnotationList.forEach((item, indexs) => {
  1770. let textContent = item.con.replace(/<[^>]*>?/gm, '');
  1771. if (textContent === words.chs.trim()) {
  1772. noteIndex = `${String(indexs)}`;
  1773. }
  1774. });
  1775. } else {
  1776. _this.handleChangeTime(time, ed, index);
  1777. }
  1778. if (noteIndex) {
  1779. this.showNoteDetail(e, noteIndex);
  1780. }
  1781. },
  1782. showNoteDetail(e, noteNum) {
  1783. let _this = this;
  1784. // if (_this.oldNoteNum != noteNum) {
  1785. this.isNoteShow = false;
  1786. setTimeout(() => {
  1787. _this.noteNum = noteNum;
  1788. }, 50);
  1789. // }
  1790. _this.clientY = e.clientY;
  1791. let left = e.clientX;
  1792. let width = 642;
  1793. if (left - this.bodyLeft > this.contentWidth / 2) {
  1794. _this.left = 500;
  1795. } else if (left - 200 > 500) {
  1796. _this.left = 500;
  1797. } else {
  1798. _this.left = left - 200;
  1799. }
  1800. if (_this.oldNoteNum === noteNum) {
  1801. _this.handleNote(noteNum);
  1802. }
  1803. },
  1804. // 处理分词数据
  1805. handleNote(val) {
  1806. let _this = this;
  1807. _this.isNoteShow = true;
  1808. _this.oldNoteNum = val;
  1809. let noteIndex = Number(val);
  1810. if (_this.NNPEAnnotationList && _this.NNPEAnnotationList.length > 0) {
  1811. _this.curNoteCon = _this.NNPEAnnotationList[noteIndex] ? _this.NNPEAnnotationList[noteIndex] : null;
  1812. }
  1813. },
  1814. changeCard(isShow) {
  1815. let _this = this;
  1816. _this.isNoteShow = isShow;
  1817. _this.oldNoteNum = '';
  1818. _this.noteNum = '';
  1819. },
  1820. }, // 如果页面有keep-alive缓存功能,这个函数会触发
  1821. };
  1822. </script>
  1823. <style lang="scss" scoped>
  1824. .NNPE-ArticleView {
  1825. width: 100%;
  1826. .aduioLine-practice-npc {
  1827. display: flex;
  1828. align-items: center;
  1829. justify-content: flex-start;
  1830. .aduioLine-content {
  1831. flex: 1;
  1832. }
  1833. .aduioLine-right {
  1834. box-sizing: border-box;
  1835. display: flex;
  1836. align-items: center;
  1837. justify-content: space-between;
  1838. width: 69px;
  1839. height: 40px;
  1840. padding: 0 12px;
  1841. border-left: 1px solid rgba(0, 0, 0, 10%);
  1842. .svg-icon {
  1843. width: 16px;
  1844. height: 16px;
  1845. cursor: pointer;
  1846. }
  1847. }
  1848. }
  1849. .NPC-sentences-list {
  1850. overflow: auto;
  1851. // padding: 24px 0;
  1852. color: rgba(0, 0, 0, 85%);
  1853. .NPC-article-empty {
  1854. display: flex;
  1855. align-items: flex-start;
  1856. justify-content: flex-start;
  1857. > div {
  1858. height: 24px;
  1859. &.empty-left {
  1860. box-sizing: border-box;
  1861. width: 100%;
  1862. &.hasRemark {
  1863. box-sizing: border-box;
  1864. width: 70%;
  1865. border-right: 1px rgba(0, 0, 0, 10%) solid;
  1866. }
  1867. }
  1868. &.empty-right {
  1869. flex: 1;
  1870. }
  1871. }
  1872. &-bottom {
  1873. > div {
  1874. height: 40px;
  1875. }
  1876. }
  1877. }
  1878. }
  1879. .NNPE-detail {
  1880. // overflow: hidden; // 为了不遮挡备注内容
  1881. display: flex;
  1882. align-items: flex-start;
  1883. justify-content: flex-start;
  1884. clear: both;
  1885. .para-center {
  1886. display: flex;
  1887. flex-flow: wrap;
  1888. justify-content: center;
  1889. width: 100%;
  1890. }
  1891. .para-right {
  1892. display: flex;
  1893. flex-flow: wrap;
  1894. justify-content: end;
  1895. width: 100%;
  1896. }
  1897. .NNPE-words {
  1898. float: left;
  1899. padding-bottom: 5px;
  1900. &-box {
  1901. float: left;
  1902. > span {
  1903. display: block;
  1904. &.NNPE-pinyin {
  1905. height: 22px;
  1906. font-family: 'League';
  1907. font-size: 14px;
  1908. font-weight: normal;
  1909. line-height: 1.5;
  1910. color: #000;
  1911. &.noFont {
  1912. font-family: initial;
  1913. }
  1914. &.textLeft {
  1915. text-align: left;
  1916. }
  1917. &.textRight {
  1918. text-align: right;
  1919. }
  1920. }
  1921. &.NNPE-chs {
  1922. display: flex;
  1923. flex-flow: wrap;
  1924. align-items: center;
  1925. font-family: '楷体';
  1926. font-size: 20px;
  1927. line-height: 1.4;
  1928. color: #000;
  1929. &.overActive {
  1930. background: rgba(0, 0, 0, 6%);
  1931. }
  1932. &.active {
  1933. background: rgba(222, 68, 68, 15%);
  1934. }
  1935. &.wordActive {
  1936. color: rgba(222, 68, 68, 100%);
  1937. }
  1938. .wordActive {
  1939. color: rgba(222, 68, 68, 100%);
  1940. }
  1941. }
  1942. &.padding {
  1943. padding: 0 3px;
  1944. }
  1945. }
  1946. }
  1947. &.textLeft {
  1948. text-align: left;
  1949. }
  1950. &.textCenter {
  1951. text-align: center;
  1952. .NNPE-chs {
  1953. justify-content: center;
  1954. }
  1955. }
  1956. &.textRight {
  1957. text-align: right;
  1958. }
  1959. > span {
  1960. display: block;
  1961. &.NNPE-pinyin {
  1962. height: 22px;
  1963. font-family: 'League';
  1964. font-size: 14px;
  1965. font-weight: normal;
  1966. line-height: 1.5;
  1967. color: #000;
  1968. &.noFont {
  1969. font-family: initial;
  1970. }
  1971. &.textLeft {
  1972. text-align: left;
  1973. }
  1974. &.textRight {
  1975. text-align: right;
  1976. }
  1977. }
  1978. &.NNPE-chs {
  1979. display: flex;
  1980. flex-flow: wrap;
  1981. align-items: center;
  1982. font-family: '楷体';
  1983. font-size: 20px;
  1984. line-height: 1.4;
  1985. color: #000;
  1986. &.overActive {
  1987. background: rgba(0, 0, 0, 6%);
  1988. }
  1989. &.active {
  1990. background: rgba(222, 68, 68, 15%);
  1991. }
  1992. &.wordActive {
  1993. color: rgba(222, 68, 68, 100%);
  1994. }
  1995. .wordActive {
  1996. color: rgba(222, 68, 68, 100%);
  1997. }
  1998. }
  1999. &.padding {
  2000. padding: 0 3px;
  2001. }
  2002. }
  2003. }
  2004. &.NNPE-detail-title {
  2005. .NNPE-title {
  2006. margin: 0 auto;
  2007. }
  2008. .wordsList-box {
  2009. > div {
  2010. display: flex;
  2011. flex-flow: wrap;
  2012. justify-content: center;
  2013. }
  2014. }
  2015. }
  2016. .index {
  2017. box-sizing: border-box;
  2018. width: 48px;
  2019. padding: 8px;
  2020. text-align: right;
  2021. border-right: 1px solid rgba(0, 0, 0, 10%);
  2022. b {
  2023. font-weight: 400;
  2024. line-height: 1.5;
  2025. color: #000;
  2026. }
  2027. }
  2028. .wordsList-box {
  2029. // display: flex;
  2030. width: 100%;
  2031. padding: 6px 24px 12px;
  2032. &-left {
  2033. justify-content: flex-start;
  2034. }
  2035. &-center {
  2036. justify-content: center;
  2037. }
  2038. &-right {
  2039. justify-content: flex-end;
  2040. }
  2041. > div {
  2042. overflow: hidden;
  2043. clear: both;
  2044. }
  2045. > img {
  2046. display: block;
  2047. max-width: 100%;
  2048. margin: 0 auto;
  2049. }
  2050. }
  2051. .article-content {
  2052. box-sizing: border-box;
  2053. // display: flex;
  2054. // align-items: flex-start;
  2055. // justify-content: flex-start;
  2056. width: 100%;
  2057. &.hasRemark {
  2058. width: 70%;
  2059. padding: 8px 0 8px 23px;
  2060. border-right: 1px rgba(0, 0, 0, 10%) solid;
  2061. }
  2062. &.paraLast {
  2063. padding-bottom: 24px;
  2064. }
  2065. }
  2066. }
  2067. .remarkBox {
  2068. position: relative;
  2069. display: flex;
  2070. flex: 1;
  2071. align-items: center;
  2072. justify-content: center;
  2073. &.remark72 {
  2074. padding-top: 72px;
  2075. }
  2076. &.remark-top {
  2077. padding-top: 44px;
  2078. }
  2079. &.remark-top-8 {
  2080. padding-top: 8px;
  2081. }
  2082. }
  2083. .NNPE-noteDetail {
  2084. position: fixed;
  2085. top: 50%;
  2086. left: 50%;
  2087. z-index: 9999;
  2088. max-width: 100%;
  2089. margin-top: -196px;
  2090. overflow: auto;
  2091. // box-shadow: 0 4px 16px rgba(0, 0, 0, 15%);
  2092. }
  2093. .NNPE-detail-box {
  2094. box-sizing: border-box;
  2095. width: 100%;
  2096. padding: 8px 24px;
  2097. margin-bottom: 8px;
  2098. &.active {
  2099. background: rgba(222, 68, 68, 15%);
  2100. }
  2101. }
  2102. .NNPE-details {
  2103. overflow: hidden;
  2104. clear: both;
  2105. .NNPE-words {
  2106. float: left;
  2107. &-box {
  2108. float: left;
  2109. > span {
  2110. display: block;
  2111. &.NNPE-pinyin {
  2112. height: 20px;
  2113. font-family: 'League';
  2114. font-size: 14px;
  2115. font-weight: normal;
  2116. line-height: 20px;
  2117. color: rgba(0, 0, 0, 100%);
  2118. &.noFont {
  2119. font-family: initial;
  2120. }
  2121. &.textLeft {
  2122. text-align: left;
  2123. }
  2124. &.wordBlank {
  2125. color: rgba(0, 0, 0, 100%);
  2126. }
  2127. }
  2128. &.NNPE-chs {
  2129. display: flex;
  2130. flex-flow: wrap;
  2131. align-items: center;
  2132. font-family: '楷体';
  2133. font-size: 20px;
  2134. line-height: 28px;
  2135. color: rgba(0, 0, 0, 100%);
  2136. .active {
  2137. color: #de4444;
  2138. }
  2139. &.wordBlank {
  2140. color: rgba(0, 0, 0, 100%);
  2141. }
  2142. }
  2143. // &.padding {
  2144. // padding-right: 6px;
  2145. // }
  2146. }
  2147. }
  2148. &.textLeft {
  2149. text-align: left;
  2150. }
  2151. &.textCenter {
  2152. text-align: center;
  2153. .NNPE-chs {
  2154. justify-content: center;
  2155. }
  2156. }
  2157. &.textRight {
  2158. text-align: right;
  2159. }
  2160. > span {
  2161. display: block;
  2162. &.NNPE-pinyin {
  2163. height: 20px;
  2164. font-family: 'League';
  2165. font-size: 14px;
  2166. font-weight: normal;
  2167. line-height: 20px;
  2168. color: rgba(0, 0, 0, 100%);
  2169. &.noFont {
  2170. font-family: initial;
  2171. }
  2172. &.textLeft {
  2173. text-align: left;
  2174. }
  2175. &.wordBlank {
  2176. color: rgba(0, 0, 0, 100%);
  2177. }
  2178. }
  2179. &.NNPE-chs {
  2180. display: flex;
  2181. flex-flow: wrap;
  2182. align-items: center;
  2183. font-family: '楷体';
  2184. font-size: 20px;
  2185. line-height: 28px;
  2186. color: rgba(0, 0, 0, 100%);
  2187. .active {
  2188. color: #de4444;
  2189. }
  2190. &.wordBlank {
  2191. color: rgba(0, 0, 0, 100%);
  2192. }
  2193. }
  2194. &.padding {
  2195. padding: 0 3px;
  2196. }
  2197. }
  2198. }
  2199. }
  2200. .enwords {
  2201. padding-left: 3px;
  2202. font-family: 'Helvetica';
  2203. font-size: 14px;
  2204. font-weight: normal;
  2205. line-height: 22px;
  2206. color: rgba(0, 0, 0, 100%);
  2207. word-break: break-word;
  2208. &.wordBlank {
  2209. color: rgba(0, 0, 0, 100%);
  2210. }
  2211. }
  2212. .multilingual {
  2213. padding: 6px 24px 12px;
  2214. word-break: break-word;
  2215. }
  2216. .multilingual-para {
  2217. text-indent: 40px;
  2218. word-break: break-word;
  2219. &-center,
  2220. &.multilingual-center {
  2221. text-align: center;
  2222. text-indent: 0;
  2223. }
  2224. &.multilingual-right {
  2225. text-align: right;
  2226. }
  2227. }
  2228. }
  2229. </style>