123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407 |
- <template>
- <div class="result" v-loading="loading">
- <Header
- :projectShow="true"
- :seekShow="true"
- :seekOption="false"
- :seekOptions="true"
- @changehzdata="getdata(true)"
- />
- <div class="main">
- <div class="hanzi_list">
- <div class="top_jf">
- <div class="j_f">
- <div :class="[JFIndex == 0 ? 'sele' : '']" @click="jfEvent(0)">简</div>
- <div :class="[JFIndex == 1 ? 'sele' : '']" @click="jfEvent(1)">繁</div>
- </div>
- </div>
- <div
- class="list_one_box"
- :style="{
- overflowY: unfold ? 'scroll' : 'hidden'
- }"
- v-if="ShowHzData"
- >
- <div class="list_one" v-for="(item, index) in ShowHzData" :key="'index' + index">
- <Strockplayredline
- v-if="item.hzDetail.hz_json"
- :Book_text="JFIndex == 0 ? item.con : item.fanti"
- :playStorkes="true"
- :curItem="item.hzDetail"
- :targetDiv="'bwcHanziIntp' + index + item.con"
- :isHighlight="false"
- :judgeAnswer="2"
- />
- <div class="Highlight" v-if="item.hzDetail.hz_json">
- <div class="play_audio">
- <img src="../../assets/teacherdev/speaker-one.png" alt="" />
- <span>{{ item.pinyin }}</span>
- </div>
- <div v-for="(items, indexs) in item.hzDetail.hz_json.medians.length" :key="'row' + indexs" class="row">
- <StrockplayredlineCorpus
- :Book_text="JFIndex == 0 ? item.con : item.fanti"
- :playStorkes="false"
- :curItem="item.hzDetail"
- :targetDiv="'bwcHanziIntp_height' + index + item.con + indexs"
- :targetDivGray="'bwcHanziIntp_height_Grey' + index + item.con + indexs"
- :isHighlight="true"
- :judgeAnswer="indexs + 1"
- :BoxbgType="0"
- strokeColorgray="#ccc"
- strokeColor="#000000"
- />
- <div class="number">{{ indexs + 1 }}</div>
- </div>
- </div>
- </div>
- </div>
- <div class="shouqi" v-if="hzData.length > 2">
- <span @click="updownHz">
- <template v-if="unfold">
- <img src="../../assets/teacherdev/up.png" alt="" />
- 收起
- </template>
- <template v-else>
- <img src="../../assets/teacherdev/down.png" alt="" />
- 展开
- </template>
- </span>
- </div>
- </div>
- <div class="txt_imgtable">
- <div class="left">
- <div class="top">
- <div>
- <div class="pattern">
- <div :class="[patternIndex == 0 ? 'sele' : '']" @click="cutPattern(0)">引语模式</div>
- <div :class="[patternIndex == 1 ? 'sele' : '']" @click="cutPattern(1)">KWIC模式</div>
- </div>
- <template v-if="patternIndex == 1">
- <div class="KWIC_sort">
- <span
- :class="['sort', KWIC_sortIndex == 0 ? 'sele' : '']"
- @click="KWICsortEvent(0, 'sentence_list_sort_left')"
- >
- <img src="../../assets/teacherdev/analys-right.png" alt="" />
- </span>
- <span
- :class="['sort', KWIC_sortIndex == 1 ? 'sele' : '']"
- @click="KWICsortEvent(1, 'sentence_list_sort_mid')"
- >
- <img src="../../assets/teacherdev/analys-center.png" alt="" />
- </span>
- <span
- :class="['sort', KWIC_sortIndex == 2 ? 'sele' : '']"
- @click="KWICsortEvent(2, 'sentence_list_sort_right')"
- >
- <img src="../../assets/teacherdev/analys-left.png" alt="" />
- </span>
- </div>
- </template>
- <template v-if="patternIndex == 0">
- <div class="lang_sort" @click="sortEvent">
- 长度
- <img v-if="sort == 'down'" src="../../assets/teacherdev/ylk-sort-down.png" alt="" />
- <img v-else-if="sort == 'up'" src="../../assets/teacherdev/ylk-sort-up.png" alt="" />
- <img v-else src="../../assets/teacherdev/ylk-sort-no.png" alt="" />
- </div>
- </template>
- <div class="refresh" @click="handleRefresh">
- <img src="../../assets/teacherdev/refresh.png" alt="" />
- </div>
- <template v-if="patternIndex == 0">
- <!-- <el-switch
- v-model="pinyinShow"
- active-text="拼音"
- active-color="#424242"
- style="margin-left: 24px"
- >
- </el-switch> -->
- <el-switch v-model="shiyiShow" active-text="释义" active-color="#424242" style="margin-left: 16px">
- </el-switch>
- </template>
- </div>
- <div class="size">
- <span :class="[sizeIndex == 0 ? 'sele' : '']" @click="cutSize(0)">大</span>
- <span :class="[sizeIndex == 1 ? 'sele' : '']" @click="cutSize(1)">中</span>
- <span :class="[sizeIndex == 2 ? 'sele' : '']" @click="cutSize(2)">小</span>
- </div>
- </div>
- <div class="main">
- <div class="list">
- <template v-if="patternIndex == 0">
- <div v-for="(item, i) in ShowList" :key="i + 'sentence'" class="one">
- <div class="top">
- <!--
- :class="['number-' + sizeIndex + '-' + pinyinShow]"
- -->
- <div class="number">{{ item.number }}.</div>
- <!--
- :class="['speaker-' + sizeIndex + '-' + pinyinShow]"
- -->
- <img src="../../assets/teacherdev/speaker-one.png" alt="" />
- <div class="words">
- <span
- :style="{
- fontSize: conSize + 'px'
- }"
- v-html="item.res"
- ></span>
- <template v-if="shiyiShow && item.word_definition_list.length > 0">
- <span class="shiyi">
- (
- <span v-for="(items, indexs) in item.word_definition_list" :key="indexs" v-html="items">
- </span>
- )
- </span>
- </template>
- </div>
- <!--
- :class="['shiyi-' + sizeIndex]"
- -->
- </div>
- <div class="bottom">
- {{ item.source_courseware_name_path }}
- </div>
- </div>
- </template>
- <template v-else>
- <div v-for="(item, index) in ShowList" :key="'kwic' + index" class="kwic_one">
- <div class="number">{{ item.number }}</div>
- <el-tooltip effect="dark" placement="bottom">
- <div slot="content">
- {{ item.source_courseware_name_path }}
- </div>
- <div class="laiyuan">
- {{ item.source_courseware_name_path }}
- </div>
- </el-tooltip>
- <div
- class="word"
- :style="{
- fontSize: conSize + 'px'
- }"
- >
- <div v-for="(txt, indexs) in item.resArr" :key="indexs">
- <span v-for="(txts, indexs) in txt" v-html="txts" :key="indexs"></span>
- </div>
- </div>
- </div>
- </template>
- </div>
- <div class="page">
- <span class="text"> 共 {{ CurrentList.length }} 条 {{patternIndex == 0?' 命中 '+scoreAHitNumber+' 次':''}} </span>
- <el-pagination
- background
- @current-change="handleCurrentChange"
- :current-page.sync="page"
- :page-size="pageSize"
- layout="prev, pager, next"
- :total="CurrentList.length"
- :pager-count="5"
- >
- </el-pagination>
- </div>
- </div>
- </div>
- <div class="right">
- <div class="top">
- <div>
- <div v-if="allList.stat_list_word_definition&&allList.stat_list_word_definition.length>0" :class="[rightTopIndex == 0 ? 'sele' : '']" @click="cutsyly(0)">释义</div>
- <div :class="[rightTopIndex == 1 ? 'sele' : '']" @click="cutsyly(1)">来源</div>
- </div>
- </div>
- <div id="shanxing_main" style="height: 398px"></div>
- <div class="list" v-if="rightList.length > 0">
- <div
- v-for="(item, i) in rightList"
- :key="i + 'right'"
- class="one"
- :style="{
- borderBottom: i == rightList.length - 1 ? 'none' : '1px solid #eeeeee'
- }"
- @mouseover="gaolangbzt(i, 'shanxing_main')"
- @mouseout="closegaolangbzt(i, 'shanxing_main')"
- >
- <div style="width: 60%">
- <span></span>
- <span v-html="item.book_name"></span>
- </div>
- <div style="width: 10%">
- <span>{{ item.count }}</span>
- </div>
- <div style="width: 30%">
- <span>{{ item.percent }}%</span>
- </div>
- </div>
- <div class="one all">
- <div style="width: 60%">
- <span></span>
- <span>合计</span>
- </div>
- <div style="width: 10%">
- <span>{{ allNumber }}</span>
- </div>
- <div style="width: 30%">
- <span>100%</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
- //例如:import 《组件名称》from ‘《组件路径》';
- import Header from '@/components/Header';
- import { getLogin, BookgetContent } from '@/api/api';
- import Strockplayredline from '@/components/corpus/Strockplayredline';
- import StrockplayredlineCorpus from '@/components/corpus/StrockplayredlineCorpus';
- import '@/utils/pinyin_dict_withtone';
- import '@/utils/pinyinUtil';
- const OpenCC = require('opencc-js');
- const converter = OpenCC.Converter({ from: 'cn', to: 'tw' });
- import * as echarts from 'echarts';
- export default {
- //import引入的组件需要注入到对象中才能使用
- components: {
- Header,
- Strockplayredline,
- StrockplayredlineCorpus
- },
- props: {},
- data() {
- //这里存放数据
- return {
- page: 1,
- pageSize: 30,
- shiyiShow: true,
- pinyinShow: true,
- JFIndex: 0,
- hzData: [],
- ShowHzData: [],
- loading: true,
- lang: null,
- unfold: true,
- patternIndex: 0,
- rightTopIndex: 0,
- sizeIndex: 1,
- sort: '',
- rightList: [],
- KWIC_sortIndex: 0,
- allNumber: 0,
- conSize: 20,
- pinyinSize: 12,
- allList: [],
- CurrentList: [],
- ShowList: [],
- chsFhList: [',', '。', '”', ':', '》', '《', '?', '!', ';'],
- scoreAHitNumber: 0
- };
- },
- //计算属性 类似于data概念
- computed: {},
- //监控data中数据变化
- watch: {},
- //方法集合
- methods: {
- handleCurrentChange(val) {
- this.page = val;
- this.padingEvetn();
- },
- // KWIC排序
- KWICsortEvent(index, type) {
- if (this.KWIC_sortIndex == index) return;
- this.KWIC_sortIndex = index;
- // this.CurrentList = this.allList[type];
- // this.padingEvetn();
- this.getdata();
- },
- // 排序
- sortEvent() {
- if (this.sort == 'up' || !this.sort) {
- this.sort = 'down';
- } else {
- this.sort = 'up';
- }
- this.getdata();
- this.page = 1;
- },
- // 修改大小
- cutSize(index) {
- this.sizeIndex = index;
- if (index == 0) {
- //大
- if (this.patternIndex == 0) {
- this.conSize = 24;
- this.pinyinSize = 12;
- } else {
- this.conSize = 20;
- }
- } else if (index == 1) {
- //中
- if (this.patternIndex == 0) {
- this.conSize = 20;
- this.pinyinSize = 12;
- } else {
- this.conSize = 17;
- }
- } else {
- //小
- if (this.patternIndex == 0) {
- this.conSize = 16;
- this.pinyinSize = 10;
- } else {
- this.conSize = 15;
- }
- }
- },
- // 切换模式
- cutPattern(index) {
- if (this.patternIndex == index) {
- return;
- }
- this.patternIndex = index;
- this.getdata()
- // if (this.patternIndex == 0) {
- // this.CurrentList = JSON.parse(JSON.stringify(this.allList.sentence_list));
- // } else {
- // this.CurrentList = JSON.parse(JSON.stringify(this.allList.sentence_list_sort_left));
- // }
- // this.padingEvetn();
- this.page = 1;
- },
- // 切换释义来源
- cutsyly(index) {
- if (this.rightTopIndex == index) {
- return;
- }
- this.rightTopIndex = index;
- if (this.rightTopIndex == 0) {
- this.rightList = this.allList.stat_list_word_definition;
- } else {
- this.rightList = this.allList.stat_list_sentence_source_book;
- }
- // if (this.rightList.length > 0) {
- this.inityuan();
- // }
- },
- updownHz() {
- this.unfold = !this.unfold;
- if (this.unfold) {
- this.ShowHzData = JSON.parse(JSON.stringify(this.hzData));
- } else {
- this.ShowHzData.splice(2);
- }
- },
- jfEvent(index) {
- this.JFIndex = index;
- if (index == 0) {
- //简体
- this.gethzJSON();
- } else {
- //繁体
- this.hzData.forEach(item => {
- let a = converter(item.con);
- item.fanti = a;
- });
- this.gethzJSON();
- }
- },
- // 获取汉字josn
- gethzJSON() {
- this.ShowHzData = null;
- this.loading = true;
- let MethodName = 'hz_resource_manager-GetHZStrokesContent';
- this.hzData.forEach((item, i) => {
- let data = {
- hz: this.JFIndex == 0 ? item.con : item.fanti
- };
- item.hzDetail = {
- hz_json: null
- };
- this.$forceUpdate();
- getLogin(MethodName, data)
- .then(res => {
- this.$set(item.hzDetail, 'hz_json', res);
- this.$forceUpdate();
- this.ShowHzData = JSON.parse(JSON.stringify(this.hzData));
- if (i == this.hzData.length - 1) {
- this.loading = false;
- }
- })
- .catch(() => {
- this.loading = false;
- });
- });
- },
- getrightListdata() {
- this.inityuan();
- },
- inityuan() {
- var chartDom = document.getElementById('shanxing_main');
- var myChart = echarts.init(chartDom);
- var option;
- this.allNumber = 0;
- let newdata = JSON.parse(JSON.stringify(this.rightList));
- newdata.forEach(item => {
- this.allNumber += item.count;
- let percent = item.percent;
- item.value = item.count;
- if (percent % 1 == 0) {
- item.name = item.book_name + ' ' + percent + '%';
- } else {
- item.name = item.book_name + ' ' + percent.toFixed(2) + '%';
- }
- });
- option = {
- series: [
- {
- name: 'Access From',
- type: 'pie',
- // radius: ["50%", "50%"],
- data: newdata.length>0?newdata:[],
- itemStyle: {
- // borderColor: "#fff",
- // borderWidth: 2,
- },
- top: 50,
- emphasis: {
- itemStyle: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- }
- }
- ],
- xAxis: {
- show: false, //不显示坐标轴线、坐标轴刻度线和坐标轴上的文字
- axisTick: {
- show: false //不显示坐标轴刻度线
- },
- axisLine: {
- show: false //不显示坐标轴线
- },
- axisLabel: {
- show: false //不显示坐标轴上的文字
- }
- }
- };
- option && myChart.setOption(option);
- },
- // 鼠标进入
- gaolangbzt(index, id) {
- var compareChart = echarts.getInstanceByDom(document.getElementById(id));
- compareChart.dispatchAction({
- type: 'highlight',
- seriesIndex: 0,
- dataIndex: index
- });
- },
- // 鼠标移出
- closegaolangbzt(index, id) {
- var compareChart = echarts.getInstanceByDom(document.getElementById(id));
- compareChart.dispatchAction({
- type: 'downplay',
- seriesIndex: 0,
- dataIndex: index
- });
- },
- changehzdata() {
- this.hzData = [];
- this.jfEvent(0);
- let arr = this.$route.query.keyword.split('');
- arr.forEach(item => {
- if (!/^[\u4e00-\u9fa5]/.test(item)) {
- return;
- }
- let result = pinyinUtil.getPinyin(item);
- let obj = {
- con: item,
- pinyin: result,
- hzDetail: {
- hz_json: null
- }
- };
- this.hzData.push(obj);
- this.ShowHzData = JSON.parse(JSON.stringify(this.hzData));
- });
- this.gethzJSON();
- },
- handleRefresh() {
- this.pinyinShow = true;
- this.shiyiShow = true;
- this.sizeIndex = 1;
- this.sort = 'down';
- this.KWIC_sortIndex = 0;
- this.cutSize(1);
- this.getdata();
- this.page = 1;
- },
- getdata(flag) {
- this.loading = true;
- this.scoreAHitNumber = 0
- let Mname = 'book-courseware_manager-GetCoursewareWordExampleSentenceList_Sort';
- let data = {
- // courseware_id: "003-20211012-17-BDUZ1JVCAN",
- courseware_id: '',
- // word: this.$route.query.keyword, // 单词
- word: this.$route.query.keyword,
- search_scope: 3, // 检索范围 0 【本章】,1【本教材】,2【本套教材】,3【系统所有教材】
- // 本章:同一本教材下,归属同一个第一级章节下的所有课件为同一章。
- is_contain_word_variants: false, // 是否包含单词变体例句
- is_contain_stat_data: true, //
- is_filter_repetitive_sentence: 'true',
- sort_mode: this.sort ? (this.sort == 'down' ? 'DESCENT' : 'ASCENT') : 'NO',
- compare_mode: this.patternIndex === 0 ? 'LENGTH' : 'KWIC',
- kwic_arrange_type: this.KWIC_sortIndex === 0 ? 'LEFT' : this.KWIC_sortIndex === 1 ? 'MID' : 'RIGHT',
- kwic_compare_by: 0
- };
- BookgetContent(Mname, data)
- .then(res => {
- this.allList = {
- sentence_list: [],
- sentence_list_sort_left: [],
- sentence_list_sort_mid: [],
- sentence_list_sort_right: [],
- stat_list_sentence_source_book: res.stat_list_sentence_source_book,
- stat_list_word_definition: res.stat_list_word_definition
- };
- if (res.sentence_list.length > 0) {
- res.stat_list_word_definition.forEach(item => {
- item.book_name = item.definition.replace(/<i>/g, "").replace(/<\/i>/g, "");
- });
- // 清理脏数据
- if(this.patternIndex === 1){
- this.removeRubbishData(res);
- }
- if(res.stat_list_word_definition.length===0){
- this.rightTopIndex = 1
- }
- if(this.rightTopIndex === 0){
- this.rightList = res.stat_list_word_definition;
- }else{
- this.rightList = res.stat_list_sentence_source_book;
- }
- this.getrightListdata();
- if(this.patternIndex === 0){
- this.allList.sentence_list = this.handleExample(res.sentence_list);
- }else{
- if(this.KWIC_sortIndex === 0){
- this.allList.sentence_list_sort_left = this.handleExample(res.sentence_list, 'left');
- }else if(this.KWIC_sortIndex === 1){
- this.allList.sentence_list_sort_mid = this.handleExample(res.sentence_list, 'mid');
- }else{
- this.allList.sentence_list_sort_right = this.handleExample(res.sentence_list, 'right');
- }
- }
- this.CurrentList = JSON.parse(JSON.stringify(res.sentence_list));
- this.padingEvetn();
- } else {
- this.CurrentList = [];
- this.ShowList = [];
- this.rightList = [];
- this.getrightListdata();
- }
- if (this.$route.query.keyword && flag) {
- this.changehzdata();
- } else {
- this.loading = false;
- }
- })
- .catch(err => {
- this.loading = false;
- });
- },
- handleExample(list, type) {
- if (list.length > 0) {
- list = list.map((item, index) => {
- item.number = index + 1;
- let str = item.source_courseware_name_path;
- item.show_source_courseware_name_path = str.slice(0, 8) + '...';
- if (type == 'left') {
- let arr = JSON.parse(JSON.stringify(item.sentence_fc_list));
- arr.forEach((items, indexs) => {
- if (indexs == item.sentence_fc_list_word_index) {
- arr[indexs] = `<span style=color:#DE4444;font-weight:700;>${arr[indexs]}</span>`;
- }
- });
- let data = this.changefiveword(arr, item.sentence_fc_list_word_index, type);
- item.resArr = data;
- } else if (type == 'right') {
- let sentence = JSON.parse(JSON.stringify(item.sentence));
- let arr = JSON.parse(JSON.stringify(item.sentence_fc_list));
- arr.forEach((items, indexs) => {
- if (indexs == item.sentence_fc_list_word_index) {
- arr[indexs] = `<span style=color:#DE4444;font-weight:700;>${arr[indexs]}</span>`;
- }
- });
- let data = this.changefiveword(arr, item.sentence_fc_list_word_index, type);
- item.resArr = data;
- } else if (type == 'mid') {
- let sentence = JSON.parse(JSON.stringify(item.sentence));
- let arr = JSON.parse(JSON.stringify(item.sentence_fc_list));
- arr.forEach((items, indexs) => {
- if (indexs == item.sentence_fc_list_word_index) {
- arr[indexs] = `<span style=color:#DE4444;font-weight:700;>${arr[indexs]}</span>`;
- }
- });
- let data = this.changefiveword(arr, item.sentence_fc_list_word_index, type);
- item.resArr = data;
- } else {
- this.scoreAHitNumber += item.position_list.length;
- let newsentence = JSON.parse(JSON.stringify(item.sentence));
- let res = '';
- for (let i = 0; i < item.position_list.length; i++) {
- let part1 = '';
- let part2 = '';
- let part3 = '';
- if (item.position_list.length > 1) {
- if (i == 0) {
- part1 = newsentence.substring(0, item.position_list[i].begin);
- part2 = newsentence.substring(item.position_list[i].begin, item.position_list[i].end);
- part3 = newsentence.substring(item.position_list[i].end, item.position_list[i + 1].begin);
- } else if (i == item.position_list.length - 1) {
- part2 = newsentence.substring(item.position_list[i].begin, item.position_list[i].end);
- part3 = newsentence.substring(item.position_list[i].end);
- } else {
- part2 = newsentence.substring(item.position_list[i].begin, item.position_list[i].end);
- part3 = newsentence.substring(item.position_list[i].end, item.position_list[i + 1].begin);
- }
- } else {
- part1 = newsentence.substring(0, item.position_list[i].begin);
- part2 = newsentence.substring(item.position_list[i].begin, item.position_list[i].end);
- part3 = newsentence.substring(item.position_list[i].end);
- }
- res += part1 + '<span style="color:#DE4444;">' + part2 + '</span>' + part3;
- }
- item.res = res;
- }
- return item;
- });
- return list;
- } else {
- return [];
- }
- },
- changefiveword(arr, index, type) {
- let num = 6;
- let colorIndex = 0;
- let colorList = ['#4D7EFF', '#A4430F', '#9342C5', '#FF8718', '#1DAA91'];
- for (let i = 1; i < num; i++) {
- if (type == 'left') {
- if (index - i >= 0) {
- if (this.chsFhList.indexOf(arr[index - i]) == -1) {
- arr[index - i] = `<span style=color:${colorList[colorIndex]};>${arr[index - i]}</span>`;
- colorIndex++;
- } else {
- num++;
- }
- }
- } else if (type == 'right') {
- if (index + i <= arr.length - 1) {
- if (this.chsFhList.indexOf(arr[index + i]) == -1) {
- arr[index + i] = `<span style=color:${colorList[colorIndex]};>${arr[index + i]}</span>`;
- colorIndex++;
- } else {
- num++;
- }
- }
- }
- }
- let newarr = [];
- let arr1 = [];
- let arr2 = [];
- let arr3 = [];
- arr.forEach((item, i) => {
- if (i < index) {
- arr1.push(item);
- } else if (i == index) {
- arr2.push(item);
- } else {
- arr3.push(item);
- }
- });
- newarr.push(arr1);
- newarr.push(arr2);
- newarr.push(arr3);
- return newarr;
- },
- // 处理分页
- padingEvetn() {
- let arr = JSON.parse(JSON.stringify(this.CurrentList));
- let newarr = arr.splice((this.page - 1) * this.pageSize, this.pageSize);
- this.ShowList = JSON.parse(JSON.stringify(newarr));
- },
- // 删除脏数据
- removeRubbishData(data) {
- if(data.sentence_list.length>0){
- for (let i = data.sentence_list.length - 1; i--; ) {
- if (data.sentence_list[i].sentence_fc_list.length <= 1) {
- data.sentence_list.splice(i, 1);
- }
- }
- }
- }
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created() {},
- //生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {
- this.getdata(true);
- },
- //生命周期-创建之前
- beforeCreated() {},
- //生命周期-挂载之前
- beforeMount() {},
- //生命周期-更新之前
- beforUpdate() {},
- //生命周期-更新之后
- updated() {},
- //生命周期-销毁之前
- beforeDestory() {},
- //生命周期-销毁完成
- destoryed() {},
- //如果页面有keep-alive缓存功能,这个函数会触发
- activated() {}
- };
- </script>
- <style lang="scss" scoped>
- /* @import url(); 引入css类 */
- .result {
- min-height: 100%;
- > .main {
- min-height: 100%;
- padding-top: 33px;
- padding-bottom: 66px;
- background: #f2f2f2;
- }
- .hanzi_list {
- position: relative;
- box-sizing: border-box;
- width: 1200px;
- padding: 40px 13px;
- margin: 0 auto;
- background: #fff;
- border-radius: 8px;
- .top_jf {
- width: 128px;
- }
- .j_f {
- display: flex;
- width: 60px;
- height: 24px;
- margin-bottom: 16px;
- margin-left: 33px;
- > :nth-child(1) {
- border-right: none;
- border-top-left-radius: 2px;
- border-bottom-left-radius: 2px;
- }
- > :nth-child(2) {
- border-left: none;
- border-top-right-radius: 2px;
- border-bottom-right-radius: 2px;
- }
- div {
- width: 30px;
- height: 24px;
- font-size: 14px;
- font-weight: 400;
- line-height: 24px;
- color: #de4444;
- text-align: center;
- cursor: pointer;
- border: 2px solid #de4444;
- }
- .sele {
- color: #fff;
- background: #de4444;
- }
- }
- .list_one_box {
- max-height: 750px;
- padding: 0 27px;
- &::-webkit-scrollbar-track-piece {
- background: #fff;
- }
- &::-webkit-scrollbar {
- width: 4px;
- }
- &::-webkit-scrollbar-thumb {
- background: #d9d9d9;
- border-radius: 20px;
- }
- }
- .list_one {
- display: flex;
- align-items: flex-start;
- margin-bottom: 20px;
- .Highlight {
- display: flex;
- flex: 1;
- flex-wrap: wrap;
- margin-left: 22px;
- .play_audio {
- display: flex;
- align-items: center;
- width: 100%;
- margin-bottom: 13px;
- img {
- width: 16px;
- height: 16px;
- cursor: pointer;
- }
- span {
- margin-left: 5px;
- font-family: 'League';
- font-size: 12px;
- font-weight: 400;
- color: #000;
- }
- }
- }
- .row {
- margin-right: 8px;
- margin-bottom: 8px;
- .number {
- flex-shrink: 0;
- width: 64px;
- height: 20px;
- margin-top: 9px;
- line-height: 20px;
- color: rgba(0, 0, 0, 50%);
- text-align: center;
- background: #f0f0f0;
- border-radius: 22px;
- }
- }
- }
- .shouqi {
- position: absolute;
- right: 26px;
- bottom: 13px;
- display: flex;
- justify-content: flex-end;
- margin-top: 21;
- span {
- display: flex;
- align-items: center;
- font-size: 16px;
- font-weight: 400;
- line-height: 24px;
- color: rgba(0, 0, 0, 50%);
- cursor: pointer;
- }
- img {
- width: 24px;
- height: 24px;
- margin-right: 4px;
- }
- }
- }
- .txt_imgtable {
- display: flex;
- width: 1200px;
- margin: 0 auto;
- margin-top: 8px;
- .left {
- position: relative;
- width: 562px;
- padding-bottom: 58px;
- margin-right: 8px;
- background: #fff;
- border-bottom: 1px solid rgba(0, 0, 0, 8%);
- border-radius: 8px;
- > .top {
- display: flex;
- align-items: center;
- justify-content: space-between;
- height: 44px;
- font-size: 12px;
- font-weight: 400;
- color: #000;
- border-bottom: 1px solid rgba(0, 0, 0, 8%);
- > div {
- display: flex;
- align-items: center;
- }
- .KWIC_sort {
- display: flex;
- margin-left: 24px;
- span {
- display: inline-block;
- display: flex;
- align-items: center;
- justify-content: center;
- width: 28px;
- height: 28px;
- cursor: pointer;
- background: #fff;
- border-radius: 4px;
- }
- .sele {
- background: #f0f0f0;
- }
- .sort {
- img {
- width: 14px;
- height: 12px;
- }
- }
- .down {
- img {
- width: 16px;
- height: 16px;
- }
- }
- }
- .pattern {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 144px;
- height: 28px;
- margin-left: 16px;
- background: #eee;
- border-radius: 4px;
- > div {
- width: 68px;
- height: 24px;
- font-size: 12px;
- font-weight: 400;
- line-height: 24px;
- color: #888;
- text-align: center;
- cursor: pointer;
- border-radius: 2px;
- }
- .sele {
- color: #000;
- background: #fff;
- box-shadow: 0 2px 2px rgba(0, 0, 0, 8%);
- }
- }
- .lang_sort {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 54px;
- height: 28px;
- margin-left: 24px;
- cursor: pointer;
- background: #eee;
- border-radius: 4px;
- img {
- width: 16px;
- height: 16px;
- margin-left: 2px;
- }
- }
- .refresh {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 28px;
- height: 28px;
- margin-left: 8px;
- cursor: pointer;
- background: #eee;
- border-radius: 4px;
- img {
- width: 16px;
- height: 16px;
- }
- }
- .size {
- margin-right: 12px;
- span {
- padding: 4px;
- font-size: 14px;
- cursor: pointer;
- }
- .sele {
- background: #e6e6e6;
- border-radius: 4px;
- }
- }
- }
- .main {
- // height: 95%;
- .list {
- margin-top: 16px;
- .one {
- padding: 0 16px;
- margin-bottom: 8px;
- .top {
- display: flex;
- // align-items: center;
- // flex-flow: wrap;
- width: 100%;
- .number {
- flex-shrink: 0;
- width: 22px;
- margin-right: 8px;
- font-size: 14px;
- font-weight: 400;
- line-height: 21px;
- color: rgba(0, 0, 0, 30%);
- text-align: right;
- &-1-false {
- margin-top: 3px;
- }
- &-0-true {
- margin-top: 21px;
- }
- &-0-false {
- margin-top: 5px;
- }
- &-2-true {
- margin-top: 17px;
- }
- &-2-false {
- margin-top: 1px;
- }
- }
- img {
- width: 16px;
- height: 16px;
- margin-right: 8px;
- cursor: pointer;
- &.speaker-1-false {
- margin-top: 6px;
- }
- &.speaker-0-true {
- margin-top: 24px;
- }
- &.speaker-0-false {
- margin-top: 8px;
- }
- &.speaker-2-true {
- margin-top: 20px;
- }
- &.speaker-2-false {
- margin-top: 4px;
- }
- }
- .words {
- // display: flex;
- // align-items: flex-end;
- // flex-flow: wrap;
- font-family: 'FZJCGFKTK';
- word-break: break-all;
- > div {
- .pinyin {
- margin-bottom: 2px;
- font-family: 'League';
- font-size: 12px;
- font-weight: 500;
- color: rgba(0, 0, 0, 50%);
- text-align: center;
- }
- .con {
- font-family: 'FZJCGFKTK';
- font-size: 20px;
- font-weight: 400;
- color: #000;
- text-align: center;
- }
- }
- }
- .shiyi {
- font-size: 12px;
- font-weight: 400;
- line-height: 24px;
- color: #48a3e6;
- font-family: 'robot', 'FZJCGFKTK';
- &-0 {
- line-height: 32px;
- }
- &-1 {
- line-height: 28px;
- }
- }
- }
- .bottom {
- font-size: 12px;
- font-weight: 400;
- line-height: 150%;
- color: rgba(0, 0, 0, 30%);
- text-align: right;
- }
- }
- .kwic_one {
- display: flex;
- align-items: center;
- padding: 0 16px;
- > :nth-child(1) {
- justify-content: flex-end;
- width: 16px;
- margin-right: 16px;
- }
- .laiyuan {
- width: 117px;
- overflow: hidden;
- font-size: 14px;
- font-weight: 400;
- line-height: 22px;
- color: rgba(0, 0, 0, 65%);
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .word {
- display: flex;
- justify-content: center;
- width: 361px;
- height: 22px;
- margin-left: 16px;
- overflow: hidden;
- font-family: 'FZJCGFKTK';
- font-size: 14px;
- font-weight: 400;
- line-height: 22px;
- color: #000;
- white-space: nowrap;
- opacity: 1;
- > :nth-child(1) {
- // direction: rtl;
- // unicode-bidi: plaintext;
- // text-align: right;
- display: flex;
- justify-content: flex-end;
- width: 172px;
- overflow: hidden;
- white-space: nowrap;
- }
- > :nth-child(3) {
- width: 172px;
- overflow: hidden;
- text-align: left;
- white-space: nowrap;
- direction: ltr;
- unicode-bidi: plaintext;
- }
- }
- }
- }
- .page {
- position: absolute;
- bottom: 16px;
- box-sizing: border-box;
- display: flex;
- justify-content: space-between;
- width: 562px;
- padding: 0 10px 0 12px;
- .text {
- display: flex;
- align-items: center;
- margin-right: 16px;
- font-size: 14px;
- font-weight: 400;
- line-height: 22px;
- color: rgba(0, 0, 0, 60%);
- text-align: center;
- }
- }
- }
- }
- .right {
- width: 630px;
- padding-bottom: 39px;
- background: #fff;
- border-bottom: 1px solid rgba(0, 0, 0, 8%);
- border-radius: 8px;
- .top {
- display: flex;
- align-items: center;
- height: 44px;
- border-bottom: 1px solid rgba(0, 0, 0, 8%);
- > div {
- display: flex;
- align-items: center;
- justify-content: center;
- // width: 84px;
- padding: 0 2px;
- height: 28px;
- margin-left: 16px;
- background: #eee;
- border-radius: 4px;
- > div {
- width: 40px;
- height: 24px;
- font-size: 12px;
- font-weight: 400;
- line-height: 24px;
- color: #888;
- text-align: center;
- cursor: pointer;
- border-radius: 2px;
- }
- .sele {
- color: #000;
- background: #fff;
- box-shadow: 0 2px 2px rgba(0, 0, 0, 8%);
- }
- }
- }
- .list {
- width: 598px;
- margin: 0 auto;
- max-height: 1450px;
- overflow: auto;
- .one {
- display: flex;
- justify-content: space-between;
- padding: 12px;
- font-size: 14px;
- font-weight: 400;
- line-height: 22px;
- color: #333;
- cursor: pointer;
- border-bottom: 1px solid #eee;
- > :nth-child(1) {
- text-align: left;
- }
- > div {
- width: 186px;
- text-align: right;
- }
- }
- .all {
- font-size: 14px;
- font-weight: 600;
- line-height: 22px;
- color: #333;
- border-bottom: none;
- }
- }
- }
- }
- }
- </style>
- <style lang="scss">
- .result {
- .el-switch__core {
- width: 26px !important;
- height: 16px;
- }
- .el-switch__core::after {
- top: 3px;
- width: 8px;
- height: 8px;
- }
- .el-switch.is-checked .el-switch__core::after {
- margin-left: -10px;
- }
- .el-switch__label.is-active {
- color: #000;
- }
- .page {
- .el-pagination.is-background .el-pager li:not(.disabled).active {
- background-color: #0052d9;
- }
- .el-pager li {
- background: #fff;
- border: 1px solid #dcdcdc;
- border-radius: 3px;
- }
- }
- }
- .el-loading-mask {
- z-index: 200000 !important;
- }
- </style>
|