natasha преди 1 година
родител
ревизия
03ea7c8451
променени са 5 файла, в които са добавени 231 реда и са изтрити 67 реда
  1. 2 0
      src/components/Header.vue
  2. 1 1
      src/utils/request.js
  3. 214 61
      src/views/corpus/seekPage.vue
  4. 11 4
      src/views/teacher-dev/TextAnalysis.vue
  5. 3 1
      src/views/wordcard/table.vue

+ 2 - 0
src/components/Header.vue

@@ -743,6 +743,8 @@ export default {
     font-weight: 400;
     line-height: 19px;
     color: #000;
+    width: 64px;
+    text-align: right;
   }
 
   .numbre-input {

+ 1 - 1
src/utils/request.js

@@ -15,7 +15,7 @@ axios.defaults.headers['X-Requested-With'] = 'XMLHttpRequest';
 const service = axios.create({
   baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
   // withCredentials: true, // send cookies when cross-domain requests
-  timeout: 60000, // request timeout
+  timeout: 600000, // request timeout
 });
 // request interceptor
 service.interceptors.request.use(

+ 214 - 61
src/views/corpus/seekPage.vue

@@ -11,7 +11,7 @@
         <button @click="getdata(true)">搜索</button>
         <el-popover v-model="visibleOption" placement="bottom" width="335" trigger="click">
           <div class="set_corpus_dv">
-            <span>选择范围</span>
+            <span>教材</span>
             <!-- <el-select v-model="corpus.scope" style="width: 205px" placeholder="请选择">
               <el-option v-for="(itemD, indexD) in scopeList" :key="indexD" :label="itemD.label" :value="itemD.value" />
             </el-select> -->
@@ -25,7 +25,7 @@
             ></el-cascader>
           </div>
           <div class="set_corpus_dv">
-            <span>句长度</span>
+            <span>句长度</span>
             <el-input
               v-model="corpus.sentenceStart"
               style="width: 55px; margin-right: 8px"
@@ -53,7 +53,7 @@
     <div class="txt">包含{{ book_count }}本教材、{{ word_count }}个字词,{{ sentence_count }}个例句</div>
     <div class="cx-list" v-if="showResult">
       <div class="cx-list-box">
-        <span>{{ keyword }}</span>
+        <span>{{ oldKey }}</span>
         <span>{{ allList.word_level_name }}</span>
         <label v-for="(items, indexs) in allList.word_cx_list" :key="indexs"
           ><span>{{ items.code }}</span
@@ -225,21 +225,17 @@
                      -->
                 </div>
                 <div class="bottom">
-                  {{ item.source_courseware_name_path }}
+                  {{
+                    item.source_courseware_name_path_short
+                      ? item.source_courseware_name_path_short
+                      : 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="{
@@ -292,6 +288,22 @@
                     </div>
                   </div>
                 </div>
+                <el-tooltip effect="dark" placement="bottom">
+                  <div slot="content">
+                    {{
+                      item.source_courseware_name_path_short
+                        ? item.source_courseware_name_path_short
+                        : item.source_courseware_name_path
+                    }}
+                  </div>
+                  <div class="laiyuan">
+                    {{
+                      item.source_courseware_name_path_short
+                        ? item.source_courseware_name_path_short
+                        : item.source_courseware_name_path
+                    }}
+                  </div>
+                </el-tooltip>
               </div>
             </template>
           </div>
@@ -331,7 +343,7 @@
           </div>
         </div>
         <div class="bottom">
-          <div id="shanxing_main" style="width: 630px; height: 398px"></div>
+          <div id="shanxing_main" style="width: 720px; height: 600px"></div>
           <div class="list" v-if="rightList.length > 0">
             <div class="one all" style="border-bottom: 1px solid #eee">
               <div style="width: 60%">{{ rightTopIndex == 1 ? '来源' : '释义' }}</div>
@@ -348,11 +360,15 @@
               class="one"
               :style="{
                 borderBottom: i == rightList.length - 1 ? 'none' : '1px solid #eeeeee',
-                backgroundColor: selectLaiyuanBookIdList.indexOf(item.book_id) > -1 ? '#F2F3F5' : '',
+                backgroundColor:
+                  selectLaiyuanBookIdList.indexOf(item.book_id) > -1 ||
+                  selectShiyiBookIdList.indexOf(item.definition) > -1
+                    ? '#F2F3F5'
+                    : '',
               }"
               @mouseover="gaolangbzt(i, 'shanxing_main')"
               @mouseout="closegaolangbzt(i, 'shanxing_main')"
-              @click="handleBookLiju(item.book_id)"
+              @click="handleBookLiju(item, rightTopIndex)"
             >
               <div style="width: 60%">
                 <span></span>
@@ -374,7 +390,7 @@
                 <span>{{ allNumber }}</span>
               </div>
               <div style="width: 20%">
-                <span>100%</span>
+                <span>{{ rightTopIndex == 1 ? allPercent.toFixed(2) : '100.00' }}%</span>
               </div>
             </div>
           </div>
@@ -404,6 +420,7 @@ export default {
     //这里存放数据
     return {
       keyword: this.$route.query.keyword ? this.$route.query.keyword : null,
+      oldKey: '',
       AccessToken: this.$route.query.AccessToken,
       AppID: this.$route.query.AppID,
       showPage: false,
@@ -443,6 +460,7 @@ export default {
       rightList: [],
       KWIC_sortIndex: 0,
       allNumber: 0,
+      allPercent: 0,
       conSize: 20,
       pinyinSize: 12,
       allList: [],
@@ -455,9 +473,12 @@ export default {
       allLevels: [],
       levelList: [],
       selectLaiyuanBookIdList: [], // 选中右侧来源书籍列表id
+      selectShiyiBookIdList: [], // 选中右侧释义书籍列表id
       selectCurrent: 0,
       showResult: false,
       shiyiList: [], //含有释义例句列表
+      bookListObj: {}, //书籍id和名称对应关系
+      bookSourceObj: {}, //书籍来源id对应关系
     };
   },
   //计算属性 类似于data概念
@@ -491,6 +512,7 @@ export default {
     getLevelList() {
       this.allLevels = [];
       this.levelList = [];
+      this.bookListObj = {};
       BookgetContent('book-book_manager-GetBookList', {
         publish_status: 1,
       }).then((res) => {
@@ -501,6 +523,7 @@ export default {
             item.value = item.id;
             item.label = item.name;
             this.allLevels.push(item.id);
+            this.$set(this.bookListObj, item.id, item.name);
           });
           // this.levelList = this.levelList.concat(res.book_list);
 
@@ -533,9 +556,12 @@ export default {
       var myChart = echarts.init(chartDom);
       var option;
       this.allNumber = 0;
+      this.allPercent = 0;
       let newdata = JSON.parse(JSON.stringify(this.rightList));
+
       newdata.forEach((item) => {
         this.allNumber += item.count;
+        this.allPercent += item.percent;
         let percent = item.percent;
         item.value = item.count;
         if (percent % 1 == 0) {
@@ -544,58 +570,131 @@ export default {
           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,
+      if (this.rightTopIndex === 1 && this.corpus.scope.length > 0) {
+        let data = [];
+        let tempdata = {};
+        this.corpus.scope.forEach((str) => {
+          if (!tempdata[str[0]]) {
+            let obj = {
+              name: str[0],
+              children: [],
+            };
+            tempdata[str[0]] = obj;
+          }
+          let childObj = {
+            name: '',
+            value: 0,
+          };
+          if (this.bookSourceObj[str[1]]) {
+            childObj.name = this.bookSourceObj[str[1]].book_name + ' ' + this.bookSourceObj[str[1]].percent + '%';
+            childObj.value = this.bookSourceObj[str[1]].count;
+          }
+          tempdata[str[0]].children.push(childObj);
+        });
+        for (const key in tempdata) {
+          data.push(tempdata[key]);
+        }
+        option = {
+          title: {
+            text: '',
+            subtext: '',
+            textStyle: {
+              fontSize: 14,
+              align: 'center',
             },
-            top: 50,
+            subtextStyle: {
+              align: 'center',
+            },
+            sublink: '',
+          },
+          series: {
+            type: 'sunburst',
+            data: data,
+            radius: [0, '95%'],
+            sort: undefined,
             emphasis: {
+              focus: 'ancestor',
+            },
+            levels: [
+              {},
+              {
+                r0: '5%',
+                r: '45%',
+                itemStyle: {
+                  borderWidth: 2,
+                },
+                label: {
+                  align: 'left',
+                },
+              },
+              {
+                r0: '25%',
+                r: '55%',
+                label: {
+                  position: 'outside',
+                },
+              },
+            ],
+          },
+        };
+      } else {
+        option = {
+          series: [
+            {
+              name: 'Access From',
+              type: 'pie',
+              // radius: ["50%", "50%"],
+              data: newdata.length > 0 ? newdata : [],
               itemStyle: {
-                shadowBlur: 10,
-                shadowOffsetX: 0,
-                shadowColor: 'rgba(0, 0, 0, 0.5)',
+                //   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, //不显示坐标轴上的文字
+            },
           },
-        ],
-        xAxis: {
-          show: false, //不显示坐标轴线、坐标轴刻度线和坐标轴上的文字
-          axisTick: {
-            show: false, //不显示坐标轴刻度线
-          },
-          axisLine: {
-            show: false, //不显示坐标轴线
-          },
-          axisLabel: {
-            show: false, //不显示坐标轴上的文字
-          },
-        },
-      };
-      option && myChart.setOption(option);
-      if (this.rightTopIndex === 1) {
-        let number = 0;
-        let _this = this;
-        myChart.on('click', function (param) {
-          //添加点击事件
-          myChart.dispatchAction({ type: 'highlight', dataIndex: param.dataIndex }); //激活点击区域高亮
-          if (param.dataIndex !== number) {
-            // 当鼠标点击的时候 消除上一个扇区的高亮
-            myChart.dispatchAction({ type: 'downplay', dataIndex: number });
-          }
-          number = param.dataIndex; //接住当前扇区的dataIndex
-          _this.handleBookLiju(param.data.book_id);
-        });
+        };
       }
+
+      option && myChart.setOption(option);
+      let number = 0;
+      let _this = this;
+      myChart.on('click', function (param) {
+        //添加点击事件
+        myChart.dispatchAction({ type: 'highlight', dataIndex: param.dataIndex }); //激活点击区域高亮
+        if (param.dataIndex !== number) {
+          // 当鼠标点击的时候 消除上一个扇区的高亮
+          myChart.dispatchAction({ type: 'downplay', dataIndex: number });
+        }
+        number = param.dataIndex; //接住当前扇区的dataIndex
+        if (_this.rightTopIndex === 0) {
+          _this.handleShiyiLiju(param.data.definition);
+        } else {
+          _this.handleBookLiju(param.data);
+        }
+      });
     },
     // 鼠标进入
     gaolangbzt(index, id) {
+      if (this.rightTopIndex === 1) return;
       var compareChart = echarts.getInstanceByDom(document.getElementById(id));
       compareChart.dispatchAction({
         type: 'highlight',
@@ -613,15 +712,34 @@ export default {
       });
     },
     // 计算选中教材例句
-    handleBookLiju(id) {
+    handleBookLiju(item, index) {
+      if (index === 0) {
+        this.handleShiyiLiju(item.definition);
+        return false;
+      }
+      let id = item.book_id;
       if (!id) return false;
       if (this.selectLaiyuanBookIdList.indexOf(id) > -1) {
         this.selectLaiyuanBookIdList.splice(this.selectLaiyuanBookIdList.indexOf(id), 1);
       } else {
         this.selectLaiyuanBookIdList.push(id);
       }
+      this.page = 1;
       this.padingEvetn();
+      window.scrollTo(0, 0);
+    },
+    // 计算选中教材例句
+    handleShiyiLiju(shiyi) {
+      if (!shiyi) return false;
+      if (this.selectShiyiBookIdList.indexOf(shiyi) > -1) {
+        this.selectShiyiBookIdList.splice(this.selectShiyiBookIdList.indexOf(shiyi), 1);
+      } else {
+        this.selectShiyiBookIdList.push(shiyi);
+      }
+      this.shiyiShow = this.selectShiyiBookIdList.length > 0;
       this.page = 1;
+      this.padingEvetns();
+      window.scrollTo(0, 0);
     },
     changehzdata() {
       this.hzData = [];
@@ -661,12 +779,14 @@ export default {
         return;
       }
       this.loading = true;
+      this.oldKey = this.keyword.trim();
       this.showResult = true;
       this.scoreAHitNumber = 0;
       let selectBookId = [];
       this.corpus.scope.forEach((item) => {
         selectBookId.push(item[1]);
       });
+      this.bookSourceObj = {};
       let Mname = 'book-courseware_manager-GetCoursewareWordExampleSentenceList_Sort';
       let data = {
         // courseware_id: "003-20211012-17-BDUZ1JVCAN",
@@ -697,12 +817,18 @@ export default {
             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_sentence_source_book_series_code: res.stat_list_sentence_source_book_series_code,
             stat_list_word_definition: res.stat_list_word_definition,
             word_level_name: res.word_level_name,
             word_cx_list: res.word_cx_list,
           };
 
+          res.stat_list_sentence_source_book.forEach((itesb) => {
+            itesb.name = itesb.book_name;
+            itesb.value = itesb.count;
+            this.$set(this.bookSourceObj, itesb.book_id, itesb);
+          });
           if (res.sentence_list.length > 0) {
             res.stat_list_word_definition.forEach((item) => {
               // item.book_name_s = item.definition;
@@ -915,6 +1041,32 @@ export default {
         });
       }
       this.selectCurrent = arrs.length;
+      arrs.forEach((item, index) => {
+        item.number = index + 1;
+      });
+      let newarr = arrs.splice((this.page - 1) * this.pageSize, this.pageSize);
+      this.ShowList = JSON.parse(JSON.stringify(newarr));
+    },
+    padingEvetns() {
+      let arr = JSON.parse(JSON.stringify(this.shiyiList));
+      let arrs = [];
+      if (this.selectShiyiBookIdList.length === 0) {
+        arrs = JSON.parse(JSON.stringify(this.CurrentList));
+      } else {
+        arr.forEach((item) => {
+          if (item.word_definition_list.length > 0) {
+            this.selectShiyiBookIdList.forEach((items) => {
+              if (item.word_definition_list.indexOf(items) > -1) {
+                arrs.push(item);
+              }
+            });
+          }
+        });
+      }
+      this.selectCurrent = arrs.length;
+      arrs.forEach((item, index) => {
+        item.number = index + 1;
+      });
       let newarr = arrs.splice((this.page - 1) * this.pageSize, this.pageSize);
       this.ShowList = JSON.parse(JSON.stringify(newarr));
     },
@@ -1012,7 +1164,7 @@ export default {
       if (this.rightTopIndex == 0) {
         this.rightList = this.allList.stat_list_word_definition;
       } else {
-        this.rightList = this.allList.stat_list_sentence_source_book_series_code;
+        this.rightList = this.allList.stat_list_sentence_source_book;
       }
       //   if (this.rightList.length > 0) {
       this.inityuan();
@@ -1400,6 +1552,7 @@ export default {
             display: flex;
             align-items: center;
             padding: 0 16px;
+            justify-content: space-between;
 
             > :nth-child(1) {
               justify-content: flex-end;
@@ -1528,7 +1681,7 @@ export default {
         display: flex;
       }
       .list {
-        width: 598px;
+        width: 508px;
         margin: 0 auto;
         max-height: 1450px;
         overflow: auto;

+ 11 - 4
src/views/teacher-dev/TextAnalysis.vue

@@ -35,7 +35,14 @@
       <div v-if="data" class="list_main">
         <div class="title">
           <span style="margin-right: 16px">文本列表:</span>
-          <el-input v-model="searchInput" placeholder="检索" @keyup.enter.native="pageQueryMyTextAnalyseRecordList" />
+          <el-input v-model="searchInput" placeholder="检索" @keyup.enter.native="pageQueryMyTextAnalyseRecordList"
+            ><el-button
+              style="padding: 12px"
+              @click="pageQueryMyTextAnalyseRecordList"
+              slot="append"
+              icon="el-icon-search"
+            ></el-button
+          ></el-input>
         </div>
         <div v-loading="recordLoading" class="list">
           <div class="list-th">
@@ -315,9 +322,9 @@ export default {
       })
         .then((data) => {
           this.data = data;
-          if (bol) {
-            this.$message.success('已存储至下方列表');
-          }
+          // if (bol) {
+          //   this.$message.success('已存储至下方列表');
+          // }
         })
         .finally(() => {
           this.recordLoading = false;

+ 3 - 1
src/views/wordcard/table.vue

@@ -7,7 +7,9 @@
         <div class="right" @click="Startcread">开始创建</div>
         <div class="number_cread">
           <span class="left">文件数量:{{ data.total_count }}</span>
-          <el-input v-model="searchInput" placeholder="检索" @keyup.enter.native="getdata" />
+          <el-input v-model="searchInput" placeholder="检索" @keyup.enter.native="getdata"
+            ><el-button style="padding: 12px" @click="getdata" slot="append" icon="el-icon-search"></el-button
+          ></el-input>
         </div>
         <div class="table">
           <div>