index.vue 58 KB

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