| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310 |
- <!-- -->
- <template>
- <div v-if="curQue" class="NNPE-ArticleView">
- <div
- v-if="
- ((curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url) ||
- config.isHasPY ||
- config.isHasEN) &&
- curQue.property.mp3_position === 'top'
- "
- class="aduioLine-box aduioLine-practice-npc"
- >
- <div class="aduioLine-content">
- <template v-if="curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url">
- <AudioLine
- ref="audioLine"
- audio-id="diaPhraAudio"
- :mp3="curQue.mp3_list[0].url"
- :get-cur-time="getCurTime"
- :mp3-source="curQue.mp3_list[0].source"
- :width="colLength == 2 ? 200 : isMobile ? 200 : 790"
- :attrib="attrib"
- />
- </template>
- </div>
- <div class="aduioLine-right">
- <!-- <span
- :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
- @click="changePinyin"
- v-if="config.isHasPY"
- ></span>
- <span :class="['EN-16', config.isShowEN ? '' : 'disabled']" @click="changeEN" v-if="config.isHasEN"></span> -->
- <SvgIcon
- v-if="config.isHasPY"
- icon-class="pin-btn"
- size="16"
- :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
- :style="{ color: config.isShowPY ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
- @click="changePinyin"
- />
- <!-- <span :class="['EN-16', config.isShowEN ? '' : 'disabled']" @click="changeEN" v-if="config.isHasEN"></span> -->
- <SvgIcon
- v-if="config.isHasEN"
- icon-class="en-btn"
- size="16"
- :class="['EN-16', config.isShowEN ? '' : 'disabled']"
- :style="{ color: config.isShowEN ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
- @click="changeEN"
- />
- </div>
- </div>
- <template v-if="resArr.length > 0">
- <div
- class="NPC-sentences-list"
- :style="{
- height: curQue.property.content_height ? curQue.property.content_height + 'px' : '',
- }"
- >
- <div class="NPC-article-empty">
- <div
- :class="['empty-left', isHasRemark ? 'hasRemark' : '']"
- :style="{
- width: isHasRemark && curQue.property.remarkWidth ? 100 - curQue.property.remarkWidth * 1 + '%' : '',
- }"
- ></div>
- <div class="empty-right"></div>
- </div>
- <div
- v-for="(item, index) in resArr"
- :key="'detail' + index"
- :class="['NNPE-detail', item.isTitle ? 'NNPE-detail-title' : '']"
- >
- <div
- :class="['article-content', isHasRemark ? 'hasRemark' : '']"
- :style="{
- width: isHasRemark && curQue.property.remarkWidth ? 100 - curQue.property.remarkWidth * 1 + '%' : '',
- }"
- >
- <template v-if="item.type === 'notice'">
- <p
- v-if="item.noticeWordList.length === 0"
- :class="['notice']"
- :style="{
- fontSize: curQue.property.notice_size ? curQue.property.notice_size + 'px' : '',
- color: curQue.property.notice_color ? curQue.property.notice_color : '',
- fontFamily: curQue.property.noitce_family ? curQue.property.noitce_family : '',
- }"
- >
- {{ convertText(item.notice) }}
- </p>
- <p
- v-else
- :class="['notice']"
- :style="{
- fontSize: curQue.property.notice_size ? curQue.property.notice_size + 'px' : '',
- color: curQue.property.notice_color ? curQue.property.notice_color : '',
- fontFamily: curQue.property.noitce_family ? curQue.property.noitce_family : '',
- }"
- >
- <span v-for="(items, indexs) in item.noticeWordList" :key="indexs">
- <span
- v-for="(pItem, indexss) in items"
- :key="indexss"
- :style="{
- fontFamily: pItem.fontFamily,
- textDecoration: pItem.textDecoration,
- borderBottom: pItem.border === 'dotted' ? '1px dotted' : '',
- fontWeight: pItem.fontWeight,
- color: pItem.color,
- display: 'inline-block',
- margin: /^[A-Za-z]+$/.test(pItem.chs)
- ? indexs === 0 && indexss === 0
- ? '0 2px 0 0'
- : '0 2px'
- : '',
- }"
- >
- {{ convertText(pItem.chs) }}
- </span>
- </span>
- </p>
- </template>
- <template v-else>
- <RoleChs :cur-role="item.roleDetail" :type="curQue.property.role_img_type" />
- <div class="wordsList-box">
- <img v-if="articleImg[0] && index == 0" :src="articleImg[index]" />
- <!-- <div class="roleDetail" v-if="item.roleDetail.detail && item.roleDetail.detail.wordsList.length > 0">
- <span class="pinyin">{{ item.roleDetail.detail.wordsList | handlePinyin }}</span>
- <span class="chs">{{ item.roleDetail.detail.wordsList | handleChs }}</span>
- </div> -->
- <div v-if="item.roleDetail.fullName || item.roleDetail.fullPinyin" class="roleDetail">
- <template v-if="item.roleDetail.segList && item.roleDetail.segList.length > 0">
- <span
- v-for="(items, indexs) in item.roleDetail.segList"
- :key="indexs"
- class="chs"
- :style="{
- color: items.matchWords ? (attrib ? attrib.topic_color : '') : '',
- }"
- @click="showWordDetail($event, items.matchWords)"
- >{{ convertText(items.chs) }}</span
- >
- </template>
- <span v-else class="chs">{{ convertText(item.roleDetail.fullName) }}</span>
- <span class="pinyin">{{ item.roleDetail.fullPinyin }}</span>
- </div>
- <div
- class="para-con"
- :style="{
- backgroundColor:
- item.timeList &&
- item.timeList.length > 0 &&
- curTime >= item.timeList[0].bg + 0.01 &&
- curTime <= item.timeList[item.timeList.length - 1].ed - 0.01 &&
- attrib
- ? attrib.assist_color
- : '',
- }"
- >
- <div
- v-if="config.isShowEN && item.enwords && curQue.enPosition && curQue.enPosition == 'top'"
- class="enwords"
- >
- {{ convertText(item.enwords) }}
- </div>
- <div style="overflow: hidden; clear: both"></div>
- <template v-if="item.type === 'text'">
- <div
- v-for="(pItem, pIndex) in item.wordsList"
- :key="'wordsList' + pIndex"
- class="NNPE-words"
- :class="[
- pItem.chs != '“' && pItem.wordIndex == 0 ? 'textLeft' : 'textCenter',
- pItem.chs == '“' ? 'textRight' : '',
- ]"
- @click="showWordDetail($event, pItem.chs, pItem.words)"
- >
- <template v-if="!pItem.width">
- <template v-if="pItem.isShow">
- <span
- v-if="
- item.wordsList[pIndex - 1] &&
- item.wordsList[pIndex - 1].chs &&
- firstFhlist.indexOf(item.wordsList[pIndex - 1].chs) > -1 &&
- item.wordsList[pIndex - 2] &&
- item.wordsList[pIndex - 2].chs &&
- firstFhlist.indexOf(item.wordsList[pIndex - 2].chs) > -1
- "
- class="NNPE-words-box"
- >
- <span
- v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
- :class="[
- 'NNPE-pinyin',
- noFont.indexOf(item.wordsList[pIndex - 2].pinyin) > -1 ? 'noFont' : '',
- ]"
- style="text-align: left"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- @click.stop="
- viewNotes($event, item.wordsList[pIndex - 2].pinyin, item.wordsList[pIndex - 2])
- "
- >{{
- NumberList.indexOf(item.wordsList[pIndex - 2].pinyin) === -1
- ? item.wordsList[pIndex - 2].pinyin
- : ''
- }}</span
- >
- <el-tooltip
- v-if="item.wordsList[pIndex - 2].matchNotesObj.con"
- popper-class="article-bubble"
- effect="light"
- placement="bottom-start"
- >
- <div
- slot="content"
- :style="{
- color: attrib && attrib.text_color ? attrib.text_color : '#de4444',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '',
- }"
- v-html="item.wordsList[pIndex - 2].matchNotesObj.con"
- ></div>
- <span
- class="NNPE-chs"
- style="text-align: left"
- :class="[
- pItem.chstimeList &&
- pItem.chstimeList[0] &&
- curTime >= pItem.chstimeList[0].wordBg &&
- curQue.wordTime &&
- curTime <= item.timeList[pItem.sentIndex].ed
- ? 'wordActive'
- : '',
- newWordList.indexOf(item.wordsList[pIndex - 2].chs) > -1 ? 'newActive' : '',
- item.wordsList[pIndex - 2].words ? 'newActive' : '',
- ]"
- :style="{
- fontFamily: item.wordsList[pIndex - 2].config.fontFamily,
- textDecoration: item.wordsList[pIndex - 2].config.textDecoration,
- borderBottom:
- item.wordsList[pIndex - 2].config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: item.wordsList[pIndex - 2].config.fontWeight,
- height:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- color:
- newWordList.indexOf(item.wordsList[pIndex - 2].chs) > -1 ||
- item.wordsList[pIndex - 2].words
- ? attrib
- ? attrib.topic_color
- : item.wordsList[pIndex - 2].config.color
- : item.wordsList[pIndex - 2].matchNotesObj.con &&
- item.wordsList[pIndex - 2].matchNotesObj.notesColor
- ? item.wordsList[pIndex - 2].matchNotesObj.notesColor
- : item.wordsList[pIndex - 2].config.color,
- whiteSpace: item.wordsList[pIndex - 2].chs.trim() === '' ? 'pre' : '', // 保留空白分词
- }"
- @click.stop="
- viewNotes(
- $event,
- item.wordsList[pIndex - 2].words
- ? item.wordsList[pIndex - 2].words
- : item.wordsList[pIndex - 2].chs,
- item.wordsList[pIndex - 2],
- )
- "
- >{{ convertText(item.wordsList[pIndex - 2].chs) }}</span
- >
- </el-tooltip>
- <template v-else>
- <span
- class="NNPE-chs"
- style="text-align: left"
- :class="[
- pItem.chstimeList &&
- pItem.chstimeList[0] &&
- curTime >= pItem.chstimeList[0].wordBg &&
- curQue.wordTime &&
- curTime <= item.timeList[pItem.sentIndex].ed
- ? 'wordActive'
- : '',
- newWordList.indexOf(item.wordsList[pIndex - 2].chs) > -1 ? 'newActive' : '',
- item.wordsList[pIndex - 2].words ? 'newActive' : '',
- ]"
- :style="{
- fontFamily: item.wordsList[pIndex - 2].config.fontFamily,
- textDecoration: item.wordsList[pIndex - 2].config.textDecoration,
- borderBottom:
- item.wordsList[pIndex - 2].config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: item.wordsList[pIndex - 2].config.fontWeight,
- height:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- color:
- newWordList.indexOf(item.wordsList[pIndex - 2].chs) > -1 ||
- item.wordsList[pIndex - 2].words
- ? attrib
- ? attrib.topic_color
- : item.wordsList[pIndex - 2].config.color
- : item.wordsList[pIndex - 2].matchNotesObj.con &&
- item.wordsList[pIndex - 2].matchNotesObj.notesColor
- ? item.wordsList[pIndex - 2].matchNotesObj.notesColor
- : item.wordsList[pIndex - 2].config.color,
- whiteSpace: item.wordsList[pIndex - 2].chs.trim() === '' ? 'pre' : '', // 保留空白分词
- }"
- @click.stop="
- viewNotes(
- $event,
- item.wordsList[pIndex - 2].words
- ? item.wordsList[pIndex - 2].words
- : item.wordsList[pIndex - 2].chs,
- item.wordsList[pIndex - 2],
- )
- "
- >{{ convertText(item.wordsList[pIndex - 2].chs) }}</span
- >
- </template>
- <span
- v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
- :class="[
- 'NNPE-pinyin',
- noFont.indexOf(item.wordsList[pIndex - 2].pinyin) > -1 ? 'noFont' : '',
- ]"
- style="text-align: left"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- @click.stop="
- viewNotes($event, item.wordsList[pIndex - 2].pinyin, item.wordsList[pIndex - 2])
- "
- >{{
- NumberList.indexOf(item.wordsList[pIndex - 2].pinyin) === -1
- ? item.wordsList[pIndex - 2].pinyin
- : ''
- }}</span
- >
- </span>
- <span
- v-if="
- item.wordsList[pIndex - 1] &&
- item.wordsList[pIndex - 1].chs &&
- firstFhlist.indexOf(item.wordsList[pIndex - 1].chs) > -1
- "
- class="NNPE-words-box"
- >
- <span
- v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
- :class="[
- 'NNPE-pinyin',
- noFont.indexOf(item.wordsList[pIndex - 1].pinyin) > -1 ? 'noFont' : '',
- ]"
- style="text-align: left"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- @click.stop="
- viewNotes($event, item.wordsList[pIndex - 1].pinyin, item.wordsList[pIndex - 1])
- "
- >{{
- NumberList.indexOf(item.wordsList[pIndex - 1].pinyin) === -1
- ? item.wordsList[pIndex - 1].pinyin
- : ''
- }}</span
- >
- <el-tooltip
- v-if="item.wordsList[pIndex - 1].matchNotesObj.con"
- popper-class="article-bubble"
- effect="light"
- placement="bottom-start"
- >
- <div
- slot="content"
- :style="{
- color: attrib && attrib.text_color ? attrib.text_color : '#de4444',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '',
- }"
- v-html="item.wordsList[pIndex - 1].matchNotesObj.con"
- ></div>
- <span
- class="NNPE-chs"
- style="text-align: left"
- :class="[
- pItem.chstimeList &&
- pItem.chstimeList[0] &&
- curTime >= pItem.chstimeList[0].wordBg &&
- curQue.wordTime &&
- curTime <= item.timeList[pItem.sentIndex].ed
- ? 'wordActive'
- : '',
- newWordList.indexOf(item.wordsList[pIndex - 1].chs) > -1 ? 'newActive' : '',
- item.wordsList[pIndex - 1].words ? 'newActive' : '',
- ]"
- :style="{
- fontFamily: item.wordsList[pIndex - 1].config.fontFamily,
- textDecoration: item.wordsList[pIndex - 1].config.textDecoration,
- borderBottom:
- item.wordsList[pIndex - 1].config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: item.wordsList[pIndex - 1].config.fontWeight,
- height:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- color:
- newWordList.indexOf(item.wordsList[pIndex - 1].chs) > -1 ||
- item.wordsList[pIndex - 1].words
- ? attrib
- ? attrib.topic_color
- : item.wordsList[pIndex - 1].config.color
- : item.wordsList[pIndex - 1].matchNotesObj.con &&
- item.wordsList[pIndex - 1].matchNotesObj.notesColor
- ? item.wordsList[pIndex - 1].matchNotesObj.notesColor
- : item.wordsList[pIndex - 1].config.color,
- whiteSpace: item.wordsList[pIndex - 1].chs.trim() === '' ? 'pre' : '', // 保留空白分词
- }"
- @click.stop="
- viewNotes(
- $event,
- item.wordsList[pIndex - 1].words
- ? item.wordsList[pIndex - 1].words
- : item.wordsList[pIndex - 1].chs,
- item.wordsList[pIndex - 1],
- )
- "
- >{{ convertText(item.wordsList[pIndex - 1].chs) }}</span
- >
- </el-tooltip>
- <template v-else>
- <span
- class="NNPE-chs"
- style="text-align: left"
- :class="[
- pItem.chstimeList &&
- pItem.chstimeList[0] &&
- curTime >= pItem.chstimeList[0].wordBg &&
- curQue.wordTime &&
- curTime <= item.timeList[pItem.sentIndex].ed
- ? 'wordActive'
- : '',
- newWordList.indexOf(item.wordsList[pIndex - 1].chs) > -1 ? 'newActive' : '',
- item.wordsList[pIndex - 1].words ? 'newActive' : '',
- ]"
- :style="{
- fontFamily: item.wordsList[pIndex - 1].config.fontFamily,
- textDecoration: item.wordsList[pIndex - 1].config.textDecoration,
- borderBottom:
- item.wordsList[pIndex - 1].config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: item.wordsList[pIndex - 1].config.fontWeight,
- height:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- color:
- newWordList.indexOf(item.wordsList[pIndex - 1].chs) > -1 ||
- item.wordsList[pIndex - 1].words
- ? attrib
- ? attrib.topic_color
- : item.wordsList[pIndex - 1].config.color
- : item.wordsList[pIndex - 1].matchNotesObj.con &&
- item.wordsList[pIndex - 1].matchNotesObj.notesColor
- ? item.wordsList[pIndex - 1].matchNotesObj.notesColor
- : item.wordsList[pIndex - 1].config.color,
- whiteSpace: item.wordsList[pIndex - 1].chs.trim() === '' ? 'pre' : '', // 保留空白分词
- }"
- @click.stop="
- viewNotes(
- $event,
- item.wordsList[pIndex - 1].words
- ? item.wordsList[pIndex - 1].words
- : item.wordsList[pIndex - 1].chs,
- item.wordsList[pIndex - 1],
- )
- "
- >{{ convertText(item.wordsList[pIndex - 1].chs) }}</span
- >
- </template>
- <span
- v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
- :class="[
- 'NNPE-pinyin',
- noFont.indexOf(item.wordsList[pIndex - 1].pinyin) > -1 ? 'noFont' : '',
- ]"
- style="text-align: left"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- @click.stop="
- viewNotes($event, item.wordsList[pIndex - 1].pinyin, item.wordsList[pIndex - 1])
- "
- >{{
- NumberList.indexOf(item.wordsList[pIndex - 1].pinyin) === -1
- ? item.wordsList[pIndex - 1].pinyin
- : ''
- }}</span
- >
- </span>
- <template
- v-if="
- item.wordsList[pIndex + 1] &&
- item.wordsList[pIndex + 1].chs &&
- (chsFhList.indexOf(item.wordsList[pIndex + 1].chs) > -1 ||
- NumberList.indexOf(item.wordsList[pIndex + 1].chs) > -1)
- "
- >
- <span class="NNPE-words-box">
- <span
- v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
- class="NNPE-pinyin"
- :class="[
- pItem.className ? pItem.className : '',
- noFont.indexOf(item.pinyin) > -1 ? 'noFont' : '',
- ]"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- @click.stop="viewNotes($event, pItem.pinyin, pItem)"
- >{{ NumberList.indexOf(pItem.pinyin) === -1 ? pItem.pinyin : '' }}</span
- >
- <el-tooltip
- v-if="pItem.matchNotesObj.con"
- popper-class="article-bubble"
- effect="light"
- placement="bottom-start"
- >
- <div
- slot="content"
- :style="{
- color: attrib && attrib.text_color ? attrib.text_color : '#de4444',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '',
- }"
- v-html="pItem.matchNotesObj.con"
- ></div>
- <span
- class="NNPE-chs"
- :class="[
- newWordList.indexOf(pItem.chs) > -1 ? 'newActive' : '',
- pItem.words ? 'newActive' : '',
- ]"
- :style="{
- fontFamily: pItem.config.fontFamily,
- textDecoration: pItem.config.textDecoration,
- borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: pItem.config.fontWeight,
- height:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- color:
- newWordList.indexOf(pItem.chs) > -1 || pItem.words
- ? attrib
- ? attrib.topic_color
- : pItem.config.color
- : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
- ? pItem.matchNotesObj.notesColor
- : pItem.config.color,
- whiteSpace: pItem.chs.trim() === '' ? 'pre' : '', // 保留空白分词
- }"
- @click.stop="viewNotes($event, pItem.words ? pItem.words : pItem.chs, pItem)"
- >{{ convertText(pItem.chs) }}</span
- >
- </el-tooltip>
- <template v-else>
- <span
- class="NNPE-chs"
- :class="[
- newWordList.indexOf(pItem.chs) > -1 ? 'newActive' : '',
- pItem.words ? 'newActive' : '',
- ]"
- :style="{
- fontFamily: pItem.config.fontFamily,
- textDecoration: pItem.config.textDecoration,
- borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: pItem.config.fontWeight,
- height:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- color:
- newWordList.indexOf(pItem.chs) > -1 || pItem.words
- ? attrib
- ? attrib.topic_color
- : pItem.config.color
- : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
- ? pItem.matchNotesObj.notesColor
- : pItem.config.color,
- whiteSpace: pItem.chs.trim() === '' ? 'pre' : '', // 保留空白分词
- }"
- @click.stop="viewNotes($event, pItem.words ? pItem.words : pItem.chs, pItem)"
- >{{ convertText(pItem.chs) }}</span
- >
- </template>
- <span
- v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
- class="NNPE-pinyin"
- :class="[
- pItem.className ? pItem.className : '',
- noFont.indexOf(item.pinyin) > -1 ? 'noFont' : '',
- ]"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- @click.stop="viewNotes($event, pItem.pinyin, pItem)"
- >{{ NumberList.indexOf(pItem.pinyin) === -1 ? pItem.pinyin : '' }}</span
- >
- </span>
- <span class="NNPE-words-box">
- <span
- v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
- class="NNPE-pinyin"
- style="text-align: left"
- :class="[noFont.indexOf(item.wordsList[pIndex + 1].pinyin) > -1 ? 'noFont' : '']"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- @click.stop="
- viewNotes($event, item.wordsList[pIndex + 1].pinyin, item.wordsList[pIndex + 1])
- "
- >{{
- NumberList.indexOf(item.wordsList[pIndex + 1].pinyin) === -1
- ? item.wordsList[pIndex + 1].pinyin
- : ''
- }}</span
- >
- <el-tooltip
- v-if="item.wordsList[pIndex + 1].matchNotesObj.con"
- popper-class="article-bubble"
- effect="light"
- placement="bottom-start"
- >
- <div
- slot="content"
- :style="{
- color: attrib && attrib.text_color ? attrib.text_color : '#de4444',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '',
- }"
- v-html="item.wordsList[pIndex + 1].matchNotesObj.con"
- ></div>
- <span
- class="NNPE-chs"
- :class="[
- newWordList.indexOf(item.wordsList[pIndex + 1].chs) > -1 ? 'newActive' : '',
- item.wordsList[pIndex + 1].words ? 'newActive' : '',
- ]"
- style="text-align: left"
- :style="{
- fontFamily: item.wordsList[pIndex + 1].config.fontFamily,
- textDecoration: item.wordsList[pIndex + 1].config.textDecoration,
- borderBottom:
- item.wordsList[pIndex + 1].config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: item.wordsList[pIndex + 1].config.fontWeight,
- height:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- color:
- newWordList.indexOf(item.wordsList[pIndex + 1].chs) > -1 ||
- item.wordsList[pIndex + 1].words
- ? attrib
- ? attrib.topic_color
- : item.wordsList[pIndex + 1].config.color
- : item.wordsList[pIndex + 1].matchNotesObj.con &&
- item.wordsList[pIndex + 1].matchNotesObj.notesColor
- ? item.wordsList[pIndex + 1].matchNotesObj.notesColor
- : item.wordsList[pIndex + 1].config.color,
- whiteSpace: item.wordsList[pIndex + 1].chs.trim() === '' ? 'pre' : '', // 保留空白分词
- }"
- @click.stop="
- viewNotes(
- $event,
- item.wordsList[pIndex + 1].words
- ? item.wordsList[pIndex + 1].words
- : item.wordsList[pIndex + 1].chs,
- item.wordsList[pIndex + 1],
- )
- "
- >{{ convertText(item.wordsList[pIndex + 1].chs) }}</span
- >
- </el-tooltip>
- <template v-else>
- <span
- class="NNPE-chs"
- :class="[
- newWordList.indexOf(item.wordsList[pIndex + 1].chs) > -1 ? 'newActive' : '',
- item.wordsList[pIndex + 1].words ? 'newActive' : '',
- ]"
- style="text-align: left"
- :style="{
- fontFamily: item.wordsList[pIndex + 1].config.fontFamily,
- textDecoration: item.wordsList[pIndex + 1].config.textDecoration,
- borderBottom:
- item.wordsList[pIndex + 1].config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: item.wordsList[pIndex + 1].config.fontWeight,
- height:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- color:
- newWordList.indexOf(item.wordsList[pIndex + 1].chs) > -1 ||
- item.wordsList[pIndex + 1].words
- ? attrib
- ? attrib.topic_color
- : item.wordsList[pIndex + 1].config.color
- : item.wordsList[pIndex + 1].matchNotesObj.con &&
- item.wordsList[pIndex + 1].matchNotesObj.notesColor
- ? item.wordsList[pIndex + 1].matchNotesObj.notesColor
- : item.wordsList[pIndex + 1].config.color,
- whiteSpace: item.wordsList[pIndex + 1].chs.trim() === '' ? 'pre' : '', // 保留空白分词
- }"
- @click.stop="
- viewNotes(
- $event,
- item.wordsList[pIndex + 1].words
- ? item.wordsList[pIndex + 1].words
- : item.wordsList[pIndex + 1].chs,
- item.wordsList[pIndex + 1],
- )
- "
- >{{ convertText(item.wordsList[pIndex + 1].chs) }}</span
- >
- </template>
- <span
- v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
- class="NNPE-pinyin"
- :class="[noFont.indexOf(item.wordsList[pIndex + 1].pinyin) > -1 ? 'noFont' : '']"
- style="text-align: left"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- @click.stop="
- viewNotes($event, item.wordsList[pIndex + 1].pinyin, item.wordsList[pIndex + 1])
- "
- >{{
- NumberList.indexOf(item.wordsList[pIndex + 1].pinyin) === -1
- ? item.wordsList[pIndex + 1].pinyin
- : ''
- }}</span
- >
- </span>
- <span
- v-if="
- item.wordsList[pIndex + 2] &&
- item.wordsList[pIndex + 2].chs &&
- (chsFhList.indexOf(item.wordsList[pIndex + 2].chs) > -1 ||
- NumberList.indexOf(item.wordsList[pIndex + 2].chs) > -1)
- "
- class="NNPE-words-box"
- >
- <span
- v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
- :class="[
- 'NNPE-pinyin',
- noFont.indexOf(item.wordsList[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
- ]"
- style="text-align: left"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- @click.stop="
- viewNotes($event, item.wordsList[pIndex + 2].pinyin, item.wordsList[pIndex + 2])
- "
- >{{
- NumberList.indexOf(item.wordsList[pIndex + 2].pinyin) === -1
- ? item.wordsList[pIndex + 2].pinyin
- : ''
- }}</span
- >
- <el-tooltip
- v-if="item.wordsList[pIndex + 2].matchNotesObj.con"
- popper-class="article-bubble"
- effect="light"
- placement="bottom-start"
- >
- <div
- slot="content"
- :style="{
- color: attrib && attrib.text_color ? attrib.text_color : '#de4444',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '',
- }"
- v-html="item.wordsList[pIndex + 2].matchNotesObj.con"
- ></div>
- <span
- class="NNPE-chs"
- style="text-align: left"
- :class="[
- pItem.chstimeList &&
- pItem.chstimeList[pItem.leg - 1] &&
- curTime >= pItem.chstimeList[pItem.leg - 1].wordBg &&
- curQue.wordTime &&
- curTime <= item.timeList[pItem.sentIndex].ed
- ? 'wordActive'
- : '',
- newWordList.indexOf(item.wordsList[pIndex + 2].chs) > -1 ? 'newActive' : '',
- item.wordsList[pIndex + 2].words ? 'newActive' : '',
- ]"
- :style="{
- fontFamily: item.wordsList[pIndex + 2].config.fontFamily,
- textDecoration: item.wordsList[pIndex + 2].config.textDecoration,
- borderBottom:
- item.wordsList[pIndex + 2].config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: item.wordsList[pIndex + 2].config.fontWeight,
- height:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- color:
- newWordList.indexOf(item.wordsList[pIndex + 2].chs) > -1 ||
- item.wordsList[pIndex + 2].words
- ? attrib
- ? attrib.topic_color
- : item.wordsList[pIndex + 2].config.color
- : item.wordsList[pIndex + 2].matchNotesObj.con &&
- item.wordsList[pIndex + 2].matchNotesObj.notesColor
- ? item.wordsList[pIndex + 2].matchNotesObj.notesColor
- : item.wordsList[pIndex + 2].config.color,
- whiteSpace: item.wordsList[pIndex + 2].chs.trim() === '' ? 'pre' : '', // 保留空白分词
- }"
- @click.stop="
- viewNotes(
- $event,
- item.wordsList[pIndex + 2].words
- ? item.wordsList[pIndex + 2].words
- : item.wordsList[pIndex + 2].chs,
- item.wordsList[pIndex + 2],
- )
- "
- >{{ convertText(item.wordsList[pIndex + 2].chs) }}</span
- >
- </el-tooltip>
- <template v-else>
- <span
- class="NNPE-chs"
- style="text-align: left"
- :class="[
- pItem.chstimeList &&
- pItem.chstimeList[pItem.leg - 1] &&
- curTime >= pItem.chstimeList[pItem.leg - 1].wordBg &&
- curQue.wordTime &&
- curTime <= item.timeList[pItem.sentIndex].ed
- ? 'wordActive'
- : '',
- newWordList.indexOf(item.wordsList[pIndex + 2].chs) > -1 ? 'newActive' : '',
- item.wordsList[pIndex + 2].words ? 'newActive' : '',
- ]"
- :style="{
- fontFamily: item.wordsList[pIndex + 2].config.fontFamily,
- textDecoration: item.wordsList[pIndex + 2].config.textDecoration,
- borderBottom:
- item.wordsList[pIndex + 2].config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: item.wordsList[pIndex + 2].config.fontWeight,
- height:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- color:
- newWordList.indexOf(item.wordsList[pIndex + 2].chs) > -1 ||
- item.wordsList[pIndex + 2].words
- ? attrib
- ? attrib.topic_color
- : item.wordsList[pIndex + 2].config.color
- : item.wordsList[pIndex + 2].matchNotesObj.con &&
- item.wordsList[pIndex + 2].matchNotesObj.notesColor
- ? item.wordsList[pIndex + 2].matchNotesObj.notesColor
- : item.wordsList[pIndex + 2].config.color,
- whiteSpace: item.wordsList[pIndex + 2].chs.trim() === '' ? 'pre' : '', // 保留空白分词
- }"
- @click.stop="
- viewNotes(
- $event,
- item.wordsList[pIndex + 2].words
- ? item.wordsList[pIndex + 2].words
- : item.wordsList[pIndex + 2].chs,
- item.wordsList[pIndex + 2],
- )
- "
- >{{ convertText(item.wordsList[pIndex + 2].chs) }}</span
- >
- </template>
- <span
- v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
- :class="[
- 'NNPE-pinyin',
- noFont.indexOf(item.wordsList[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
- ]"
- style="text-align: left"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- @click.stop="
- viewNotes($event, item.wordsList[pIndex + 2].pinyin, item.wordsList[pIndex + 2])
- "
- >{{
- NumberList.indexOf(item.wordsList[pIndex + 2].pinyin) === -1
- ? item.wordsList[pIndex + 2].pinyin
- : ''
- }}</span
- >
- </span>
- </template>
- <template v-else>
- <span class="NNPE-words-box">
- <span
- v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
- class="NNPE-pinyin"
- :class="[
- pItem.chs != '“' && pItem.padding ? 'padding' : '',
- pItem.className ? pItem.className : '',
- noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
- ]"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- @click.stop="viewNotes($event, pItem.pinyin, pItem)"
- >{{ NumberList.indexOf(pItem.pinyin) === -1 ? pItem.pinyin : '' }}</span
- >
- <el-tooltip
- v-if="pItem.matchNotesObj.con"
- popper-class="article-bubble"
- effect="light"
- placement="bottom-start"
- >
- <div
- slot="content"
- :style="{
- color: attrib && attrib.text_color ? attrib.text_color : '#de4444',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '',
- }"
- v-html="pItem.matchNotesObj.con"
- ></div>
- <span
- v-if="pItem.chs != '#'"
- class="NNPE-chs"
- :class="[
- newWordList.indexOf(pItem.chs) > -1 ? 'newActive' : '',
- pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
- pItem.words ? 'newActive' : '',
- ]"
- :style="{
- fontFamily: pItem.config.fontFamily,
- textDecoration: pItem.config.textDecoration,
- borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: pItem.config.fontWeight,
- height:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- color:
- newWordList.indexOf(pItem.chs) > -1 || pItem.words
- ? attrib
- ? attrib.topic_color
- : pItem.config.color
- : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
- ? pItem.matchNotesObj.notesColor
- : pItem.config.color,
- whiteSpace: pItem.chs.trim() === '' ? 'pre' : '', // 保留空白分词
- }"
- @click.stop="viewNotes($event, pItem.words ? pItem.words : pItem.chs, pItem)"
- >{{ convertText(pItem.chs) }}</span
- >
- </el-tooltip>
- <template v-else>
- <span
- v-if="pItem.chs != '#'"
- class="NNPE-chs"
- :class="[
- newWordList.indexOf(pItem.chs) > -1 ? 'newActive' : '',
- pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
- pItem.words ? 'newActive' : '',
- ]"
- :style="{
- fontFamily: pItem.config.fontFamily,
- textDecoration: pItem.config.textDecoration,
- borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: pItem.config.fontWeight,
- height:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size
- ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
- : '28px',
- color:
- newWordList.indexOf(pItem.chs) > -1 || pItem.words
- ? attrib
- ? attrib.topic_color
- : pItem.config.color
- : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
- ? pItem.matchNotesObj.notesColor
- : pItem.config.color,
- whiteSpace: pItem.chs.trim() === '' ? 'pre' : '', // 保留空白分词
- }"
- @click.stop="viewNotes($event, pItem.words ? pItem.words : pItem.chs, pItem)"
- >{{ convertText(pItem.chs) }}</span
- >
- </template>
- <span
- v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
- class="NNPE-pinyin"
- :class="[
- pItem.chs != '“' && pItem.padding ? 'padding' : '',
- pItem.className ? pItem.className : '',
- noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
- ]"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- @click.stop="viewNotes($event, pItem.pinyin, pItem)"
- >{{ NumberList.indexOf(pItem.pinyin) === -1 ? pItem.pinyin : '' }}</span
- >
- </span>
- </template>
- </template>
- </template>
- <template v-else>
- <span
- :style="{
- height: pItem.height + 'px',
- width: pItem.width + 'px',
- }"
- ></span>
- </template>
- </div>
- </template>
- <img v-else :src="item.file_url_open" />
- <div style="overflow: hidden; clear: both"></div>
- <div
- v-if="
- config.isShowEN &&
- item.enwords &&
- (!curQue.enPosition || (curQue.enPosition && curQue.enPosition == 'bottom'))
- "
- class="enwords"
- >
- {{ convertText(item.enwords) }}
- </div>
- <div
- v-if="curQue.property.multilingual_position === 'para'"
- class="multilingual-para"
- :class="[item.isTitle ? 'multilingual-para-center' : '']"
- >
- {{
- curQue.detail[index].multilingualTextList &&
- curQue.detail[index].multilingualTextList[multilingual]
- ? curQue.detail[index].multilingualTextList[multilingual].join(' ')
- : ''
- }}
- </div>
- </div>
- <img v-if="articleImg[index + 1]" :src="articleImg[index + 1]" />
- </div>
- </template>
- </div>
- <div
- :class="[
- 'remarkBox',
- item.roleDetail && item.roleDetail.detail && item.roleDetail.detail.wordsList.length > 0
- ? 'remark-top'
- : 'remark-top-8',
- ]"
- >
- <RemarkChs
- :remark-detail="item.remarkDetail"
- :margin-top="
- item.roleDetail && item.roleDetail.detail && item.roleDetail.detail.wordsList.length > 0 ? 44 : 8
- "
- />
- </div>
- </div>
- <div class="NPC-article-empty NPC-article-empty-bottom">
- <div
- :class="['empty-left', isHasRemark ? 'hasRemark' : '']"
- :style="{
- width: isHasRemark && curQue.property.remarkWidth ? 100 - curQue.property.remarkWidth * 1 + '%' : '',
- }"
- ></div>
- <div class="empty-right"></div>
- </div>
- <template v-for="(items, indexs) in curQue.detail">
- <div
- v-if="
- curQue.property.multilingual_position === 'all' &&
- items.multilingualTextList &&
- items.multilingualTextList[multilingual] &&
- items.multilingualTextList[multilingual].length > 0
- "
- :key="indexs"
- class="multilingual"
- >
- <div class="multilingual-para" :class="[items.isTitle ? 'multilingual-para-center' : '']">
- {{
- items.multilingualTextList && items.multilingualTextList[multilingual]
- ? items.multilingualTextList[multilingual].join(' ')
- : ''
- }}
- </div>
- </div>
- </template>
- <div v-if="1 == 2" class="dia-article-record">
- <Soundrecord type="promax" class="luyin-box" @handleWav="handleWav" />
- </div>
- </div>
- </template>
- <div
- v-if="
- ((curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url) ||
- config.isHasPY ||
- config.isHasEN) &&
- curQue.property.mp3_position === 'bottom'
- "
- class="aduioLine-box aduioLine-practice-npc aduioLine-box-bottom"
- >
- <div class="aduioLine-content">
- <template v-if="curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url">
- <AudioLine
- ref="audioLine"
- audio-id="diaPhraAudio"
- :mp3="curQue.mp3_list[0].url"
- :get-cur-time="getCurTime"
- :mp3-source="curQue.mp3_list[0].source"
- :width="colLength == 2 ? 200 : isMobile ? 200 : 790"
- :attrib="attrib"
- />
- </template>
- </div>
- <div class="aduioLine-right">
- <SvgIcon
- v-if="config.isHasPY"
- icon-class="pin-btn"
- size="16"
- :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
- :style="{ color: config.isShowPY ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
- @click="changePinyin"
- />
- <SvgIcon
- v-if="config.isHasEN"
- icon-class="en-btn"
- size="16"
- :class="['EN-16', config.isShowEN ? '' : 'disabled']"
- :style="{ color: config.isShowEN ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
- @click="changeEN"
- />
- </div>
- </div>
- <template v-if="isShow">
- <div
- ref="dialogueWordcard"
- class="NNPE-wordDetail"
- :style="{
- marginLeft:
- word.detail.new_word.length === 1
- ? '-152px'
- : windowWidth > word.detail.new_word.length * 126 + 48
- ? '-' + (word.detail.new_word.length * 63 + 24) + 'px'
- : '0px',
- left: windowWidth > word.detail.new_word.length * 126 + 48 ? '' : '0px',
- }"
- >
- <Wordcard
- :word="word"
- :change-word-card="changeWordCard"
- :theme-color="attrib ? attrib.topic_color : '#e35454'"
- :current-tree-i-d="currentTreeID"
- :TaskModel="TaskModel"
- :write-list="curQue.Bookanswer.writeModel"
- :mp3-url="wordPlayMp3"
- :bg="wordbgs"
- :ed="wordeds"
- :attrib="attrib"
- :is-mobile="isMobile"
- @changeCurQue="changeCurQue"
- />
- </div>
- </template>
- <template v-if="isNoteShow">
- <div
- ref="dialogueNotecard"
- class="NNPE-wordDetail NNPE-noteDetail"
- :style="{
- marginLeft: windowWidth > 642 ? '-321px' : '0px',
- left: windowWidth > 642 ? '' : '0px',
- width: isMobile ? '100%' : '',
- }"
- >
- <Notecard :item="curNoteCon" :change-card="changeCard" :attrib="attrib" :is-mobile="isMobile" />
- </div>
- </template>
- </div>
- </template>
- <script>
- import { timeStrToSen } from '@/utils/transform';
- import AudioLine from '../voice_matrix/components/AudioLine.vue';
- import Wordcard from '../article/components/Wordcard.vue'; // 卡片
- import Notecard from '../article/components/Notecard.vue'; // 注释
- import RoleChs from './RoleChs.vue';
- import RemarkChs from './RemarkChs.vue';
- import Soundrecord from '../../common/SoundRecord.vue';
- export default {
- name: 'PhraseModelChs',
- components: {
- AudioLine,
- Wordcard,
- RoleChs,
- RemarkChs,
- Soundrecord,
- Notecard,
- },
- filters: {
- handlePinyin(wordsList) {
- let str = '';
- wordsList.forEach((item, index) => {
- if (index < wordsList.length - 1) {
- str += `${item.pinyin} `;
- } else {
- str += item.pinyin;
- }
- });
- return str;
- },
- handleChs(wordsList) {
- let str = '';
- wordsList.forEach((item, index) => {
- if (index < wordsList.length - 1) {
- str += `${item.chs} `;
- } else {
- str += item.chs;
- }
- });
- return str;
- },
- },
- inject: ['convertText'],
- props: [
- 'curQue',
- 'bodyLeft',
- 'NNPENewWordList',
- 'NNPEAnnotationList',
- 'colorBox',
- 'attrib',
- 'noFont',
- 'currentTreeID',
- 'config',
- 'TaskModel',
- 'colLength',
- 'NpcNewWordMp3',
- 'isMobile',
- 'multilingual',
- ],
- data() {
- return {
- resArr: [],
- curTime: 0, // 单位s
- chsFhList: [',', '。', '”', ':', '》', '?', '!', ';', '#', '、', '’', ')', '〕', '〕〕', '〉'],
- enFhList: [',', '.', ';', '?', '!', ':', '>', '<'],
- firstFhlist: ['(', '“', '‘', '〔', '〔〔', '〈', '《'],
- NumberList: ['①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳'],
- newWords: ['鱼', '辩礼义'],
- oldHz: '',
- hz: '',
- clientY: '',
- top: 0,
- left: 0,
- articleImg: {}, // 文章图片
- newWordList: [],
- annotationList: [],
- word: null,
- isShow: false,
- screenHeight: 0,
- cardHeight: 0,
- isHasRemark: false,
- clickType: '',
- isNoteShow: false,
- noteNum: '',
- oldNoteNum: '',
- curNoteCon: null,
- contentWidth: 732,
- highWords: null,
- highWordsArr: [],
- highIndex: 0,
- wordbgs: 0,
- wordeds: 0,
- wordPlayMp3: '',
- windowWidth: window.innerWidth,
- };
- },
- computed: {},
- watch: {
- hz: {
- handler(val, oldVal) {
- let _this = this;
- if (val) {
- _this.handleNewWords(val, _this.top, _this.left);
- }
- },
- // 深度观察监听
- deep: true,
- },
- isShow: {
- handler(val, oldVal) {
- let _this = this;
- if (val) {
- setTimeout(() => {
- _this.cardHeight = _this.$refs.dialogueWordcard.offsetHeight;
- if (_this.screenHeight - _this.clientY > _this.cardHeight) {
- _this.top = _this.clientY + 20;
- } else {
- _this.top = _this.clientY - _this.cardHeight - 30;
- }
- }, 50);
- }
- },
- // 深度观察监听
- deep: true,
- },
- noteNum: {
- handler(val, oldVal) {
- let _this = this;
- if (val) {
- _this.handleNote(val);
- }
- },
- // 深度观察监听
- deep: true,
- },
- isNoteShow: {
- handler(val, oldVal) {
- let _this = this;
- if (val) {
- setTimeout(() => {
- _this.cardHeight = _this.$refs.dialogueNotecard.offsetHeight;
- if (_this.screenHeight - _this.clientY > _this.cardHeight) {
- _this.top = _this.clientY + 20;
- } else {
- _this.top = _this.clientY - _this.cardHeight - 30;
- }
- }, 50);
- }
- },
- // 深度观察监听
- deep: true,
- },
- },
- // 生命周期 - 创建完成(可以访问当前this实例)
- created() {},
- // 生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {
- if (
- (this.NNPENewWordList && this.NNPENewWordList.length > 0) ||
- (this.NNPEAnnotationList && this.NNPEAnnotationList.length > 0)
- ) {
- this.handleNewword();
- }
- if (this.curQue) {
- this.handleData();
- }
- window.addEventListener('resize', this.getScreenHeight);
- this.getScreenHeight();
- },
- beforeCreate() {}, // 生命周期 - 创建之前
- beforeMount() {}, // 生命周期 - 挂载之前
- beforeUpdate() {}, // 生命周期 - 更新之前
- updated() {}, // 生命周期 - 更新之后
- beforeDestroy() {
- window.removeEventListener('resize', this.getScreenHeight);
- }, // 生命周期 - 销毁之前
- destroyed() {}, // 生命周期 - 销毁完成
- activated() {},
- // 方法集合
- methods: {
- // 拼音的显示和隐藏
- changePinyin() {
- if (this.config.isHasPY) {
- this.$emit('changeConfig', 'isShowPY');
- }
- },
- // 英文的显示和隐藏
- changeEN() {
- if (this.config.isHasEN) {
- this.$emit('changeConfig', 'isShowEN');
- }
- },
- handleWav() {},
- getCurTime(curTime) {
- this.curTime = curTime * 1000;
- },
- handleData() {
- let resArr = [];
- let leg = this.curQue.detail.length;
- let curQue = JSON.parse(JSON.stringify(this.curQue));
- let dhaspinyin = false; // 每段是否有拼音
- this.isHasRemark = false;
- curQue.detail.forEach((dItem, dIndex) => {
- dhaspinyin = false;
- let roleDetail = this.getRole(dItem);
- let remarkDetail = dItem.remark;
- if (
- remarkDetail &&
- (remarkDetail.chs || remarkDetail.en || (remarkDetail.img_list && remarkDetail.img_list.length > 0))
- ) {
- this.isHasRemark = true;
- }
- let paraArr = [];
- dItem.wordsList.forEach((sItem, sIndex) => {
- let sentence = dItem.sentences[sIndex];
- sItem.forEach((wItem, wIndex) => {
- // this.judgePad(sItem, wItem, wIndex);
- this.mergeWordSymbol(wItem);
- let words = '';
- if (this.newWordList.length > 0) {
- if (!this.highWords) {
- this.findLightWord(wItem, wIndex, sentence, sItem);
- words = this.highWords ? this.highWords.words : '';
- } else if (wIndex > this.highWords.endIndex - 1) {
- this.highWords = null;
- this.findLightWord(wItem, wIndex, sentence, sItem);
- words = this.highWords ? this.highWords.words : '';
- } else {
- words = this.highWords ? this.highWords.words : '';
- }
- }
- let obj = {
- paraIndex: dIndex, // 段落索引
- sentIndex: sIndex, // 在段落中句子索引
- wordIndex: wIndex, // 单词的索引
- pinyin:
- curQue.pinyin_type === 'pinyin'
- ? curQue.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true' && wIndex === 0
- ? wItem.pinyin_up
- : wItem.pinyin
- : wItem.pinyin_tone,
- chs: wItem.chs,
- padding: true, // wItem.padding,
- className: wItem.className,
- isShow: wItem.isShow,
- words,
- isNewWord: this.newWords.indexOf(wItem.chs) > -1,
- config: {
- fontFamily: wItem.fontFamily,
- color: wItem.color,
- textDecoration: wItem.textDecoration,
- border: wItem.border,
- fontWeight: wItem.fontWeight,
- },
- matchWords: wItem.matchWords,
- matchNotes: wItem.matchNotes,
- notesColor: wItem.notesColor,
- matchNotesObj: wItem.matchNotesObj,
- img: wItem.img,
- imgPosition: wItem.imgPosition,
- };
- paraArr.push(obj);
- if (wItem.pinyin) dhaspinyin = true;
- });
- });
- let curSentencesLeg = dItem.sentences.length;
- let startLeg = dIndex === 0 ? 0 : curQue.detail[dIndex - 1].endLeg;
- let endLeg = startLeg + curSentencesLeg;
- dItem.endLeg = endLeg;
- if (dItem.type === 'notice') {
- dItem.endLeg = dIndex === 0 ? 0 : curQue.detail[dIndex - 1].endLeg;
- }
- let timeList = [];
- if (curQue.wordTime && curQue.wordTime.length > 0 && dItem.type === 'text') {
- timeList = curQue.wordTime.slice(startLeg, endLeg);
- }
- let enwords =
- dItem.sentencesEn && dItem.sentencesEn.length > 0 ? dItem.sentencesEn.join(' ').replace(/\\'/g, '’') : '';
- let paraObj = {
- wordsList: paraArr,
- enwords,
- timeList,
- roleDetail,
- remarkDetail,
- dhaspinyin,
- type: dItem.type,
- notice: dItem.notice,
- noticeWordList: dItem.noticeWordList,
- notice_size: dItem.notice_size,
- noitce_family: dItem.noitce_family,
- notice_color: dItem.notice_color,
- file_url_open: dItem.file_url_open,
- };
- resArr.push(paraObj);
- });
- this.resArr = resArr;
- // 循环文章图片
- if (curQue.img_list) {
- curQue.img_list.forEach((item) => {
- this.articleImg[item.imgNumber] = item.id;
- });
- }
- },
- findLightWord(wItem, startIndex, sentence, sItem) {
- let endIndex = 0;
- let words = '';
- this.newWordList.forEach((item) => {
- if (item.length === 1) {
- if (item === wItem.chs && !wItem.banLight) {
- words = wItem.chs;
- endIndex = startIndex + 1;
- }
- } else if (item.substring(0, wItem.chs.length) === wItem.chs && sentence.indexOf(item) > -1) {
- let index = null;
- let chsStr = '';
- for (let i = startIndex; i < sItem.length + 1; i++) {
- index = i;
- if (chsStr.length === item.length) {
- break;
- } else {
- chsStr += sItem[i] ? sItem[i].chs : '';
- }
- }
- if (chsStr === item && !wItem.banLight) {
- words = item;
- endIndex = index;
- }
- } else if (wItem.new_word && wItem.new_word === item && !wItem.banLight) {
- words = item;
- endIndex = startIndex + 1;
- }
- });
- if (words) {
- this.highWords = { words, endIndex };
- } else {
- this.highWords = null;
- }
- },
- // 词和标点合一起
- mergeWordSymbol(wItem) {
- if (
- this.chsFhList.indexOf(wItem.chs) > -1 ||
- this.NumberList.indexOf(wItem.chs) > -1 ||
- this.firstFhlist.indexOf(wItem.chs) > -1
- ) {
- wItem.isShow = false;
- } else {
- wItem.isShow = true;
- }
- },
- // 获取角色
- getRole(dItem) {
- let roleIndex = dItem.roleIndex;
- let resObj = null;
- let roleList = JSON.parse(JSON.stringify(this.curQue.property.role_list));
- for (let i = 0; i < roleList.length; i++) {
- let item = roleList[i];
- if (item.id === roleIndex) {
- resObj = item;
- // resObj.color = this.colorBox[i];
- break;
- }
- }
- return resObj;
- },
- // 判断是否有padding
- judgePad(sItem, wItem, curIndex) {
- let leg = sItem.length;
- if (curIndex < leg - 1) {
- let nextIndex = curIndex + 1;
- let chs = sItem[nextIndex].chs;
- if (this.chsFhList.indexOf(chs) > -1 || this.chsFhList.indexOf(wItem.chs) > -1) {
- wItem.padding = false;
- } else {
- wItem.padding = true;
- }
- if (this.enFhList.indexOf(wItem.pinyin) > -1) {
- wItem.className = 'textLeft';
- }
- }
- },
- // 转化时间
- handleTimeList(list) {
- let listRes = [];
- list.forEach((item) => {
- let res = timeStrToSen(item);
- listRes.push(res);
- });
- return listRes;
- },
- // 点击播放某个句子
- handleChangeTime(time) {
- this.curTime = time;
- this.$refs.audioLine.onTimeupdateTime(time);
- },
- handleNewword() {
- let NewWordList = [];
- this.NNPENewWordList.forEach((wItem) => {
- // item.forEach((wItem) => {
- if (wItem.new_word) {
- NewWordList.push(wItem.new_word);
- } else if (wItem.detail && wItem.detail.sentence) {
- NewWordList.push(wItem.detail.sentence);
- }
- // });
- });
- this.newWordList = JSON.parse(JSON.stringify(NewWordList));
- let annotationList = [];
- this.NNPEAnnotationList.forEach((wItem) => {
- // item.forEach((wItem) => {
- if (wItem.con) {
- annotationList.push(wItem.con.replace(/<[^>]*>?/gm, ''));
- }
- // });
- });
- this.annotationList = JSON.parse(JSON.stringify(annotationList));
- },
- showWordDetail(e, word, words) {
- let _this = this;
- _this.highIndex = 0;
- _this.highWordsArr = [];
- if (word && this.newWordList.indexOf(word) > -1) {
- this.highWordsArr.push(word);
- }
- if (words && word !== words && this.newWordList.indexOf(words) > -1) {
- this.highWordsArr.push(words);
- }
- if (this.newWordList.indexOf(word) > -1 || this.newWordList.indexOf(words) > -1) {
- if (word && this.newWordList.indexOf(word) > -1) {
- if (_this.oldHz !== word) {
- this.isShow = false;
- setTimeout(() => {
- _this.hz = word;
- }, 50);
- }
- } else if (words && this.newWordList.indexOf(words) > -1) {
- if (_this.oldHz !== words) {
- this.isShow = false;
- setTimeout(() => {
- _this.hz = words;
- }, 50);
- }
- }
- _this.clientY = e.clientY;
- let left = e.clientX;
- let width = 0;
- if (word.length === 1 || word.length === 2) {
- width = 304;
- } else if (word.length === 3 || word.length === 4) {
- width = 432;
- } else if (word.length > 3) {
- width = 560;
- }
- if (left - this.bodyLeft > this.contentWidth / 2) {
- _this.left = left - width + 10;
- } else {
- _this.left = left;
- }
- }
- },
- hideWordDetail() {
- this.isShow = false;
- },
- changeWordCard(isShow) {
- this.isShow = isShow;
- this.oldHz = '';
- this.hz = '';
- },
- // 处理分词数据
- handleNewWords(val, top, left) {
- this.isShow = true;
- this.word = null;
- for (let i = 0; i < this.NNPENewWordList.length; i++) {
- let pItem = this.NNPENewWordList[i];
- // for (let j = 0; j < pItem.length; j++) {
- let item = pItem;
- if (item.new_word.trim() === val.trim()) {
- let wordlist = val.split('');
- this.word = JSON.parse(
- JSON.stringify({
- list: wordlist,
- detail: item,
- top,
- left,
- }),
- );
- break;
- }
- // }
- }
- this.oldHz = val;
- },
- viewNotes(e, noteNum, words) {
- let _this = this;
- _this.clickType = 'note';
- let noteIndex = '';
- _this.wordPlayMp3 = '';
- _this.NNPENewWordList.forEach((itemn) => {
- // items.forEach((itemn) => {
- if (itemn.new_word === noteNum) {
- _this.wordbgs = itemn.audio_begin_time || itemn.bg;
- _this.wordeds = itemn.audio_end_time || itemn.ed;
- _this.wordPlayMp3 = itemn.newWordMp3 || itemn.audio_file_url;
- }
- // });
- });
- if (_this.NumberList.indexOf(noteNum) > -1) {
- for (let i = 0; i < _this.NumberList.length; i++) {
- if (_this.NumberList[i] === noteNum) {
- noteIndex = `${String(i)}`;
- break;
- }
- }
- this.showNoteDetail(e, noteIndex);
- } else if (words.matchNotes) {
- // 关联了注释
- if (_this.NNPEAnnotationList && _this.NNPEAnnotationList.length > 0) {
- _this.NNPEAnnotationList.forEach((item, indexs) => {
- let textContent = item.con.replace(/<[^>]*>?/gm, '');
- if (textContent === words.matchNotes.trim()) {
- noteIndex = `${String(indexs)}`;
- this.showNoteDetail(e, noteIndex);
- }
- });
- }
- // } else if (
- // _this.NNPEAnnotationList &&
- // _this.NNPEAnnotationList.length > 0 &&
- // _this.annotationList.indexOf(words.chs) > -1
- // ) {
- // _this.NNPEAnnotationList.forEach((item, indexs) => {
- // let textContent = item.con.replace(/<[^>]*>?/gm, '');
- // if (textContent === words.chs.trim()) {
- // noteIndex = `${String(indexs)}`;
- // this.showNoteDetail(e, noteIndex);
- // }
- // });
- } else if (this.newWordList.indexOf(noteNum) > -1) {
- if (_this.oldHz !== noteNum) {
- this.isShow = false;
- setTimeout(() => {
- _this.hz = noteNum;
- }, 50);
- }
- _this.clientY = e.clientY;
- let left = e.clientX;
- let width = 0;
- if (noteNum.length === 1 || noteNum.length === 2) {
- width = 304;
- } else if (noteNum.length === 3 || noteNum.length === 4) {
- width = 432;
- } else if (noteNum.length > 3) {
- width = 560;
- }
- if (left - this.bodyLeft > this.contentWidth / 2) {
- _this.left = left - width + 10;
- } else {
- _this.left = left;
- }
- } else if (words.matchWords && this.newWordList.indexOf(words.matchWords) > -1) {
- // 关联了生词
- if (_this.oldHz !== words.matchWords) {
- this.isShow = false;
- setTimeout(() => {
- _this.hz = words.matchWords;
- }, 50);
- }
- _this.clientY = e.clientY;
- let left = e.clientX;
- let width = 0;
- if (words.matchWords.length === 1 || words.matchWords.length === 2) {
- width = 304;
- } else if (words.matchWords.length === 3 || words.matchWords.length === 4) {
- width = 432;
- } else if (words.matchWords.length > 3) {
- width = 560;
- }
- if (left - this.bodyLeft > this.contentWidth / 2) {
- _this.left = left - width + 10;
- } else {
- _this.left = left;
- }
- }
- },
- showNoteDetail(e, noteNum) {
- let _this = this;
- if (_this.oldNoteNum !== noteNum) {
- this.isNoteShow = false;
- setTimeout(() => {
- _this.noteNum = noteNum;
- }, 50);
- }
- _this.clientY = e.clientY;
- let left = e.clientX;
- let width = 642;
- if (left - this.bodyLeft > this.contentWidth / 2) {
- _this.left = left - width + 10;
- } else {
- _this.left = left - 200;
- }
- },
- // 处理注释数据
- handleNote(val) {
- let _this = this;
- _this.isNoteShow = true;
- _this.oldNoteNum = val;
- let noteIndex = Number(val);
- if (_this.NNPEAnnotationList && _this.NNPEAnnotationList.length > 0) {
- _this.curNoteCon = _this.NNPEAnnotationList[noteIndex] ? _this.NNPEAnnotationList[noteIndex] : null;
- }
- },
- changeCard(isShow) {
- let _this = this;
- _this.isNoteShow = isShow;
- _this.oldNoteNum = '';
- _this.noteNum = '';
- },
- getScreenHeight() {
- this.screenHeight = window.innerHeight;
- },
- changeCurQue(answer) {
- if (answer) {
- let writeModel = this.curQue.Bookanswer.writeModel;
- let hz = answer.hz;
- if (writeModel.hasOwnProperty(hz)) {
- writeModel[hz].push(answer);
- } else {
- writeModel[hz] = [answer];
- }
- }
- },
- }, // 如果页面有keep-alive缓存功能,这个函数会触发
- };
- </script>
- <style lang="scss" scoped>
- .NNPE-ArticleView {
- width: 100%;
- .aduioLine-practice-npc {
- display: flex;
- align-items: center;
- justify-content: flex-start;
- .aduioLine-content {
- flex: 1;
- }
- .aduioLine-right {
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: space-between;
- width: 69px;
- height: 40px;
- padding: 0 12px;
- border-left: 1px solid rgba(0, 0, 0, 10%);
- > span {
- width: 16px;
- height: 16px;
- cursor: pointer;
- }
- }
- }
- .NPC-sentences-list {
- overflow: auto;
- .NPC-article-empty {
- display: flex;
- align-items: flex-start;
- justify-content: flex-start;
- > div {
- height: 24px;
- &.empty-left {
- box-sizing: border-box;
- width: 100%;
- &.hasRemark {
- box-sizing: border-box;
- width: 70%;
- border-right: 1px rgba(0, 0, 0, 10%) solid;
- }
- }
- &.empty-right {
- flex: 1;
- }
- }
- &-bottom {
- > div {
- height: 40px;
- }
- }
- }
- .dia-article-record {
- width: 100%;
- border-top: 1px solid rgba(0, 0, 0, 10%);
- .luyin-box {
- justify-content: start;
- justify-content: flex-start;
- width: 280px;
- height: 40px;
- padding: 8px 12px;
- }
- }
- }
- .multilingual {
- padding: 6px 24px 12px;
- word-break: break-word;
- }
- .NNPE-detail {
- // overflow: hidden; // 为了不遮挡备注内容
- display: flex;
- align-items: flex-start;
- justify-content: flex-start;
- clear: both;
- &.active {
- background: rgba(0, 0, 0, 6%);
- }
- .article-content {
- box-sizing: border-box;
- display: flex;
- align-items: flex-start;
- justify-content: flex-start;
- width: 100%;
- padding: 8px 24px;
- &.hasRemark {
- width: 70%;
- padding: 8px 0 8px 23px;
- border-right: 1px rgba(0, 0, 0, 10%) solid;
- }
- &.paraLast {
- padding-bottom: 24px;
- }
- }
- .enwords {
- padding-left: 3px;
- font-family: 'Helvetica';
- font-size: 14px;
- font-weight: normal;
- line-height: 22px;
- color: rgba(0, 0, 0, 85%);
- word-break: break-word;
- }
- .NNPE-words {
- float: left;
- padding-bottom: 5px;
- &-box {
- float: left;
- > span {
- display: block;
- &.NNPE-pinyin {
- height: 22px;
- font-family: 'League';
- font-size: 14px;
- font-weight: normal;
- line-height: 1.5;
- color: #000;
- &.noFont {
- font-family: initial;
- }
- &.textLeft {
- text-align: left;
- }
- }
- &.NNPE-chs {
- font-family: '楷体';
- font-size: 20px;
- line-height: 1.4;
- color: #000;
- &.active {
- background: rgba(60, 200, 99, 20%);
- }
- &.wordActive {
- color: #de4444;
- }
- &.newActive {
- color: #de4444;
- }
- }
- &.padding {
- padding: 0 3px;
- }
- }
- }
- &.textLeft {
- text-align: left;
- }
- &.textCenter {
- text-align: center;
- }
- &.textRight {
- text-align: right;
- }
- > span {
- display: block;
- &.NNPE-pinyin {
- height: 22px;
- font-family: 'League';
- font-size: 14px;
- font-weight: normal;
- line-height: 1.5;
- color: #000;
- &.noFont {
- font-family: initial;
- }
- &.textLeft {
- text-align: left;
- }
- }
- &.NNPE-chs {
- font-family: '楷体';
- font-size: 20px;
- line-height: 1.4;
- color: #000;
- &.active {
- background: rgba(60, 200, 99, 20%);
- }
- &.wordActive {
- color: #de4444;
- }
- &.newActive {
- color: #de4444;
- }
- }
- &.padding {
- padding: 0 3px;
- }
- }
- }
- &.NNPE-detail-title {
- .wordsList-box {
- > div {
- display: flex;
- flex-flow: wrap;
- justify-content: center;
- }
- }
- }
- .index {
- box-sizing: border-box;
- width: 48px;
- padding: 8px;
- text-align: right;
- border-right: 1px solid rgba(0, 0, 0, 10%);
- b {
- font-weight: 400;
- line-height: 1.5;
- color: #000;
- }
- }
- .wordsList-box {
- width: 100%;
- padding: 0 24px 0 8px;
- overflow: hidden;
- clear: both;
- .roleDetail {
- display: flex;
- align-items: center;
- justify-content: flex-start;
- height: 36px;
- .pinyin {
- margin-left: 4px;
- font-family: 'League';
- font-size: 14px;
- line-height: 22px;
- color: rgba(0, 0, 0, 85%);
- }
- .chs {
- font-family: '楷体';
- font-size: 16px;
- line-height: 24px;
- color: rgba(0, 0, 0, 85%);
- }
- }
- > .para-con {
- box-sizing: border-box;
- float: left;
- padding: 8px 12px;
- border: 1px solid rgba(0, 0, 0, 10%);
- border-radius: 8px;
- }
- > img {
- display: block;
- max-width: 100%;
- margin: 0 auto;
- }
- }
- }
- .remarkBox {
- position: relative;
- display: flex;
- flex: 1;
- align-items: center;
- justify-content: center;
- &.remark72 {
- padding-top: 72px;
- }
- &.remark-top {
- padding-top: 44px;
- }
- }
- .NNPE-wordDetail {
- position: fixed;
- top: 50%;
- left: 50%;
- z-index: 116;
- max-width: 100%;
- margin-top: -196px;
- overflow: auto;
- // box-shadow: 0 4px 16px rgba(0, 0, 0, 15%);
- }
- .NNPE-noteDetail {
- padding: 8px;
- margin-top: -130px;
- box-shadow: none;
- }
- .notice {
- margin: 0;
- font-size: 14px;
- font-weight: 400;
- line-height: 150%;
- color: #000;
- word-break: break-word;
- }
- img {
- max-width: 100%;
- }
- }
- </style>
- <style lang="scss">
- .article-bubble.el-tooltip__popper.is-light {
- max-width: 530px;
- border-color: #fff;
- box-shadow: 0 4px 16px rgba(0, 0, 0, 15%);
- }
- .article-bubble.el-tooltip__popper .popper__arrow,
- .article-bubble.el-tooltip__popper .popper__arrow::before {
- border-bottom-color: transparent !important;
- }
- </style>
|