seekPage.vue 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860
  1. <template>
  2. <div class="corpus_seekpage result" v-loading="loading">
  3. <Header v-if="!userID" />
  4. <template v-if="showPage">
  5. <div class="title">
  6. <p>教材语料库</p>
  7. <!-- <p>Corpus Dictionary</p> -->
  8. </div>
  9. <div class="seek" @keydown="downSeek">
  10. <input type="text" v-model="keyword" />
  11. <button @click="getdata(true)">搜索</button>
  12. <el-popover v-model="visibleOption" placement="bottom" width="335" trigger="click">
  13. <div class="set_corpus_dv">
  14. <span>教材</span>
  15. <!-- <el-select v-model="corpus.scope" style="width: 205px" placeholder="请选择">
  16. <el-option v-for="(itemD, indexD) in scopeList" :key="indexD" :label="itemD.label" :value="itemD.value" />
  17. </el-select> -->
  18. <el-cascader
  19. v-model="corpus.scope"
  20. placeholder=""
  21. :options="levelList"
  22. :props="{ multiple: true }"
  23. filterable
  24. collapse-tags
  25. ></el-cascader>
  26. </div>
  27. <div class="set_corpus_dv">
  28. <span>例句长度</span>
  29. <el-input
  30. v-model="corpus.sentenceStart"
  31. style="width: 55px; margin-right: 8px"
  32. onkeyup="value=value.replace(/^0+(\d)|[^\d]+/g,'')"
  33. class="numbre-input"
  34. />
  35. ——
  36. <el-input
  37. v-model="corpus.sentenceEnd"
  38. style="width: 55px; margin: 0 8px"
  39. onkeyup="value=value.replace(/^0+(\d)|[^\d]+/g,'')"
  40. class="numbre-input"
  41. />
  42. </div>
  43. <div class="set_corpus_submit">
  44. <div @click="visibleOption = false">取消</div>
  45. <div @click="sureCorpus">确认</div>
  46. </div>
  47. <div slot="reference" class="set_corpus" style="margin-left: 24px; cursor: pointer">筛选</div>
  48. </el-popover>
  49. </div>
  50. </template>
  51. <div class="txt">包含{{ book_count }}本教材、{{ word_count }}个字词,{{ sentence_count }}个例句</div>
  52. <div class="cx-list" v-if="showResult">
  53. <div class="cx-list-box">
  54. <span style="color: #de4444">{{ oldKey }}</span>
  55. <span>{{ allList.word_level_name }}</span>
  56. <label v-for="(items, indexs) in allList.word_cx_list" :key="indexs"
  57. ><span>{{ items.code }}</span
  58. ><span>{{ items.name }}</span></label
  59. >
  60. </div>
  61. </div>
  62. <div class="txt_imgtable" v-if="showResult">
  63. <div class="left">
  64. <div class="top">
  65. <div>
  66. <div class="pattern">
  67. <div :class="[patternIndex == 0 ? 'sele' : '']" @click="cutPattern(0)">引语模式</div>
  68. <div :class="[patternIndex == 1 ? 'sele' : '']" @click="cutPattern(1)">KWIC模式</div>
  69. </div>
  70. <template v-if="patternIndex == 1">
  71. <div class="KWIC_sort">
  72. <span
  73. :class="['sort', KWIC_sortIndex == 0 ? 'sele' : '']"
  74. @click="KWICsortEvent(0, 'sentence_list_sort_left')"
  75. >
  76. <img src="../../assets/teacherdev/analys-right.png" alt="" />
  77. </span>
  78. <span
  79. :class="['sort', KWIC_sortIndex == 1 ? 'sele' : '']"
  80. @click="KWICsortEvent(1, 'sentence_list_sort_mid')"
  81. >
  82. <img src="../../assets/teacherdev/analys-center.png" alt="" />
  83. </span>
  84. <span
  85. :class="['sort', KWIC_sortIndex == 2 ? 'sele' : '']"
  86. @click="KWICsortEvent(2, 'sentence_list_sort_right')"
  87. >
  88. <img src="../../assets/teacherdev/analys-left.png" alt="" />
  89. </span>
  90. </div>
  91. </template>
  92. <div class="refresh" @click="handleRefresh">
  93. <img src="../../assets/teacherdev/refresh.png" alt="" />
  94. </div>
  95. <template v-if="patternIndex == 0">
  96. <div class="lang_sort" :class="[sortType === 'length' ? 'active' : '']" @click="sortEvent('length')">
  97. 按长度
  98. <img
  99. v-if="sort == 'down' && sortType === 'length'"
  100. src="../../assets/teacherdev/ylk-sort-up.png"
  101. alt=""
  102. />
  103. <img
  104. v-else-if="sort == 'up' && sortType === 'length'"
  105. src="../../assets/teacherdev/ylk-sort-down.png"
  106. alt=""
  107. />
  108. <img v-else src="../../assets/teacherdev/ylk-sort-no.png" alt="" />
  109. </div>
  110. </template>
  111. <template v-else>
  112. <div style="display: flex">
  113. <div
  114. class="lang_sort"
  115. :class="[sortType === 'zflength' ? 'active' : '']"
  116. @click="sortEvent('zflength')"
  117. >
  118. 按长度
  119. <img
  120. v-if="sort == 'down' && sortType === 'zflength'"
  121. src="../../assets/teacherdev/ylk-sort-up.png"
  122. alt=""
  123. />
  124. <img
  125. v-else-if="sort == 'up' && sortType === 'zflength'"
  126. src="../../assets/teacherdev/ylk-sort-down.png"
  127. alt=""
  128. />
  129. <img v-else src="../../assets/teacherdev/ylk-sort-no.png" alt="" />
  130. </div>
  131. <div
  132. class="lang_sort"
  133. :class="[sortType === 'pclength' ? 'active' : '']"
  134. @click="sortEvent('pclength')"
  135. >
  136. 按频次
  137. <img
  138. v-if="sort == 'down' && sortType === 'pclength'"
  139. src="../../assets/teacherdev/ylk-sort-up.png"
  140. alt=""
  141. />
  142. <img
  143. v-else-if="sort == 'up' && sortType === 'pclength'"
  144. src="../../assets/teacherdev/ylk-sort-down.png"
  145. alt=""
  146. />
  147. <img v-else src="../../assets/teacherdev/ylk-sort-no.png" alt="" />
  148. </div>
  149. </div>
  150. </template>
  151. </div>
  152. <div class="size">
  153. <template v-if="patternIndex == 0">
  154. <!-- <el-switch
  155. v-model="pinyinShow"
  156. active-text="拼音"
  157. active-color="#424242"
  158. style="margin-left: 24px"
  159. >
  160. </el-switch> -->
  161. <el-switch
  162. v-model="shiyiShow"
  163. active-text="释义"
  164. active-color="#424242"
  165. style="margin-left: 20px"
  166. @change="changeShiyi"
  167. >
  168. </el-switch>
  169. </template>
  170. <el-switch v-model="fenciShow" active-text="分词" active-color="#424242" style="margin-left: 8px">
  171. </el-switch>
  172. <span :class="[sizeIndex == 0 ? 'sele' : '']" @click="cutSize(0)">大</span>
  173. <span :class="[sizeIndex == 1 ? 'sele' : '']" @click="cutSize(1)">中</span>
  174. <span :class="[sizeIndex == 2 ? 'sele' : '']" @click="cutSize(2)">小</span>
  175. </div>
  176. </div>
  177. <div class="main">
  178. <div class="list">
  179. <template v-if="patternIndex == 0">
  180. <div v-for="(item, i) in ShowList" :key="i + 'sentence'" class="one">
  181. <div class="top">
  182. <!--
  183. :class="['number-' + sizeIndex + '-' + pinyinShow]"
  184. -->
  185. <div class="number">{{ item.number }}.</div>
  186. <!--
  187. :class="['speaker-' + sizeIndex + '-' + pinyinShow]"
  188. -->
  189. <!-- <img src="../../assets/teacherdev/speaker-one.png" alt="" /> -->
  190. <div class="words">
  191. <template v-if="item.sentence_fc_list_style && item.sentence_fc_list_style.length > 1">
  192. <span
  193. :style="{
  194. fontSize: conSize + 'px',
  195. padding: fenciShow ? '0 2px' : '',
  196. }"
  197. v-for="(items, indexs) in item.sentence_fc_list_style"
  198. :key="indexs"
  199. v-html="items"
  200. ></span>
  201. </template>
  202. <template v-else>
  203. <span
  204. :style="{
  205. fontSize: conSize + 'px',
  206. padding: fenciShow ? '0 2px' : '',
  207. }"
  208. v-html="item.res"
  209. ></span>
  210. </template>
  211. <template v-if="shiyiShow && item.word_definition_list.length > 0">
  212. <span class="shiyi">
  213. <span v-html="item.word_definition_list.join('; ')"> </span>
  214. </span>
  215. </template>
  216. </div>
  217. <!--
  218. :class="['shiyi-' + sizeIndex]"
  219. -->
  220. </div>
  221. <el-tooltip effect="dark" placement="bottom">
  222. <div slot="content">
  223. {{
  224. item.source_courseware_name_path_short
  225. ? item.source_courseware_name_path_short
  226. : item.source_courseware_name_path
  227. }}
  228. </div>
  229. <div class="bottom">
  230. {{
  231. item.source_courseware_name_path_short
  232. ? item.source_courseware_name_path_short
  233. : item.source_courseware_name_path
  234. }}
  235. </div>
  236. </el-tooltip>
  237. <!-- <div class="bottom">
  238. {{
  239. item.source_courseware_name_path_short
  240. ? item.source_courseware_name_path_short
  241. : item.source_courseware_name_path
  242. }}
  243. </div> -->
  244. </div>
  245. </template>
  246. <template v-else>
  247. <div v-for="(item, index) in ShowList" :key="'kwic' + index" class="kwic_one">
  248. <div class="number">{{ item.number }}</div>
  249. <div
  250. class="word"
  251. :style="{
  252. fontSize: conSize + 'px',
  253. }"
  254. >
  255. <div v-for="(txt, indexs) in item.resArr" :key="indexs">
  256. <div
  257. :style="{ padding: fenciShow ? '0 2px' : '', display: 'inline-block' }"
  258. v-for="(txts, indext) in txt"
  259. :key="indext"
  260. >
  261. <!-- <span v-html="txts"></span> -->
  262. <template v-if="sortType === 'pclength' && (KWIC_sortIndex === 0 || KWIC_sortIndex === 2)">
  263. <template v-if="indexs === 0 && KWIC_sortIndex === 0">
  264. <el-tooltip effect="dark" placement="bottom" style="display: inline">
  265. <div slot="content">
  266. {{
  267. item.adjoin_fc_frequency_list_left && item.adjoin_fc_frequency_list_left[indext]
  268. ? item.adjoin_fc_frequency_list_left[indext]
  269. : 1
  270. }}
  271. </div>
  272. <div class="">
  273. <span v-html="txts"></span>
  274. </div>
  275. </el-tooltip>
  276. </template>
  277. <template v-else-if="indexs === 2 && KWIC_sortIndex === 2">
  278. <el-tooltip effect="dark" placement="bottom" style="display: inline">
  279. <div slot="content">
  280. {{
  281. item.adjoin_fc_frequency_list_right && item.adjoin_fc_frequency_list_right[indext]
  282. ? item.adjoin_fc_frequency_list_right[indext]
  283. : 1
  284. }}
  285. </div>
  286. <div class="">
  287. <span v-html="txts"></span>
  288. </div>
  289. </el-tooltip>
  290. </template>
  291. <template v-else>
  292. <span v-html="txts"></span>
  293. </template>
  294. </template>
  295. <template v-else>
  296. <span v-html="txts"></span>
  297. </template>
  298. </div>
  299. </div>
  300. </div>
  301. <el-tooltip effect="dark" placement="bottom">
  302. <div slot="content">
  303. {{
  304. item.source_courseware_name_path_short
  305. ? item.source_courseware_name_path_short
  306. : item.source_courseware_name_path
  307. }}
  308. </div>
  309. <div class="laiyuan">
  310. {{
  311. item.source_courseware_name_path_short
  312. ? item.source_courseware_name_path_short
  313. : item.source_courseware_name_path
  314. }}
  315. </div>
  316. </el-tooltip>
  317. </div>
  318. </template>
  319. </div>
  320. <div class="page">
  321. <el-pagination
  322. background
  323. @current-change="handleCurrentChange"
  324. :current-page.sync="page"
  325. :page-size="pageSize"
  326. layout="prev, pager, next"
  327. :total="selectCurrent ? selectCurrent : CurrentList.length"
  328. :pager-count="5"
  329. >
  330. </el-pagination>
  331. <span class="text">
  332. 共 {{ selectCurrent ? selectCurrent : CurrentList.length }} 条
  333. {{
  334. patternIndex === 0 && selectLaiyuanBookIdList.length === 0 && !shiyiShow
  335. ? ' 命中 ' + scoreAHitNumber + ' 次'
  336. : ''
  337. }}
  338. </span>
  339. </div>
  340. </div>
  341. </div>
  342. <div class="right">
  343. <div class="top">
  344. <div>
  345. <div
  346. v-if="allList.stat_list_word_definition && allList.stat_list_word_definition.length > 0"
  347. :class="[rightTopIndex == 0 ? 'sele' : '']"
  348. @click="cutsyly(0)"
  349. >
  350. 释义
  351. </div>
  352. <div :class="[rightTopIndex == 1 ? 'sele' : '']" @click="cutsyly(1)">来源</div>
  353. </div>
  354. </div>
  355. <div class="bottom">
  356. <div id="shanxing_main" style="width: 720px; height: 600px"></div>
  357. <div class="list" v-if="rightList.length > 0">
  358. <div class="one all" style="border-bottom: 1px solid #eee">
  359. <div style="width: 60%">{{ rightTopIndex == 1 ? '来源' : '释义' }}</div>
  360. <div style="width: 20%">
  361. <span>出现次数</span>
  362. </div>
  363. <div style="width: 20%">
  364. <span>占比</span>
  365. </div>
  366. </div>
  367. <div
  368. v-for="(item, i) in rightList"
  369. :key="i + 'right'"
  370. class="one"
  371. :style="{
  372. borderBottom: i == rightList.length - 1 ? 'none' : '1px solid #eeeeee',
  373. backgroundColor:
  374. selectLaiyuanBookIdList.indexOf(item.book_id) > -1 ||
  375. selectShiyiBookIdList.indexOf(item.definition) > -1
  376. ? '#F2F3F5'
  377. : '',
  378. }"
  379. @mouseover="gaolangbzt(i, 'shanxing_main')"
  380. @mouseout="closegaolangbzt(i, 'shanxing_main')"
  381. @click="handleBookLiju(item, rightTopIndex)"
  382. >
  383. <div style="width: 60%">
  384. <span></span>
  385. <span v-html="item.book_name"></span>
  386. </div>
  387. <div style="width: 20%">
  388. <span>{{ item.count }}</span>
  389. </div>
  390. <div style="width: 20%">
  391. <span>{{ item.percent }}%</span>
  392. </div>
  393. </div>
  394. <div class="one all">
  395. <div style="width: 60%">
  396. <span></span>
  397. <span>合计</span>
  398. </div>
  399. <div style="width: 20%">
  400. <span>{{ allNumber }}</span>
  401. </div>
  402. <div style="width: 20%">
  403. <span>{{ rightTopIndex == 1 ? allPercent.toFixed(2) : '100.00' }}%</span>
  404. </div>
  405. </div>
  406. </div>
  407. </div>
  408. </div>
  409. </div>
  410. </div>
  411. </template>
  412. <script>
  413. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  414. //例如:import 《组件名称》from ‘《组件路径》';
  415. import Header from '@/components/Header';
  416. import { getConfigInfor } from '@/utils/index';
  417. import { getStaticContent, BookgetContent } from '@/api/api';
  418. import { setToken } from '@/utils/auth';
  419. import * as echarts from 'echarts';
  420. export default {
  421. name: 'corpus_seekpage',
  422. //import引入的组件需要注入到对象中才能使用
  423. components: {
  424. Header,
  425. },
  426. props: {},
  427. data() {
  428. //这里存放数据
  429. return {
  430. keyword: this.$route.query.keyword ? this.$route.query.keyword : null,
  431. oldKey: '',
  432. AccessToken: this.$route.query.AccessToken,
  433. AppID: this.$route.query.AppID,
  434. showPage: false,
  435. userID: this.$route.query.UserID ? this.$route.query.UserID : '',
  436. book_count: 0,
  437. word_count: 0,
  438. sentence_count: 0,
  439. visibleOption: false,
  440. corpus: {
  441. difficlty: null,
  442. scope: [],
  443. sentenceStart: null,
  444. sentenceEnd: null,
  445. },
  446. scopeList: [
  447. {
  448. value: '',
  449. label: '全部',
  450. },
  451. ],
  452. page: 1,
  453. pageSize: 30,
  454. shiyiShow: false,
  455. fenciShow: false,
  456. pinyinShow: true,
  457. JFIndex: 0,
  458. hzData: [],
  459. ShowHzData: [],
  460. loading: true,
  461. lang: null,
  462. unfold: true,
  463. patternIndex: 0,
  464. rightTopIndex: 0,
  465. sizeIndex: 1,
  466. sort: '',
  467. sortType: '',
  468. rightList: [],
  469. KWIC_sortIndex: 0,
  470. allNumber: 0,
  471. allPercent: 0,
  472. conSize: 20,
  473. pinyinSize: 12,
  474. allList: [],
  475. CurrentList: [],
  476. ShowList: [],
  477. chsFhList: [',', '。', '”', ':', '》', '《', '?', '!', ';'],
  478. scoreAHitNumber: 0,
  479. checkAll: false,
  480. isIndeterminate: true,
  481. allLevels: [],
  482. levelList: [],
  483. selectLaiyuanBookIdList: [], // 选中右侧来源书籍列表id
  484. selectShiyiBookIdList: [], // 选中右侧释义书籍列表id
  485. selectCurrent: 0,
  486. showResult: false,
  487. shiyiList: [], //含有释义例句列表
  488. bookListObj: {}, //书籍id和名称对应关系
  489. bookSourceObj: {}, //书籍来源id对应关系
  490. };
  491. },
  492. //计算属性 类似于data概念
  493. computed: {},
  494. //监控data中数据变化
  495. watch: {},
  496. //方法集合
  497. methods: {
  498. downSeek(e) {
  499. if (e.keyCode == 13) {
  500. this.getdata(true);
  501. }
  502. },
  503. getTotalCount() {
  504. const Mname = 'book-data_stat-GetBookWordExampleSentenceTotalCount';
  505. BookgetContent(Mname, {}).then((res) => {
  506. if (res.status === 1) {
  507. this.book_count = res.book_count;
  508. this.word_count = res.word_count;
  509. this.sentence_count = res.example_sentence_count;
  510. }
  511. });
  512. },
  513. // 存储句长信息
  514. sureCorpus() {
  515. this.visibleOption = false;
  516. this.getdata(true);
  517. // if (this.seekOptions) this.seekresult();
  518. },
  519. // 获取上架教材列表
  520. getLevelList() {
  521. this.allLevels = [];
  522. this.levelList = [];
  523. this.bookListObj = {};
  524. BookgetContent('book-book_manager-GetBookList', {
  525. publish_status: 1,
  526. }).then((res) => {
  527. this.loading = false;
  528. this.levelList = [];
  529. if (res.status === 1) {
  530. res.book_list.forEach((item) => {
  531. item.value = item.id;
  532. item.label = item.name;
  533. this.allLevels.push(item.id);
  534. this.$set(this.bookListObj, item.id, item.name);
  535. });
  536. // this.levelList = this.levelList.concat(res.book_list);
  537. let tempdata = {};
  538. res.book_list.forEach((str) => {
  539. if (tempdata[str.series_code] != null) {
  540. tempdata[str.series_code].push(str);
  541. } else {
  542. let every = [];
  543. every.push(str);
  544. tempdata[str.series_code] = every;
  545. }
  546. });
  547. for (const key in tempdata) {
  548. let obj = {
  549. value: tempdata[key][0].series_code,
  550. label: tempdata[key][0].series_code ? tempdata[key][0].series_code : '未分类',
  551. children: tempdata[key],
  552. };
  553. this.levelList.push(obj);
  554. }
  555. }
  556. });
  557. },
  558. getrightListdata() {
  559. this.inityuan();
  560. },
  561. inityuan() {
  562. var chartDom = document.getElementById('shanxing_main');
  563. var myChart = echarts.init(chartDom);
  564. var option;
  565. this.allNumber = 0;
  566. this.allPercent = 0;
  567. let newdata = JSON.parse(JSON.stringify(this.rightList));
  568. newdata.forEach((item) => {
  569. this.allNumber += item.count;
  570. this.allPercent += item.percent;
  571. let percent = item.percent;
  572. item.value = item.count;
  573. if (percent % 1 == 0) {
  574. item.name = item.book_name + ' ' + percent + '%';
  575. } else {
  576. item.name = item.book_name + ' ' + percent.toFixed(2) + '%';
  577. }
  578. });
  579. if (this.rightTopIndex === 1) {
  580. let data = [];
  581. let tempdata = {};
  582. if (this.corpus.scope.length === 0) {
  583. this.levelList.forEach((item) => {
  584. let obj = {
  585. name: item.label,
  586. children: [],
  587. };
  588. item.children.forEach((items) => {
  589. let childObj = {
  590. name: '',
  591. value: 0,
  592. };
  593. if (this.bookSourceObj[items.id]) {
  594. childObj.name = items.name + ' ' + this.bookSourceObj[items.id].percent + '%';
  595. childObj.value = this.bookSourceObj[items.id].count;
  596. }
  597. obj.children.push(childObj);
  598. });
  599. data.push(obj);
  600. });
  601. } else {
  602. this.corpus.scope.forEach((str) => {
  603. if (!tempdata[str[0]]) {
  604. let obj = {
  605. name: str[0],
  606. children: [],
  607. };
  608. tempdata[str[0]] = obj;
  609. }
  610. let childObj = {
  611. name: '',
  612. value: 0,
  613. };
  614. if (this.bookSourceObj[str[1]]) {
  615. childObj.name = this.bookSourceObj[str[1]].book_name + ' ' + this.bookSourceObj[str[1]].percent + '%';
  616. childObj.value = this.bookSourceObj[str[1]].count;
  617. }
  618. tempdata[str[0]].children.push(childObj);
  619. });
  620. for (const key in tempdata) {
  621. data.push(tempdata[key]);
  622. }
  623. }
  624. option = {
  625. title: {
  626. text: '',
  627. subtext: '',
  628. textStyle: {
  629. fontSize: 14,
  630. align: 'center',
  631. },
  632. subtextStyle: {
  633. align: 'center',
  634. },
  635. sublink: '',
  636. },
  637. series: {
  638. type: 'sunburst',
  639. data: data,
  640. radius: [0, '95%'],
  641. sort: undefined,
  642. emphasis: {
  643. focus: 'ancestor',
  644. },
  645. levels: [
  646. {},
  647. {
  648. r0: '3%',
  649. r: '35%',
  650. itemStyle: {
  651. borderWidth: 2,
  652. },
  653. label: {
  654. align: 'left',
  655. },
  656. },
  657. {
  658. r0: '35%',
  659. r: '40%',
  660. label: {
  661. position: 'outside',
  662. },
  663. },
  664. ],
  665. },
  666. };
  667. } else {
  668. option = {
  669. series: [
  670. {
  671. name: 'Access From',
  672. type: 'pie',
  673. // radius: ["50%", "50%"],
  674. data: newdata.length > 0 ? newdata : [],
  675. itemStyle: {
  676. // borderColor: "#fff",
  677. // borderWidth: 2,
  678. },
  679. top: 50,
  680. emphasis: {
  681. itemStyle: {
  682. shadowBlur: 10,
  683. shadowOffsetX: 0,
  684. shadowColor: 'rgba(0, 0, 0, 0.5)',
  685. },
  686. },
  687. },
  688. ],
  689. xAxis: {
  690. show: false, //不显示坐标轴线、坐标轴刻度线和坐标轴上的文字
  691. axisTick: {
  692. show: false, //不显示坐标轴刻度线
  693. },
  694. axisLine: {
  695. show: false, //不显示坐标轴线
  696. },
  697. axisLabel: {
  698. show: false, //不显示坐标轴上的文字
  699. },
  700. },
  701. };
  702. }
  703. option && myChart.setOption(option);
  704. let number = 0;
  705. let _this = this;
  706. myChart.on('click', function (param) {
  707. //添加点击事件
  708. myChart.dispatchAction({ type: 'highlight', dataIndex: param.dataIndex }); //激活点击区域高亮
  709. if (param.dataIndex !== number) {
  710. // 当鼠标点击的时候 消除上一个扇区的高亮
  711. myChart.dispatchAction({ type: 'downplay', dataIndex: number });
  712. }
  713. number = param.dataIndex; //接住当前扇区的dataIndex
  714. if (_this.rightTopIndex === 0) {
  715. _this.handleShiyiLiju(param.data.definition);
  716. } else {
  717. _this.handleBookLiju(param.data);
  718. }
  719. });
  720. },
  721. // 鼠标进入
  722. gaolangbzt(index, id) {
  723. if (this.rightTopIndex === 1) return;
  724. var compareChart = echarts.getInstanceByDom(document.getElementById(id));
  725. compareChart.dispatchAction({
  726. type: 'highlight',
  727. seriesIndex: 0,
  728. dataIndex: index,
  729. });
  730. },
  731. // 鼠标移出
  732. closegaolangbzt(index, id) {
  733. var compareChart = echarts.getInstanceByDom(document.getElementById(id));
  734. compareChart.dispatchAction({
  735. type: 'downplay',
  736. seriesIndex: 0,
  737. dataIndex: index,
  738. });
  739. },
  740. // 计算选中教材例句
  741. handleBookLiju(item, index) {
  742. if (index === 0) {
  743. this.handleShiyiLiju(item.definition);
  744. return false;
  745. }
  746. let id = item.book_id;
  747. if (!id) return false;
  748. if (this.selectLaiyuanBookIdList.indexOf(id) > -1) {
  749. this.selectLaiyuanBookIdList.splice(this.selectLaiyuanBookIdList.indexOf(id), 1);
  750. } else {
  751. this.selectLaiyuanBookIdList.push(id);
  752. }
  753. this.page = 1;
  754. this.padingEvetn();
  755. window.scrollTo(0, 0);
  756. },
  757. // 计算选中教材例句
  758. handleShiyiLiju(shiyi) {
  759. if (!shiyi) return false;
  760. if (this.selectShiyiBookIdList.indexOf(shiyi) > -1) {
  761. this.selectShiyiBookIdList.splice(this.selectShiyiBookIdList.indexOf(shiyi), 1);
  762. } else {
  763. this.selectShiyiBookIdList.push(shiyi);
  764. }
  765. this.shiyiShow = this.selectShiyiBookIdList.length > 0;
  766. this.page = 1;
  767. this.padingEvetns();
  768. window.scrollTo(0, 0);
  769. },
  770. changehzdata() {
  771. this.hzData = [];
  772. this.jfEvent(0);
  773. let arr = this.keyword.trim().split('');
  774. arr.forEach((item) => {
  775. if (!/^[\u4e00-\u9fa5]/.test(item)) {
  776. return;
  777. }
  778. let result = pinyinUtil.getPinyin(item);
  779. let obj = {
  780. con: item,
  781. pinyin: result,
  782. hzDetail: {
  783. hz_json: null,
  784. },
  785. };
  786. this.hzData.push(obj);
  787. this.ShowHzData = JSON.parse(JSON.stringify(this.hzData));
  788. });
  789. },
  790. handleRefresh() {
  791. this.pinyinShow = true;
  792. this.shiyiShow = true;
  793. this.fenciShow = true;
  794. this.sizeIndex = 1;
  795. this.sort = '';
  796. this.sortType = '';
  797. this.KWIC_sortIndex = 0;
  798. this.cutSize(1);
  799. this.getdata();
  800. this.page = 1;
  801. },
  802. getdata(flag) {
  803. if (!this.keyword || !this.keyword.trim()) {
  804. this.$message.warning('请输入要搜索的内容');
  805. return;
  806. }
  807. this.loading = true;
  808. this.oldKey = this.keyword.trim();
  809. this.showResult = true;
  810. this.scoreAHitNumber = 0;
  811. let selectBookId = [];
  812. this.corpus.scope.forEach((item) => {
  813. selectBookId.push(item[1]);
  814. });
  815. this.bookSourceObj = {};
  816. let Mname = 'book-courseware_manager-GetCoursewareWordExampleSentenceList_Sort';
  817. let data = {
  818. // courseware_id: "003-20211012-17-BDUZ1JVCAN",
  819. courseware_id: '',
  820. // word: this.$route.query.keyword, // 单词
  821. word: this.keyword.trim(),
  822. search_scope: 3, // 检索范围 0 【本章】,1【本教材】,2【本套教材】,3【系统所有教材】
  823. // 本章:同一本教材下,归属同一个第一级章节下的所有课件为同一章。
  824. is_contain_word_variants: false, // 是否包含单词变体例句
  825. is_contain_stat_data: true, //是否包统计数据
  826. is_filter_repetitive_sentence: 'true', // 过滤重复例句
  827. sort_mode: this.sort ? (this.sort == 'down' ? 'DESCENT' : 'ASCENT') : 'NO', // 排序模式 NO 【不排序】,ASCENT【顺序】,DESCENT【倒序】
  828. compare_mode: this.patternIndex === 0 ? 'LENGTH' : 'KWIC', // 排序比较模式,LENGTH【例句长度】,KWIC【KWIC 模式】
  829. kwic_arrange_type: this.KWIC_sortIndex === 0 ? 'LEFT' : this.KWIC_sortIndex === 1 ? 'MID' : 'RIGHT', // KWIC 排列类型, LEFT【左】,MID【中】,RIGHT【右】
  830. kwic_compare_by: this.sortType === 'pclength' ? 1 : 0, // KWIC 排序比较依据,0【字符】,1【相邻的搭配词出现的次数】
  831. book_publish_status: 1, // 教材发布状态 -1【全部】, 0【下架】1【上架】
  832. book_id_list: selectBookId, // 指定教材查询,空表示在检索范围内检索所有教材。
  833. sentence_fc_length_min: this.corpus.sentenceStart ? Number(this.corpus.sentenceStart) : -1, // 例句分词长度范围(最小值),-1 表示不检测最小值
  834. sentence_fc_length_max: this.corpus.sentenceEnd ? Number(this.corpus.sentenceEnd) : -1, // 例句分词长度范围(最大值),-1 表示不检测最大值
  835. is_analyse_word_cx: 'true',
  836. is_analyse_word_level: 'true',
  837. };
  838. BookgetContent(Mname, data, this.AppID, this.AccessToken)
  839. .then((res) => {
  840. this.shiyiList = [];
  841. this.allList = {
  842. sentence_list: [],
  843. sentence_list_sort_left: [],
  844. sentence_list_sort_mid: [],
  845. sentence_list_sort_right: [],
  846. stat_list_sentence_source_book: res.stat_list_sentence_source_book,
  847. stat_list_sentence_source_book_series_code: res.stat_list_sentence_source_book_series_code,
  848. stat_list_word_definition: res.stat_list_word_definition,
  849. word_level_name: res.word_level_name,
  850. word_cx_list: res.word_cx_list,
  851. };
  852. res.stat_list_sentence_source_book.forEach((itesb) => {
  853. itesb.name = itesb.book_name;
  854. itesb.value = itesb.count;
  855. this.$set(this.bookSourceObj, itesb.book_id, itesb);
  856. });
  857. if (res.sentence_list.length > 0) {
  858. res.stat_list_word_definition.forEach((item) => {
  859. // item.book_name_s = item.definition;
  860. item.book_name = JSON.parse(JSON.stringify(item.definition)).replace(/<i>/g, '').replace(/<\/i>/g, '');
  861. });
  862. res.stat_list_sentence_source_book_series_code.forEach((item) => {
  863. item.book_name = item.series_code;
  864. });
  865. // 清理脏数据
  866. this.removeRubbishData(res);
  867. if (res.stat_list_word_definition.length === 0) {
  868. this.rightTopIndex = 1;
  869. }
  870. if (this.rightTopIndex === 0) {
  871. this.rightList = res.stat_list_word_definition;
  872. } else {
  873. this.rightList = res.stat_list_sentence_source_book;
  874. }
  875. this.getrightListdata();
  876. if (this.patternIndex === 0) {
  877. this.allList.sentence_list = this.handleExample(res.sentence_list);
  878. } else {
  879. if (this.KWIC_sortIndex === 0) {
  880. this.allList.sentence_list_sort_left = this.handleExample(res.sentence_list, 'left');
  881. } else if (this.KWIC_sortIndex === 1) {
  882. this.allList.sentence_list_sort_mid = this.handleExample(res.sentence_list, 'mid');
  883. } else {
  884. this.allList.sentence_list_sort_right = this.handleExample(res.sentence_list, 'right');
  885. }
  886. }
  887. this.CurrentList = JSON.parse(JSON.stringify(res.sentence_list));
  888. let shiyiIndex = 1;
  889. JSON.parse(JSON.stringify(res.sentence_list)).forEach((items) => {
  890. if (items.word_definition_list && items.word_definition_list.length > 0) {
  891. items.number = shiyiIndex;
  892. this.shiyiList.push(items);
  893. shiyiIndex++;
  894. }
  895. });
  896. this.padingEvetn();
  897. } else {
  898. this.CurrentList = [];
  899. this.ShowList = [];
  900. this.rightList = [];
  901. this.shiyiList = [];
  902. this.getrightListdata();
  903. }
  904. if (this.keyword.trim() && flag) {
  905. this.changehzdata();
  906. } else {
  907. this.loading = false;
  908. }
  909. if (res.word_pinyin_list) {
  910. res.word_pinyin_list.forEach((itemP, indexP) => {
  911. if (this.hzData[indexP]) {
  912. this.hzData[indexP].pinyin = itemP;
  913. }
  914. });
  915. }
  916. })
  917. .catch((err) => {
  918. this.loading = false;
  919. });
  920. },
  921. handleExample(list, type) {
  922. if (list.length > 0) {
  923. list = list.map((item, index) => {
  924. item.number = index + 1;
  925. let str = item.source_courseware_name_path;
  926. item.show_source_courseware_name_path = str.slice(0, 8) + '...';
  927. if (type == 'left') {
  928. let arr = JSON.parse(JSON.stringify(item.sentence_fc_list));
  929. arr.forEach((items, indexs) => {
  930. if (indexs == item.sentence_fc_list_word_index) {
  931. arr[indexs] = `<span style=color:#DE4444;font-weight:700;>${arr[indexs]}</span>`;
  932. }
  933. });
  934. let data = this.changefiveword(arr, item.sentence_fc_list_word_index, type);
  935. item.resArr = data;
  936. item.adjoin_fc_frequency_list_left = item.adjoin_fc_frequency_list.splice(
  937. 0,
  938. item.sentence_fc_list_word_index,
  939. );
  940. } else if (type == 'right') {
  941. let sentence = JSON.parse(JSON.stringify(item.sentence));
  942. let arr = JSON.parse(JSON.stringify(item.sentence_fc_list));
  943. arr.forEach((items, indexs) => {
  944. if (indexs == item.sentence_fc_list_word_index) {
  945. arr[indexs] = `<span style=color:#DE4444;font-weight:700;>${arr[indexs]}</span>`;
  946. }
  947. });
  948. let data = this.changefiveword(arr, item.sentence_fc_list_word_index, type);
  949. item.resArr = data;
  950. item.adjoin_fc_frequency_list_right = item.adjoin_fc_frequency_list.splice(
  951. item.sentence_fc_list_word_index + 1,
  952. );
  953. } else if (type == 'mid') {
  954. let sentence = JSON.parse(JSON.stringify(item.sentence));
  955. let arr = JSON.parse(JSON.stringify(item.sentence_fc_list));
  956. arr.forEach((items, indexs) => {
  957. if (indexs == item.sentence_fc_list_word_index) {
  958. arr[indexs] = `<span style=color:#DE4444;font-weight:700;>${arr[indexs]}</span>`;
  959. }
  960. });
  961. let data = this.changefiveword(arr, item.sentence_fc_list_word_index, type);
  962. item.resArr = data;
  963. } else {
  964. this.scoreAHitNumber += item.position_list.length;
  965. let sentence_fc_list_style = [];
  966. let newsentence = JSON.parse(JSON.stringify(item.sentence));
  967. let res = '';
  968. for (let i = 0; i < item.position_list.length; i++) {
  969. let part1 = '';
  970. let part2 = '';
  971. let part3 = '';
  972. if (item.position_list.length > 1) {
  973. if (i == 0) {
  974. part1 = newsentence.substring(0, item.position_list[i].begin);
  975. part2 = newsentence.substring(item.position_list[i].begin, item.position_list[i].end);
  976. part3 = newsentence.substring(item.position_list[i].end, item.position_list[i + 1].begin);
  977. } else if (i == item.position_list.length - 1) {
  978. part2 = newsentence.substring(item.position_list[i].begin, item.position_list[i].end);
  979. part3 = newsentence.substring(item.position_list[i].end);
  980. } else {
  981. part2 = newsentence.substring(item.position_list[i].begin, item.position_list[i].end);
  982. part3 = newsentence.substring(item.position_list[i].end, item.position_list[i + 1].begin);
  983. }
  984. } else {
  985. part1 = newsentence.substring(0, item.position_list[i].begin);
  986. part2 = newsentence.substring(item.position_list[i].begin, item.position_list[i].end);
  987. part3 = newsentence.substring(item.position_list[i].end);
  988. }
  989. res += part1 + '<span style="color:#DE4444;">' + part2 + '</span>' + part3;
  990. }
  991. item.res = res;
  992. item.sentence_fc_list.forEach((items, indexs) => {
  993. if (item.sentence_fc_list_word_index_list.indexOf(indexs) > -1) {
  994. sentence_fc_list_style.push('<span style="color:#DE4444;">' + items + '</span>');
  995. } else {
  996. sentence_fc_list_style.push(items);
  997. }
  998. });
  999. item.sentence_fc_list_style = sentence_fc_list_style;
  1000. }
  1001. return item;
  1002. });
  1003. return list;
  1004. } else {
  1005. return [];
  1006. }
  1007. },
  1008. changefiveword(arr, index, type) {
  1009. let num = 6;
  1010. let colorIndex = 0;
  1011. let colorList = ['#4D7EFF', '#A4430F', '#9342C5', '#FF8718', '#1DAA91'];
  1012. for (let i = 1; i < num; i++) {
  1013. if (type == 'left') {
  1014. if (index - i >= 0) {
  1015. if (this.chsFhList.indexOf(arr[index - i]) == -1) {
  1016. arr[index - i] = `<span style=color:${colorList[colorIndex]};>${arr[index - i]}</span>`;
  1017. colorIndex++;
  1018. } else {
  1019. num++;
  1020. }
  1021. }
  1022. } else if (type == 'right') {
  1023. if (index + i <= arr.length - 1) {
  1024. if (this.chsFhList.indexOf(arr[index + i]) == -1) {
  1025. arr[index + i] = `<span style=color:${colorList[colorIndex]};>${arr[index + i]}</span>`;
  1026. colorIndex++;
  1027. } else {
  1028. num++;
  1029. }
  1030. }
  1031. }
  1032. }
  1033. let newarr = [];
  1034. let arr1 = [];
  1035. let arr2 = [];
  1036. let arr3 = [];
  1037. arr.forEach((item, i) => {
  1038. if (i < index) {
  1039. arr1.push(item);
  1040. } else if (i == index) {
  1041. arr2.push(item);
  1042. } else {
  1043. arr3.push(item);
  1044. }
  1045. });
  1046. newarr.push(arr1);
  1047. newarr.push(arr2);
  1048. newarr.push(arr3);
  1049. return newarr;
  1050. },
  1051. // 处理分页
  1052. padingEvetn() {
  1053. let arr =
  1054. this.shiyiShow && this.patternIndex === 0
  1055. ? JSON.parse(JSON.stringify(this.shiyiList))
  1056. : JSON.parse(JSON.stringify(this.CurrentList));
  1057. let arrs = [];
  1058. if (this.selectLaiyuanBookIdList.length === 0) {
  1059. arrs = arr;
  1060. } else {
  1061. arr.forEach((item) => {
  1062. let path = item.source_courseware_id_path.split('/');
  1063. if (path.length > 0 && this.selectLaiyuanBookIdList.indexOf(path[0]) > -1) {
  1064. arrs.push(item);
  1065. }
  1066. });
  1067. }
  1068. this.selectCurrent = arrs.length;
  1069. arrs.forEach((item, index) => {
  1070. item.number = index + 1;
  1071. });
  1072. let newarr = arrs.splice((this.page - 1) * this.pageSize, this.pageSize);
  1073. this.ShowList = JSON.parse(JSON.stringify(newarr));
  1074. },
  1075. padingEvetns() {
  1076. let arr = JSON.parse(JSON.stringify(this.shiyiList));
  1077. let arrs = [];
  1078. if (this.selectShiyiBookIdList.length === 0) {
  1079. arrs = JSON.parse(JSON.stringify(this.CurrentList));
  1080. } else {
  1081. arr.forEach((item) => {
  1082. if (item.word_definition_list.length > 0) {
  1083. this.selectShiyiBookIdList.forEach((items) => {
  1084. if (item.word_definition_list.indexOf(items) > -1) {
  1085. arrs.push(item);
  1086. }
  1087. });
  1088. }
  1089. });
  1090. }
  1091. this.selectCurrent = arrs.length;
  1092. arrs.forEach((item, index) => {
  1093. item.number = index + 1;
  1094. });
  1095. let newarr = arrs.splice((this.page - 1) * this.pageSize, this.pageSize);
  1096. this.ShowList = JSON.parse(JSON.stringify(newarr));
  1097. },
  1098. // 删除脏数据
  1099. removeRubbishData(data) {
  1100. if (data.sentence_list.length > 0) {
  1101. for (let i = data.sentence_list.length; i--; ) {
  1102. if (
  1103. data.sentence_list[i].sentence_fc_list.length <= 1 ||
  1104. data.sentence_list[i].sentence_fc_list_word_index === -1
  1105. ) {
  1106. data.sentence_list.splice(i, 1);
  1107. }
  1108. }
  1109. }
  1110. },
  1111. handleCurrentChange(val) {
  1112. this.page = val;
  1113. this.padingEvetn();
  1114. },
  1115. // KWIC排序
  1116. KWICsortEvent(index, type) {
  1117. if (this.KWIC_sortIndex == index) return;
  1118. this.KWIC_sortIndex = index;
  1119. // this.CurrentList = this.allList[type];
  1120. // this.padingEvetn();
  1121. this.getdata();
  1122. },
  1123. // 切换释义
  1124. changeShiyi() {
  1125. this.page = 1;
  1126. this.padingEvetn();
  1127. },
  1128. // 排序
  1129. sortEvent(type) {
  1130. if (type !== this.sortType) {
  1131. this.sortType = type;
  1132. this.sort = '';
  1133. }
  1134. if (this.sort == 'down' || !this.sort) {
  1135. this.sort = 'up';
  1136. } else {
  1137. this.sort = 'down';
  1138. }
  1139. this.getdata();
  1140. this.page = 1;
  1141. },
  1142. // 修改大小
  1143. cutSize(index) {
  1144. this.sizeIndex = index;
  1145. if (index == 0) {
  1146. //大
  1147. if (this.patternIndex == 0) {
  1148. this.conSize = 24;
  1149. this.pinyinSize = 12;
  1150. } else {
  1151. this.conSize = 20;
  1152. }
  1153. } else if (index == 1) {
  1154. //中
  1155. if (this.patternIndex == 0) {
  1156. this.conSize = 20;
  1157. this.pinyinSize = 12;
  1158. } else {
  1159. this.conSize = 17;
  1160. }
  1161. } else {
  1162. //小
  1163. if (this.patternIndex == 0) {
  1164. this.conSize = 16;
  1165. this.pinyinSize = 10;
  1166. } else {
  1167. this.conSize = 15;
  1168. }
  1169. }
  1170. },
  1171. // 切换模式
  1172. cutPattern(index) {
  1173. if (this.patternIndex == index) {
  1174. return;
  1175. }
  1176. this.patternIndex = index;
  1177. this.getdata();
  1178. // if (this.patternIndex == 0) {
  1179. // this.CurrentList = JSON.parse(JSON.stringify(this.allList.sentence_list));
  1180. // } else {
  1181. // this.CurrentList = JSON.parse(JSON.stringify(this.allList.sentence_list_sort_left));
  1182. // }
  1183. // this.padingEvetn();
  1184. this.page = 1;
  1185. },
  1186. // 切换释义来源
  1187. cutsyly(index) {
  1188. if (this.rightTopIndex == index) {
  1189. return;
  1190. }
  1191. this.rightTopIndex = index;
  1192. if (this.rightTopIndex == 0) {
  1193. this.rightList = this.allList.stat_list_word_definition;
  1194. } else {
  1195. this.rightList = this.allList.stat_list_sentence_source_book;
  1196. }
  1197. // if (this.rightList.length > 0) {
  1198. this.inityuan();
  1199. // }
  1200. },
  1201. },
  1202. //生命周期 - 创建完成(可以访问当前this实例)
  1203. async created() {
  1204. const _this = this;
  1205. if (this.AccessToken) {
  1206. const Mname = 'login_control-ParseAccessToken';
  1207. await getStaticContent(Mname, {
  1208. access_token: _this.AccessToken,
  1209. }).then((res) => {
  1210. res.access_token = _this.AccessToken;
  1211. setToken(res);
  1212. sessionStorage.setItem('GCLS_Token_Tc', JSON.stringify(res));
  1213. this.showPage = true;
  1214. });
  1215. await getConfigInfor();
  1216. }
  1217. localStorage.removeItem('seekPageData');
  1218. this.showPage = true;
  1219. this.getLevelList();
  1220. this.getTotalCount();
  1221. if (this.keyword && this.keyword.trim()) {
  1222. this.getdata(true);
  1223. }
  1224. },
  1225. //生命周期 - 挂载完成(可以访问DOM元素)
  1226. mounted() {},
  1227. //生命周期-创建之前
  1228. beforeCreated() {},
  1229. //生命周期-挂载之前
  1230. beforeMount() {},
  1231. //生命周期-更新之前
  1232. beforUpdate() {},
  1233. //生命周期-更新之后
  1234. updated() {},
  1235. //生命周期-销毁之前
  1236. beforeDestory() {},
  1237. //生命周期-销毁完成
  1238. destoryed() {},
  1239. //如果页面有keep-alive缓存功能,这个函数会触发
  1240. activated() {},
  1241. };
  1242. </script>
  1243. <style lang="scss" scoped>
  1244. /* @import url(); 引入css类 */
  1245. .corpus_seekpage {
  1246. .title {
  1247. margin-top: 24px;
  1248. > :nth-child(1) {
  1249. font-weight: 700;
  1250. font-size: 32px;
  1251. line-height: 38px;
  1252. color: #000000;
  1253. }
  1254. > :nth-child(2) {
  1255. font-weight: 400;
  1256. font-size: 14px;
  1257. line-height: 16px;
  1258. }
  1259. > p {
  1260. margin: 0;
  1261. text-align: center;
  1262. }
  1263. }
  1264. .seek {
  1265. margin-top: 18px;
  1266. display: flex;
  1267. justify-content: center;
  1268. height: 51px;
  1269. position: relative;
  1270. input {
  1271. width: 468px;
  1272. height: 51px;
  1273. border: 1px solid #669aff;
  1274. outline: none;
  1275. box-sizing: border-box;
  1276. padding: 0 10px;
  1277. }
  1278. button {
  1279. width: 96px;
  1280. height: 100%;
  1281. background: #669aff;
  1282. border-width: 1px 1px 1px 0px;
  1283. border-style: solid;
  1284. border-color: #669aff;
  1285. text-align: center;
  1286. font-weight: 400;
  1287. font-size: 16px;
  1288. line-height: 51px;
  1289. color: #ffffff;
  1290. cursor: pointer;
  1291. box-sizing: border-box;
  1292. }
  1293. .set_corpus {
  1294. position: absolute;
  1295. top: 16px;
  1296. }
  1297. }
  1298. .txt {
  1299. margin-top: 24px;
  1300. text-align: center;
  1301. font-weight: 400;
  1302. font-size: 16px;
  1303. line-height: 19px;
  1304. color: #000000;
  1305. opacity: 0.65;
  1306. }
  1307. .txt_imgtable {
  1308. width: 1200px;
  1309. margin: 0 auto;
  1310. .left {
  1311. position: relative;
  1312. width: 100%;
  1313. padding-bottom: 68px;
  1314. margin-right: 8px;
  1315. background: #fff;
  1316. border: 1px solid rgba(0, 0, 0, 8%);
  1317. border-radius: 0 0 8px 8px;
  1318. > .top {
  1319. display: flex;
  1320. align-items: center;
  1321. justify-content: space-between;
  1322. height: 44px;
  1323. font-size: 12px;
  1324. font-weight: 400;
  1325. color: #000;
  1326. border-bottom: 1px solid rgba(0, 0, 0, 8%);
  1327. > div {
  1328. display: flex;
  1329. align-items: center;
  1330. column-gap: 16px;
  1331. }
  1332. .KWIC_sort {
  1333. display: flex;
  1334. span {
  1335. display: inline-block;
  1336. display: flex;
  1337. align-items: center;
  1338. justify-content: center;
  1339. width: 28px;
  1340. height: 28px;
  1341. cursor: pointer;
  1342. background: #fff;
  1343. border-radius: 4px;
  1344. }
  1345. .sele {
  1346. background: #f0f0f0;
  1347. }
  1348. .sort {
  1349. img {
  1350. width: 14px;
  1351. height: 12px;
  1352. }
  1353. }
  1354. .down {
  1355. img {
  1356. width: 16px;
  1357. height: 16px;
  1358. }
  1359. }
  1360. }
  1361. .pattern {
  1362. display: flex;
  1363. align-items: center;
  1364. justify-content: center;
  1365. width: 144px;
  1366. height: 28px;
  1367. margin-left: 16px;
  1368. background: #eee;
  1369. border-radius: 4px;
  1370. > div {
  1371. width: 68px;
  1372. height: 24px;
  1373. font-size: 12px;
  1374. font-weight: 400;
  1375. line-height: 24px;
  1376. color: #888;
  1377. text-align: center;
  1378. cursor: pointer;
  1379. border-radius: 2px;
  1380. }
  1381. .sele {
  1382. color: #000;
  1383. background: #fff;
  1384. box-shadow: 0 2px 2px rgba(0, 0, 0, 8%);
  1385. }
  1386. }
  1387. .refresh {
  1388. display: flex;
  1389. align-items: center;
  1390. justify-content: center;
  1391. width: 28px;
  1392. height: 28px;
  1393. cursor: pointer;
  1394. background: #eee;
  1395. border-radius: 4px;
  1396. img {
  1397. width: 16px;
  1398. height: 16px;
  1399. }
  1400. }
  1401. .size {
  1402. margin-right: 12px;
  1403. span {
  1404. padding: 4px;
  1405. font-size: 14px;
  1406. cursor: pointer;
  1407. }
  1408. .sele {
  1409. background: #e6e6e6;
  1410. border-radius: 4px;
  1411. }
  1412. }
  1413. }
  1414. .lang_sort {
  1415. display: flex;
  1416. align-items: center;
  1417. justify-content: center;
  1418. width: max-content;
  1419. cursor: pointer;
  1420. margin-right: 16px;
  1421. border-radius: 20px;
  1422. border: 1px solid #e5e6eb;
  1423. padding: 4px 12px;
  1424. font-size: 14px;
  1425. &.active {
  1426. border-color: #4992ff;
  1427. background: #4992ff;
  1428. color: #fff;
  1429. }
  1430. img {
  1431. width: 16px;
  1432. height: 16px;
  1433. margin-left: 2px;
  1434. }
  1435. }
  1436. .main {
  1437. // height: 95%;
  1438. .list {
  1439. margin-top: 16px;
  1440. .one {
  1441. padding: 0 16px;
  1442. margin-bottom: 8px;
  1443. display: flex;
  1444. align-items: end;
  1445. .top {
  1446. display: flex;
  1447. // align-items: center;
  1448. // flex-flow: wrap;
  1449. width: 100%;
  1450. .number {
  1451. flex-shrink: 0;
  1452. width: 22px;
  1453. margin-right: 8px;
  1454. font-size: 14px;
  1455. font-weight: 400;
  1456. line-height: 21px;
  1457. color: rgba(0, 0, 0, 30%);
  1458. text-align: right;
  1459. &-1-false {
  1460. margin-top: 3px;
  1461. }
  1462. &-0-true {
  1463. margin-top: 21px;
  1464. }
  1465. &-0-false {
  1466. margin-top: 5px;
  1467. }
  1468. &-2-true {
  1469. margin-top: 17px;
  1470. }
  1471. &-2-false {
  1472. margin-top: 1px;
  1473. }
  1474. }
  1475. img {
  1476. width: 16px;
  1477. height: 16px;
  1478. margin-right: 8px;
  1479. cursor: pointer;
  1480. &.speaker-1-false {
  1481. margin-top: 6px;
  1482. }
  1483. &.speaker-0-true {
  1484. margin-top: 24px;
  1485. }
  1486. &.speaker-0-false {
  1487. margin-top: 8px;
  1488. }
  1489. &.speaker-2-true {
  1490. margin-top: 20px;
  1491. }
  1492. &.speaker-2-false {
  1493. margin-top: 4px;
  1494. }
  1495. }
  1496. .words {
  1497. // display: flex;
  1498. // align-items: flex-end;
  1499. // flex-flow: wrap;
  1500. font-family: 'FZJCGFKTK';
  1501. word-break: break-all;
  1502. > div {
  1503. .pinyin {
  1504. margin-bottom: 2px;
  1505. font-family: 'League';
  1506. font-size: 12px;
  1507. font-weight: 500;
  1508. color: rgba(0, 0, 0, 50%);
  1509. text-align: center;
  1510. }
  1511. .con {
  1512. font-family: 'FZJCGFKTK';
  1513. font-size: 20px;
  1514. font-weight: 400;
  1515. color: #000;
  1516. text-align: center;
  1517. }
  1518. }
  1519. }
  1520. .shiyi {
  1521. font-size: 12px;
  1522. font-weight: 400;
  1523. line-height: 24px;
  1524. color: #48a3e6;
  1525. font-family: 'robot', 'FZJCGFKTK';
  1526. &-0 {
  1527. line-height: 32px;
  1528. }
  1529. &-1 {
  1530. line-height: 28px;
  1531. }
  1532. }
  1533. }
  1534. .bottom {
  1535. font-size: 12px;
  1536. font-weight: 400;
  1537. line-height: 150%;
  1538. color: rgba(0, 0, 0, 30%);
  1539. text-align: right;
  1540. width: 117px;
  1541. overflow: hidden;
  1542. text-overflow: ellipsis;
  1543. white-space: nowrap;
  1544. flex-shrink: 0;
  1545. }
  1546. }
  1547. .kwic_one {
  1548. display: flex;
  1549. align-items: center;
  1550. padding: 0 16px;
  1551. justify-content: space-between;
  1552. > :nth-child(1) {
  1553. justify-content: flex-end;
  1554. width: 16px;
  1555. margin-right: 16px;
  1556. }
  1557. .laiyuan {
  1558. width: 117px;
  1559. overflow: hidden;
  1560. font-size: 14px;
  1561. font-weight: 400;
  1562. line-height: 22px;
  1563. color: rgba(0, 0, 0, 65%);
  1564. text-overflow: ellipsis;
  1565. white-space: nowrap;
  1566. }
  1567. .word {
  1568. display: flex;
  1569. justify-content: center;
  1570. // width: 361px;
  1571. height: 22px;
  1572. margin-left: 16px;
  1573. overflow: hidden;
  1574. font-family: 'FZJCGFKTK';
  1575. font-size: 14px;
  1576. font-weight: 400;
  1577. line-height: 22px;
  1578. color: #000;
  1579. white-space: nowrap;
  1580. opacity: 1;
  1581. > :nth-child(1) {
  1582. // direction: rtl;
  1583. // unicode-bidi: plaintext;
  1584. // text-align: right;
  1585. display: flex;
  1586. justify-content: flex-end;
  1587. width: 472px;
  1588. overflow: hidden;
  1589. white-space: nowrap;
  1590. }
  1591. > :nth-child(3) {
  1592. width: 472px;
  1593. overflow: hidden;
  1594. text-align: left;
  1595. white-space: nowrap;
  1596. direction: ltr;
  1597. unicode-bidi: plaintext;
  1598. }
  1599. }
  1600. }
  1601. }
  1602. .page {
  1603. position: absolute;
  1604. bottom: 0;
  1605. box-sizing: border-box;
  1606. display: flex;
  1607. justify-content: space-between;
  1608. align-items: center;
  1609. width: 100%;
  1610. height: 64px;
  1611. border-top: 1px solid rgba(0, 0, 0, 0.08);
  1612. padding: 16px;
  1613. .text {
  1614. display: flex;
  1615. align-items: center;
  1616. font-size: 14px;
  1617. font-weight: 400;
  1618. line-height: 22px;
  1619. color: rgba(0, 0, 0, 60%);
  1620. text-align: center;
  1621. }
  1622. }
  1623. }
  1624. }
  1625. .right {
  1626. width: 100%;
  1627. padding-bottom: 39px;
  1628. background: #fff;
  1629. border: 1px solid rgba(0, 0, 0, 8%);
  1630. border-radius: 8px;
  1631. margin-top: 16px;
  1632. .top {
  1633. display: flex;
  1634. align-items: center;
  1635. height: 44px;
  1636. // border-bottom: 1px solid rgba(0, 0, 0, 8%);
  1637. > div {
  1638. display: flex;
  1639. align-items: center;
  1640. justify-content: center;
  1641. // width: 84px;
  1642. padding: 0 2px;
  1643. height: 28px;
  1644. margin-left: 16px;
  1645. background: #eee;
  1646. border-radius: 4px;
  1647. > div {
  1648. width: 40px;
  1649. height: 24px;
  1650. font-size: 12px;
  1651. font-weight: 400;
  1652. line-height: 24px;
  1653. color: #888;
  1654. text-align: center;
  1655. cursor: pointer;
  1656. border-radius: 2px;
  1657. }
  1658. .sele {
  1659. color: #000;
  1660. background: #fff;
  1661. box-shadow: 0 2px 2px rgba(0, 0, 0, 8%);
  1662. }
  1663. }
  1664. }
  1665. .bottom {
  1666. display: flex;
  1667. }
  1668. .list {
  1669. width: 508px;
  1670. margin: 0 auto;
  1671. max-height: 1450px;
  1672. overflow: auto;
  1673. .one {
  1674. display: flex;
  1675. justify-content: space-between;
  1676. padding: 12px;
  1677. font-size: 14px;
  1678. font-weight: 400;
  1679. line-height: 22px;
  1680. color: #333;
  1681. cursor: pointer;
  1682. border-bottom: 1px solid #eee;
  1683. > :nth-child(1) {
  1684. text-align: left;
  1685. }
  1686. > div {
  1687. width: 186px;
  1688. text-align: center;
  1689. }
  1690. }
  1691. .all {
  1692. font-size: 14px;
  1693. font-weight: 600;
  1694. line-height: 22px;
  1695. color: #333;
  1696. border-bottom: none;
  1697. }
  1698. }
  1699. }
  1700. }
  1701. .cx-list {
  1702. width: 1200px;
  1703. margin: 24px auto 0 auto;
  1704. .cx-list-box {
  1705. display: flex;
  1706. padding: 8px 16px;
  1707. align-items: center;
  1708. gap: 16px;
  1709. border-radius: 8px 8px 0px 0px;
  1710. border: 1px solid #ebebeb;
  1711. background: #f7f7f7;
  1712. border-bottom: none;
  1713. width: max-content;
  1714. color: #000;
  1715. font-size: 16px;
  1716. line-height: 24px;
  1717. label {
  1718. display: flex;
  1719. padding: 4px 16px;
  1720. flex-wrap: wrap;
  1721. border-radius: 4px;
  1722. gap: 8px;
  1723. background: #fff;
  1724. color: #007eff;
  1725. font-size: 14px;
  1726. font-weight: 600;
  1727. line-height: 22px;
  1728. > :nth-child(2) {
  1729. color: #000;
  1730. font-weight: 400;
  1731. }
  1732. }
  1733. }
  1734. }
  1735. }
  1736. </style>
  1737. <style lang="scss">
  1738. .result {
  1739. .el-switch__core {
  1740. width: 26px !important;
  1741. height: 16px;
  1742. }
  1743. .el-switch__core::after {
  1744. top: 3px;
  1745. width: 8px;
  1746. height: 8px;
  1747. }
  1748. .el-switch.is-checked .el-switch__core::after {
  1749. margin-left: -10px;
  1750. }
  1751. .el-switch__label.is-active {
  1752. color: #000;
  1753. }
  1754. .page {
  1755. .el-pagination.is-background .el-pager li:not(.disabled).active {
  1756. background-color: #0052d9;
  1757. }
  1758. .el-pager li {
  1759. background: #fff;
  1760. border: 1px solid #dcdcdc;
  1761. border-radius: 3px;
  1762. }
  1763. }
  1764. }
  1765. .el-loading-mask {
  1766. z-index: 200000 !important;
  1767. }
  1768. .checkAllCheckbox {
  1769. width: 100%;
  1770. padding: 0 20px;
  1771. height: 34px;
  1772. line-height: 34px;
  1773. &:hover {
  1774. background-color: #f5f7fa;
  1775. }
  1776. .el-checkbox__input {
  1777. display: none;
  1778. }
  1779. .el-checkbox__label {
  1780. padding: 0;
  1781. }
  1782. }
  1783. .selectBook {
  1784. .el-tag {
  1785. max-width: 90px;
  1786. }
  1787. }
  1788. </style>