12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270 |
- <template>
- <div class="print-model">
- <div class="print-model-top">
- <a class="goback" @click="goBack"
- ><i class="el-icon-arrow-left"></i>回到文章</a
- >
- <div class="border"></div>
- <p class="article-title">打印预览</p>
- </div>
- <div class="print-model-bottom">
- <div
- class="print-model-bottom-left"
- ref="printArea"
- id="showWaterMark"
- :style="{ width: isPrint ? '220mm' : '' }"
- >
- <div class="print-inner">
- <h2>
- <span
- :style="{
- color: colorObj.titleColor,
- fontSize: titleFontsize + 'px',
- lineHeight: titleFontsize + 8 + 'px',
- marginRight: '10px',
- fontWeight: '700',
- cursor: 'pointer',
- wordBreak: 'break-word',
- }"
- >{{ articleInfo.art_title }}</span
- >
- </h2>
- <h6
- class="nnpe-article-author"
- :style="{
- color: colorObj.sourceColor,
- fontSize: wordFontsize - 4 + 'px',
- lineHeight: wordFontsize + 4 + 'px',
- fontWeight: '400',
- }"
- >
- {{
- articleInfo.art_author +
- " · " +
- articleInfo.study_phase_name +
- "版 · 第 " +
- articleInfo.iss_no +
- " 期 · " +
- articleInfo.release_date +
- " · " +
- articleInfo.chn_item +
- (articleInfo.page_no_in_pub
- ? " · P" + articleInfo.page_no_in_pub
- : "")
- }}
- {{ printForm.info.length > 0 ? " | " : "" }}
- {{
- printForm.info.indexOf("wordLength") > -1
- ? " 长度 " + articleInfo.art_corpus_data.artStatInfo.wc
- : ""
- }}
- {{
- printForm.info.indexOf("wordNumber") > -1
- ? " · 词数 " + articleInfo.art_corpus_data.artStatInfo.wdc
- : ""
- }}
- {{
- printForm.info.indexOf("difficulty") > -1
- ? " · 难度 " +
- articleInfo.art_corpus_data.artStatInfo.vocabHardLevel
- : ""
- }}
- </h6>
- <template v-if="resArr.length > 0 && articleInfo.en_flag">
- <div class="table-box">
- <div
- :class="['NNPE-detail']"
- v-for="(item, index) in resArr"
- :key="'detail' + index"
- >
- <div class="wordsList-box">
- <template v-if="index !== 0">
- <div class="nnpe-sentence-box">
- <div
- v-for="(pItem, pIndex) in item.wordsList"
- :key="'wordsList' + pIndex"
- class="word-box"
- :class="[
- pItem.isExplain || pItem.explainNumber
- ? 'hasExplain'
- : '',
- ]"
- >
- <template v-if="pItem.isShow">
- <template v-if="pItem.tokens[2] === '#@@#'">
- <span
- class="NNPE-chs"
- :style="{
- width: printForm.fontSize + 'px',
- height:
- printForm.fontSize * printForm.lineHeight +
- 'px',
- display: 'block',
- fontFamily: printForm.fontFamily,
- }"
- ></span>
- </template>
- <template v-else>
- <div :class="['NNPE-words']">
- <span
- class="NNPE-chs"
- :class="[
- pItem.tokens[9] === '' ? 'marginRight' : '',
- (pItem.highIndex &&
- printForm.bold.indexOf(pItem.types) > -1) ||
- (printForm.bold.indexOf('sentence') > -1 &&
- longSentIds.indexOf(pItem.sent_id) > -1)
- ? 'fontWeight'
- : '',
- pItem.marginRigh ? 'marginSingleRight' : '',
- ]"
- :style="{
- fontSize: printForm.fontSize + 'px',
- color: printForm.color,
- lineHeight: printForm.lineHeight,
- fontFamily: printForm.fontFamily,
- }"
- >{{ pItem.tokens[2] }}</span
- >
- <span
- class="NNPE-chs NNPE-chs-both"
- v-if="
- item.wordsList[pIndex + 1] &&
- item.wordsList[pIndex + 1].tokens[2] &&
- enFhList.indexOf(
- item.wordsList[pIndex + 1].tokens[2]
- ) > -1
- "
- :class="[
- item.wordsList[pIndex + 1].tokens[8] === ''
- ? 'marginLeft'
- : '',
- (item.wordsList[pIndex + 1].highIndex &&
- printForm.bold.indexOf(
- item.wordsList[pIndex + 1].types
- ) > -1) ||
- (printForm.bold.indexOf('sentence') > -1 &&
- longSentIds.indexOf(
- item.wordsList[pIndex + 1].sent_id
- ) > -1)
- ? 'fontWeight'
- : '',
- item.wordsList[pIndex + 1].marginRight
- ? 'marginSingleRight'
- : '',
- ]"
- :style="{
- fontSize: printForm.fontSize + 'px',
- color: printForm.color,
- lineHeight: printForm.lineHeight,
- fontFamily: printForm.fontFamily,
- }"
- >{{
- item.wordsList[pIndex + 1].tokens[2]
- }}</span
- >
- </div>
- </template>
- </template>
- </div>
- </div>
- </template>
- </div>
- <template
- v-if="
- articleImg &&
- articleImg[index] &&
- printForm.range.indexOf('image') > -1
- "
- >
- <figure
- v-for="(itemI, indexI) in articleImg[index]"
- :key="indexI"
- style="text-align: center"
- >
- <img
- @load="handleImageLoad($event, itemI)"
- :style="{
- width: itemI.width,
- height: itemI.height,
- }"
- :src="itemI.src"
- />
- <!-- <el-image
- :src="itemI.src"
- fit="contain"
- :style="{
- width: itemI.width,
- height: itemI.height,
- }"
- :preview-src-list="[itemI.src]"
- @load="handleImageLoad($event, itemI)"
- ></el-image> -->
- </figure>
- </template>
- </div>
- </div>
- </template>
- <div
- v-else
- class="cn-content"
- v-html="articleInfo.art_content"
- :style="{
- color: printForm.color,
- fontSize: printForm.fontSize + 'px',
- lineHeight: printForm.lineHeight,
- }"
- ></div>
- <template v-if="printForm.range.indexOf('vocab') > -1">
- <h5>词表</h5>
- <ul class="newwordlist">
- <li
- v-for="(itemW, indexW) in wordLit"
- :key="indexW"
- :class="['li-' + colorObj.type]"
- >
- <div class="word-info">
- <div class="word-info-top">
- <b class="word" :style="{ color: colorObj.newWordColor }">{{
- itemW.word
- }}</b>
- <span
- class="symbol"
- :style="{ color: colorObj.newWordOtherColor }"
- >{{ itemW.symbol }}</span
- >
- <label
- class="word-type"
- :style="{
- color: colorObj.newWordType[itemW.type]
- ? colorObj.newWordType[itemW.type].color
- : '',
- background: colorObj.newWordType[itemW.type]
- ? colorObj.newWordType[itemW.type].bg
- : '',
- }"
- >{{ itemW.typeCn }}</label
- >
- <span class="star" v-if="itemW.rate">
- <svg-icon
- icon-class="star-filled"
- v-for="(itemS, indexS) in itemW.rate"
- :key="indexS"
- :style="{ color: colorObj.newWordStar }"
- ></svg-icon>
- </span>
- <div class="para-list">
- <div
- class="para"
- v-for="(itemP, indexP) in itemW.paraList"
- :key="indexP"
- >
- <span
- class="cixing"
- :style="{ color: colorObj.newWordOtherColor }"
- >{{ itemP.cixing }}</span
- >
- <span
- class="shiyi"
- :style="{ color: colorObj.newWordOtherColor }"
- >{{ itemP.para }}</span
- >
- </div>
- </div>
- </div>
- </div>
- </li>
- </ul>
- <h5
- v-if="
- articleInfo.art_phrase_data &&
- articleInfo.art_phrase_data.length > 0
- "
- >
- 短语
- </h5>
- <ul
- class="phraselist"
- v-if="
- articleInfo.art_phrase_data &&
- articleInfo.art_phrase_data.length > 0
- "
- >
- <li v-for="(itemW, indexW) in phraseList" :key="indexW">
- <div class="word-info">
- <div class="word-info-top">
- <b
- class="phrase"
- :style="{ color: colorObj.phraseColor }"
- @click="showItem(itemW, indexW)"
- >{{ itemW.exp_title }}</b
- >
- <div class="para-list">
- <div class="para">
- <span
- class="shiyi"
- :style="{ color: colorObj.phraseOhterColor }"
- >{{ itemW.exp_content }}</span
- >
- </div>
- </div>
- </div>
- </div>
- </li>
- </ul>
- <h5
- v-if="
- articleInfo.art_explain_data &&
- articleInfo.art_explain_data.length > 0
- "
- >
- 注释
- </h5>
- <ul
- class="explainlist"
- v-if="
- articleInfo.art_explain_data &&
- articleInfo.art_explain_data.length > 0
- "
- >
- <li
- v-for="(itemW, indexW) in articleInfo.art_explain_data"
- :key="indexW"
- >
- <b
- class="prefix"
- :style="{ color: colorObj.phraseOhterColor }"
- >{{ itemW.exp_title }}</b
- >
- <div
- class="para-list"
- :style="{ color: colorObj.newWordOtherColor }"
- v-html="itemW.exp_content"
- ></div>
- </li>
- </ul>
- </template>
- <template v-if="printForm.range.indexOf('ciyun') > -1">
- <iframe
- class="ciyun-box"
- width="100%"
- height="720px"
- border="none"
- :src="
- './ciyun/ciyunPrint.html?partitionKey=1&searchType=2&articleId=' +
- articleId
- "
- ></iframe>
- </template>
- <template v-if="printForm.range.indexOf('notes') > -1">
- <h5 v-if="notesList.length > 0">笔记</h5>
- <ul class="explainlist">
- <li v-for="(itemW, indexW) in notesList" :key="indexW">
- <b
- class="prefix"
- :style="{ color: colorObj.phraseOhterColor }"
- >{{ itemW.select_text }}</b
- >
- <div
- class="para-list"
- :style="{ color: colorObj.newWordOtherColor }"
- v-html="itemW.note"
- ></div>
- </li>
- </ul>
- </template>
- </div>
- <footer class="print-footer">
- <span>{{ printForm.school }}</span>
- <span>{{ printForm.className }}</span>
- <span>{{ printForm.name }}</span>
- <span style="flex: 1"></span>
- <span>{{ printForm.dateStr }}</span>
- <span>{{ printForm.momo }}</span>
- </footer>
- </div>
- <div class="print-model-bottom-right">
- <h3><svg-icon icon-class="print"></svg-icon>打印设置</h3>
- <div class="config-box">
- <div class="item-page">
- <label>字体:</label>
- <el-select v-model="printForm.fontFamily" placeholder="请选择">
- <el-option
- v-for="item in fontList"
- :key="item.value"
- :label="item.name"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </div>
- <div class="item-page">
- <label>字号:</label>
- <el-input-number
- v-model="printForm.fontSize"
- :step="2"
- ></el-input-number>
- </div>
- <div class="item-page">
- <label>颜色:</label>
- <el-color-picker
- v-model="printForm.color"
- size="small"
- ></el-color-picker>
- </div>
- <el-divider class="print-divider"></el-divider>
- <div class="item-page">
- <label>行距:</label>
- <el-select v-model="printForm.lineHeight" placeholder="请选择">
- <el-option
- v-for="item in lineHeightList"
- :key="item.value"
- :label="item.name"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </div>
- <el-divider class="print-divider"></el-divider>
- <div class="item-page">
- <label>打印范围:</label>
- <el-checkbox-group v-model="printForm.range">
- <el-checkbox
- v-for="(itemT, indexT) in rangeList"
- :key="indexT"
- :label="itemT.value"
- >{{ itemT.name }}</el-checkbox
- >
- </el-checkbox-group>
- </div>
- <div class="item-page" v-if="articleInfo.en_flag">
- <label>加粗显示:</label>
- <el-checkbox-group v-model="printForm.bold">
- <el-checkbox
- v-for="(itemT, indexT) in boldList"
- :key="indexT"
- :label="itemT.value"
- >{{ itemT.name }}</el-checkbox
- >
- </el-checkbox-group>
- </div>
- <el-divider class="print-divider"></el-divider>
- <div class="item-page">
- <label>附加信息:</label>
- <b @click="handleClear"
- ><svg-icon icon-class="clear"></svg-icon>清除</b
- >
- </div>
- <div class="item-page">
- <label>姓名:</label>
- <el-input
- v-model="printForm.name"
- autocomplete="off"
- placeholder="请输入"
- maxlength="20"
- >
- </el-input>
- </div>
- <div class="item-page">
- <label>学校:</label>
- <el-input
- v-model="printForm.school"
- autocomplete="off"
- placeholder="请输入"
- maxlength="20"
- >
- </el-input>
- </div>
- <div class="item-page">
- <label>班级:</label>
- <el-input
- v-model="printForm.className"
- autocomplete="off"
- placeholder="请输入"
- maxlength="20"
- >
- </el-input>
- </div>
- <div class="item-page">
- <label>日期:</label>
- <el-input
- v-model="printForm.dateStr"
- autocomplete="off"
- placeholder="请输入"
- maxlength="20"
- >
- </el-input>
- </div>
- <div class="item-page">
- <label>备注:</label>
- <el-input
- v-model="printForm.momo"
- autocomplete="off"
- placeholder="请输入"
- maxlength="20"
- >
- </el-input>
- </div>
- <el-divider class="print-divider"></el-divider>
- <div class="item-page">
- <label>统计信息:</label>
- <el-checkbox-group v-model="printForm.info">
- <el-checkbox
- v-for="(itemT, indexT) in infoList"
- :key="indexT"
- :label="itemT.value"
- >{{ itemT.name }}</el-checkbox
- >
- </el-checkbox-group>
- </div>
- <el-divider class="print-divider"></el-divider>
- </div>
- <p style="color: red; width: 100%; margin: 10px 0; text-align: center">
- 若点击打印按钮无法显示,下一个页面点击更多设置,勾选背景图形
- </p>
- <div class="item-page" style="padding: 0 24px">
- <el-button @click="goBack" size="small">取消</el-button>
- <el-button type="primary" @click="generatePDF" size="small"
- >下载</el-button
- >
- <el-button type="primary" @click="handlePrint" size="small"
- >打印</el-button
- >
- <el-button type="primary" @click="handleManyPrint" size="small"
- >打印多篇</el-button
- >
- </div>
- </div>
- </div>
- <el-dialog
- :visible.sync="printManyFlag"
- width="500px"
- append-to-body
- :show-close="true"
- title="选择打印的文章"
- :close-on-click-modal="false"
- >
- <el-form ref="form">
- <el-form-item prop="name">
- <el-cascader
- v-model="printManyId"
- :props="{ multiple: true }"
- collapse-tags
- :options="printManyMenu"
- style="width: 470px"
- />
- </el-form-item>
- <el-form-item style="text-align: right">
- <el-button @click="printManyFlag = false">取 消</el-button>
- <el-button :loading="loading" type="primary" @click="submitPrintMore"
- >确 定</el-button
- ></el-form-item
- >
- </el-form>
- </el-dialog>
- <div
- class="print-model-bottom-left"
- ref="printAreaManys"
- id="showWaterMarks"
- v-if="isPrintMore"
- :style="{
- width: '220mm',
- }"
- >
- <div
- class="print-inner"
- v-for="(itemA, index) in printManyDetails"
- :key="index"
- >
- <h2>
- <span
- :style="{
- color: colorObj.titleColor,
- fontSize: titleFontsize + 'px',
- lineHeight: titleFontsize + 8 + 'px',
- marginRight: '10px',
- fontWeight: '700',
- cursor: 'pointer',
- wordBreak: 'break-word',
- }"
- >{{ itemA.art_title }}</span
- >
- </h2>
- <h6
- class="nnpe-article-author"
- :style="{
- color: colorObj.sourceColor,
- fontSize: wordFontsize - 4 + 'px',
- lineHeight: wordFontsize + 4 + 'px',
- fontWeight: '400',
- }"
- >
- {{
- itemA.art_author +
- " · " +
- itemA.study_phase_name +
- "版 · 第 " +
- itemA.iss_no +
- " 期 · " +
- itemA.release_date +
- " · " +
- itemA.chn_item +
- (itemA.page_no_in_pub ? " · P" + itemA.page_no_in_pub : "")
- }}
- {{ printForm.info.length > 0 ? " | " : "" }}
- {{
- printForm.info.indexOf("wordLength") > -1
- ? " 长度 " + itemA.art_corpus_data.artStatInfo.wc
- : ""
- }}
- {{
- printForm.info.indexOf("wordNumber") > -1
- ? " · 词数 " + itemA.art_corpus_data.artStatInfo.wdc
- : ""
- }}
- {{
- printForm.info.indexOf("difficulty") > -1
- ? " · 难度 " + itemA.art_corpus_data.artStatInfo.vocabHardLevel
- : ""
- }}
- </h6>
- <template v-if="itemA.resArr.length > 0 && itemA.en_flag">
- <div class="table-box">
- <div
- :class="['NNPE-detail']"
- v-for="(item, index) in itemA.resArr"
- :key="'detail' + index"
- >
- <div class="wordsList-box">
- <template v-if="index !== 0">
- <div class="nnpe-sentence-box">
- <div
- v-for="(pItem, pIndex) in item.wordsList"
- :key="'wordsList' + pIndex"
- class="word-box"
- :class="[
- pItem.isExplain || pItem.explainNumber
- ? 'hasExplain'
- : '',
- ]"
- >
- <template v-if="pItem.isShow">
- <template v-if="pItem.tokens[2] === '#@@#'">
- <span
- class="NNPE-chs"
- :style="{
- width: printForm.fontSize + 'px',
- height:
- printForm.fontSize * printForm.lineHeight +
- 'px',
- display: 'block',
- fontFamily: printForm.fontFamily,
- }"
- ></span>
- </template>
- <template v-else>
- <div :class="['NNPE-words']">
- <span
- class="NNPE-chs"
- :class="[
- pItem.tokens[9] === '' ? 'marginRight' : '',
- (pItem.highIndex &&
- printForm.bold.indexOf(pItem.types) > -1) ||
- (printForm.bold.indexOf('sentence') > -1 &&
- longSentIds.indexOf(pItem.sent_id) > -1)
- ? 'fontWeight'
- : '',
- pItem.marginRigh ? 'marginSingleRight' : '',
- ]"
- :style="{
- fontSize: printForm.fontSize + 'px',
- color: printForm.color,
- lineHeight: printForm.lineHeight,
- fontFamily: printForm.fontFamily,
- }"
- >{{ pItem.tokens[2] }}</span
- >
- <span
- class="NNPE-chs NNPE-chs-both"
- v-if="
- item.wordsList[pIndex + 1] &&
- item.wordsList[pIndex + 1].tokens[2] &&
- enFhList.indexOf(
- item.wordsList[pIndex + 1].tokens[2]
- ) > -1
- "
- :class="[
- item.wordsList[pIndex + 1].tokens[8] === ''
- ? 'marginLeft'
- : '',
- (item.wordsList[pIndex + 1].highIndex &&
- printForm.bold.indexOf(
- item.wordsList[pIndex + 1].types
- ) > -1) ||
- (printForm.bold.indexOf('sentence') > -1 &&
- longSentIds.indexOf(
- item.wordsList[pIndex + 1].sent_id
- ) > -1)
- ? 'fontWeight'
- : '',
- item.wordsList[pIndex + 1].marginRight
- ? 'marginSingleRight'
- : '',
- ]"
- :style="{
- fontSize: printForm.fontSize + 'px',
- color: printForm.color,
- lineHeight: printForm.lineHeight,
- fontFamily: printForm.fontFamily,
- }"
- >{{ item.wordsList[pIndex + 1].tokens[2] }}</span
- >
- </div>
- </template>
- </template>
- </div>
- </div>
- </template>
- </div>
- <template
- v-if="
- itemA.articleImg &&
- itemA.articleImg[index] &&
- printForm.range.indexOf('image') > -1
- "
- >
- <figure
- v-for="(itemI, indexI) in itemA.articleImg[index]"
- :key="indexI"
- style="text-align: center"
- >
- <img
- @load="handleImageLoad($event, itemI)"
- :style="{
- width: itemI.width,
- height: itemI.height,
- }"
- :src="itemI.src"
- />
- <!-- <el-image
- :src="itemI.src"
- fit="contain"
- :style="{
- width: itemI.width,
- height: itemI.height,
- }"
- :preview-src-list="[itemI.src]"
-
- ></el-image> -->
- </figure>
- </template>
- </div>
- </div>
- </template>
- <div
- v-else
- class="cn-content"
- v-html="itemA.art_content"
- :style="{
- color: printForm.color,
- fontSize: printForm.fontSize + 'px',
- lineHeight: printForm.lineHeight,
- }"
- ></div>
- <template v-if="printForm.range.indexOf('vocab') > -1">
- <h5>词表</h5>
- <ul class="newwordlist">
- <li
- v-for="(itemW, indexW) in itemA.wordLit"
- :key="indexW"
- :class="['li-' + colorObj.type]"
- >
- <div class="word-info">
- <div class="word-info-top">
- <b class="word" :style="{ color: colorObj.newWordColor }">{{
- itemW.word
- }}</b>
- <span
- class="symbol"
- :style="{ color: colorObj.newWordOtherColor }"
- >{{ itemW.symbol }}</span
- >
- <label
- class="word-type"
- :style="{
- color: colorObj.newWordType[itemW.type]
- ? colorObj.newWordType[itemW.type].color
- : '',
- background: colorObj.newWordType[itemW.type]
- ? colorObj.newWordType[itemW.type].bg
- : '',
- }"
- >{{ itemW.typeCn }}</label
- >
- <span class="star" v-if="itemW.rate">
- <svg-icon
- icon-class="star-filled"
- v-for="(itemS, indexS) in itemW.rate"
- :key="indexS"
- :style="{ color: colorObj.newWordStar }"
- ></svg-icon>
- </span>
- <div class="para-list">
- <div
- class="para"
- v-for="(itemP, indexP) in itemW.paraList"
- :key="indexP"
- >
- <span
- class="cixing"
- :style="{ color: colorObj.newWordOtherColor }"
- >{{ itemP.cixing }}</span
- >
- <span
- class="shiyi"
- :style="{ color: colorObj.newWordOtherColor }"
- >{{ itemP.para }}</span
- >
- </div>
- </div>
- </div>
- </div>
- </li>
- </ul>
- <h5 v-if="itemA.art_phrase_data && itemA.art_phrase_data.length > 0">
- 短语
- </h5>
- <ul
- class="phraselist"
- v-if="itemA.art_phrase_data && itemA.art_phrase_data.length > 0"
- >
- <li v-for="(itemW, indexW) in itemA.phraseList" :key="indexW">
- <div class="word-info">
- <div class="word-info-top">
- <b
- class="phrase"
- :style="{ color: colorObj.phraseColor }"
- @click="showItem(itemW, indexW)"
- >{{ itemW.exp_title }}</b
- >
- <div class="para-list">
- <div class="para">
- <span
- class="shiyi"
- :style="{ color: colorObj.phraseOhterColor }"
- >{{ itemW.exp_content }}</span
- >
- </div>
- </div>
- </div>
- </div>
- </li>
- </ul>
- <h5
- v-if="itemA.art_explain_data && itemA.art_explain_data.length > 0"
- >
- 注释
- </h5>
- <ul
- class="explainlist"
- v-if="itemA.art_explain_data && itemA.art_explain_data.length > 0"
- >
- <li v-for="(itemW, indexW) in itemA.art_explain_data" :key="indexW">
- <b class="prefix" :style="{ color: colorObj.phraseOhterColor }">{{
- itemW.exp_title
- }}</b>
- <div
- class="para-list"
- :style="{ color: colorObj.newWordOtherColor }"
- v-html="itemW.exp_content"
- ></div>
- </li>
- </ul>
- </template>
- <template v-if="printForm.range.indexOf('ciyun') > -1">
- <iframe
- class="ciyun-box"
- width="100%"
- height="720px"
- border="none"
- :src="
- './ciyun/ciyunPrint.html?partitionKey=1&searchType=2&articleId=' +
- itemA.id
- "
- ></iframe>
- </template>
- <template v-if="printForm.range.indexOf('notes') > -1">
- <h5 v-if="itemA.notesList.length > 0">笔记</h5>
- <ul class="explainlist">
- <li v-for="(itemW, indexW) in itemA.notesList" :key="indexW">
- <b class="prefix" :style="{ color: colorObj.phraseOhterColor }">{{
- itemW.select_text
- }}</b>
- <div
- class="para-list"
- :style="{ color: colorObj.newWordOtherColor }"
- v-html="itemW.note"
- ></div>
- </li>
- </ul>
- </template>
- </div>
- <footer class="print-footer">
- <span>{{ printForm.school }}</span>
- <span>{{ printForm.className }}</span>
- <span>{{ printForm.name }}</span>
- <span style="flex: 1"></span>
- <span>{{ printForm.dateStr }}</span>
- <span>{{ printForm.momo }}</span>
- </footer>
- </div>
- </div>
- </template>
- <script>
- import waterMark from "../../../store/watermark";
- import { getToken } from "@/utils/auth";
- import { getLogin } from "@/api/ajax";
- import html2pdf from "html2pdf.js";
- export default {
- props: [
- "titleFontsize",
- "wordFontsize",
- "colorObj",
- "articleType",
- "articleInfo",
- "likePhraseList",
- "likeWord",
- "articleImg",
- ],
- data() {
- return {
- userMessage: getToken() ? JSON.parse(getToken()) : null,
- articleId: this.$route.query.id ? this.$route.query.id : "",
- issId: this.$route.query.iss_id ? this.$route.query.iss_id : "",
- resArr: [],
- enFhList: [
- ",",
- ".",
- ";",
- "?",
- "!",
- ":",
- ">",
- "<",
- "'",
- "’",
- "n't",
- "n’t",
- "n’ts",
- "n‘t",
- "'t",
- "’t",
- "‘t",
- "'s",
- "’s",
- "‘s",
- "'m",
- "’m",
- "‘m",
- "'re",
- "’re",
- "‘re",
- "'d",
- "’d",
- "‘d",
- "'ve",
- "’ve",
- "‘ve",
- ")",
- "'ll",
- "’ll",
- "‘ll",
- "”",
- ],
- sentenceList: [],
- longSentIds: [], // 长句id
- allWordList: [], // 生词短语注释总列表
- wordLit: [],
- annotationList: [],
- phraseList: [],
- notesList: [], // 笔记列表
- fontList: [
- {
- value: "roman",
- name: "Times New Roman",
- },
- {
- value: "Arial",
- name: "Arial",
- },
- ],
- lineHeightList: [
- {
- value: "0.8",
- name: "0.8倍",
- },
- {
- value: "1.0",
- name: "1.0倍",
- },
- {
- value: "1.5",
- name: "1.5倍",
- },
- {
- value: "2.0",
- name: "2.0倍",
- },
- ],
- rangeList: [
- {
- value: "image",
- name: "图片",
- },
- {
- value: "vocab",
- name: "词表",
- },
- {
- value: "ciyun",
- name: "词云",
- },
- {
- value: "notes",
- name: "笔记",
- },
- ],
- boldList: [
- {
- value: "newWord",
- name: "生词",
- },
- {
- value: "phrase",
- name: "短语",
- },
- {
- value: "sentence",
- name: "长句",
- },
- ],
- infoList: [
- {
- value: "wordLength",
- name: "长度",
- },
- {
- value: "wordNumber",
- name: "词数",
- },
- {
- value: "difficulty",
- name: "难度",
- },
- ],
- printForm: {
- fontFamily: "roman",
- fontSize: 24,
- color: "#2F3742",
- lineHeight: "1.5",
- range: [],
- bold: ["newWord", "phrase"],
- info: [],
- name: "",
- school: "",
- className: "",
- dateStr: "",
- momo: "",
- },
- isPrint: false,
- printNumber: 0,
- issDetail: null, // 整期文章内容
- issDetailMap: {}, // 整期文章详情map
- printManyFlag: false,
- printManyId: [], // 打印多篇文章id
- loading: false,
- printManyMenu: [], // 打印多篇文章目录
- printManyDetails: [], // 最终确定打印文章内容详情
- isPrintMore: false,
- };
- },
- created() {
- if (this.articleInfo.en_flag) {
- this.rangeList = [
- {
- value: "image",
- name: "图片",
- },
- {
- value: "vocab",
- name: "词表",
- },
- {
- value: "ciyun",
- name: "词云",
- },
- {
- value: "notes",
- name: "笔记",
- },
- ];
- } else {
- this.rangeList = [
- {
- value: "vocab",
- name: "词表",
- },
- {
- value: "ciyun",
- name: "词云",
- },
- {
- value: "notes",
- name: "笔记",
- },
- ];
- }
- this.getIssueDetail();
- },
- methods: {
- goBack() {
- this.$emit("closePrint");
- },
- handleData() {
- let explainNumber = 1;
- let resArr = [];
- let articleInfo = JSON.parse(JSON.stringify(this.articleInfo));
- this.sentenceList =
- articleInfo.art_corpus_data && articleInfo.art_corpus_data.sentList
- ? articleInfo.art_corpus_data.sentList
- : [];
- this.longSentIds =
- articleInfo.art_corpus_data && articleInfo.art_corpus_data.artStatInfo
- ? articleInfo.art_corpus_data.artStatInfo.longSentIds
- : [];
- this.wordLit = articleInfo.art_voc_data ? articleInfo.art_voc_data : [];
- this.annotationList = articleInfo.art_phrase_data
- ? articleInfo.art_explain_data
- : [];
- this.phraseList = articleInfo.art_explain_data
- ? articleInfo.art_phrase_data
- : [];
- this.wordLit.forEach((item) => {
- item.types = "newWord";
- item.exp_title = item.word_name;
- let paraStr = "";
- if (item.word_explain && item.word_explain.word_para_list) {
- item.word_explain.word_para_list.forEach((items) => {
- paraStr += items.para;
- });
- }
- item.exp_content = paraStr;
- item.word = item.word_name;
- item.symbol = item.word_explain.ph ? item.word_explain.ph : "";
- item.paraList = item.word_explain.word_para_list;
- item.type = item.word_explain.vl_level
- ? item.word_explain.vl_level
- : "";
- item.typeCn = item.word_explain.vl_level_name
- ? item.word_explain.vl_level_name
- : "";
- item.rate = item.word_explain.star ? item.word_explain.star : null;
- });
- this.phraseList.forEach((item) => {
- item.type = "phrase";
- });
- this.annotationList.forEach((item) => {
- item.type = "explain";
- });
- this.allWordList = this.wordLit.concat(this.phraseList);
- let leg = articleInfo.art_corpus_data
- ? articleInfo.art_corpus_data.sentList[
- articleInfo.art_corpus_data.sentList.length - 1
- ].pno
- : 0;
- this.sentenceList.forEach((item, index) => {
- let flag = "";
- item.StyleTokens = [];
- item.tokens.forEach((items, indexs) => {
- let obj = {
- tokens: items,
- marginRight: indexs === item.tokens.length - 1,
- };
- this.allWordList.forEach((itema, indexa) => {
- itema.bind_sent_data.bind_sents.forEach((itemb, indexb) => {
- if (itemb.sent_id === item.id) {
- if (itema.type === "explain") {
- if (
- indexs ===
- itemb.sel_token_idxes[itemb.sel_token_idxes.length - 1]
- ) {
- obj.highIndex = true;
- obj.type = itema.type;
- obj.types = itema.type;
- obj.word_id = itema.id; // 生词注释短语的id
- obj.explainNumber = explainNumber;
- explainNumber++;
- }
- } else {
- itemb.sel_token_idxes.forEach((itemi) => {
- if (indexs === itemi) {
- obj.highIndex = true;
- obj.type = itema.type;
- obj.types = itema.types ? itema.types : itema.type;
- obj.word_id = itema.id; // 生词注释短语的id
- }
- });
- }
- if (
- itemb.sel_token_idxes.length === 0 &&
- itema.type === "explain" &&
- indexs === item.tokens.length - 1
- ) {
- flag = itema.id;
- }
- }
- });
- });
- item.StyleTokens.push(obj);
- if (flag) {
- item.StyleTokens.push({
- tokens: [
- 0,
- 8,
- "Students",
- "",
- "",
- "",
- "",
- "",
- "",
- " ",
- 0,
- "",
- "",
- "",
- ],
- type: "explain",
- word_id: flag,
- isExplain: true,
- explainNumber: explainNumber,
- });
- explainNumber++;
- }
- });
- });
- for (let i = 0; i < leg + 1; i++) {
- let obgs = {
- isShow: true,
- marginRight: false,
- tokens: [
- "",
- "",
- "#@@#",
- "",
- "",
- "",
- "",
- "",
- " ",
- " ",
- "",
- "",
- "",
- "",
- "",
- ],
- };
- let obj = {
- wordsList: i === 0 ? [] : [obgs, obgs],
- };
- resArr.push(obj);
- }
- this.sentenceList.forEach((item, index) => {
- item.StyleTokens.forEach((items, indexs) => {
- items.isShow = this.enFhList.indexOf(items.tokens[2]) == -1;
- items.sent_id = item.id;
- resArr[item.pno].wordsList.push(items);
- });
- });
- this.resArr = resArr;
- setTimeout(() => {
- waterMark.set(
- this.userMessage.user_name + " " + this.userMessage.phone,
- "",
- "showWaterMark"
- );
- }, 1000);
- },
- // 打印
- handlePrint() {
- let MethodName =
- "/ShopServer/Client/PrintRecordManager/GetMyPrintCount_Article";
- getLogin(MethodName, {
- goods_type: 21,
- date_range: "TODAY",
- article_id: this.articleId,
- }).then((res) => {
- if (res.status === 1) {
- if (res.print_count < 5) {
- getLogin(
- "/ShopServer/Client/PrintRecordManager/AddPrintRecord_Article",
- {
- goods_type: 21,
- article_id: this.articleId,
- }
- ).then((res) => {
- if (res.status === 1) {
- }
- });
- this.$nextTick(() => {
- this.$print(this.$refs["printArea"], {
- noPrint: ".noPrint",
- type: "html",
- scanStyles: true,
- showModal: true,
- // style: style,// 亦可使用引入的外部css;
- onStart: () => {
- // console.log("打印开始");
- },
- onEnd: () => {
- // console.log("打印完成");
- },
- });
- });
- } else {
- this.$message.warning("今日打印次数已达上限");
- }
- }
- });
- },
- // 清除
- handleClear() {
- this.printForm.name = "";
- this.printForm.school = "";
- this.printForm.className = "";
- this.printForm.dateStr = "";
- this.printForm.momo = "";
- },
- // 高亮笔记句子
- handleHighSentence() {
- let MethodName = "/PaperServer/Client/Article/ArtNoteListInArt";
- let data = {
- id: this.$route.query.id,
- };
- getLogin(MethodName, data).then((res) => {
- if (res.status === 1) {
- this.notesList = res.data;
- }
- });
- },
- // 下载pdf
- async generatePDF() {
- let MethodName =
- "/ShopServer/Client/PrintRecordManager/GetMyPrintCount_Article";
- getLogin(MethodName, {
- goods_type: 21,
- date_range: "TODAY",
- article_id: this.articleId,
- }).then((res) => {
- if (res.status === 1) {
- if (res.print_count < 5) {
- getLogin(
- "/ShopServer/Client/PrintRecordManager/AddPrintRecord_Article",
- {
- goods_type: 21,
- article_id: this.articleId,
- }
- ).then((res) => {
- if (res.status === 1) {
- }
- });
- this.$nextTick(() => {
- this.isPrint = true;
- const element = document.getElementById("showWaterMark");
- const opt = {
- margin: [0, 0, 0, 0],
- useCORS: true,
- filename: "二十一世纪英语智慧阅读平台.pdf",
- image: { type: "jpeg", quality: 0.98 },
- html2canvas: { scale: 2 }, // 或其他自定义设置,例如scale可以放大内容以便更容易阅读和打印。
- jsPDF: { unit: "mm", format: "a4", orientation: "portrait" }, // A4尺寸的PDF,纵向打印。
- };
- html2pdf().set(opt).from(element).save();
- setTimeout(() => {
- this.isPrint = false;
- }, 100);
- });
- } else {
- this.$message.warning("今日下载次数已达上限");
- }
- }
- });
- },
- // 获取整期报刊内容
- getIssueDetail() {
- this.issDetail = null;
- this.issDetailMap = {};
- let MethodName = "/PaperServer/Client/Article/GetIssueDetail";
- getLogin(MethodName, {
- id: this.issId,
- }).then((res) => {
- if (res.status === 1) {
- this.issDetail = res.data;
- if (res.data.articles) {
- this.issDetailMap = res.data.articles.reduce((acc, user) => {
- acc[user.id] = user;
- return acc;
- }, {});
- res.data.articles.forEach((itemA) => {
- let explainNumber = 1;
- let resArr = [];
- let articleInfo = JSON.parse(JSON.stringify(itemA));
- let sentenceList = articleInfo.art_corpus_data
- ? articleInfo.art_corpus_data.sentList
- : [];
- let longSentIds =
- articleInfo.art_corpus_data &&
- articleInfo.art_corpus_data.artStatInfo
- ? articleInfo.art_corpus_data.artStatInfo.longSentIds
- : [];
- let wordLit = articleInfo.art_voc_data
- ? articleInfo.art_voc_data
- : [];
- let annotationList = articleInfo.art_phrase_data
- ? articleInfo.art_explain_data
- : [];
- let phraseList = articleInfo.art_explain_data
- ? articleInfo.art_phrase_data
- : [];
- wordLit.forEach((item) => {
- item.types = "newWord";
- item.exp_title = item.word_name;
- let paraStr = "";
- if (item.word_explain && item.word_explain.word_para_list) {
- item.word_explain.word_para_list.forEach((items) => {
- paraStr += items.para;
- });
- }
- item.exp_content = paraStr;
- item.word = item.word_name;
- item.symbol = item.word_explain.ph ? item.word_explain.ph : "";
- item.paraList = item.word_explain.word_para_list;
- item.type = item.word_explain.vl_level
- ? item.word_explain.vl_level
- : "";
- item.typeCn = item.word_explain.vl_level_name
- ? item.word_explain.vl_level_name
- : "";
- item.rate = item.word_explain.star
- ? item.word_explain.star
- : null;
- });
- phraseList.forEach((item) => {
- item.type = "phrase";
- });
- annotationList.forEach((item) => {
- item.type = "explain";
- });
- let allWordList = wordLit.concat(phraseList);
- let leg =
- articleInfo.art_corpus_data &&
- articleInfo.art_corpus_data.sentList
- ? articleInfo.art_corpus_data.sentList[
- articleInfo.art_corpus_data.sentList.length - 1
- ].pno
- : 0;
- sentenceList.forEach((item, index) => {
- let flag = "";
- item.StyleTokens = [];
- item.tokens.forEach((items, indexs) => {
- let obj = {
- tokens: items,
- marginRight: indexs === item.tokens.length - 1,
- };
- allWordList.forEach((itema, indexa) => {
- itema.bind_sent_data.bind_sents.forEach((itemb, indexb) => {
- if (itemb.sent_id === item.id) {
- if (itema.type === "explain") {
- if (
- indexs ===
- itemb.sel_token_idxes[
- itemb.sel_token_idxes.length - 1
- ]
- ) {
- obj.highIndex = true;
- obj.type = itema.type;
- obj.types = itema.type;
- obj.word_id = itema.id; // 生词注释短语的id
- obj.explainNumber = explainNumber;
- explainNumber++;
- }
- } else {
- itemb.sel_token_idxes.forEach((itemi) => {
- if (indexs === itemi) {
- obj.highIndex = true;
- obj.type = itema.type;
- obj.types = itema.types
- ? itema.types
- : itema.type;
- obj.word_id = itema.id; // 生词注释短语的id
- }
- });
- }
- if (
- itemb.sel_token_idxes.length === 0 &&
- itema.type === "explain" &&
- indexs === item.tokens.length - 1
- ) {
- flag = itema.id;
- }
- }
- });
- });
- item.StyleTokens.push(obj);
- if (flag) {
- item.StyleTokens.push({
- tokens: [
- 0,
- 8,
- "Students",
- "",
- "",
- "",
- "",
- "",
- "",
- " ",
- 0,
- "",
- "",
- "",
- ],
- type: "explain",
- word_id: flag,
- isExplain: true,
- explainNumber: explainNumber,
- });
- explainNumber++;
- }
- });
- });
- for (let i = 0; i < leg + 1; i++) {
- let obgs = {
- isShow: true,
- marginRight: false,
- tokens: [
- "",
- "",
- "#@@#",
- "",
- "",
- "",
- "",
- "",
- " ",
- " ",
- "",
- "",
- "",
- "",
- "",
- ],
- };
- let obj = {
- wordsList: i === 0 ? [] : [obgs, obgs],
- };
- resArr.push(obj);
- }
- sentenceList.forEach((item, index) => {
- item.StyleTokens.forEach((items, indexs) => {
- items.isShow = this.enFhList.indexOf(items.tokens[2]) == -1;
- items.sent_id = item.id;
- resArr[item.pno].wordsList.push(items);
- });
- });
- itemA.resArr = resArr;
- itemA.longSentIds = longSentIds;
- itemA.sentenceList = sentenceList;
- itemA.wordLit = wordLit;
- itemA.annotationList = annotationList;
- itemA.phraseList = phraseList;
- itemA.allWordList = allWordList;
- itemA.articleImg = {};
- let articleArr = itemA.art_content.split('<p class="para"');
- articleArr.forEach((itema) => {
- if (itema.indexOf("<img") > -1) {
- // 当前段落有图片
- let imgArr = [];
- let pno =
- itema.indexOf('pno="') > -1
- ? itema.substring(
- itema.indexOf('pno="') + 5,
- itema
- .substring(itema.indexOf('pno="') + 5)
- .indexOf('"') +
- 1 +
- 5
- )
- : 0;
- let itemArr = itema.split("<img");
- itemArr.forEach((items) => {
- if (items.indexOf('src="') > -1) {
- let indexS =
- items
- .substring(items.indexOf('src="') + 5)
- .indexOf('"') + items.indexOf('src="'); // src所在索引
- let indexW =
- items.indexOf('width="') > -1
- ? items
- .substring(items.indexOf('width="') + 7)
- .indexOf('"')
- : items.indexOf("width: ") > -1
- ? items
- .substring(items.indexOf("width: ") + 7)
- .indexOf(";")
- : -1; // width所在索引
- let indexH =
- items.indexOf('height="') > -1
- ? items
- .substring(items.indexOf('height="') + 8)
- .indexOf('"')
- : items.indexOf("height: ") > -1
- ? items
- .substring(items.indexOf("height: ") + 8)
- .indexOf(";")
- : -1; // height所在索引
- let imgobj = {
- src: items.substring(
- items.indexOf('src="') + 5,
- indexS + 5
- ),
- width:
- items.indexOf('width="') > -1
- ? items.substring(
- items.indexOf('width="') + 7,
- items.indexOf('width="') + indexW + 7
- )
- : items.indexOf("width: ") > -1
- ? items.substring(
- items.indexOf("width: ") + 7,
- items.indexOf("width: ") + indexW + 7
- )
- : null,
- height:
- items.indexOf('height="') > -1
- ? items.substring(
- items.indexOf('height="') + 8,
- items.indexOf('height="') + indexH + 8
- )
- : items.indexOf("height: ") > -1
- ? items.substring(
- items.indexOf("height: ") + 8,
- items.indexOf('height="') + indexH + 8
- )
- : null,
- };
- imgArr.push(imgobj);
- }
- });
- itemA.articleImg[pno] = imgArr;
- }
- });
- let MethodNames = "/PaperServer/Client/Article/ArtNoteListInArt";
- let data = {
- id: itemA.id,
- };
- getLogin(MethodNames, data).then((res) => {
- if (res.status === 1) {
- itemA.notesList = res.data;
- }
- });
- });
- }
- if (res.data.issueInfo) {
- let arr = [];
- res.data.issueInfo.chn_art_data.forEach((item) => {
- let arrs = [];
- item.arts.forEach((items) => {
- arrs.push({
- value: items.id,
- label: items.art_title,
- });
- });
- arr.push({
- value: item.chn_idx,
- label: item.chn_name,
- children: arrs,
- });
- });
- this.printManyMenu = [
- {
- value: res.data.issueInfo.id,
- label: res.data.issueInfo.iss_name,
- children: arr,
- },
- ];
- }
- }
- });
- },
- // 打印多篇按钮
- handleManyPrint() {
- this.printManyFlag = true;
- },
- // 确定打印多篇
- submitPrintMore() {
- this.loading = true;
- let printManyIds = [];
- let printManyDetails = [];
- this.printManyId.forEach((item) => {
- printManyIds.push(item[2]);
- printManyDetails.push(this.issDetailMap[item[2]]);
- });
- this.printManyDetails = printManyDetails;
- this.isPrintMore = true;
- setTimeout(() => {
- waterMark.set(
- this.userMessage.user_name + " " + this.userMessage.phone,
- "",
- "showWaterMarks"
- );
- }, 1000);
- setTimeout(() => {
- this.handlePrintManyDetails();
- }, 1500);
- },
- handlePrintManyDetails() {
- let MethodName =
- "/ShopServer/Client/PrintRecordManager/GetMyPrintCount_Article";
- getLogin(MethodName, {
- goods_type: 21,
- date_range: "TODAY",
- article_id: this.articleId,
- }).then((res) => {
- if (res.status === 1) {
- if (res.print_count < 5) {
- getLogin(
- "/ShopServer/Client/PrintRecordManager/AddPrintRecord_Article",
- {
- goods_type: 21,
- article_id: this.articleId,
- }
- ).then((res) => {
- if (res.status === 1) {
- }
- });
- this.$nextTick(() => {
- this.$print(this.$refs["printAreaManys"], {
- noPrint: ".noPrint",
- type: "html",
- scanStyles: true,
- showModal: true,
- // style: style,// 亦可使用引入的外部css;
- onStart: () => {
- // console.log("打印开始");
- },
- onEnd: () => {
- // console.log("打印完成");
- },
- });
- this.loading = false;
- this.printManyFlag = false;
- this.isPrintMore = false;
- });
- } else {
- this.loading = false;
- this.printManyFlag = false;
- this.isPrintMore = false;
- this.$message.warning("今日打印次数已达上限");
- }
- }
- });
- },
- handleImageLoad(event, item) {
- if (!item.width || item.width > 870) {
- item.width =
- event.target.naturalWidth > 870
- ? 870 + "px"
- : event.target.naturalWidth + "px";
- }
- if (!item.height) {
- item.height =
- item.width === "870px" ? "" : event.target.naturalHeight + "px";
- }
- this.$forceUpdate();
- },
- },
- mounted() {
- if (this.articleInfo) {
- this.handleData();
- this.handleHighSentence();
- }
- this.$nextTick(() => {
- document.onselectstart = new Function("event.returnValue=false");
- });
- },
- beforeDestroy() {
- document.onselectstart = new Function("event.returnValue=true");
- },
- };
- </script>
- <style lang="scss" scoped>
- .print-model {
- background: #f2f3f5;
- &-top {
- padding: 8px 16px;
- border-bottom: 1px solid #ebebeb;
- background: #fff;
- display: flex;
- align-items: center;
- width: 100%;
- position: fixed;
- top: 0;
- left: 0;
- z-index: 10000;
- .goback {
- color: #2f3742;
- font-size: 20px;
- font-weight: 500;
- line-height: 28px;
- padding-right: 12px;
- .el-icon-arrow-left {
- width: 24px;
- height: 24px;
- }
- }
- .border {
- background: #e5e6eb;
- height: 16px;
- margin-top: 2px;
- width: 1px;
- }
- p {
- margin: 0 12px;
- color: #1c2129;
- font-size: 14px;
- font-weight: 500;
- line-height: 22px;
- }
- }
- &-bottom {
- display: flex;
- justify-content: center;
- padding-top: 46px;
- &-left {
- width: 1070px;
- margin: 8px 346px 8px 8px;
- background: #fff;
- flex-shrink: 0;
- .print-inner {
- overflow: auto;
- padding: 120px 100px 30px 100px;
- }
- .nnpe-article-author {
- margin: 24px 0;
- text-align: center;
- }
- h2 {
- display: flex;
- flex-flow: wrap;
- justify-content: center;
- }
- .table-box {
- // background: #f7f7f7;
- // border-top: 1px solid rgba(0, 0, 0, 0.1);
- :last-child {
- :last-child.wordsList-box {
- padding-bottom: 40px;
- }
- }
- .wordsList-box {
- flex: 1;
- // padding: 6px 0 12px 0;
- .nnpe-sentence-box {
- display: flex;
- flex-flow: wrap;
- .word-box {
- position: relative;
- }
- }
- > img {
- max-width: 50%;
- display: block;
- padding: 16px 0;
- margin: 0 auto;
- }
- }
- }
- .NNPE-detail {
- clear: both;
- overflow: hidden;
- // display: flex;
- .NNPE-words {
- float: left;
- padding: 0;
- &.noPadding {
- padding: 0;
- }
- &.sentActive {
- background: rgba(24, 144, 255, 0.1);
- }
- &.overActive {
- background: rgba(0, 0, 0, 0.06);
- }
- > span {
- float: left;
- &.NNPE-chs {
- // font-size: 24px;
- font-family: "Smartisan";
- line-height: 150%;
- color: #000000;
- padding: 0 3px;
- &.wordActive {
- color: #175dff !important;
- }
- &.marginRight {
- padding-right: 0;
- }
- &.marginLeft {
- padding-left: 0;
- }
- &.marginSingleRight {
- padding-right: 3px;
- }
- &.fontWeight {
- font-weight: bold;
- }
- &.newWord {
- color: #3459d2 !important;
- }
- &.phrase {
- color: #ff802b !important;
- }
- &.explain {
- // color: #23C847 !important;
- font-weight: 400;
- }
- }
- &.padding {
- padding: 0 3px;
- cursor: pointer;
- }
- }
- }
- }
- h5 {
- color: #000;
- font-size: 36px;
- font-weight: 700;
- line-height: 44px;
- margin: 24px 0;
- }
- .newwordlist,
- .phraselist {
- li {
- padding: 4px;
- display: flex;
- margin: 1px 0;
- border-radius: 4px;
- .word-info {
- flex: 1;
- }
- .sentence {
- font-size: 14px;
- line-height: 22px;
- color: #2f3742;
- }
- .word-type {
- padding: 0px 8px;
- border-radius: 2px;
- font-weight: 500;
- font-size: 12px;
- line-height: 20px;
- height: 20px;
- margin: 4px 8px 0 0;
- }
- .el-icon-arrow-right {
- width: 24px;
- height: 24px;
- color: #929ca8;
- text-align: center;
- line-height: 24px;
- cursor: pointer;
- }
- .word-info-top {
- display: flex;
- .word {
- font-weight: 700;
- font-size: 20px;
- line-height: 28px;
- color: #175dff;
- margin-right: 8px;
- font-family: "Arial";
- cursor: pointer;
- }
- .phrase {
- font-weight: 500;
- font-size: 24px;
- line-height: 32px;
- color: #ed5f00;
- }
- .symbol {
- font-size: 20px;
- line-height: 28px;
- color: #667180;
- margin-right: 8px;
- font-family: "Arial";
- }
- .star {
- margin-right: 8px;
- line-height: 20px;
- }
- .para-list {
- flex: 1;
- .para {
- display: flex;
- font-size: 16px;
- line-height: 24px;
- color: #1c2129;
- margin-bottom: 4px;
- .cixing {
- margin-right: 4px;
- }
- }
- }
- }
- .word-info-bottom {
- font-size: 12px;
- line-height: 20px;
- color: #929ca8;
- margin: 4px 8px 0 0;
- span {
- margin-right: 8px;
- }
- }
- }
- }
- .phraselist {
- .para {
- line-height: 32px !important;
- margin-left: 8px;
- margin-bottom: 0 !important;
- }
- }
- .explainlist {
- li {
- padding: 8px;
- margin: 4px 0;
- .prefix {
- color: #151515;
- font-size: 24px;
- font-weight: 700;
- line-height: 32px;
- }
- .para-list {
- color: #2f3742;
- font-size: 16px;
- font-weight: 500;
- line-height: 24px;
- margin-top: 8px;
- }
- }
- }
- }
- &-right {
- width: 360px;
- padding: 24px 0;
- background: #fff;
- position: fixed;
- z-index: 1;
- top: 46px;
- right: calc((100% - 1450px) / 2);
- height: calc(100% - 48px);
- .config-box {
- height: calc(100% - 110px);
- overflow: auto;
- padding: 0 24px;
- }
- h3 {
- color: #2f3742;
- font-size: 24px;
- font-weight: 400;
- line-height: 32px;
- margin: 0;
- padding: 0 24px;
- .svg-icon {
- width: 24px;
- height: 24px;
- margin-right: 8px;
- }
- }
- }
- }
- }
- .item-page {
- display: flex;
- padding-top: 24px;
- > label {
- color: #2f3742;
- text-align: right;
- font-size: 14px;
- font-weight: 500;
- line-height: 30px;
- width: 72px;
- margin-right: 16px;
- flex-shrink: 0;
- }
- .el-select {
- height: 32px;
- border-radius: 2px;
- width: 202px;
- }
- .el-button {
- width: 70px;
- padding: 8px 0;
- color: rgba(0, 0, 0, 0.91);
- font-size: 14px;
- font-weight: 400;
- line-height: 22px;
- border-radius: 4px;
- background: #ebebeb;
- border: none;
- }
- .el-button--primary {
- background: #3459d2;
- color: #fff;
- }
- > b {
- flex: 1;
- text-align: right;
- cursor: pointer;
- line-height: 30px;
- color: #175dff;
- font-size: 14px;
- font-weight: 400;
- .svg-icon {
- width: 12px;
- margin-right: 4px;
- }
- }
- }
- .print-divider {
- margin: 24px 0 0 0;
- background-color: #f2f3f5;
- }
- #showWaterMark,
- #showWaterMarks {
- overflow: hidden;
- position: relative;
- z-index: 9999;
- // width: 210mm;
- }
- .print-footer {
- width: 100%;
- min-height: 22px;
- padding: 30px 96px;
- color: #667180;
- font-size: 14px;
- font-weight: 700;
- line-height: 22px;
- display: flex;
- justify-content: space-between;
- span {
- margin: 0 4px;
- }
- }
- .ciyun-box {
- width: 870px;
- height: 720px;
- border: none;
- overflow: hidden;
- }
- @media print {
- .no-print {
- display: none;
- }
- body {
- margin-top: 0;
- margin-bottom: 0;
- padding-top: 0;
- padding-bottom: 0;
- }
- .printheader {
- font-size: 50px;
- color: green;
- font-weight: bold;
- position: fixed;
- top: 0;
- left: 0;
- z-index: 10000;
- }
- .printFotter {
- position: fixed;
- left: 0;
- bottom: 0;
- z-index: 100000;
- }
- .print-footer {
- position: fixed;
- bottom: -30px;
- left: 10px;
- }
- @page {
- margin: 30px 30px 60px 30px;
- }
- #showWaterMark,
- #showWaterMarks {
- margin: 0;
- }
- }
- :deep .image img {
- max-width: 100%;
- }
- :deep figure {
- margin: 1em 0;
- }
- </style>
- <style lang="scss">
- .item-page {
- .el-input__inner {
- height: 32px;
- line-height: 32px;
- background: #f2f3f5;
- border: none;
- }
- .el-input__icon {
- line-height: 32px;
- }
- .el-input-number {
- line-height: 30px;
- width: 202px;
- }
- .el-input-number__decrease,
- .el-input-number__increase {
- height: 30px;
- width: 30px;
- }
- .el-checkbox {
- margin-right: 12px;
- line-height: 30px;
- }
- .el-checkbox__input.is-checked + .el-checkbox__label {
- color: #2f3742;
- }
- .el-checkbox__input.is-checked .el-checkbox__inner,
- .el-checkbox__input.is-indeterminate .el-checkbox__inner {
- background-color: #3459d2;
- border-color: #3459d2;
- }
- }
- </style>
|