index.vue 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897
  1. <template>
  2. <div v-loading="loading" class="textanalysis_index">
  3. <div class="wheader">
  4. <HeaderPage />
  5. </div>
  6. <div class="main">
  7. <div>
  8. <div v-loading="LeftLoading" class="left">
  9. <div class="search">
  10. <div class="select-result" @click="showSearchColorList">
  11. <span class="selectBg" :style="{ background: colorValue }"></span>
  12. <i class="tri"></i>
  13. </div>
  14. <input
  15. v-model="searchVal"
  16. class="searchVal"
  17. :style="{ color: colorValue }"
  18. @keyup.enter="onSearch"
  19. @blur="searchVal = searchVal.trim()"
  20. @keydown="searchValChange"
  21. />
  22. <i class="search-icon" style="cursor: pointer" @click="onSearch"></i>
  23. <ul v-if="isSCL" class="searchColorList">
  24. <li
  25. v-for="(item, index) in searchColorList"
  26. :key="'search' + index"
  27. @click="selectSearchColor(item, index)"
  28. >
  29. <span class="searchColor" :style="{ background: item }"></span>
  30. </li>
  31. <li class="close" @click="closeSearchColor">关闭</li>
  32. </ul>
  33. </div>
  34. <div class="result-left-numberclose">
  35. <span>
  36. <span v-if="searchWordShow" style="font-size: 14px; line-height: 22px; color: #333">
  37. {{ SearchwordNumber }}次匹配
  38. </span>
  39. </span>
  40. <span class="resule-right-btn" @click="clearSelected('all')">清除标记</span>
  41. </div>
  42. <div class="top_nav">
  43. <div :class="[leftNavIndex == 0 ? 'sele' : '']" @click="cutNav(0)">音节</div>
  44. <div :class="[leftNavIndex == 1 ? 'sele' : '']" @click="cutNav(1)">汉字</div>
  45. <div :class="[leftNavIndex == 2 ? 'sele' : '']" @click="cutNav(2)">词汇</div>
  46. </div>
  47. <div class="left_list">
  48. <div class="left_list_nav">
  49. <div class="left">
  50. <span :class="[headerText == 'wordCount' ? 'sele' : '']" @click="cutHeaderText('wordCount')">词头</span>
  51. <span :class="[headerText == 'textCount' ? 'sele' : '']" @click="cutHeaderText('textCount')">文本</span>
  52. </div>
  53. <div class="right">
  54. <span style="margin-right: 16px">
  55. <el-switch
  56. v-model="xifen"
  57. active-color="#735CFF"
  58. :width="26"
  59. style="margin-right: 10px"
  60. active-text="细分"
  61. @change="changexifen"
  62. />
  63. </span>
  64. <span @click="downloadLeft">
  65. <img src="../../assets/teacherdev/dowload-text.png" alt="" />
  66. 下载</span
  67. >
  68. </div>
  69. </div>
  70. <div class="left_list_main">
  71. <div
  72. v-for="(item, index) in leftList"
  73. :key="'one' + index"
  74. :class="[seleLevelMapList.indexOf(item.name) != -1 ? 'sele' : '']"
  75. @click="levelMapListEvent(item)"
  76. >
  77. <div class="leftType">
  78. <span
  79. class="color"
  80. :style="{
  81. background: item.name && levelMap[item.name] ? levelMap[item.name].color : '',
  82. }"
  83. ></span>
  84. <span class="type">{{ item.name }}</span>
  85. </div>
  86. <div class="rightCount">
  87. <span class="count">{{ item.count }}</span>
  88. <span class="precent">{{ item.ratio }}%</span>
  89. </div>
  90. </div>
  91. <div class="heji" @click="allListEvent">
  92. <div class="leftType">
  93. <span class="color"></span>
  94. <span class="type">合计</span>
  95. </div>
  96. <div class="rightCount">
  97. <span class="count">{{ allValue }}</span>
  98. <span class="precent">100.00%</span>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. <div id="echarts" class="tubiao">
  104. <div style="height: 22px">
  105. <template v-if="chartIndex != 3">
  106. <el-switch
  107. v-model="ratioShow"
  108. inactive-text="数量"
  109. active-text="比例"
  110. :width="26"
  111. style="margin-left: 24px"
  112. @change="changeratioShow"
  113. />
  114. </template>
  115. </div>
  116. <div id="main_echarts" class="main_echarts"></div>
  117. <div class="cut_download">
  118. <span
  119. :class="[chartIndex == 0 ? 'sele' : '']"
  120. @click="createEcharts('main_echarts', '柱状图', leftList, 0)"
  121. >
  122. <img src="../../assets/teacherdev/duotone-chart1.png" alt="" />
  123. </span>
  124. <span
  125. :class="[chartIndex == 1 ? 'sele' : '']"
  126. @click="createEcharts('main_echarts', '雷达图', leftList, 1)"
  127. >
  128. <img src="../../assets/teacherdev/duotone-chart2.png" alt="" />
  129. </span>
  130. <span
  131. :class="[chartIndex == 2 ? 'sele' : '']"
  132. @click="createEcharts('main_echarts', '折线图', leftList, 2)"
  133. >
  134. <img src="../../assets/teacherdev/duotone-chart3.png" alt="" />
  135. </span>
  136. <span
  137. :class="[chartIndex == 3 ? 'sele' : '']"
  138. @click="createEcharts('main_echarts', '饼状图', leftList, 3)"
  139. >
  140. <img src="../../assets/teacherdev/duotone-chart4.png" alt="" />
  141. </span>
  142. <span class="download" @click="downLoadEcharts">
  143. <img src="../../assets/teacherdev/dowload-text.png" alt="" />
  144. 下载
  145. </span>
  146. </div>
  147. </div>
  148. </div>
  149. <div class="right">
  150. <div class="word_back">
  151. <div class="word">
  152. <span class="title">主题词:</span>
  153. <span v-for="(item, i) in subjectWords" :key="i + 'word'">{{ item }}</span>
  154. </div>
  155. <div v-if="$route.query.type != '文本分析'" class="back">返回课文</div>
  156. </div>
  157. <div class="btn_set">
  158. <div class="btn">
  159. <div class="btn_dv" style="margin-right: 16px" @click="ciyunEvent">
  160. <img src="../../assets/teacherdev/icon-ciyun.png" alt="" />
  161. 词云
  162. </div>
  163. <div class="btn_dv" style="margin-right: 16px" @click="gowordTable">
  164. <img src="../../assets/teacherdev/icon-cibiao.png" alt="" />
  165. 词表
  166. </div>
  167. <div class="btn_dv" style="margin-right: 24px" @click="downArticle">
  168. <img src="../../assets/teacherdev/icon-down.png" alt="" />
  169. 下载
  170. </div>
  171. <div class="daxiao">
  172. <span @click="handleFontsize('-')">
  173. <template v-if="wordFontsize > 12">
  174. <img src="../../assets/teacherdev/minus-icon.png" />
  175. </template>
  176. <template v-else>
  177. <img src="../../assets/teacherdev/minus-icon-white-disabled.png" />
  178. </template>
  179. </span>
  180. <img src="../../assets/teacherdev/dxAA.png" class="dxAA" />
  181. <span @click="handleFontsize('+')">
  182. <template v-if="wordFontsize < 24">
  183. <img src="../../assets/teacherdev/add-icon.png" />
  184. </template>
  185. <template v-else>
  186. <img src="../../assets/teacherdev/add-icon-white-disabled.png" />
  187. </template>
  188. </span>
  189. </div>
  190. </div>
  191. <div class="set">
  192. <el-switch
  193. v-model="fenci"
  194. active-color="#735CFF"
  195. :width="26"
  196. style="margin-right: 34px"
  197. inactive-text="分词"
  198. />
  199. <el-switch v-model="pinyinShow" active-color="#735CFF" :width="26" inactive-text="显示拼音" />
  200. </div>
  201. </div>
  202. <div class="right_main">
  203. <div class="right_main_top">
  204. <div>
  205. <span
  206. >音节难度
  207. <span style="margin-left: 5px">
  208. {{ (difficulty.pinyinDifficulty * 1).toFixed(2) }}
  209. </span>
  210. </span>
  211. <span class="line"></span>
  212. <span>{{ base.pinyinCount }} / {{ base.pinyinTextCount }}</span>
  213. </div>
  214. <div class="twoline">
  215. <span class="line"></span>
  216. <span class="line"></span>
  217. </div>
  218. <div>
  219. <span
  220. >汉字难度
  221. <span style="margin-left: 5px">
  222. {{ (difficulty.wordDifficulty * 1).toFixed(2) }}
  223. </span>
  224. </span>
  225. <span class="line"></span>
  226. <span>{{ base.wordCount }} / {{ base.wordTextCount }}</span>
  227. </div>
  228. <div class="twoline">
  229. <span class="line"></span>
  230. <span class="line"></span>
  231. </div>
  232. <div>
  233. <span
  234. >词汇难度
  235. <span style="margin-left: 5px">
  236. {{ (difficulty.vocabularyDifficulty * 1).toFixed(2) }}
  237. </span>
  238. </span>
  239. <span class="line"></span>
  240. <span>{{ base.vocabularyCount }} / {{ base.vocabularyTextCount }}</span>
  241. </div>
  242. </div>
  243. <div class="articel">
  244. <div v-for="(items, index) in ArticelData" :key="index + 'paragraph'" class="paragraph">
  245. <!-- <span
  246. class="sentence"
  247. v-for="(items, indexs) in item"
  248. :key="indexs + 'sentence'"
  249. > -->
  250. <span
  251. v-for="(itemss, indexss) in items"
  252. :key="indexss + 'words'"
  253. class="words"
  254. :style="{
  255. margin: fenci ? `0 ${wordsMargin}px` : '',
  256. }"
  257. >
  258. <template v-if="fenci">
  259. <span v-for="(word, indexsss) in itemss.text" :key="indexsss + 'word'" :class="['word']">
  260. <template v-if="word.isShow">
  261. <span
  262. v-if="pinyinShow"
  263. :class="['pinyin']"
  264. :style="{
  265. fontSize: pinyinFontsize + 'px',
  266. lineHeight: pinyinLineHeight + 'px',
  267. }"
  268. >
  269. {{ word.pinyin }}
  270. </span>
  271. <br v-if="pinyinShow" />
  272. <span
  273. class="hanzi"
  274. :style="{
  275. fontSize: wordFontsize + 'px',
  276. lineHeight: wordLineHeight + 'px',
  277. background: word.color ? word.color : '',
  278. color: word.color
  279. ? '#FFFFFF'
  280. : !xifen
  281. ? leftNavIndex == 0
  282. ? seleLevelMapList.indexOf(word.levels.P_G) != -1
  283. ? levelMap[word.levels.P_G].color
  284. : ''
  285. : leftNavIndex == 1
  286. ? seleLevelMapList.indexOf(word.levels.W_G) != -1
  287. ? levelMap[word.levels.W_G].color
  288. : ''
  289. : leftNavIndex == 2
  290. ? seleLevelMapList.indexOf(word.levels.C_G) != -1
  291. ? levelMap[word.levels.C_G].color
  292. : ''
  293. : ''
  294. : leftNavIndex == 0
  295. ? seleLevelMapList.indexOf(word.levels.P_L) != -1
  296. ? levelMap[word.levels.P_L].color
  297. : ''
  298. : leftNavIndex == 1
  299. ? seleLevelMapList.indexOf(word.levels.W_L) != -1
  300. ? levelMap[word.levels.W_L].color
  301. : ''
  302. : leftNavIndex == 2
  303. ? seleLevelMapList.indexOf(word.levels.C_L) != -1
  304. ? levelMap[word.levels.C_L].color
  305. : ''
  306. : '',
  307. }"
  308. >
  309. {{ word.word }}
  310. </span>
  311. </template>
  312. </span>
  313. </template>
  314. <template v-else>
  315. <span v-for="(word, indexsss) in itemss.text" :key="indexsss + 'word'" class="word">
  316. <template v-if="word.isShow">
  317. <span
  318. v-if="pinyinShow"
  319. :class="['pinyin']"
  320. :style="{
  321. fontSize: pinyinFontsize + 'px',
  322. lineHeight: pinyinLineHeight + 'px',
  323. }"
  324. >
  325. {{ word.pinyin }}
  326. </span>
  327. <br v-if="pinyinShow" />
  328. <span
  329. class="hanzi"
  330. :style="{
  331. fontSize: wordFontsize + 'px',
  332. lineHeight: wordLineHeight + 'px',
  333. background: word.color ? word.color : '',
  334. color: word.color
  335. ? '#FFFFFF'
  336. : !xifen
  337. ? leftNavIndex == 0
  338. ? seleLevelMapList.indexOf(word.levels.P_G) != -1
  339. ? levelMap[word.levels.P_G].color
  340. : ''
  341. : leftNavIndex == 1
  342. ? seleLevelMapList.indexOf(word.levels.W_G) != -1
  343. ? levelMap[word.levels.W_G].color
  344. : ''
  345. : leftNavIndex == 2
  346. ? seleLevelMapList.indexOf(word.levels.C_G) != -1
  347. ? levelMap[word.levels.C_G].color
  348. : ''
  349. : ''
  350. : leftNavIndex == 0
  351. ? seleLevelMapList.indexOf(word.levels.P_L) != -1
  352. ? levelMap[word.levels.P_L].color
  353. : ''
  354. : leftNavIndex == 1
  355. ? seleLevelMapList.indexOf(word.levels.W_L) != -1
  356. ? levelMap[word.levels.W_L].color
  357. : ''
  358. : leftNavIndex == 2
  359. ? seleLevelMapList.indexOf(word.levels.C_L) != -1
  360. ? levelMap[word.levels.C_L].color
  361. : ''
  362. : '',
  363. }"
  364. >
  365. {{ word.word }}
  366. </span>
  367. </template>
  368. </span>
  369. </template>
  370. </span>
  371. <!-- </span> -->
  372. </div>
  373. </div>
  374. </div>
  375. </div>
  376. </div>
  377. </div>
  378. <div id="echarts_none_0" style="display:none; width: 592px; height: 568px"></div>
  379. <div id="echarts_none_1" style="display:none; width: 592px; height: 568px"></div>
  380. <div id="echarts_none_2" style="display:none; width: 592px; height: 568px"></div>
  381. <div id="echarts_none_3" style="display:none; width: 592px; height: 568px"></div>
  382. </div>
  383. </template>
  384. <script>
  385. import HeaderPage from '@/components/Header.vue';
  386. import * as echarts from 'echarts';
  387. import 'echarts/lib/chart/bar';
  388. import 'echarts/lib/component/legend';
  389. import 'echarts/lib/component/title';
  390. import { postapi, publicMethods } from '@/api/api';
  391. import { levelMap } from '../../common/data';
  392. import { json2excel } from '@/utils/setMethods';
  393. import FileSaver from 'file-saver';
  394. import htmlDocx from 'html-docx-js/dist/html-docx';
  395. import { markRaw } from 'vue'
  396. export default {
  397. components: {
  398. HeaderPage,
  399. },
  400. data() {
  401. return {
  402. ratioShow: false,
  403. chsFhList: [',', '。', '”', ':', '》', '《', '?', '!', ';', '、'],
  404. loading: false,
  405. LeftLoading: false,
  406. wordFontsize: 20, // 汉字字号初始值
  407. pinyinFontsize: 12, // 拼音字号初始值
  408. wordLineHeight: 28,
  409. pinyinLineHeight: 12,
  410. wordsMargin: 3,
  411. fenci: false,
  412. pinyinShow: false,
  413. leftNavIndex: 2,
  414. leftList: null,
  415. colorValue: '#FF3737',
  416. colorIndex: 0,
  417. searchVal: '',
  418. isSCL: false,
  419. searchColorList: [
  420. '#FF3737',
  421. '#875EDE',
  422. '#FF8000',
  423. '#FF55F3',
  424. '#CEB800',
  425. // "#CB1975",
  426. // "#00D8B4",
  427. // "#00CEFF",
  428. // "#3274FF",
  429. // "#00B60A",
  430. // 等级颜色
  431. '#B6D58A',
  432. '#66AE5B',
  433. '#35776B',
  434. '#73CDDE',
  435. '#4CA6EE',
  436. '#3873CB',
  437. '#9031AA',
  438. '#CBCBCB',
  439. '#888888',
  440. ],
  441. SearchwordNumber: 0,
  442. searchWord: [],
  443. searchWordShow: false,
  444. type: '',
  445. headerText: 'wordCount',
  446. xifen: false,
  447. myChart: null,
  448. myChart_none: null,
  449. currentTBdata: {},
  450. currentcolorValue: [],
  451. subjectWords: null,
  452. partitionKey: null,
  453. base: {},
  454. levelMap,
  455. allValue: 0,
  456. allRatio: 0,
  457. chartIndex: 0,
  458. ArticelData: null,
  459. seleLevelMapList: [],
  460. difficulty: {},
  461. textContent: '',
  462. routerData: null,
  463. id: null
  464. };
  465. },
  466. created() {
  467. this.routerData = this.$route.query;
  468. if (!this.routerData) return;
  469. this.partitionKey = Number(this.routerData.partition_key);
  470. this.subjectWords = JSON.parse(this.routerData.subject_words || '[]');
  471. this.base.wordTextCount = Number(this.routerData.word_text_count);
  472. this.base.wordCount = Number(this.routerData.word_count);
  473. this.base.vocabularyTextCount = Number(this.routerData.vocabulary_text_count);
  474. this.base.vocabularyCount = Number(this.routerData.vocabulary_count);
  475. this.base.pinyinCount = Number(this.routerData.pinyin_count);
  476. this.base.pinyinTextCount = Number(this.routerData.pinyin_text_count);
  477. this.difficulty.pinyinDifficulty = this.routerData.pinyin_difficulty;
  478. this.difficulty.vocabularyDifficulty = this.routerData.vocabulary_difficulty;
  479. this.difficulty.wordDifficulty = this.routerData.word_difficulty;
  480. this.id = this.routerData.id
  481. this.getstatistics();
  482. },
  483. methods: {
  484. // 词表
  485. gowordTable() {
  486. let data = JSON.parse(JSON.stringify(this.routerData));
  487. data.leftNavIndex = this.leftNavIndex;
  488. this.$router.push({
  489. path: '/textanalysis/WordTable',
  490. query: data,
  491. });
  492. },
  493. // 取消搜索高亮
  494. closeSearchhighlight() {
  495. this.ArticelData.forEach((item) => {
  496. // item.forEach((items) => {
  497. item.forEach((itemss) => {
  498. itemss.text.forEach((itemsss) => {
  499. itemsss.color = null;
  500. });
  501. });
  502. // });
  503. });
  504. },
  505. // 取消等级高亮
  506. closelevelMaphighlight() {
  507. this.seleLevelMapList = [];
  508. },
  509. // 下载文章
  510. downArticle() {
  511. let html = '';
  512. // let newhtml = '';
  513. if (this.$('.articel').length > 0) {
  514. html = this.$('.articel').html();
  515. // this.$("br").remove();
  516. // newhtml = this.$(".articel").html();
  517. // this.$(".articel").html(html);
  518. }
  519. let dv = document.createElement('div');
  520. dv.id = 'html_dv';
  521. dv.innerHTML = html;
  522. dv.style.display = 'none';
  523. document.body.appendChild(dv);
  524. let cxzcxz = this.$('#html_dv').html();
  525. let style = `<style>
  526. .sentence {
  527. margin-bottom: 8px;
  528. }
  529. .pinyin {
  530. color: rgba(255, 255, 255, 0.5);
  531. text-align: center;
  532. line-height: 12px;
  533. font-family: "GB-PINYINOK-B";
  534. }
  535. .hanzi {
  536. color: rgb(255, 255, 255);
  537. text-align: center;
  538. line-height: 28px;
  539. font-family: "FZJCGFKTK";
  540. }
  541. </style>`;
  542. let content = `<!DOCTYPE html>
  543. <html lang="en">
  544. <head>
  545. <meta charset="UTF-8">
  546. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  547. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  548. ${style}
  549. </head>
  550. <body>
  551. <div style="background:#26272a">
  552. ${cxzcxz}
  553. </div>
  554. </body>
  555. </html>`;
  556. let converted = htmlDocx.asBlob(content);
  557. FileSaver.saveAs(converted, '文章.docx');
  558. },
  559. // 全部高亮
  560. allListEvent() {
  561. if (this.seleLevelMapList.length === this.leftList.length) {
  562. this.seleLevelMapList = [];
  563. } else {
  564. this.seleLevelMapList = [];
  565. this.leftList.forEach((item) => {
  566. this.seleLevelMapList.push(item.name);
  567. });
  568. }
  569. },
  570. // 选择高亮等级
  571. levelMapListEvent(item) {
  572. // this.clearSelected("all");
  573. let index = this.seleLevelMapList.indexOf(item.name);
  574. if (index === -1) {
  575. this.seleLevelMapList.push(item.name);
  576. } else {
  577. this.seleLevelMapList.splice(index, 1);
  578. }
  579. },
  580. downloadLeft() {
  581. let data = JSON.parse(JSON.stringify(this.leftList));
  582. data.forEach((item) => {
  583. item.ratio += '%';
  584. });
  585. let obj = {
  586. name: '合计',
  587. ratio: this.allRatio,
  588. value: `${this.allValue}%`,
  589. };
  590. data.push(obj);
  591. let excelDatas = [
  592. {
  593. tHeader: ['等级', '数量', '占比'],
  594. filterVal: ['name', 'value', 'ratio'], // 表一的数据字段
  595. tableDatas: data, // 表一的整体json数据
  596. sheetName: 'sheet1', // 表一的sheet名字
  597. },
  598. ];
  599. // 引入的函数
  600. json2excel(excelDatas, '等级分布', true, 'xlsx');
  601. },
  602. downLoadEcharts() {
  603. let chartsCanvas = document.getElementById('echarts_none_'+this.chartIndex).querySelectorAll('canvas')[0];
  604. let picInfo = chartsCanvas.toDataURL({
  605. type: 'png',
  606. pixelRatio: 1, // 放大两倍下载。解决生成图片在移动端模糊问题
  607. backgroundColor: '#fff',
  608. excludeComponents: ['toolbox'], // 导出时忽略toolbox组件
  609. }); // 获取到的是一串base64信息
  610. const elink = document.createElement('a');
  611. // 设置默认文件名,this.chartTitle为绘图时生成的标题
  612. elink.download = '等级分布.png';
  613. elink.style.display = 'none';
  614. elink.href = picInfo;
  615. document.body.appendChild(elink);
  616. elink.click();
  617. URL.revokeObjectURL(elink.href); // 释放URL 对象
  618. document.body.removeChild(elink);
  619. },
  620. ciyunEvent() {
  621. window.open(
  622. `./ciyun/ciyunindex.html?partitionKey=${this.partitionKey}&searchType=${this.leftNavIndex}`,
  623. '_blank',
  624. );
  625. },
  626. // 处理字体大小
  627. handleFontsize(symbol) {
  628. if (symbol === '+') {
  629. if (this.wordFontsize < 24) {
  630. this.pinyinFontsize += 2;
  631. this.wordFontsize += 2;
  632. this.pinyinLineHeight += 2;
  633. this.wordLineHeight += 2;
  634. this.wordsMargin += 1;
  635. }
  636. } else if (symbol === '-') {
  637. if (this.wordFontsize > 12) {
  638. this.pinyinFontsize -= 2;
  639. this.wordFontsize -= 2;
  640. this.pinyinLineHeight -= 2;
  641. this.wordLineHeight -= 2;
  642. if (this.wordsMargin > 2) {
  643. this.wordsMargin -= 1;
  644. }
  645. }
  646. }
  647. },
  648. cutNav(index) {
  649. this.leftNavIndex = index;
  650. this.seleLevelMapList = [];
  651. this.xifen = false;
  652. this.getstatistics('left');
  653. },
  654. showSearchColorList() {
  655. this.isSCL = !this.isSCL;
  656. },
  657. closeSearchColor() {
  658. this.isSCL = false;
  659. },
  660. selectSearchColor(item, index) {
  661. this.isSCL = false;
  662. this.colorValue = item;
  663. this.colorIndex = index;
  664. },
  665. searchValChange(e) {
  666. if (this.searchVal.length === 1 && e.keyCode === 8) {
  667. if (this.colorIndex === this.searchWord.length + 1 || this.searchWord.length === 0) {
  668. return;
  669. }
  670. this.colorIndex = this.searchWord.length + 1;
  671. this.colorValue = this.searchColorList[this.colorIndex];
  672. }
  673. },
  674. onSearch() {
  675. if (!this.searchVal) {
  676. return;
  677. }
  678. this.searchWordShow = true;
  679. this.closelevelMaphighlight();
  680. let index = this.searchWord.indexOf(this.searchVal.toLowerCase());
  681. if (index === -1) {
  682. this.searchWord.push(this.searchVal.toLowerCase());
  683. this.currentcolorValue.push(this.colorValue);
  684. } else {
  685. // this.currentcolorValue[index] = this.colorValue;
  686. this.$set(this.currentcolorValue, index, this.colorValue);
  687. }
  688. this.type = '';
  689. this.calculateSearchwordNumber();
  690. // this.searchVal = "";
  691. },
  692. // 词表跳转高亮
  693. async wordTablehighlight(data, color) {
  694. this.searchWordShow = true;
  695. this.colorValue = color;
  696. this.searchColorList.forEach((item, i) => {
  697. if (color === item) {
  698. this.colorIndex = i;
  699. }
  700. });
  701. this.searchVal = data[data.length - 1];
  702. let arr = [];
  703. await data.forEach((item) => {
  704. this.calculateIndex(this.textContent, item).then((res) => {
  705. arr.push(res);
  706. });
  707. });
  708. this.SearchwordNumber = arr[arr.length - 1].length; // 高亮最后一次
  709. // 匹配高亮
  710. this.ArticelData.forEach((item) => {
  711. item.forEach((items) => {
  712. // items.forEach((itemss) => {
  713. items.text.forEach((itemsss) => {
  714. arr.forEach((searchItem) => {
  715. searchItem.forEach((searchItems) => {
  716. searchItems.forEach((searchItemss) => {
  717. if (itemsss.index === searchItemss) {
  718. itemsss.color = color;
  719. }
  720. });
  721. });
  722. });
  723. });
  724. // });
  725. });
  726. });
  727. this.$forceUpdate();
  728. },
  729. // 计算匹配个数
  730. async calculateSearchwordNumber() {
  731. let arr = [];
  732. await this.searchWord.forEach((item) => {
  733. this.calculateIndex(this.textContent, item).then((res) => {
  734. arr.push(res);
  735. });
  736. });
  737. this.SearchwordNumber = 0;
  738. // 高亮全部
  739. // arr.forEach((item) => {
  740. // this.SearchwordNumber += item.length;
  741. // });
  742. this.SearchwordNumber = arr[arr.length - 1].length; // 高亮最后一次
  743. // 匹配高亮
  744. this.ArticelData.forEach((item) => {
  745. item.forEach((items) => {
  746. // items.forEach((itemss) => {
  747. items.text.forEach((itemsss) => {
  748. arr.forEach((searchItem, i) => {
  749. searchItem.forEach((searchItems) => {
  750. searchItems.forEach((searchItemss) => {
  751. if (itemsss.index === searchItemss) {
  752. itemsss.color = this.currentcolorValue[i];
  753. }
  754. });
  755. });
  756. });
  757. });
  758. // });
  759. });
  760. });
  761. },
  762. replacepos(text, start, stop, replacetext) {
  763. return text.substring(0, stop - 1) + replacetext + text.substring(stop + 1);
  764. },
  765. // 找出对应字符的索引
  766. calculateIndex(txt, key) {
  767. return new Promise((reslove) => {
  768. // 去除标点
  769. let keylength = key.length;
  770. let arr = [];
  771. for (let i = 0; i < txt.length; i++) {
  772. if (txt[i] === key[0]) {
  773. arr.push(i);
  774. }
  775. }
  776. let indexArr = [];
  777. arr.forEach((item) => {
  778. let arr = [];
  779. for (let i = 0; i < keylength; i++) {
  780. if (txt[item + i] === key[i]) {
  781. arr.push(item + i);
  782. } else {
  783. arr = [];
  784. }
  785. }
  786. if (arr.length > 0) {
  787. indexArr.push(arr);
  788. }
  789. });
  790. reslove(indexArr);
  791. });
  792. },
  793. clearSelected(all) {
  794. let _this = this;
  795. _this.type = '';
  796. _this.searchVal = '';
  797. _this.searchWord = [];
  798. _this.currentcolorValue = [];
  799. _this.SearchwordNumber = 0;
  800. if (all) {
  801. this.seleLevelMapList = [];
  802. _this.searchWordShow = false;
  803. sessionStorage.setItem('tablehighlight', false);
  804. }
  805. this.colorIndex = 0;
  806. this.colorValue = this.searchColorList[this.colorIndex];
  807. this.closeSearchhighlight();
  808. },
  809. cutHeaderText(type) {
  810. this.headerText = type;
  811. this.seleLevelMapList = [];
  812. this.getstatistics('left');
  813. },
  814. changexifen() {
  815. this.seleLevelMapList = [];
  816. this.getstatistics('left');
  817. },
  818. // 添加dom
  819. addnode() {
  820. return new Promise((reslove) => {
  821. let fatherNode = document.getElementById('echarts');
  822. let node = document.getElementById('main_echarts');
  823. if (node) {
  824. node.remove();
  825. }
  826. let newnode = document.createElement('div');
  827. newnode.id = 'main_echarts';
  828. newnode.style.width = '342px';
  829. newnode.style.height = '256px';
  830. newnode.style.margin = '0 auto';
  831. let qianNode = document.getElementById('distributionOperation');
  832. fatherNode.insertBefore(newnode, qianNode); // 添加的元素需要时通过createElement创建 不能使用字符串
  833. reslove();
  834. });
  835. },
  836. changeratioShow() {
  837. let str =
  838. this.chartIndex === 0 ? '柱状图' : this.chartIndex === 1 ? '雷达图' : this.chartIndex === 2 ? '折线图' : '';
  839. this.createEcharts('main_echarts', str, this.leftList, this.chartIndex);
  840. },
  841. // 图表
  842. async createEcharts(id, type, data, index) {
  843. this.chartIndex = index;
  844. this.myChart = null
  845. this.myChart_none = null
  846. let indicatorMax = 0, indicatorMaxRatio = 0
  847. // 先添加DOM再进行创建图表
  848. await this.addnode().then(() => {
  849. let newdata = JSON.parse(JSON.stringify(data));
  850. // newdata.splice(data.length - 1, 1);
  851. let name = [];
  852. let valueStype = [];
  853. let value = [];
  854. let leidaList = [];
  855. // 去除括号
  856. newdata.forEach((item) => {
  857. if (this.xifen) {
  858. item.name = item.name.replace('(', '');
  859. item.name = item.name.replace(')', '');
  860. }
  861. if(item.value>indicatorMax){
  862. indicatorMax = item.value
  863. }
  864. if(item.ratio>indicatorMaxRatio){
  865. indicatorMaxRatio = item.ratio
  866. }
  867. });
  868. indicatorMax += 50
  869. if(indicatorMaxRatio<50){
  870. indicatorMaxRatio = 50
  871. }
  872. // 比例开关
  873. if (this.ratioShow) {
  874. newdata.forEach((item) => {
  875. item.value = item.ratio;
  876. // item.name = item.name;
  877. name.push(item.name);
  878. valueStype.push({
  879. value: item.ratio,
  880. percent: `${item.ratio}%`,
  881. });
  882. value.push(item.ratio);
  883. leidaList.push({
  884. name: item.name,
  885. max: indicatorMaxRatio
  886. });
  887. });
  888. } else {
  889. newdata.forEach((item) => {
  890. // item.value = item.value;
  891. // item.name = item.name;
  892. name.push(item.name);
  893. valueStype.push({
  894. value: item.value,
  895. percent: `${item.ratio}%`,
  896. });
  897. value.push(item.value);
  898. leidaList.push({
  899. name: item.name,
  900. max: indicatorMax
  901. });
  902. });
  903. }
  904. let chartDom = document.getElementById(id);
  905. this.myChart = markRaw(echarts.init(chartDom));
  906. let chartDom_none = document.getElementById('echarts_none_'+index);
  907. this.myChart_none = markRaw(echarts.init(chartDom_none));
  908. let option = null;
  909. let color1 = ['#35776B', '#3873CB', '#9031AA', '#EA1F1F', '#CBCBCB', '#888888'];
  910. let color2 = [
  911. '#B6D58A',
  912. '#66AE5B',
  913. '#35776B',
  914. '#73CDDE',
  915. '#4CA6EE',
  916. '#3873CB',
  917. '#9031AA',
  918. '#EA1F1F',
  919. '#CBCBCB',
  920. '#888888',
  921. ];
  922. if (type === '饼状图') {
  923. newdata.forEach((item) => {
  924. item.name = `${item.name + item.ratio}%`;
  925. });
  926. option = {
  927. color: this.xifen ? color2 : color1,
  928. xAxis: {
  929. show: false, // 不显示坐标轴线、坐标轴刻度线和坐标轴上的文字
  930. axisTick: {
  931. show: false, // 不显示坐标轴刻度线
  932. },
  933. axisLine: {
  934. show: false, // 不显示坐标轴线
  935. },
  936. axisLabel: {
  937. show: false, // 不显示坐标轴上的文字
  938. },
  939. },
  940. series: [
  941. {
  942. name: 'Access From',
  943. type: 'pie',
  944. // radius: ["40%", "70%"],
  945. radius: ['20%', '50%'],
  946. data: newdata,
  947. label: {
  948. fontSize: 8,
  949. },
  950. itemStyle: {
  951. borderColor: '#f5f5f5',
  952. borderWidth: 5,
  953. },
  954. },
  955. ],
  956. };
  957. } else if (type === '柱状图') {
  958. let that = this;
  959. option = {
  960. tooltip: {
  961. trigger: 'axis',
  962. axisPointer: {
  963. type: 'shadow',
  964. },
  965. formatter(params) {
  966. if (that.ratioShow) {
  967. return `${params[0].name} ${params[0].value}%`;
  968. }
  969. return `${params[0].name} ${params[0].value}`;
  970. },
  971. },
  972. xAxis: {
  973. type: 'category',
  974. data: name,
  975. axisLabel: {
  976. alignWithLabel: true,
  977. // interval: 0, // 设置数据间隔
  978. // rotate: -90, // 标题倾斜
  979. formatter(value) {
  980. let str = value.split('');
  981. return str.join('\n');
  982. },
  983. },
  984. },
  985. yAxis: {
  986. type: 'value',
  987. axisLabel: {
  988. formatter: that.ratioShow ? '{value}%' : '{value}',
  989. },
  990. },
  991. grid: {
  992. left: 20,
  993. right: 20,
  994. bottom: 0,
  995. containLabel: true,
  996. },
  997. series: [
  998. {
  999. name: '',
  1000. data: valueStype,
  1001. type: 'bar',
  1002. itemStyle: {
  1003. color(params) {
  1004. let color = that.xifen ? color2 : color1;
  1005. return color[params.dataIndex];
  1006. },
  1007. },
  1008. },
  1009. ],
  1010. };
  1011. } else if (type === '折线图') {
  1012. let that = this;
  1013. option = {
  1014. tooltip: {
  1015. trigger: 'axis',
  1016. formatter(params) {
  1017. if (that.ratioShow) {
  1018. return `${params[0].name} ${params[0].value}%`;
  1019. }
  1020. return `${params[0].name} ${params[0].value}`;
  1021. },
  1022. },
  1023. xAxis: {
  1024. type: 'category',
  1025. data: name,
  1026. axisLabel: {
  1027. // interval: 0, // 设置数据间隔
  1028. // rotate: -90, // 标题倾斜
  1029. formatter(value) {
  1030. let str = value.split('');
  1031. return str.join('\n');
  1032. },
  1033. // margin: 5, //刻度标签与轴线之间的距离
  1034. // textStyle: {
  1035. // fontSize: 9, //横轴字体大小
  1036. // color: "#000000",//颜色
  1037. // },
  1038. },
  1039. },
  1040. color: '#5470c6',
  1041. yAxis: {
  1042. type: 'value',
  1043. axisLabel: {
  1044. formatter: this.ratioShow ? '{value}%' : '{value}',
  1045. },
  1046. },
  1047. grid: {
  1048. left: 20,
  1049. right: 20,
  1050. bottom: 0,
  1051. containLabel: true,
  1052. },
  1053. series: [
  1054. {
  1055. data: value,
  1056. type: 'line',
  1057. },
  1058. ],
  1059. };
  1060. } else if (type === '雷达图') {
  1061. let that = this;
  1062. const buildSeries = (data) => {
  1063. const helper = data.map((item, index) => {
  1064. const arr = new Array(data.length);
  1065. arr.splice(index, 1, item);
  1066. return arr;
  1067. });
  1068. return [data, ...helper].map((item, index) => {
  1069. return {
  1070. type: 'radar',
  1071. symbol: index === 0 ? 'circle' : 'none',
  1072. symbolSize: 6,
  1073. lineStyle: {
  1074. color: index === 0 ? '#5470C6' : 'transparent',
  1075. },
  1076. areaStyle: {
  1077. color: index === 0 ? '#5470C6' : 'transparent',
  1078. opacity: 0.5,
  1079. },
  1080. tooltip: {
  1081. show: index !== 0,
  1082. formatter() {
  1083. that.leiDaDataIndex = index - 1;
  1084. if (that.ratioShow) {
  1085. return `${leidaList[index - 1].name}:${value[index - 1]}%`;
  1086. }
  1087. return `${leidaList[index - 1].name}:${value[index - 1]}`;
  1088. },
  1089. },
  1090. z: index === 0 ? 1 : 2,
  1091. data: [item],
  1092. };
  1093. });
  1094. };
  1095. option = {
  1096. tooltip: {},
  1097. radar: {
  1098. indicator: leidaList,
  1099. radius: '50%',
  1100. },
  1101. series: buildSeries(value),
  1102. };
  1103. }
  1104. option && this.myChart.setOption(option);
  1105. if (type === '饼状图') {
  1106. this.myChart_none.setOption({
  1107. color: this.xifen ? color2 : color1,
  1108. xAxis: {
  1109. show: false, // 不显示坐标轴线、坐标轴刻度线和坐标轴上的文字
  1110. axisTick: {
  1111. show: false, // 不显示坐标轴刻度线
  1112. },
  1113. axisLine: {
  1114. show: false, // 不显示坐标轴线
  1115. },
  1116. axisLabel: {
  1117. show: false, // 不显示坐标轴上的文字
  1118. },
  1119. },
  1120. series: [
  1121. {
  1122. name: 'Access From',
  1123. type: 'pie',
  1124. radius: ['40%', '60%'],
  1125. data: newdata,
  1126. itemStyle: {
  1127. borderColor: '#fff',
  1128. borderWidth: 2,
  1129. },
  1130. emphasis: {
  1131. itemStyle: {
  1132. shadowBlur: 10,
  1133. shadowOffsetX: 0,
  1134. shadowColor: 'rgba(0, 0, 0, 0.5)',
  1135. },
  1136. },
  1137. },
  1138. ],
  1139. });
  1140. } else {
  1141. option && this.myChart_none && this.myChart_none.setOption(option);
  1142. }
  1143. let that = this;
  1144. // 默认展示第一个
  1145. for (let key in that.leftList[0]) {
  1146. that.currentTBdata[key] = that.leftList[index][key];
  1147. }
  1148. this.myChart.on('click', (params) => {
  1149. let index = null;
  1150. if (type === '雷达图') {
  1151. index = that.leiDaDataIndex;
  1152. } else {
  1153. index = params.dataIndex;
  1154. }
  1155. for (let key in that.leftList[index]) {
  1156. that.currentTBdata[key] = that.leftList[index][key];
  1157. }
  1158. that.$forceUpdate();
  1159. // that.$router.push({
  1160. // path: "/errorstatistics",
  1161. // query: {
  1162. // errorTypeId: that.leftdata[index].errorTypeId,
  1163. // rangeId: that.scoreRangeId,
  1164. // },
  1165. // });
  1166. });
  1167. });
  1168. },
  1169. // 获取图标统计信息
  1170. getstatistics(type) {
  1171. if (type) {
  1172. this.LeftLoading = true;
  1173. } else {
  1174. this.loading = true;
  1175. }
  1176. let base = null;
  1177. publicMethods('/TeachingServer/TextAnalyser/StatLevelDist',{
  1178. analyse_record_id: this.id,
  1179. type: this.leftNavIndex,
  1180. level_type: this.xifen ? 1 : 0,
  1181. count_type: this.headerText === 'wordCount' ? 0 : 1
  1182. })
  1183. // if (this.leftNavIndex === 0) {
  1184. // base = this.headerText === 'wordCount' ? this.base.pinyinCount : this.base.pinyinTextCount;
  1185. // } else if (this.leftNavIndex === 1) {
  1186. // base = this.headerText === 'wordCount' ? this.base.wordCount : this.base.wordTextCount;
  1187. // } else {
  1188. // base = this.headerText === 'wordCount' ? this.base.vocabularyCount : this.base.vocabularyTextCount;
  1189. // }
  1190. // postapi({
  1191. // url: '/GCLSTCServer/tools/TS/statistics',
  1192. // data: {
  1193. // searchType: this.leftNavIndex,
  1194. // partitionKey: this.partitionKey,
  1195. // statisticsType: this.xifen ? 0 : 1,
  1196. // base: base || null,
  1197. // textType: this.headerText === 'wordCount' ? 0 : 1,
  1198. // },
  1199. // })
  1200. .then((res) => {
  1201. this.allRatio = 0;
  1202. this.allValue = 0;
  1203. res.data_list.forEach((item) => {
  1204. this.allRatio += Number(item.ratio);
  1205. this.allValue += item.count;
  1206. item.value = item.count
  1207. });
  1208. res.data_list.forEach((item) => {
  1209. if (item.count !== 0) {
  1210. item.ratio = ((item.count / this.allValue) * 100).toFixed(2);
  1211. }
  1212. });
  1213. this.allRatio = this.allRatio.toFixed(2);
  1214. this.leftList = res.data_list;
  1215. this.createEcharts('main_echarts', '柱状图', this.leftList, 0);
  1216. // this.loading = false;
  1217. if (type) {
  1218. this.LeftLoading = false;
  1219. } else {
  1220. this.getArticleData();
  1221. }
  1222. })
  1223. .catch(() => {
  1224. this.loading = false;
  1225. });
  1226. },
  1227. // 获取分析结果
  1228. getArticleData() {
  1229. this.loading = true;
  1230. publicMethods('/TeachingServer/TextAnalyser/GetParsedTextInfo',{
  1231. analyse_record_id: this.id,
  1232. }
  1233. )
  1234. .then((res) => {
  1235. if(res.status===1){
  1236. let newdata = [];
  1237. res.parsed_text.paragraph_list.forEach((item) => {
  1238. if (item.length !== 0) {
  1239. newdata.push(item);
  1240. }
  1241. });
  1242. this.ArticelData = newdata;
  1243. let str = '';
  1244. // 合并标点
  1245. this.ArticelData.forEach((item) => {
  1246. item.forEach((items) => {
  1247. items.forEach((itemss, index) => {
  1248. itemss.text.forEach((itemsss) => {
  1249. if (this.chsFhList.indexOf(itemsss.word) === -1) {
  1250. itemsss.isShow = true;
  1251. } else {
  1252. let obj = JSON.parse(JSON.stringify(itemsss));
  1253. obj.isShow = true;
  1254. if (index > 0) {
  1255. if (items[index - 1].text[items[index - 1].text.length - 1].isShow) {
  1256. items[index - 1].text.push(obj);
  1257. itemsss.isShow = false;
  1258. } else {
  1259. items[index - 2].text.push(obj);
  1260. itemsss.isShow = false;
  1261. }
  1262. } else {
  1263. itemsss.isShow = true;
  1264. }
  1265. }
  1266. str += itemsss.word;
  1267. });
  1268. });
  1269. });
  1270. });
  1271. let index = 0;
  1272. // 添加索引
  1273. this.ArticelData.forEach((item) => {
  1274. item.forEach((items) => {
  1275. items.forEach((itemss) => {
  1276. itemss.text.forEach((itemsss) => {
  1277. if (itemsss.isShow) {
  1278. itemsss.index = index;
  1279. index += 1;
  1280. }
  1281. });
  1282. });
  1283. });
  1284. });
  1285. let arr = [];
  1286. this.ArticelData.forEach((item, i) => {
  1287. arr.push([]);
  1288. item.forEach((items) => {
  1289. items.forEach((itemss) => {
  1290. arr[i].push(itemss);
  1291. });
  1292. });
  1293. });
  1294. this.ArticelData = arr;
  1295. this.textContent = str;
  1296. let flag = sessionStorage.getItem('tablehighlight');
  1297. if (this.$route.query.remarks && flag === 'true') {
  1298. this.cutNav(Number(this.$route.query.leftNavIndex));
  1299. this.wordTablehighlight(JSON.parse(this.$route.query.remarks), this.$route.query.color);
  1300. }
  1301. this.loading = false;
  1302. }
  1303. })
  1304. .catch(() => {
  1305. this.loading = false;
  1306. });
  1307. },
  1308. },
  1309. };
  1310. </script>
  1311. <style lang="scss" scoped>
  1312. .textanalysis_index {
  1313. min-height: 100%;
  1314. background: #f6f6f6;
  1315. .wheader {
  1316. background: #fff;
  1317. }
  1318. .main {
  1319. padding-top: 29px;
  1320. padding-bottom: 66px;
  1321. > div {
  1322. display: flex;
  1323. width: 1200px;
  1324. padding: 24px;
  1325. margin: 0 auto;
  1326. // height: 1187px;
  1327. background: #fff;
  1328. > .left {
  1329. width: 352px;
  1330. .top_nav {
  1331. display: flex;
  1332. align-items: center;
  1333. justify-content: center;
  1334. width: 352px;
  1335. height: 32px;
  1336. margin-top: 16px;
  1337. background: #eee;
  1338. border-radius: 4px;
  1339. > div {
  1340. width: 116px;
  1341. height: 28px;
  1342. font-size: 12px;
  1343. font-weight: 500;
  1344. line-height: 28px;
  1345. color: #888;
  1346. text-align: center;
  1347. cursor: pointer;
  1348. border-radius: 2px;
  1349. }
  1350. .sele {
  1351. color: #000;
  1352. background: #fff;
  1353. box-shadow: 0 2px 2px rgba(0, 0, 0, 8%);
  1354. }
  1355. }
  1356. .search {
  1357. position: relative;
  1358. box-sizing: border-box;
  1359. display: flex;
  1360. align-items: center;
  1361. justify-content: flex-start;
  1362. width: 100%;
  1363. height: 40px;
  1364. padding: 7px 0;
  1365. border: 1px solid #ddd;
  1366. .select-result {
  1367. display: flex;
  1368. align-items: center;
  1369. justify-content: flex-start;
  1370. height: 24px;
  1371. padding: 4px 11px;
  1372. cursor: pointer;
  1373. .selectBg {
  1374. width: 16px;
  1375. height: 16px;
  1376. background: #de4444;
  1377. border-radius: 2px;
  1378. }
  1379. .tri {
  1380. width: 10px;
  1381. height: 10px;
  1382. margin-left: 4px;
  1383. background: url('../../assets/teacherdev/down-icon.png') no-repeat left top;
  1384. background-size: 100% 100%;
  1385. }
  1386. }
  1387. .searchVal {
  1388. box-sizing: border-box;
  1389. flex: 1;
  1390. padding: 0 30px 0 12px;
  1391. font-weight: bold;
  1392. border: 0;
  1393. border-left: 1px solid #ddd;
  1394. outline: 0;
  1395. }
  1396. .search-icon {
  1397. position: absolute;
  1398. right: 12px;
  1399. display: block;
  1400. width: 14px;
  1401. height: 14px;
  1402. background: url('../../assets/teacherdev/search-icon.png') no-repeat left top;
  1403. background-size: 100% 100%;
  1404. }
  1405. .searchColorList {
  1406. position: absolute;
  1407. top: 38px;
  1408. left: 0;
  1409. width: 58px;
  1410. padding: 0;
  1411. margin: 0;
  1412. list-style: none;
  1413. background: #fff;
  1414. border: 1px #d9d9d9 solid;
  1415. > li {
  1416. display: flex;
  1417. align-items: center;
  1418. justify-content: center;
  1419. width: 100%;
  1420. padding: 8px 0;
  1421. cursor: pointer;
  1422. > span {
  1423. width: 14px;
  1424. height: 14px;
  1425. border-radius: 2px;
  1426. }
  1427. &.close {
  1428. font-size: 12px;
  1429. border-top: 1px #d9d9d9 solid;
  1430. }
  1431. }
  1432. }
  1433. }
  1434. .result-left-numberclose {
  1435. display: flex;
  1436. justify-content: space-between;
  1437. padding-bottom: 16px;
  1438. margin-top: 16px;
  1439. font-size: 14px;
  1440. font-weight: 400;
  1441. color: #333;
  1442. border-bottom: 1px solid rgba(0, 0, 0, 8%);
  1443. .resule-right-btn {
  1444. display: inline-block;
  1445. width: 88px;
  1446. height: 32px;
  1447. line-height: 32px;
  1448. text-align: center;
  1449. cursor: pointer;
  1450. background: #fff;
  1451. border: 1px solid #d9d9d9;
  1452. border-radius: 4px;
  1453. box-shadow: 0 2px 0 rgba(0, 0, 0, 2%);
  1454. }
  1455. }
  1456. .left_list {
  1457. margin-top: 16px;
  1458. .left_list_nav {
  1459. display: flex;
  1460. align-items: center;
  1461. justify-content: space-between;
  1462. height: 52px;
  1463. .left {
  1464. display: flex;
  1465. align-items: center;
  1466. justify-content: center;
  1467. width: 84px;
  1468. height: 28px;
  1469. background: #eee;
  1470. border-radius: 4px;
  1471. span {
  1472. display: inline-block;
  1473. width: 40px;
  1474. height: 24px;
  1475. font-size: 12px;
  1476. font-weight: 400;
  1477. line-height: 24px;
  1478. text-align: center;
  1479. cursor: pointer;
  1480. border-radius: 2px;
  1481. }
  1482. .sele {
  1483. color: #000;
  1484. background: #fff;
  1485. box-shadow: 0 2px 2px rgba(0, 0, 0, 8%);
  1486. }
  1487. }
  1488. .right {
  1489. display: flex;
  1490. > span {
  1491. display: flex;
  1492. align-items: center;
  1493. }
  1494. span {
  1495. font-size: 14px;
  1496. font-weight: 400;
  1497. line-height: 22px;
  1498. /* identical to box height, or 157% */
  1499. color: #000;
  1500. cursor: pointer;
  1501. }
  1502. img {
  1503. width: 24px;
  1504. height: 24px;
  1505. }
  1506. .el-switch.is-checked .el-switch__core::after {
  1507. left: 100%;
  1508. margin-left: -10px;
  1509. }
  1510. .el-switch__core {
  1511. height: 16px;
  1512. }
  1513. .el-switch__core::after {
  1514. top: 3px;
  1515. width: 8px;
  1516. height: 8px;
  1517. }
  1518. }
  1519. }
  1520. .left_list_main {
  1521. .heji {
  1522. font-size: 14px;
  1523. font-weight: 600;
  1524. line-height: 22px;
  1525. color: #333;
  1526. }
  1527. .sele {
  1528. background: #eaeaea;
  1529. }
  1530. > div {
  1531. display: flex;
  1532. align-items: center;
  1533. justify-content: space-between;
  1534. // width: 100%;
  1535. height: 48px;
  1536. padding: 0 12px;
  1537. font-size: 14px;
  1538. line-height: 22px;
  1539. color: #333;
  1540. cursor: pointer;
  1541. border-bottom: 1px solid #eee;
  1542. &.active {
  1543. background: #eee;
  1544. }
  1545. &.fontWeight {
  1546. font-weight: bold;
  1547. }
  1548. > .leftType {
  1549. > .color {
  1550. display: inline-block;
  1551. width: 9px;
  1552. height: 9px;
  1553. margin-right: 10px;
  1554. border-radius: 50%;
  1555. }
  1556. }
  1557. > .rightCount {
  1558. display: flex;
  1559. > span.count {
  1560. width: 70px;
  1561. font-size: 14px;
  1562. color: #333;
  1563. text-align: right;
  1564. }
  1565. > span.precent {
  1566. width: 88px;
  1567. font-size: 14px;
  1568. color: #333;
  1569. text-align: right;
  1570. }
  1571. }
  1572. }
  1573. }
  1574. }
  1575. .tubiao {
  1576. position: relative;
  1577. width: 352px;
  1578. height: 374px;
  1579. padding-top: 24px;
  1580. margin: 0 auto;
  1581. margin-top: 24px;
  1582. background: #f5f5f5;
  1583. border-radius: 4px;
  1584. .tubiao_top {
  1585. height: 22px;
  1586. margin-bottom: 24px;
  1587. font-size: 14px;
  1588. font-weight: 500;
  1589. color: #000;
  1590. text-align: center;
  1591. }
  1592. .main_echarts {
  1593. margin: 0 auto;
  1594. }
  1595. .cut_download {
  1596. position: absolute;
  1597. bottom: 24px;
  1598. left: 56px;
  1599. display: flex;
  1600. .sele {
  1601. background: rgba(0, 0, 0, 8%);
  1602. border-radius: 4px;
  1603. }
  1604. span {
  1605. display: flex;
  1606. align-items: center;
  1607. justify-content: center;
  1608. width: 32px;
  1609. height: 32px;
  1610. margin-right: 16px;
  1611. cursor: pointer;
  1612. }
  1613. .download {
  1614. width: 56px;
  1615. }
  1616. img {
  1617. width: 24px;
  1618. height: 24px;
  1619. }
  1620. }
  1621. }
  1622. }
  1623. > .right {
  1624. flex: 1;
  1625. margin-left: 24px;
  1626. .word_back {
  1627. display: flex;
  1628. align-items: center;
  1629. justify-content: space-between;
  1630. .word {
  1631. font-size: 14px;
  1632. font-weight: 400;
  1633. line-height: 22px;
  1634. color: #000;
  1635. .title {
  1636. font-weight: 500;
  1637. }
  1638. span {
  1639. margin-right: 16px;
  1640. }
  1641. }
  1642. .back {
  1643. width: 88px;
  1644. height: 32px;
  1645. font-size: 14px;
  1646. font-weight: 400;
  1647. line-height: 32px;
  1648. text-align: center;
  1649. cursor: pointer;
  1650. border: 1px solid #d9d9d9;
  1651. border-radius: 4px;
  1652. box-shadow: 0 2px 0 rgba(0, 0, 0, 2%);
  1653. }
  1654. }
  1655. .btn_set {
  1656. display: flex;
  1657. align-items: center;
  1658. justify-content: space-between;
  1659. margin-top: 21px;
  1660. .btn {
  1661. display: flex;
  1662. .btn_dv {
  1663. display: flex;
  1664. align-items: center;
  1665. justify-content: center;
  1666. width: 82px;
  1667. height: 40px;
  1668. font-size: 14px;
  1669. font-weight: 400;
  1670. color: rgba(0, 0, 0, 85%);
  1671. cursor: pointer;
  1672. border: 1px solid #d9d9d9;
  1673. border-radius: 4px;
  1674. box-shadow: 0 2px 0 rgba(0, 0, 0, 2%);
  1675. img {
  1676. width: 14px;
  1677. height: 14px;
  1678. margin-right: 8px;
  1679. }
  1680. }
  1681. }
  1682. .daxiao {
  1683. display: flex;
  1684. align-items: center;
  1685. span {
  1686. box-sizing: border-box;
  1687. display: flex;
  1688. align-items: center;
  1689. justify-content: center;
  1690. width: 24px;
  1691. height: 24px;
  1692. cursor: pointer;
  1693. border: 1px solid gainsboro;
  1694. border-radius: 4px;
  1695. img {
  1696. width: 22px;
  1697. height: 22px;
  1698. }
  1699. }
  1700. > img {
  1701. width: 24px;
  1702. height: 24px;
  1703. margin: 0 8px;
  1704. }
  1705. }
  1706. }
  1707. .right_main {
  1708. height: calc(100% - 137px);
  1709. padding: 12px 15px;
  1710. margin-top: 16px;
  1711. background: #26272a;
  1712. border-radius: 4px;
  1713. .right_main_top {
  1714. display: flex;
  1715. align-items: center;
  1716. justify-content: flex-end;
  1717. font-size: 14px;
  1718. font-weight: 600;
  1719. line-height: 22px;
  1720. color: #a6a6a6;
  1721. .twoline {
  1722. margin: 0 20px;
  1723. span {
  1724. margin: 0 2px;
  1725. }
  1726. }
  1727. // > div {
  1728. // margin-left: 24px;
  1729. // }
  1730. .line {
  1731. display: inline-block;
  1732. width: 1px;
  1733. height: 12px;
  1734. margin: 0 12px;
  1735. background: #525252;
  1736. }
  1737. }
  1738. .articel {
  1739. width: 640px;
  1740. margin: 0 auto;
  1741. margin-top: 40px;
  1742. font-weight: 500;
  1743. .paragraph {
  1744. display: flex;
  1745. flex-wrap: wrap;
  1746. margin-bottom: 22px;
  1747. // .sentence {
  1748. // display: flex;
  1749. // flex-wrap: wrap;
  1750. // margin-bottom: 8px;
  1751. .words {
  1752. display: flex;
  1753. .word {
  1754. text-align: center;
  1755. }
  1756. .pinyin {
  1757. min-height: 12px;
  1758. font-family: 'GB-PINYINOK-B';
  1759. line-height: 12px;
  1760. color: rgba(255, 255, 255, 50%);
  1761. text-align: center;
  1762. }
  1763. .hanzi {
  1764. font-family: 'FZJCGFKTK';
  1765. line-height: 28px;
  1766. color: rgb(255, 255, 255);
  1767. text-align: center;
  1768. }
  1769. }
  1770. }
  1771. // }
  1772. }
  1773. }
  1774. }
  1775. }
  1776. }
  1777. }
  1778. </style>
  1779. <style lang="scss">
  1780. .textanalysis_index {
  1781. .el-switch {
  1782. .el-switch__label {
  1783. color: #888;
  1784. }
  1785. }
  1786. .el-switch__label.is-active {
  1787. color: #000;
  1788. }
  1789. .el-switch.is-checked .el-switch__core::after {
  1790. left: 100%;
  1791. margin-left: -10px;
  1792. }
  1793. .el-switch__core {
  1794. height: 16px;
  1795. }
  1796. .el-switch__core::after {
  1797. top: 3px;
  1798. width: 8px;
  1799. height: 8px;
  1800. }
  1801. }
  1802. </style>