PhraseModelChs.vue 98 KB

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