index.vue 52 KB

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