PrintModel.vue 72 KB

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