index.vue 56 KB

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