PrintModel.vue 72 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309
  1. <template>
  2. <div class="print-model">
  3. <div class="print-model-top">
  4. <a class="goback" @click="goBack"
  5. ><i class="el-icon-arrow-left"></i>回到文章</a
  6. >
  7. <div class="border"></div>
  8. <p class="article-title">打印预览</p>
  9. </div>
  10. <div class="print-model-bottom">
  11. <div
  12. class="print-model-bottom-left"
  13. ref="printArea"
  14. id="showWaterMark"
  15. :style="{ width: isPrint ? '220mm' : '' }"
  16. >
  17. <div class="print-inner">
  18. <h2>
  19. <span
  20. :style="{
  21. color: colorObj.titleColor,
  22. fontSize: titleFontsize + 'px',
  23. lineHeight: titleFontsize + 8 + 'px',
  24. marginRight: '10px',
  25. fontWeight: '700',
  26. cursor: 'pointer',
  27. wordBreak: 'break-word',
  28. }"
  29. >{{ articleInfo.art_title }}</span
  30. >
  31. </h2>
  32. <h6
  33. class="nnpe-article-author"
  34. :style="{
  35. color: colorObj.sourceColor,
  36. fontSize: wordFontsize - 4 + 'px',
  37. lineHeight: wordFontsize + 4 + 'px',
  38. fontWeight: '400',
  39. }"
  40. >
  41. {{
  42. articleInfo.art_author +
  43. " · " +
  44. articleInfo.study_phase_name +
  45. "版 · 第 " +
  46. articleInfo.iss_no +
  47. " 期 · " +
  48. articleInfo.release_date +
  49. " · " +
  50. articleInfo.chn_item +
  51. (articleInfo.page_no_in_pub
  52. ? " · P" + articleInfo.page_no_in_pub
  53. : "")
  54. }}
  55. {{ printForm.info.length > 0 ? " | " : "" }}
  56. {{
  57. printForm.info.indexOf("wordLength") > -1
  58. ? " 长度 " + articleInfo.art_corpus_data.artStatInfo.wc
  59. : ""
  60. }}
  61. {{
  62. printForm.info.indexOf("wordNumber") > -1
  63. ? " · 词数 " + articleInfo.art_corpus_data.artStatInfo.wdc
  64. : ""
  65. }}
  66. {{
  67. printForm.info.indexOf("difficulty") > -1
  68. ? " · 难度 " +
  69. articleInfo.art_corpus_data.artStatInfo.vocabHardLevel
  70. : ""
  71. }}
  72. </h6>
  73. <template v-if="resArr.length > 0 && articleInfo.en_flag">
  74. <div class="table-box">
  75. <div
  76. :class="['NNPE-detail']"
  77. v-for="(item, index) in resArr"
  78. :key="'detail' + index"
  79. >
  80. <div class="wordsList-box">
  81. <template v-if="index !== 0">
  82. <div class="nnpe-sentence-box">
  83. <div
  84. v-for="(pItem, pIndex) in item.wordsList"
  85. :key="'wordsList' + pIndex"
  86. class="word-box"
  87. :class="[
  88. pItem.isExplain || pItem.explainNumber
  89. ? 'hasExplain'
  90. : '',
  91. ]"
  92. >
  93. <template v-if="pItem.isShow">
  94. <template v-if="pItem.tokens[2] === '#@@#'">
  95. <span
  96. class="NNPE-chs"
  97. :style="{
  98. width: printForm.fontSize + 'px',
  99. height:
  100. printForm.fontSize * printForm.lineHeight +
  101. 'px',
  102. display: 'block',
  103. fontFamily: printForm.fontFamily,
  104. }"
  105. ></span>
  106. </template>
  107. <template v-else>
  108. <div :class="['NNPE-words']">
  109. <span
  110. class="NNPE-chs"
  111. :class="[
  112. pItem.tokens[9] === '' ? 'marginRight' : '',
  113. (pItem.highIndex &&
  114. printForm.bold.indexOf(pItem.types) > -1) ||
  115. (printForm.bold.indexOf('sentence') > -1 &&
  116. longSentIds.indexOf(pItem.sent_id) > -1)
  117. ? 'fontWeight'
  118. : '',
  119. pItem.marginRigh ? 'marginSingleRight' : '',
  120. ]"
  121. :style="{
  122. fontSize: printForm.fontSize + 'px',
  123. color: printForm.color,
  124. lineHeight: printForm.lineHeight,
  125. fontFamily: printForm.fontFamily,
  126. }"
  127. >{{ pItem.tokens[2] }}</span
  128. >
  129. <span
  130. class="NNPE-chs NNPE-chs-both"
  131. v-if="
  132. item.wordsList[pIndex + 1] &&
  133. item.wordsList[pIndex + 1].tokens[2] &&
  134. enFhList.indexOf(
  135. item.wordsList[pIndex + 1].tokens[2]
  136. ) > -1
  137. "
  138. :class="[
  139. item.wordsList[pIndex + 1].tokens[8] === ''
  140. ? 'marginLeft'
  141. : '',
  142. (item.wordsList[pIndex + 1].highIndex &&
  143. printForm.bold.indexOf(
  144. item.wordsList[pIndex + 1].types
  145. ) > -1) ||
  146. (printForm.bold.indexOf('sentence') > -1 &&
  147. longSentIds.indexOf(
  148. item.wordsList[pIndex + 1].sent_id
  149. ) > -1)
  150. ? 'fontWeight'
  151. : '',
  152. item.wordsList[pIndex + 1].marginRight
  153. ? 'marginSingleRight'
  154. : '',
  155. ]"
  156. :style="{
  157. fontSize: printForm.fontSize + 'px',
  158. color: printForm.color,
  159. lineHeight: printForm.lineHeight,
  160. fontFamily: printForm.fontFamily,
  161. }"
  162. >{{
  163. item.wordsList[pIndex + 1].tokens[2]
  164. }}</span
  165. >
  166. </div>
  167. </template>
  168. </template>
  169. </div>
  170. </div>
  171. </template>
  172. </div>
  173. <template
  174. v-if="
  175. articleImg &&
  176. articleImg[index] &&
  177. printForm.range.indexOf('image') > -1
  178. "
  179. >
  180. <figure
  181. v-for="(itemI, indexI) in articleImg[index]"
  182. :key="indexI"
  183. style="text-align: center"
  184. >
  185. <img
  186. @load="handleImageLoad($event, itemI)"
  187. :style="{
  188. width: itemI.width,
  189. height: itemI.height,
  190. maxWidth: isPrint ? '630px' : '',
  191. }"
  192. :src="itemI.newSrc ? itemI.newSrc : itemI.src"
  193. />
  194. <!-- <el-image
  195. :src="itemI.src"
  196. fit="contain"
  197. :style="{
  198. width: itemI.width,
  199. height: itemI.height,
  200. }"
  201. :preview-src-list="[itemI.src]"
  202. @load="handleImageLoad($event, itemI)"
  203. ></el-image> -->
  204. </figure>
  205. </template>
  206. </div>
  207. </div>
  208. </template>
  209. <div
  210. v-else
  211. class="cn-content"
  212. v-html="articleInfo.art_content"
  213. :style="{
  214. color: printForm.color,
  215. fontSize: printForm.fontSize + 'px',
  216. lineHeight: printForm.lineHeight,
  217. }"
  218. ></div>
  219. <template v-if="printForm.range.indexOf('vocab') > -1">
  220. <h5>词表</h5>
  221. <ul class="newwordlist">
  222. <li
  223. v-for="(itemW, indexW) in wordLit"
  224. :key="indexW"
  225. :class="['li-' + colorObj.type]"
  226. >
  227. <div class="word-info">
  228. <div class="word-info-top">
  229. <b class="word" :style="{ color: colorObj.newWordColor }">{{
  230. itemW.word
  231. }}</b>
  232. <span
  233. class="symbol"
  234. :style="{ color: colorObj.newWordOtherColor }"
  235. >{{ itemW.symbol }}</span
  236. >
  237. <label
  238. class="word-type"
  239. :style="{
  240. color: colorObj.newWordType[itemW.type]
  241. ? colorObj.newWordType[itemW.type].color
  242. : '',
  243. background: colorObj.newWordType[itemW.type]
  244. ? colorObj.newWordType[itemW.type].bg
  245. : '',
  246. }"
  247. >{{ itemW.typeCn }}</label
  248. >
  249. <span class="star" v-if="itemW.rate">
  250. <svg-icon
  251. icon-class="star-filled"
  252. v-for="(itemS, indexS) in itemW.rate"
  253. :key="indexS"
  254. :style="{ color: colorObj.newWordStar }"
  255. ></svg-icon>
  256. </span>
  257. <div class="para-list">
  258. <div
  259. class="para"
  260. v-for="(itemP, indexP) in itemW.paraList"
  261. :key="indexP"
  262. >
  263. <span
  264. class="cixing"
  265. :style="{ color: colorObj.newWordOtherColor }"
  266. >{{ itemP.cixing }}</span
  267. >
  268. <span
  269. class="shiyi"
  270. :style="{ color: colorObj.newWordOtherColor }"
  271. >{{ itemP.para }}</span
  272. >
  273. </div>
  274. </div>
  275. </div>
  276. </div>
  277. </li>
  278. </ul>
  279. <h5
  280. v-if="
  281. articleInfo.art_phrase_data &&
  282. articleInfo.art_phrase_data.length > 0
  283. "
  284. >
  285. 短语
  286. </h5>
  287. <ul
  288. class="phraselist"
  289. v-if="
  290. articleInfo.art_phrase_data &&
  291. articleInfo.art_phrase_data.length > 0
  292. "
  293. >
  294. <li v-for="(itemW, indexW) in phraseList" :key="indexW">
  295. <div class="word-info">
  296. <div class="word-info-top">
  297. <b
  298. class="phrase"
  299. :style="{ color: colorObj.phraseColor }"
  300. @click="showItem(itemW, indexW)"
  301. >{{ itemW.exp_title }}</b
  302. >
  303. <div class="para-list">
  304. <div class="para">
  305. <span
  306. class="shiyi"
  307. :style="{ color: colorObj.phraseOhterColor }"
  308. >{{ itemW.exp_content }}</span
  309. >
  310. </div>
  311. </div>
  312. </div>
  313. </div>
  314. </li>
  315. </ul>
  316. <h5
  317. v-if="
  318. articleInfo.art_explain_data &&
  319. articleInfo.art_explain_data.length > 0
  320. "
  321. >
  322. 注释
  323. </h5>
  324. <ul
  325. class="explainlist"
  326. v-if="
  327. articleInfo.art_explain_data &&
  328. articleInfo.art_explain_data.length > 0
  329. "
  330. >
  331. <li
  332. v-for="(itemW, indexW) in articleInfo.art_explain_data"
  333. :key="indexW"
  334. >
  335. <b
  336. class="prefix"
  337. :style="{ color: colorObj.phraseOhterColor }"
  338. >{{ itemW.exp_title }}</b
  339. >
  340. <div
  341. class="para-list"
  342. :style="{ color: colorObj.newWordOtherColor }"
  343. v-html="itemW.exp_content"
  344. ></div>
  345. </li>
  346. </ul>
  347. </template>
  348. <template v-if="printForm.range.indexOf('ciyun') > -1">
  349. <iframe
  350. class="ciyun-box"
  351. width="100%"
  352. height="720px"
  353. border="none"
  354. :src="
  355. './ciyun/ciyunPrint.html?partitionKey=1&searchType=2&articleId=' +
  356. articleId
  357. "
  358. ></iframe>
  359. </template>
  360. <template v-if="printForm.range.indexOf('notes') > -1">
  361. <h5 v-if="notesList.length > 0">笔记</h5>
  362. <ul class="explainlist">
  363. <li v-for="(itemW, indexW) in notesList" :key="indexW">
  364. <b
  365. class="prefix"
  366. :style="{ color: colorObj.phraseOhterColor }"
  367. >{{ itemW.select_text }}</b
  368. >
  369. <div
  370. class="para-list"
  371. :style="{ color: colorObj.newWordOtherColor }"
  372. v-html="itemW.note"
  373. ></div>
  374. </li>
  375. </ul>
  376. </template>
  377. </div>
  378. <footer
  379. class="print-footer"
  380. v-if="
  381. printForm.school ||
  382. printForm.className ||
  383. printForm.name ||
  384. printForm.dateStr ||
  385. printForm.momo
  386. "
  387. >
  388. <span>{{ printForm.school }}</span>
  389. <span>{{ printForm.className }}</span>
  390. <span>{{ printForm.name }}</span>
  391. <span style="flex: 1"></span>
  392. <span>{{ printForm.dateStr }}</span>
  393. <span>{{ printForm.momo }}</span>
  394. </footer>
  395. </div>
  396. <div class="print-model-bottom-right">
  397. <h3><svg-icon icon-class="print"></svg-icon>打印设置</h3>
  398. <div class="config-box">
  399. <div class="item-page">
  400. <label>字体:</label>
  401. <el-select v-model="printForm.fontFamily" placeholder="请选择">
  402. <el-option
  403. v-for="item in fontList"
  404. :key="item.value"
  405. :label="item.name"
  406. :value="item.value"
  407. >
  408. </el-option>
  409. </el-select>
  410. </div>
  411. <div class="item-page">
  412. <label>字号:</label>
  413. <el-input-number
  414. v-model="printForm.fontSize"
  415. :step="2"
  416. ></el-input-number>
  417. </div>
  418. <div class="item-page">
  419. <label>颜色:</label>
  420. <el-color-picker
  421. v-model="printForm.color"
  422. size="small"
  423. ></el-color-picker>
  424. </div>
  425. <el-divider class="print-divider"></el-divider>
  426. <div class="item-page">
  427. <label>行距:</label>
  428. <el-select v-model="printForm.lineHeight" placeholder="请选择">
  429. <el-option
  430. v-for="item in lineHeightList"
  431. :key="item.value"
  432. :label="item.name"
  433. :value="item.value"
  434. >
  435. </el-option>
  436. </el-select>
  437. </div>
  438. <el-divider class="print-divider"></el-divider>
  439. <div class="item-page">
  440. <label>打印/下载范围:</label>
  441. <el-checkbox-group v-model="printForm.range">
  442. <el-checkbox
  443. v-for="(itemT, indexT) in rangeList"
  444. :key="indexT"
  445. :label="itemT.value"
  446. >{{ itemT.name }}</el-checkbox
  447. >
  448. </el-checkbox-group>
  449. </div>
  450. <div class="item-page" v-if="articleInfo.en_flag">
  451. <label>加粗显示:</label>
  452. <el-checkbox-group v-model="printForm.bold">
  453. <el-checkbox
  454. v-for="(itemT, indexT) in boldList"
  455. :key="indexT"
  456. :label="itemT.value"
  457. >{{ itemT.name }}</el-checkbox
  458. >
  459. </el-checkbox-group>
  460. </div>
  461. <el-divider class="print-divider"></el-divider>
  462. <div class="item-page">
  463. <label>附加信息:</label>
  464. <b @click="handleClear"
  465. ><svg-icon icon-class="clear"></svg-icon>清除</b
  466. >
  467. </div>
  468. <div class="item-page">
  469. <label>姓名:</label>
  470. <el-input
  471. v-model="printForm.name"
  472. autocomplete="off"
  473. placeholder="请输入"
  474. maxlength="20"
  475. >
  476. </el-input>
  477. </div>
  478. <div class="item-page">
  479. <label>学校:</label>
  480. <el-input
  481. v-model="printForm.school"
  482. autocomplete="off"
  483. placeholder="请输入"
  484. maxlength="20"
  485. >
  486. </el-input>
  487. </div>
  488. <div class="item-page">
  489. <label>班级:</label>
  490. <el-input
  491. v-model="printForm.className"
  492. autocomplete="off"
  493. placeholder="请输入"
  494. maxlength="20"
  495. >
  496. </el-input>
  497. </div>
  498. <div class="item-page">
  499. <label>日期:</label>
  500. <el-input
  501. v-model="printForm.dateStr"
  502. autocomplete="off"
  503. placeholder="请输入"
  504. maxlength="20"
  505. >
  506. </el-input>
  507. </div>
  508. <div class="item-page">
  509. <label>备注:</label>
  510. <el-input
  511. v-model="printForm.momo"
  512. autocomplete="off"
  513. placeholder="请输入"
  514. maxlength="20"
  515. >
  516. </el-input>
  517. </div>
  518. <el-divider class="print-divider"></el-divider>
  519. <div class="item-page">
  520. <label>统计信息:</label>
  521. <el-checkbox-group v-model="printForm.info">
  522. <el-checkbox
  523. v-for="(itemT, indexT) in infoList"
  524. :key="indexT"
  525. :label="itemT.value"
  526. >{{ itemT.name }}</el-checkbox
  527. >
  528. </el-checkbox-group>
  529. </div>
  530. <el-divider class="print-divider"></el-divider>
  531. </div>
  532. <p style="color: red; width: 100%; margin: 10px 0; text-align: center">
  533. 若点击打印按钮无法显示,下一个页面点击更多设置,勾选背景图形
  534. </p>
  535. <div class="item-page" style="padding: 0 24px">
  536. <el-button @click="goBack" size="small">取消</el-button>
  537. <el-button
  538. type="primary"
  539. @click="generatePDF(articleInfo.art_title)"
  540. size="small"
  541. >下载</el-button
  542. >
  543. <el-button type="primary" @click="handlePrint" size="small"
  544. >打印</el-button
  545. >
  546. <el-button type="primary" @click="handleManyPrint" size="small"
  547. >打印多篇</el-button
  548. >
  549. </div>
  550. </div>
  551. </div>
  552. <el-dialog
  553. :visible.sync="printManyFlag"
  554. width="500px"
  555. append-to-body
  556. :show-close="true"
  557. title="选择打印的文章"
  558. :close-on-click-modal="false"
  559. >
  560. <el-form ref="form">
  561. <el-form-item prop="name">
  562. <el-cascader
  563. v-model="printManyId"
  564. :props="{ multiple: true }"
  565. collapse-tags
  566. :options="printManyMenu"
  567. style="width: 470px"
  568. />
  569. </el-form-item>
  570. <el-form-item style="text-align: right">
  571. <el-button @click="printManyFlag = false">取 消</el-button>
  572. <el-button :loading="loading" type="primary" @click="submitPrintMore"
  573. >确 定</el-button
  574. ></el-form-item
  575. >
  576. </el-form>
  577. </el-dialog>
  578. <div
  579. class="print-model-bottom-left"
  580. ref="printAreaManys"
  581. id="showWaterMarks"
  582. v-if="isPrintMore"
  583. :style="{
  584. width: '220mm',
  585. }"
  586. >
  587. <div
  588. class="print-inner"
  589. v-for="(itemA, index) in printManyDetails"
  590. :key="index"
  591. >
  592. <h2>
  593. <span
  594. :style="{
  595. color: colorObj.titleColor,
  596. fontSize: titleFontsize + 'px',
  597. lineHeight: titleFontsize + 8 + 'px',
  598. marginRight: '10px',
  599. fontWeight: '700',
  600. cursor: 'pointer',
  601. wordBreak: 'break-word',
  602. }"
  603. >{{ itemA.art_title }}</span
  604. >
  605. </h2>
  606. <h6
  607. class="nnpe-article-author"
  608. :style="{
  609. color: colorObj.sourceColor,
  610. fontSize: wordFontsize - 4 + 'px',
  611. lineHeight: wordFontsize + 4 + 'px',
  612. fontWeight: '400',
  613. }"
  614. >
  615. {{
  616. itemA.art_author +
  617. " · " +
  618. itemA.study_phase_name +
  619. "版 · 第 " +
  620. itemA.iss_no +
  621. " 期 · " +
  622. itemA.release_date +
  623. " · " +
  624. itemA.chn_item +
  625. (itemA.page_no_in_pub ? " · P" + itemA.page_no_in_pub : "")
  626. }}
  627. {{ printForm.info.length > 0 ? " | " : "" }}
  628. {{
  629. printForm.info.indexOf("wordLength") > -1
  630. ? " 长度 " + itemA.art_corpus_data.artStatInfo.wc
  631. : ""
  632. }}
  633. {{
  634. printForm.info.indexOf("wordNumber") > -1
  635. ? " · 词数 " + itemA.art_corpus_data.artStatInfo.wdc
  636. : ""
  637. }}
  638. {{
  639. printForm.info.indexOf("difficulty") > -1
  640. ? " · 难度 " + itemA.art_corpus_data.artStatInfo.vocabHardLevel
  641. : ""
  642. }}
  643. </h6>
  644. <template v-if="itemA.resArr.length > 0 && itemA.en_flag">
  645. <div class="table-box">
  646. <div
  647. :class="['NNPE-detail']"
  648. v-for="(item, index) in itemA.resArr"
  649. :key="'detail' + index"
  650. >
  651. <div class="wordsList-box">
  652. <template v-if="index !== 0">
  653. <div class="nnpe-sentence-box">
  654. <div
  655. v-for="(pItem, pIndex) in item.wordsList"
  656. :key="'wordsList' + pIndex"
  657. class="word-box"
  658. :class="[
  659. pItem.isExplain || pItem.explainNumber
  660. ? 'hasExplain'
  661. : '',
  662. ]"
  663. >
  664. <template v-if="pItem.isShow">
  665. <template v-if="pItem.tokens[2] === '#@@#'">
  666. <span
  667. class="NNPE-chs"
  668. :style="{
  669. width: printForm.fontSize + 'px',
  670. height:
  671. printForm.fontSize * printForm.lineHeight +
  672. 'px',
  673. display: 'block',
  674. fontFamily: printForm.fontFamily,
  675. }"
  676. ></span>
  677. </template>
  678. <template v-else>
  679. <div :class="['NNPE-words']">
  680. <span
  681. class="NNPE-chs"
  682. :class="[
  683. pItem.tokens[9] === '' ? 'marginRight' : '',
  684. (pItem.highIndex &&
  685. printForm.bold.indexOf(pItem.types) > -1) ||
  686. (printForm.bold.indexOf('sentence') > -1 &&
  687. longSentIds.indexOf(pItem.sent_id) > -1)
  688. ? 'fontWeight'
  689. : '',
  690. pItem.marginRigh ? 'marginSingleRight' : '',
  691. ]"
  692. :style="{
  693. fontSize: printForm.fontSize + 'px',
  694. color: printForm.color,
  695. lineHeight: printForm.lineHeight,
  696. fontFamily: printForm.fontFamily,
  697. }"
  698. >{{ pItem.tokens[2] }}</span
  699. >
  700. <span
  701. class="NNPE-chs NNPE-chs-both"
  702. v-if="
  703. item.wordsList[pIndex + 1] &&
  704. item.wordsList[pIndex + 1].tokens[2] &&
  705. enFhList.indexOf(
  706. item.wordsList[pIndex + 1].tokens[2]
  707. ) > -1
  708. "
  709. :class="[
  710. item.wordsList[pIndex + 1].tokens[8] === ''
  711. ? 'marginLeft'
  712. : '',
  713. (item.wordsList[pIndex + 1].highIndex &&
  714. printForm.bold.indexOf(
  715. item.wordsList[pIndex + 1].types
  716. ) > -1) ||
  717. (printForm.bold.indexOf('sentence') > -1 &&
  718. longSentIds.indexOf(
  719. item.wordsList[pIndex + 1].sent_id
  720. ) > -1)
  721. ? 'fontWeight'
  722. : '',
  723. item.wordsList[pIndex + 1].marginRight
  724. ? 'marginSingleRight'
  725. : '',
  726. ]"
  727. :style="{
  728. fontSize: printForm.fontSize + 'px',
  729. color: printForm.color,
  730. lineHeight: printForm.lineHeight,
  731. fontFamily: printForm.fontFamily,
  732. }"
  733. >{{ item.wordsList[pIndex + 1].tokens[2] }}</span
  734. >
  735. </div>
  736. </template>
  737. </template>
  738. </div>
  739. </div>
  740. </template>
  741. </div>
  742. <template
  743. v-if="
  744. itemA.articleImg &&
  745. itemA.articleImg[index] &&
  746. printForm.range.indexOf('image') > -1
  747. "
  748. >
  749. <figure
  750. v-for="(itemI, indexI) in itemA.articleImg[index]"
  751. :key="indexI"
  752. style="text-align: center"
  753. >
  754. <img
  755. @load="handleImageLoad($event, itemI)"
  756. :style="{
  757. width: itemI.width,
  758. height: itemI.height,
  759. }"
  760. :src="itemI.src"
  761. />
  762. <!-- <el-image
  763. :src="itemI.src"
  764. fit="contain"
  765. :style="{
  766. width: itemI.width,
  767. height: itemI.height,
  768. }"
  769. :preview-src-list="[itemI.src]"
  770. ></el-image> -->
  771. </figure>
  772. </template>
  773. </div>
  774. </div>
  775. </template>
  776. <div
  777. v-else
  778. class="cn-content"
  779. v-html="itemA.art_content"
  780. :style="{
  781. color: printForm.color,
  782. fontSize: printForm.fontSize + 'px',
  783. lineHeight: printForm.lineHeight,
  784. }"
  785. ></div>
  786. <template v-if="printForm.range.indexOf('vocab') > -1">
  787. <h5>词表</h5>
  788. <ul class="newwordlist">
  789. <li
  790. v-for="(itemW, indexW) in itemA.wordLit"
  791. :key="indexW"
  792. :class="['li-' + colorObj.type]"
  793. >
  794. <div class="word-info">
  795. <div class="word-info-top">
  796. <b class="word" :style="{ color: colorObj.newWordColor }">{{
  797. itemW.word
  798. }}</b>
  799. <span
  800. class="symbol"
  801. :style="{ color: colorObj.newWordOtherColor }"
  802. >{{ itemW.symbol }}</span
  803. >
  804. <label
  805. class="word-type"
  806. :style="{
  807. color: colorObj.newWordType[itemW.type]
  808. ? colorObj.newWordType[itemW.type].color
  809. : '',
  810. background: colorObj.newWordType[itemW.type]
  811. ? colorObj.newWordType[itemW.type].bg
  812. : '',
  813. }"
  814. >{{ itemW.typeCn }}</label
  815. >
  816. <span class="star" v-if="itemW.rate">
  817. <svg-icon
  818. icon-class="star-filled"
  819. v-for="(itemS, indexS) in itemW.rate"
  820. :key="indexS"
  821. :style="{ color: colorObj.newWordStar }"
  822. ></svg-icon>
  823. </span>
  824. <div class="para-list">
  825. <div
  826. class="para"
  827. v-for="(itemP, indexP) in itemW.paraList"
  828. :key="indexP"
  829. >
  830. <span
  831. class="cixing"
  832. :style="{ color: colorObj.newWordOtherColor }"
  833. >{{ itemP.cixing }}</span
  834. >
  835. <span
  836. class="shiyi"
  837. :style="{ color: colorObj.newWordOtherColor }"
  838. >{{ itemP.para }}</span
  839. >
  840. </div>
  841. </div>
  842. </div>
  843. </div>
  844. </li>
  845. </ul>
  846. <h5 v-if="itemA.art_phrase_data && itemA.art_phrase_data.length > 0">
  847. 短语
  848. </h5>
  849. <ul
  850. class="phraselist"
  851. v-if="itemA.art_phrase_data && itemA.art_phrase_data.length > 0"
  852. >
  853. <li v-for="(itemW, indexW) in itemA.phraseList" :key="indexW">
  854. <div class="word-info">
  855. <div class="word-info-top">
  856. <b
  857. class="phrase"
  858. :style="{ color: colorObj.phraseColor }"
  859. @click="showItem(itemW, indexW)"
  860. >{{ itemW.exp_title }}</b
  861. >
  862. <div class="para-list">
  863. <div class="para">
  864. <span
  865. class="shiyi"
  866. :style="{ color: colorObj.phraseOhterColor }"
  867. >{{ itemW.exp_content }}</span
  868. >
  869. </div>
  870. </div>
  871. </div>
  872. </div>
  873. </li>
  874. </ul>
  875. <h5
  876. v-if="itemA.art_explain_data && itemA.art_explain_data.length > 0"
  877. >
  878. 注释
  879. </h5>
  880. <ul
  881. class="explainlist"
  882. v-if="itemA.art_explain_data && itemA.art_explain_data.length > 0"
  883. >
  884. <li v-for="(itemW, indexW) in itemA.art_explain_data" :key="indexW">
  885. <b class="prefix" :style="{ color: colorObj.phraseOhterColor }">{{
  886. itemW.exp_title
  887. }}</b>
  888. <div
  889. class="para-list"
  890. :style="{ color: colorObj.newWordOtherColor }"
  891. v-html="itemW.exp_content"
  892. ></div>
  893. </li>
  894. </ul>
  895. </template>
  896. <template v-if="printForm.range.indexOf('ciyun') > -1">
  897. <iframe
  898. class="ciyun-box"
  899. width="100%"
  900. height="720px"
  901. border="none"
  902. :src="
  903. './ciyun/ciyunPrint.html?partitionKey=1&searchType=2&articleId=' +
  904. itemA.id
  905. "
  906. ></iframe>
  907. </template>
  908. <template v-if="printForm.range.indexOf('notes') > -1">
  909. <h5 v-if="itemA.notesList.length > 0">笔记</h5>
  910. <ul class="explainlist">
  911. <li v-for="(itemW, indexW) in itemA.notesList" :key="indexW">
  912. <b class="prefix" :style="{ color: colorObj.phraseOhterColor }">{{
  913. itemW.select_text
  914. }}</b>
  915. <div
  916. class="para-list"
  917. :style="{ color: colorObj.newWordOtherColor }"
  918. v-html="itemW.note"
  919. ></div>
  920. </li>
  921. </ul>
  922. </template>
  923. </div>
  924. <footer class="print-footer">
  925. <span>{{ printForm.school }}</span>
  926. <span>{{ printForm.className }}</span>
  927. <span>{{ printForm.name }}</span>
  928. <span style="flex: 1"></span>
  929. <span>{{ printForm.dateStr }}</span>
  930. <span>{{ printForm.momo }}</span>
  931. </footer>
  932. </div>
  933. </div>
  934. </template>
  935. <script>
  936. import waterMark from "../../../store/watermark";
  937. import { getToken } from "@/utils/auth";
  938. import { getLogin } from "@/api/ajax";
  939. import html2pdf from "html2pdf.js";
  940. export default {
  941. props: [
  942. "titleFontsize",
  943. "wordFontsize",
  944. "colorObj",
  945. "articleType",
  946. "articleInfo",
  947. "likePhraseList",
  948. "likeWord",
  949. "articleImg",
  950. ],
  951. data() {
  952. return {
  953. userMessage: getToken() ? JSON.parse(getToken()) : null,
  954. articleId: this.$route.query.id ? this.$route.query.id : "",
  955. issId: this.$route.query.iss_id ? this.$route.query.iss_id : "",
  956. resArr: [],
  957. enFhList: [
  958. ",",
  959. ".",
  960. ";",
  961. "?",
  962. "!",
  963. ":",
  964. ">",
  965. "<",
  966. "'",
  967. "’",
  968. "n't",
  969. "n’t",
  970. "n’ts",
  971. "n‘t",
  972. "'t",
  973. "’t",
  974. "‘t",
  975. "'s",
  976. "’s",
  977. "‘s",
  978. "'m",
  979. "’m",
  980. "‘m",
  981. "'re",
  982. "’re",
  983. "‘re",
  984. "'d",
  985. "’d",
  986. "‘d",
  987. "'ve",
  988. "’ve",
  989. "‘ve",
  990. ")",
  991. "'ll",
  992. "’ll",
  993. "‘ll",
  994. "”",
  995. ],
  996. sentenceList: [],
  997. longSentIds: [], // 长句id
  998. allWordList: [], // 生词短语注释总列表
  999. wordLit: [],
  1000. annotationList: [],
  1001. phraseList: [],
  1002. notesList: [], // 笔记列表
  1003. fontList: [
  1004. {
  1005. value: "roman",
  1006. name: "Times New Roman",
  1007. },
  1008. {
  1009. value: "Arial",
  1010. name: "Arial",
  1011. },
  1012. ],
  1013. lineHeightList: [
  1014. {
  1015. value: "0.8",
  1016. name: "0.8倍",
  1017. },
  1018. {
  1019. value: "1.0",
  1020. name: "1.0倍",
  1021. },
  1022. {
  1023. value: "1.5",
  1024. name: "1.5倍",
  1025. },
  1026. {
  1027. value: "2.0",
  1028. name: "2.0倍",
  1029. },
  1030. ],
  1031. rangeList: [
  1032. {
  1033. value: "image",
  1034. name: "图片",
  1035. },
  1036. {
  1037. value: "vocab",
  1038. name: "词表",
  1039. },
  1040. // {
  1041. // value: "ciyun",
  1042. // name: "词云",
  1043. // },
  1044. {
  1045. value: "notes",
  1046. name: "笔记",
  1047. },
  1048. ],
  1049. boldList: [
  1050. {
  1051. value: "newWord",
  1052. name: "生词",
  1053. },
  1054. {
  1055. value: "phrase",
  1056. name: "短语",
  1057. },
  1058. {
  1059. value: "sentence",
  1060. name: "长句",
  1061. },
  1062. ],
  1063. infoList: [
  1064. {
  1065. value: "wordLength",
  1066. name: "长度",
  1067. },
  1068. {
  1069. value: "wordNumber",
  1070. name: "词数",
  1071. },
  1072. {
  1073. value: "difficulty",
  1074. name: "难度",
  1075. },
  1076. ],
  1077. printForm: {
  1078. fontFamily: "roman",
  1079. fontSize: 24,
  1080. color: "#2F3742",
  1081. lineHeight: "1.5",
  1082. range: [],
  1083. bold: ["newWord", "phrase"],
  1084. info: [],
  1085. name: "",
  1086. school: "",
  1087. className: "",
  1088. dateStr: "",
  1089. momo: "",
  1090. },
  1091. isPrint: false,
  1092. printNumber: 0,
  1093. issDetail: null, // 整期文章内容
  1094. issDetailMap: {}, // 整期文章详情map
  1095. printManyFlag: false,
  1096. printManyId: [], // 打印多篇文章id
  1097. loading: false,
  1098. printManyMenu: [], // 打印多篇文章目录
  1099. printManyDetails: [], // 最终确定打印文章内容详情
  1100. isPrintMore: false,
  1101. };
  1102. },
  1103. created() {
  1104. if (this.articleInfo.en_flag) {
  1105. this.rangeList = [
  1106. {
  1107. value: "image",
  1108. name: "图片",
  1109. },
  1110. {
  1111. value: "vocab",
  1112. name: "词表",
  1113. },
  1114. // {
  1115. // value: "ciyun",
  1116. // name: "词云",
  1117. // },
  1118. {
  1119. value: "notes",
  1120. name: "笔记",
  1121. },
  1122. ];
  1123. } else {
  1124. this.rangeList = [
  1125. {
  1126. value: "vocab",
  1127. name: "词表",
  1128. },
  1129. // {
  1130. // value: "ciyun",
  1131. // name: "词云",
  1132. // },
  1133. {
  1134. value: "notes",
  1135. name: "笔记",
  1136. },
  1137. ];
  1138. }
  1139. this.getIssueDetail();
  1140. },
  1141. methods: {
  1142. goBack() {
  1143. this.$emit("closePrint");
  1144. },
  1145. handleData() {
  1146. let explainNumber = 1;
  1147. let resArr = [];
  1148. let articleInfo = JSON.parse(JSON.stringify(this.articleInfo));
  1149. this.sentenceList =
  1150. articleInfo.art_corpus_data && articleInfo.art_corpus_data.sentList
  1151. ? articleInfo.art_corpus_data.sentList
  1152. : [];
  1153. this.longSentIds =
  1154. articleInfo.art_corpus_data && articleInfo.art_corpus_data.artStatInfo
  1155. ? articleInfo.art_corpus_data.artStatInfo.longSentIds
  1156. : [];
  1157. this.wordLit = articleInfo.art_voc_data ? articleInfo.art_voc_data : [];
  1158. this.annotationList = articleInfo.art_phrase_data
  1159. ? articleInfo.art_explain_data
  1160. : [];
  1161. this.phraseList = articleInfo.art_explain_data
  1162. ? articleInfo.art_phrase_data
  1163. : [];
  1164. this.wordLit.forEach((item) => {
  1165. item.types = "newWord";
  1166. item.exp_title = item.word_name;
  1167. let paraStr = "";
  1168. if (item.word_explain && item.word_explain.word_para_list) {
  1169. item.word_explain.word_para_list.forEach((items) => {
  1170. paraStr += items.para;
  1171. });
  1172. }
  1173. item.exp_content = paraStr;
  1174. item.word = item.word_name;
  1175. item.symbol = item.word_explain.ph ? item.word_explain.ph : "";
  1176. item.paraList = item.word_explain.word_para_list;
  1177. item.type = item.word_explain.vl_level
  1178. ? item.word_explain.vl_level
  1179. : "";
  1180. item.typeCn = item.word_explain.vl_level_name
  1181. ? item.word_explain.vl_level_name
  1182. : "";
  1183. item.rate = item.word_explain.star ? item.word_explain.star : null;
  1184. });
  1185. this.phraseList.forEach((item) => {
  1186. item.type = "phrase";
  1187. });
  1188. this.annotationList.forEach((item) => {
  1189. item.type = "explain";
  1190. });
  1191. this.allWordList = this.wordLit.concat(this.phraseList);
  1192. let leg = articleInfo.art_corpus_data
  1193. ? articleInfo.art_corpus_data.sentList[
  1194. articleInfo.art_corpus_data.sentList.length - 1
  1195. ].pno
  1196. : 0;
  1197. this.sentenceList.forEach((item, index) => {
  1198. let flag = "";
  1199. item.StyleTokens = [];
  1200. item.tokens.forEach((items, indexs) => {
  1201. let obj = {
  1202. tokens: items,
  1203. marginRight: indexs === item.tokens.length - 1,
  1204. };
  1205. this.allWordList.forEach((itema, indexa) => {
  1206. itema.bind_sent_data.bind_sents.forEach((itemb, indexb) => {
  1207. if (itemb.sent_id === item.id) {
  1208. if (itema.type === "explain") {
  1209. if (
  1210. indexs ===
  1211. itemb.sel_token_idxes[itemb.sel_token_idxes.length - 1]
  1212. ) {
  1213. obj.highIndex = true;
  1214. obj.type = itema.type;
  1215. obj.types = itema.type;
  1216. obj.word_id = itema.id; // 生词注释短语的id
  1217. obj.explainNumber = explainNumber;
  1218. explainNumber++;
  1219. }
  1220. } else {
  1221. itemb.sel_token_idxes.forEach((itemi) => {
  1222. if (indexs === itemi) {
  1223. obj.highIndex = true;
  1224. obj.type = itema.type;
  1225. obj.types = itema.types ? itema.types : itema.type;
  1226. obj.word_id = itema.id; // 生词注释短语的id
  1227. }
  1228. });
  1229. }
  1230. if (
  1231. itemb.sel_token_idxes.length === 0 &&
  1232. itema.type === "explain" &&
  1233. indexs === item.tokens.length - 1
  1234. ) {
  1235. flag = itema.id;
  1236. }
  1237. }
  1238. });
  1239. });
  1240. item.StyleTokens.push(obj);
  1241. if (flag) {
  1242. item.StyleTokens.push({
  1243. tokens: [
  1244. 0,
  1245. 8,
  1246. "Students",
  1247. "",
  1248. "",
  1249. "",
  1250. "",
  1251. "",
  1252. "",
  1253. " ",
  1254. 0,
  1255. "",
  1256. "",
  1257. "",
  1258. ],
  1259. type: "explain",
  1260. word_id: flag,
  1261. isExplain: true,
  1262. explainNumber: explainNumber,
  1263. });
  1264. explainNumber++;
  1265. }
  1266. });
  1267. });
  1268. for (let i = 0; i < leg + 1; i++) {
  1269. let obgs = {
  1270. isShow: true,
  1271. marginRight: false,
  1272. tokens: [
  1273. "",
  1274. "",
  1275. "#@@#",
  1276. "",
  1277. "",
  1278. "",
  1279. "",
  1280. "",
  1281. " ",
  1282. " ",
  1283. "",
  1284. "",
  1285. "",
  1286. "",
  1287. "",
  1288. ],
  1289. };
  1290. let obj = {
  1291. wordsList: i === 0 ? [] : [obgs, obgs],
  1292. };
  1293. resArr.push(obj);
  1294. }
  1295. this.sentenceList.forEach((item, index) => {
  1296. item.StyleTokens.forEach((items, indexs) => {
  1297. items.isShow = this.enFhList.indexOf(items.tokens[2]) == -1;
  1298. items.sent_id = item.id;
  1299. resArr[item.pno].wordsList.push(items);
  1300. });
  1301. });
  1302. this.resArr = resArr;
  1303. setTimeout(() => {
  1304. waterMark.set(
  1305. this.userMessage.user_name + " " + this.userMessage.phone,
  1306. "",
  1307. "showWaterMark"
  1308. );
  1309. }, 1000);
  1310. },
  1311. // 打印
  1312. handlePrint() {
  1313. let MethodName =
  1314. "/ShopServer/Client/PrintRecordManager/GetMyPrintCount_Article";
  1315. getLogin(MethodName, {
  1316. goods_type: 21,
  1317. date_range: "ALL",
  1318. article_id: this.articleId,
  1319. }).then((res) => {
  1320. if (res.status === 1) {
  1321. if (res.print_count < 5) {
  1322. getLogin(
  1323. "/ShopServer/Client/PrintRecordManager/AddPrintRecord_Article",
  1324. {
  1325. goods_type: 21,
  1326. article_id: this.articleId,
  1327. }
  1328. ).then((res) => {
  1329. if (res.status === 1) {
  1330. }
  1331. });
  1332. this.$nextTick(() => {
  1333. this.$print(this.$refs["printArea"], {
  1334. noPrint: ".noPrint",
  1335. type: "html",
  1336. scanStyles: true,
  1337. showModal: true,
  1338. // style: style,// 亦可使用引入的外部css;
  1339. onStart: () => {
  1340. // console.log("打印开始");
  1341. },
  1342. onEnd: () => {
  1343. // console.log("打印完成");
  1344. },
  1345. });
  1346. });
  1347. } else {
  1348. this.$message.warning("每篇文章打印+下载次数共5次,现已达上限。");
  1349. }
  1350. }
  1351. });
  1352. },
  1353. // 清除
  1354. handleClear() {
  1355. this.printForm.name = "";
  1356. this.printForm.school = "";
  1357. this.printForm.className = "";
  1358. this.printForm.dateStr = "";
  1359. this.printForm.momo = "";
  1360. },
  1361. // 高亮笔记句子
  1362. handleHighSentence() {
  1363. let MethodName = "/PaperServer/Client/Article/ArtNoteListInArt";
  1364. let data = {
  1365. id: this.$route.query.id,
  1366. };
  1367. getLogin(MethodName, data).then((res) => {
  1368. if (res.status === 1) {
  1369. this.notesList = res.data;
  1370. }
  1371. });
  1372. },
  1373. // 下载pdf
  1374. async generatePDF(title) {
  1375. let MethodName =
  1376. "/ShopServer/Client/PrintRecordManager/GetMyPrintCount_Article";
  1377. getLogin(MethodName, {
  1378. goods_type: 21,
  1379. date_range: "ALL",
  1380. article_id: this.articleId,
  1381. }).then((res) => {
  1382. if (res.status === 1) {
  1383. if (res.print_count < 5) {
  1384. getLogin(
  1385. "/ShopServer/Client/PrintRecordManager/AddPrintRecord_Article",
  1386. {
  1387. goods_type: 21,
  1388. article_id: this.articleId,
  1389. }
  1390. ).then((res) => {
  1391. if (res.status === 1) {
  1392. }
  1393. });
  1394. this.$nextTick(() => {
  1395. this.isPrint = true;
  1396. const element = document.getElementById("showWaterMark");
  1397. const opt = {
  1398. margin: [0, 0, 0, 0],
  1399. useCORS: true,
  1400. filename: title + ".pdf",
  1401. image: { type: "jpeg", quality: 0.98 },
  1402. html2canvas: { scale: 2 }, // 或其他自定义设置,例如scale可以放大内容以便更容易阅读和打印。
  1403. jsPDF: { unit: "mm", format: "a4", orientation: "portrait" }, // A4尺寸的PDF,纵向打印。
  1404. };
  1405. html2pdf().set(opt).from(element).save();
  1406. setTimeout(() => {
  1407. this.isPrint = false;
  1408. }, 100);
  1409. });
  1410. } else {
  1411. this.$message.warning("每篇文章打印+下载次数共5次,现已达上限。");
  1412. }
  1413. }
  1414. });
  1415. },
  1416. // 获取整期报刊内容
  1417. getIssueDetail() {
  1418. this.issDetail = null;
  1419. this.issDetailMap = {};
  1420. let MethodName = "/PaperServer/Client/Article/GetIssueDetail";
  1421. getLogin(MethodName, {
  1422. id: this.issId,
  1423. }).then((res) => {
  1424. if (res.status === 1) {
  1425. this.issDetail = res.data;
  1426. if (res.data.articles) {
  1427. this.issDetailMap = res.data.articles.reduce((acc, user) => {
  1428. acc[user.id] = user;
  1429. return acc;
  1430. }, {});
  1431. res.data.articles.forEach((itemA) => {
  1432. let explainNumber = 1;
  1433. let resArr = [];
  1434. let articleInfo = JSON.parse(JSON.stringify(itemA));
  1435. let sentenceList = articleInfo.art_corpus_data
  1436. ? articleInfo.art_corpus_data.sentList
  1437. : [];
  1438. let longSentIds =
  1439. articleInfo.art_corpus_data &&
  1440. articleInfo.art_corpus_data.artStatInfo
  1441. ? articleInfo.art_corpus_data.artStatInfo.longSentIds
  1442. : [];
  1443. let wordLit = articleInfo.art_voc_data
  1444. ? articleInfo.art_voc_data
  1445. : [];
  1446. let annotationList = articleInfo.art_phrase_data
  1447. ? articleInfo.art_explain_data
  1448. : [];
  1449. let phraseList = articleInfo.art_explain_data
  1450. ? articleInfo.art_phrase_data
  1451. : [];
  1452. wordLit.forEach((item) => {
  1453. item.types = "newWord";
  1454. item.exp_title = item.word_name;
  1455. let paraStr = "";
  1456. if (item.word_explain && item.word_explain.word_para_list) {
  1457. item.word_explain.word_para_list.forEach((items) => {
  1458. paraStr += items.para;
  1459. });
  1460. }
  1461. item.exp_content = paraStr;
  1462. item.word = item.word_name;
  1463. item.symbol = item.word_explain.ph ? item.word_explain.ph : "";
  1464. item.paraList = item.word_explain.word_para_list;
  1465. item.type = item.word_explain.vl_level
  1466. ? item.word_explain.vl_level
  1467. : "";
  1468. item.typeCn = item.word_explain.vl_level_name
  1469. ? item.word_explain.vl_level_name
  1470. : "";
  1471. item.rate = item.word_explain.star
  1472. ? item.word_explain.star
  1473. : null;
  1474. });
  1475. phraseList.forEach((item) => {
  1476. item.type = "phrase";
  1477. });
  1478. annotationList.forEach((item) => {
  1479. item.type = "explain";
  1480. });
  1481. let allWordList = wordLit.concat(phraseList);
  1482. let leg =
  1483. articleInfo.art_corpus_data &&
  1484. articleInfo.art_corpus_data.sentList
  1485. ? articleInfo.art_corpus_data.sentList[
  1486. articleInfo.art_corpus_data.sentList.length - 1
  1487. ].pno
  1488. : 0;
  1489. sentenceList.forEach((item, index) => {
  1490. let flag = "";
  1491. item.StyleTokens = [];
  1492. item.tokens.forEach((items, indexs) => {
  1493. let obj = {
  1494. tokens: items,
  1495. marginRight: indexs === item.tokens.length - 1,
  1496. };
  1497. allWordList.forEach((itema, indexa) => {
  1498. itema.bind_sent_data.bind_sents.forEach((itemb, indexb) => {
  1499. if (itemb.sent_id === item.id) {
  1500. if (itema.type === "explain") {
  1501. if (
  1502. indexs ===
  1503. itemb.sel_token_idxes[
  1504. itemb.sel_token_idxes.length - 1
  1505. ]
  1506. ) {
  1507. obj.highIndex = true;
  1508. obj.type = itema.type;
  1509. obj.types = itema.type;
  1510. obj.word_id = itema.id; // 生词注释短语的id
  1511. obj.explainNumber = explainNumber;
  1512. explainNumber++;
  1513. }
  1514. } else {
  1515. itemb.sel_token_idxes.forEach((itemi) => {
  1516. if (indexs === itemi) {
  1517. obj.highIndex = true;
  1518. obj.type = itema.type;
  1519. obj.types = itema.types
  1520. ? itema.types
  1521. : itema.type;
  1522. obj.word_id = itema.id; // 生词注释短语的id
  1523. }
  1524. });
  1525. }
  1526. if (
  1527. itemb.sel_token_idxes.length === 0 &&
  1528. itema.type === "explain" &&
  1529. indexs === item.tokens.length - 1
  1530. ) {
  1531. flag = itema.id;
  1532. }
  1533. }
  1534. });
  1535. });
  1536. item.StyleTokens.push(obj);
  1537. if (flag) {
  1538. item.StyleTokens.push({
  1539. tokens: [
  1540. 0,
  1541. 8,
  1542. "Students",
  1543. "",
  1544. "",
  1545. "",
  1546. "",
  1547. "",
  1548. "",
  1549. " ",
  1550. 0,
  1551. "",
  1552. "",
  1553. "",
  1554. ],
  1555. type: "explain",
  1556. word_id: flag,
  1557. isExplain: true,
  1558. explainNumber: explainNumber,
  1559. });
  1560. explainNumber++;
  1561. }
  1562. });
  1563. });
  1564. for (let i = 0; i < leg + 1; i++) {
  1565. let obgs = {
  1566. isShow: true,
  1567. marginRight: false,
  1568. tokens: [
  1569. "",
  1570. "",
  1571. "#@@#",
  1572. "",
  1573. "",
  1574. "",
  1575. "",
  1576. "",
  1577. " ",
  1578. " ",
  1579. "",
  1580. "",
  1581. "",
  1582. "",
  1583. "",
  1584. ],
  1585. };
  1586. let obj = {
  1587. wordsList: i === 0 ? [] : [obgs, obgs],
  1588. };
  1589. resArr.push(obj);
  1590. }
  1591. sentenceList.forEach((item, index) => {
  1592. item.StyleTokens.forEach((items, indexs) => {
  1593. items.isShow = this.enFhList.indexOf(items.tokens[2]) == -1;
  1594. items.sent_id = item.id;
  1595. resArr[item.pno].wordsList.push(items);
  1596. });
  1597. });
  1598. itemA.resArr = resArr;
  1599. itemA.longSentIds = longSentIds;
  1600. itemA.sentenceList = sentenceList;
  1601. itemA.wordLit = wordLit;
  1602. itemA.annotationList = annotationList;
  1603. itemA.phraseList = phraseList;
  1604. itemA.allWordList = allWordList;
  1605. itemA.articleImg = {};
  1606. let articleArr = itemA.art_content.split('<p class="para"');
  1607. articleArr.forEach((itema) => {
  1608. if (itema.indexOf("<img") > -1) {
  1609. // 当前段落有图片
  1610. let imgArr = [];
  1611. let pno =
  1612. itema.indexOf('pno="') > -1
  1613. ? itema.substring(
  1614. itema.indexOf('pno="') + 5,
  1615. itema
  1616. .substring(itema.indexOf('pno="') + 5)
  1617. .indexOf('"') +
  1618. 1 +
  1619. 5
  1620. )
  1621. : 0;
  1622. let itemArr = itema.split("<img");
  1623. itemArr.forEach((items) => {
  1624. if (items.indexOf('src="') > -1) {
  1625. let indexS =
  1626. items
  1627. .substring(items.indexOf('src="') + 5)
  1628. .indexOf('"') + items.indexOf('src="'); // src所在索引
  1629. let indexW =
  1630. items.indexOf('width="') > -1
  1631. ? items
  1632. .substring(items.indexOf('width="') + 7)
  1633. .indexOf('"')
  1634. : items.indexOf("width: ") > -1
  1635. ? items
  1636. .substring(items.indexOf("width: ") + 7)
  1637. .indexOf(";")
  1638. : -1; // width所在索引
  1639. let indexH =
  1640. items.indexOf('height="') > -1
  1641. ? items
  1642. .substring(items.indexOf('height="') + 8)
  1643. .indexOf('"')
  1644. : items.indexOf("height: ") > -1
  1645. ? items
  1646. .substring(items.indexOf("height: ") + 8)
  1647. .indexOf(";")
  1648. : -1; // height所在索引
  1649. let imgobj = {
  1650. src: items.substring(
  1651. items.indexOf('src="') + 5,
  1652. indexS + 5
  1653. ),
  1654. width:
  1655. items.indexOf('width="') > -1
  1656. ? items.substring(
  1657. items.indexOf('width="') + 7,
  1658. items.indexOf('width="') + indexW + 7
  1659. )
  1660. : items.indexOf("width: ") > -1
  1661. ? items.substring(
  1662. items.indexOf("width: ") + 7,
  1663. items.indexOf("width: ") + indexW + 7
  1664. )
  1665. : null,
  1666. height:
  1667. items.indexOf('height="') > -1
  1668. ? items.substring(
  1669. items.indexOf('height="') + 8,
  1670. items.indexOf('height="') + indexH + 8
  1671. )
  1672. : items.indexOf("height: ") > -1
  1673. ? items.substring(
  1674. items.indexOf("height: ") + 8,
  1675. items.indexOf('height="') + indexH + 8
  1676. )
  1677. : null,
  1678. };
  1679. imgArr.push(imgobj);
  1680. }
  1681. });
  1682. itemA.articleImg[pno] = imgArr;
  1683. }
  1684. });
  1685. let MethodNames = "/PaperServer/Client/Article/ArtNoteListInArt";
  1686. let data = {
  1687. id: itemA.id,
  1688. };
  1689. getLogin(MethodNames, data).then((res) => {
  1690. if (res.status === 1) {
  1691. itemA.notesList = res.data;
  1692. }
  1693. });
  1694. });
  1695. }
  1696. if (res.data.issueInfo) {
  1697. let arr = [];
  1698. res.data.issueInfo.chn_art_data.forEach((item) => {
  1699. let arrs = [];
  1700. item.arts.forEach((items) => {
  1701. arrs.push({
  1702. value: items.id,
  1703. label: items.art_title,
  1704. });
  1705. });
  1706. arr.push({
  1707. value: item.chn_idx,
  1708. label: item.chn_name,
  1709. children: arrs,
  1710. });
  1711. });
  1712. this.printManyMenu = [
  1713. {
  1714. value: res.data.issueInfo.id,
  1715. label: res.data.issueInfo.iss_name,
  1716. children: arr,
  1717. },
  1718. ];
  1719. }
  1720. }
  1721. });
  1722. },
  1723. // 打印多篇按钮
  1724. handleManyPrint() {
  1725. this.printManyFlag = true;
  1726. },
  1727. // 确定打印多篇
  1728. submitPrintMore() {
  1729. this.loading = true;
  1730. let printManyIds = [];
  1731. let printManyDetails = [];
  1732. this.printManyId.forEach((item) => {
  1733. printManyIds.push(item[2]);
  1734. printManyDetails.push(this.issDetailMap[item[2]]);
  1735. });
  1736. this.printManyDetails = printManyDetails;
  1737. this.isPrintMore = true;
  1738. setTimeout(() => {
  1739. waterMark.set(
  1740. this.userMessage.user_name + " " + this.userMessage.phone,
  1741. "",
  1742. "showWaterMarks"
  1743. );
  1744. }, 1000);
  1745. setTimeout(() => {
  1746. this.handlePrintManyDetails();
  1747. }, 1500);
  1748. },
  1749. handlePrintManyDetails() {
  1750. let MethodName =
  1751. "/ShopServer/Client/PrintRecordManager/GetMyPrintCount_Article";
  1752. getLogin(MethodName, {
  1753. goods_type: 21,
  1754. date_range: "ALL",
  1755. article_id: this.articleId,
  1756. }).then((res) => {
  1757. if (res.status === 1) {
  1758. if (res.print_count < 5) {
  1759. getLogin(
  1760. "/ShopServer/Client/PrintRecordManager/AddPrintRecord_Article",
  1761. {
  1762. goods_type: 21,
  1763. article_id: this.articleId,
  1764. }
  1765. ).then((res) => {
  1766. if (res.status === 1) {
  1767. }
  1768. });
  1769. this.$nextTick(() => {
  1770. this.$print(this.$refs["printAreaManys"], {
  1771. noPrint: ".noPrint",
  1772. type: "html",
  1773. scanStyles: true,
  1774. showModal: true,
  1775. // style: style,// 亦可使用引入的外部css;
  1776. onStart: () => {
  1777. // console.log("打印开始");
  1778. },
  1779. onEnd: () => {
  1780. // console.log("打印完成");
  1781. },
  1782. });
  1783. this.loading = false;
  1784. this.printManyFlag = false;
  1785. this.isPrintMore = false;
  1786. });
  1787. } else {
  1788. this.loading = false;
  1789. this.printManyFlag = false;
  1790. this.isPrintMore = false;
  1791. this.$message.warning("每篇文章打印+下载次数共5次,现已达上限。");
  1792. }
  1793. }
  1794. });
  1795. },
  1796. handleImageLoad(event, item) {
  1797. if (!item.width || item.width > 870) {
  1798. item.width =
  1799. event.target.naturalWidth > 870
  1800. ? 870 + "px"
  1801. : event.target.naturalWidth + "px";
  1802. }
  1803. if (!item.height) {
  1804. item.height =
  1805. item.width === "870px" ? "" : event.target.naturalHeight + "px";
  1806. }
  1807. // item.src = this.getBase64Image(
  1808. // "http://cms-bucket.ws.126.net/2021/0114/003bc5dej00qmxg5o0089c000s600e3c.jpg"
  1809. // );
  1810. this.getBase64Image(item);
  1811. },
  1812. getBase64Image(item) {
  1813. var image = new Image();
  1814. image.src = item.src + "?v=" + Math.random(); // 处理缓存
  1815. image.crossOrigin = "*"; // 支持跨域图片
  1816. image.onload = () => {
  1817. var canvas = document.createElement("canvas");
  1818. canvas.width = image.width;
  1819. canvas.height = image.height;
  1820. var context = canvas.getContext("2d");
  1821. context.drawImage(image, 0, 0, image.width, image.height);
  1822. var quality = 0.8;
  1823. let dataurl = canvas.toDataURL("image/jpeg", quality);
  1824. // this.url = dataurl;
  1825. item.src = dataurl;
  1826. this.$forceUpdate();
  1827. };
  1828. },
  1829. },
  1830. mounted() {
  1831. if (this.articleInfo) {
  1832. this.handleData();
  1833. this.handleHighSentence();
  1834. }
  1835. this.$nextTick(() => {
  1836. document.onselectstart = new Function("event.returnValue=false");
  1837. });
  1838. },
  1839. beforeDestroy() {
  1840. document.onselectstart = new Function("event.returnValue=true");
  1841. },
  1842. };
  1843. </script>
  1844. <style lang="scss" scoped>
  1845. .print-model {
  1846. background: #f2f3f5;
  1847. &-top {
  1848. padding: 8px 16px;
  1849. border-bottom: 1px solid #ebebeb;
  1850. background: #fff;
  1851. display: flex;
  1852. align-items: center;
  1853. width: 100%;
  1854. position: fixed;
  1855. top: 0;
  1856. left: 0;
  1857. z-index: 10000;
  1858. .goback {
  1859. color: #2f3742;
  1860. font-size: 20px;
  1861. font-weight: 500;
  1862. line-height: 28px;
  1863. padding-right: 12px;
  1864. .el-icon-arrow-left {
  1865. width: 24px;
  1866. height: 24px;
  1867. }
  1868. }
  1869. .border {
  1870. background: #e5e6eb;
  1871. height: 16px;
  1872. margin-top: 2px;
  1873. width: 1px;
  1874. }
  1875. p {
  1876. margin: 0 12px;
  1877. color: #1c2129;
  1878. font-size: 14px;
  1879. font-weight: 500;
  1880. line-height: 22px;
  1881. }
  1882. }
  1883. &-bottom {
  1884. display: flex;
  1885. justify-content: center;
  1886. padding-top: 46px;
  1887. &-left {
  1888. width: 1070px;
  1889. margin: 8px 346px 8px 8px;
  1890. background: #fff;
  1891. flex-shrink: 0;
  1892. .print-inner {
  1893. overflow: auto;
  1894. padding: 120px 100px 30px 100px;
  1895. }
  1896. .nnpe-article-author {
  1897. margin: 24px 0;
  1898. text-align: center;
  1899. }
  1900. h2 {
  1901. display: flex;
  1902. flex-flow: wrap;
  1903. justify-content: center;
  1904. }
  1905. .table-box {
  1906. // background: #f7f7f7;
  1907. // border-top: 1px solid rgba(0, 0, 0, 0.1);
  1908. :last-child {
  1909. :last-child.wordsList-box {
  1910. padding-bottom: 40px;
  1911. }
  1912. }
  1913. .wordsList-box {
  1914. flex: 1;
  1915. // padding: 6px 0 12px 0;
  1916. .nnpe-sentence-box {
  1917. display: flex;
  1918. flex-flow: wrap;
  1919. .word-box {
  1920. position: relative;
  1921. }
  1922. }
  1923. > img {
  1924. max-width: 50%;
  1925. display: block;
  1926. padding: 16px 0;
  1927. margin: 0 auto;
  1928. }
  1929. }
  1930. }
  1931. .NNPE-detail {
  1932. clear: both;
  1933. overflow: hidden;
  1934. // display: flex;
  1935. .NNPE-words {
  1936. float: left;
  1937. padding: 0;
  1938. &.noPadding {
  1939. padding: 0;
  1940. }
  1941. &.sentActive {
  1942. background: rgba(24, 144, 255, 0.1);
  1943. }
  1944. &.overActive {
  1945. background: rgba(0, 0, 0, 0.06);
  1946. }
  1947. > span {
  1948. float: left;
  1949. &.NNPE-chs {
  1950. // font-size: 24px;
  1951. font-family: "Smartisan";
  1952. line-height: 150%;
  1953. color: #000000;
  1954. padding: 0 3px;
  1955. &.wordActive {
  1956. color: #175dff !important;
  1957. }
  1958. &.marginRight {
  1959. padding-right: 0;
  1960. }
  1961. &.marginLeft {
  1962. padding-left: 0;
  1963. }
  1964. &.marginSingleRight {
  1965. padding-right: 3px;
  1966. }
  1967. &.fontWeight {
  1968. font-weight: bold;
  1969. }
  1970. &.newWord {
  1971. color: #3459d2 !important;
  1972. }
  1973. &.phrase {
  1974. color: #ff802b !important;
  1975. }
  1976. &.explain {
  1977. // color: #23C847 !important;
  1978. font-weight: 400;
  1979. }
  1980. }
  1981. &.padding {
  1982. padding: 0 3px;
  1983. cursor: pointer;
  1984. }
  1985. }
  1986. }
  1987. }
  1988. h5 {
  1989. color: #000;
  1990. font-size: 36px;
  1991. font-weight: 700;
  1992. line-height: 44px;
  1993. margin: 24px 0;
  1994. }
  1995. .newwordlist,
  1996. .phraselist {
  1997. li {
  1998. padding: 4px;
  1999. display: flex;
  2000. margin: 1px 0;
  2001. border-radius: 4px;
  2002. .word-info {
  2003. flex: 1;
  2004. }
  2005. .sentence {
  2006. font-size: 14px;
  2007. line-height: 22px;
  2008. color: #2f3742;
  2009. }
  2010. .word-type {
  2011. padding: 0px 8px;
  2012. border-radius: 2px;
  2013. font-weight: 500;
  2014. font-size: 12px;
  2015. line-height: 20px;
  2016. height: 20px;
  2017. margin: 4px 8px 0 0;
  2018. }
  2019. .el-icon-arrow-right {
  2020. width: 24px;
  2021. height: 24px;
  2022. color: #929ca8;
  2023. text-align: center;
  2024. line-height: 24px;
  2025. cursor: pointer;
  2026. }
  2027. .word-info-top {
  2028. display: flex;
  2029. .word {
  2030. font-weight: 700;
  2031. font-size: 20px;
  2032. line-height: 28px;
  2033. color: #175dff;
  2034. margin-right: 8px;
  2035. font-family: "Arial";
  2036. cursor: pointer;
  2037. }
  2038. .phrase {
  2039. font-weight: 500;
  2040. font-size: 24px;
  2041. line-height: 32px;
  2042. color: #ed5f00;
  2043. max-width: 60%;
  2044. word-break: break-word;
  2045. }
  2046. .symbol {
  2047. font-size: 20px;
  2048. line-height: 28px;
  2049. color: #667180;
  2050. margin-right: 8px;
  2051. font-family: "Arial";
  2052. }
  2053. .star {
  2054. margin-right: 8px;
  2055. line-height: 20px;
  2056. }
  2057. .para-list {
  2058. flex: 1;
  2059. .para {
  2060. display: flex;
  2061. font-size: 16px;
  2062. line-height: 24px;
  2063. color: #1c2129;
  2064. margin-bottom: 4px;
  2065. .cixing {
  2066. margin-right: 4px;
  2067. }
  2068. }
  2069. }
  2070. }
  2071. .word-info-bottom {
  2072. font-size: 12px;
  2073. line-height: 20px;
  2074. color: #929ca8;
  2075. margin: 4px 8px 0 0;
  2076. span {
  2077. margin-right: 8px;
  2078. }
  2079. }
  2080. }
  2081. }
  2082. .phraselist {
  2083. .para {
  2084. line-height: 32px !important;
  2085. margin-left: 8px;
  2086. margin-bottom: 0 !important;
  2087. }
  2088. }
  2089. .explainlist {
  2090. li {
  2091. padding: 8px;
  2092. margin: 4px 0;
  2093. .prefix {
  2094. color: #151515;
  2095. font-size: 24px;
  2096. font-weight: 700;
  2097. line-height: 32px;
  2098. }
  2099. .para-list {
  2100. color: #2f3742;
  2101. font-size: 16px;
  2102. font-weight: 500;
  2103. line-height: 24px;
  2104. margin-top: 8px;
  2105. }
  2106. }
  2107. }
  2108. }
  2109. &-right {
  2110. width: 360px;
  2111. padding: 24px 0;
  2112. background: #fff;
  2113. position: fixed;
  2114. z-index: 1;
  2115. top: 46px;
  2116. right: calc((100% - 1450px) / 2);
  2117. height: calc(100% - 48px);
  2118. .config-box {
  2119. height: calc(100% - 110px);
  2120. overflow: auto;
  2121. padding: 0 24px;
  2122. }
  2123. h3 {
  2124. color: #2f3742;
  2125. font-size: 24px;
  2126. font-weight: 400;
  2127. line-height: 32px;
  2128. margin: 0;
  2129. padding: 0 24px;
  2130. .svg-icon {
  2131. width: 24px;
  2132. height: 24px;
  2133. margin-right: 8px;
  2134. }
  2135. }
  2136. }
  2137. }
  2138. }
  2139. .item-page {
  2140. display: flex;
  2141. padding-top: 24px;
  2142. > label {
  2143. color: #2f3742;
  2144. text-align: right;
  2145. font-size: 14px;
  2146. font-weight: 500;
  2147. line-height: 30px;
  2148. width: 72px;
  2149. margin-right: 16px;
  2150. flex-shrink: 0;
  2151. }
  2152. .el-select {
  2153. height: 32px;
  2154. border-radius: 2px;
  2155. width: 202px;
  2156. }
  2157. .el-button {
  2158. width: 70px;
  2159. padding: 8px 0;
  2160. color: rgba(0, 0, 0, 0.91);
  2161. font-size: 14px;
  2162. font-weight: 400;
  2163. line-height: 22px;
  2164. border-radius: 4px;
  2165. background: #ebebeb;
  2166. border: none;
  2167. }
  2168. .el-button--primary {
  2169. background: #3459d2;
  2170. color: #fff;
  2171. }
  2172. > b {
  2173. flex: 1;
  2174. text-align: right;
  2175. cursor: pointer;
  2176. line-height: 30px;
  2177. color: #175dff;
  2178. font-size: 14px;
  2179. font-weight: 400;
  2180. .svg-icon {
  2181. width: 12px;
  2182. margin-right: 4px;
  2183. }
  2184. }
  2185. }
  2186. .print-divider {
  2187. margin: 24px 0 0 0;
  2188. background-color: #f2f3f5;
  2189. }
  2190. #showWaterMark,
  2191. #showWaterMarks {
  2192. overflow: hidden;
  2193. position: relative;
  2194. z-index: 9999;
  2195. // width: 210mm;
  2196. }
  2197. .print-footer {
  2198. width: 100%;
  2199. min-height: 22px;
  2200. padding: 30px 96px;
  2201. color: #667180;
  2202. font-size: 14px;
  2203. font-weight: 700;
  2204. line-height: 22px;
  2205. display: flex;
  2206. justify-content: space-between;
  2207. span {
  2208. margin: 0 4px;
  2209. }
  2210. }
  2211. .ciyun-box {
  2212. width: 870px;
  2213. height: 720px;
  2214. border: none;
  2215. overflow: hidden;
  2216. }
  2217. @media print {
  2218. .no-print {
  2219. display: none;
  2220. }
  2221. body {
  2222. margin-top: 0;
  2223. margin-bottom: 0;
  2224. padding-top: 0;
  2225. padding-bottom: 0;
  2226. }
  2227. .printheader {
  2228. font-size: 50px;
  2229. color: green;
  2230. font-weight: bold;
  2231. position: fixed;
  2232. top: 0;
  2233. left: 0;
  2234. z-index: 10000;
  2235. }
  2236. .printFotter {
  2237. position: fixed;
  2238. left: 0;
  2239. bottom: 0;
  2240. z-index: 100000;
  2241. }
  2242. .print-footer {
  2243. position: fixed;
  2244. bottom: -30px;
  2245. left: 10px;
  2246. }
  2247. @page {
  2248. margin: 30px 30px 60px 30px;
  2249. }
  2250. #showWaterMark,
  2251. #showWaterMarks {
  2252. margin: 0;
  2253. }
  2254. }
  2255. :deep .image img {
  2256. max-width: 100%;
  2257. }
  2258. :deep figure {
  2259. margin: 1em 0;
  2260. text-align: center;
  2261. img {
  2262. max-width: 70%;
  2263. }
  2264. }
  2265. </style>
  2266. <style lang="scss">
  2267. .item-page {
  2268. .el-input__inner {
  2269. height: 32px;
  2270. line-height: 32px;
  2271. background: #f2f3f5;
  2272. border: none;
  2273. }
  2274. .el-input__icon {
  2275. line-height: 32px;
  2276. }
  2277. .el-input-number {
  2278. line-height: 30px;
  2279. width: 202px;
  2280. }
  2281. .el-input-number__decrease,
  2282. .el-input-number__increase {
  2283. height: 30px;
  2284. width: 30px;
  2285. }
  2286. .el-checkbox {
  2287. margin-right: 12px;
  2288. line-height: 30px;
  2289. }
  2290. .el-checkbox__input.is-checked + .el-checkbox__label {
  2291. color: #2f3742;
  2292. }
  2293. .el-checkbox__input.is-checked .el-checkbox__inner,
  2294. .el-checkbox__input.is-indeterminate .el-checkbox__inner {
  2295. background-color: #3459d2;
  2296. border-color: #3459d2;
  2297. }
  2298. }
  2299. </style>