فهرست منبع

文本分析列表和修改文本

natasha 1 سال پیش
والد
کامیت
d79f70dbf9
2فایلهای تغییر یافته به همراه17 افزوده شده و 50 حذف شده
  1. 15 48
      src/views/Textanalysis/index.vue
  2. 2 2
      src/views/teacher-dev/TextAnalysis.vue

+ 15 - 48
src/views/Textanalysis/index.vue

@@ -265,7 +265,7 @@
                   <span>{{ base.vocabularyCount }} / {{ base.vocabularyTextCount }}</span>
                   <span>{{ base.vocabularyCount }} / {{ base.vocabularyTextCount }}</span>
                 </div>
                 </div>
               </div>
               </div>
-              <!-- <span class="edit-btn" @click="editArticle()"><i class="el-icon-edit"></i>修改文本</span> -->
+              <span class="edit-btn" @click="editArticle()"><i class="el-icon-edit"></i>修改文本</span>
             </div>
             </div>
             <div class="articel">
             <div class="articel">
               <div v-for="(items, index) in ArticelData" :key="index + 'paragraph'" class="paragraph">
               <div v-for="(items, index) in ArticelData" :key="index + 'paragraph'" class="paragraph">
@@ -309,6 +309,7 @@
                                   fontSize: wordFontsize + 'px',
                                   fontSize: wordFontsize + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   background: word.color ? word.color : '',
                                   background: word.color ? word.color : '',
+                                  whiteSpace: 'pre',
                                   color: word.color
                                   color: word.color
                                     ? '#000'
                                     ? '#000'
                                     : !xifen
                                     : !xifen
@@ -379,6 +380,7 @@
                                   fontSize: wordFontsize + 'px',
                                   fontSize: wordFontsize + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   background: word.color ? word.color : '',
                                   background: word.color ? word.color : '',
+                                  whiteSpace: 'pre',
                                   color: word.color
                                   color: word.color
                                     ? '#000'
                                     ? '#000'
                                     : !xifen
                                     : !xifen
@@ -456,6 +458,7 @@
                                   fontSize: wordFontsize + 'px',
                                   fontSize: wordFontsize + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   background: word.color ? word.color : '',
                                   background: word.color ? word.color : '',
+                                  whiteSpace: 'pre',
                                   color: word.color
                                   color: word.color
                                     ? '#000'
                                     ? '#000'
                                     : !xifen
                                     : !xifen
@@ -536,6 +539,7 @@
                                   fontSize: wordFontsize + 'px',
                                   fontSize: wordFontsize + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   background: word.color ? word.color : '',
                                   background: word.color ? word.color : '',
+                                  whiteSpace: 'pre',
                                   color: word.color
                                   color: word.color
                                     ? '#000'
                                     ? '#000'
                                     : !xifen
                                     : !xifen
@@ -617,6 +621,7 @@
                                   fontSize: wordFontsize + 'px',
                                   fontSize: wordFontsize + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   background: word.color ? word.color : '',
                                   background: word.color ? word.color : '',
+                                  whiteSpace: 'pre',
                                   color: word.color
                                   color: word.color
                                     ? '#000'
                                     ? '#000'
                                     : !xifen
                                     : !xifen
@@ -687,6 +692,7 @@
                                   fontSize: wordFontsize + 'px',
                                   fontSize: wordFontsize + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   background: word.color ? word.color : '',
                                   background: word.color ? word.color : '',
+                                  whiteSpace: 'pre',
                                   color: word.color
                                   color: word.color
                                     ? '#000'
                                     ? '#000'
                                     : !xifen
                                     : !xifen
@@ -768,6 +774,7 @@
                               fontSize: wordFontsize + 'px',
                               fontSize: wordFontsize + 'px',
                               lineHeight: wordLineHeight + 'px',
                               lineHeight: wordLineHeight + 'px',
                               background: word.color ? word.color : '',
                               background: word.color ? word.color : '',
+                              whiteSpace: 'pre',
                               color: word.color
                               color: word.color
                                 ? '#000'
                                 ? '#000'
                                 : !xifen
                                 : !xifen
@@ -838,6 +845,7 @@
                             fontSize: wordFontsize + 'px',
                             fontSize: wordFontsize + 'px',
                             lineHeight: wordLineHeight + 'px',
                             lineHeight: wordLineHeight + 'px',
                             background: word.color ? word.color : '',
                             background: word.color ? word.color : '',
+                            whiteSpace: 'pre',
                             color: word.color
                             color: word.color
                               ? '#000'
                               ? '#000'
                               : !xifen
                               : !xifen
@@ -915,7 +923,7 @@
         <span class="left">{{ noPosContent.length }}/{{ 3000 }}</span>
         <span class="left">{{ noPosContent.length }}/{{ 3000 }}</span>
         <div>
         <div>
           <el-button @click="handleClose">取 消</el-button>
           <el-button @click="handleClose">取 消</el-button>
-          <el-button type="primary" @click="saveWord(id)">确 定</el-button>
+          <el-button type="primary" @click="saveWord(id)" :loading="loading">确 定</el-button>
         </div>
         </div>
       </span>
       </span>
     </el-dialog>
     </el-dialog>
@@ -928,7 +936,7 @@ import * as echarts from 'echarts';
 import 'echarts/lib/chart/bar';
 import 'echarts/lib/chart/bar';
 import 'echarts/lib/component/legend';
 import 'echarts/lib/component/legend';
 import 'echarts/lib/component/title';
 import 'echarts/lib/component/title';
-import { postapi, publicMethods } from '@/api/api';
+import { reparse, publicMethods } from '@/api/api';
 import { levelMap } from '../../common/data';
 import { levelMap } from '../../common/data';
 import { json2excel } from '@/utils/setMethods';
 import { json2excel } from '@/utils/setMethods';
 
 
@@ -1918,9 +1926,6 @@ export default {
                 });
                 });
                 posStr += '\n';
                 posStr += '\n';
               });
               });
-              if (index !== newdata.length - 1) {
-                posStr += '\n';
-              }
             });
             });
             this.noPosContent = posStr;
             this.noPosContent = posStr;
             this.loading = false;
             this.loading = false;
@@ -1973,53 +1978,15 @@ export default {
       this.editArticleFlag = false;
       this.editArticleFlag = false;
     },
     },
     saveWord(analyse_record_id) {
     saveWord(analyse_record_id) {
-      let saveArr = [];
-      let arr = this.noPosContent.split('\n');
-      let indexP = 0; // 段落索引
-      let indexS = 0; // 句子索引
-      let flag = true;
-      arr.forEach((item) => {
-        if (item === '') {
-          saveArr.push([]);
-        }
-      });
-      arr.forEach((item, index) => {
-        if (item === '') {
-          indexP++;
-          indexS = 0;
-        } else {
-          let arrs = item.trim().split('  ');
-          let saveItem = [];
-          arrs.forEach((items, indexs) => {
-            // if(items.lastIndexOf('_')===-1||this.posList.indexOf(items.substring(items.lastIndexOf('_')+1).trim())==-1){
-            //     flag = false
-            //     return
-            // }
-            let obj = {
-              word: items.lastIndexOf('_') > -1 ? items.substring(0, items.lastIndexOf('_')).trim() : items,
-              pos: '',
-            };
-            saveItem.push(obj);
-          });
-          saveArr[indexP].push(saveItem);
-          indexS++;
-        }
-      });
-      //   if(!flag){
-      //     this.$message.warning('词性有错误请检查')
-      //     return
-      //   }
       this.loading = true;
       this.loading = true;
-      publicMethods('/TeachingServer/TextAnalyser/SetFCProofreadForAnalyseRecord', {
+      publicMethods('/TeachingServer/TextAnalyser/Analyse', {
         analyse_record_id: this.id,
         analyse_record_id: this.id,
-        proofread_text: {
-          paragraph_list: saveArr,
-        },
-        is_proofread_cx: 'false',
+        text: this.noPosContent,
+        userID: this.userID,
       })
       })
         .then((res) => {
         .then((res) => {
           if (res.status === 1) {
           if (res.status === 1) {
-            this.$message.success('保存成功');
+            this.$message.success('修改成功');
             this.editArticleFlag = false;
             this.editArticleFlag = false;
             reparse({ analyse_record_id })
             reparse({ analyse_record_id })
               .then(({ record }) => {
               .then(({ record }) => {

+ 2 - 2
src/views/teacher-dev/TextAnalysis.vue

@@ -50,7 +50,7 @@
             :style="{ backgroundColor: item.analysis_status === 0 ? '#FAF6EB' : '' }"
             :style="{ backgroundColor: item.analysis_status === 0 ? '#FAF6EB' : '' }"
           >
           >
             <div class="number">{{ pageSize * (data.cur_page - 1) + i + 1 }}</div>
             <div class="number">{{ pageSize * (data.cur_page - 1) + i + 1 }}</div>
-            <div class="name" @click="handleJump(item)">
+            <div class="name" @click="editName(item)">
               {{ item.name }}
               {{ item.name }}
             </div>
             </div>
             <div class="txt" @click="handleJump(item)">
             <div class="txt" @click="handleJump(item)">
@@ -65,7 +65,7 @@
             >
             >
               {{ item.analysis_status === 3 ? '重新解析' : '解析' }}
               {{ item.analysis_status === 3 ? '重新解析' : '解析' }}
             </div>
             </div>
-            <span class="edit-btn" @click="editName(item)"><i class="el-icon-edit"></i></span>
+            <span class="edit-btn" @click="handleJump(item)"><i class="el-icon-edit"></i></span>
             <el-popconfirm title="确定删除这一条记录吗?" @confirm="deleteTextAnalyseRecord(item.id)">
             <el-popconfirm title="确定删除这一条记录吗?" @confirm="deleteTextAnalyseRecord(item.id)">
               <img slot="reference" src="../../assets/teacherdev/delete-one.png" alt="删除" />
               <img slot="reference" src="../../assets/teacherdev/delete-one.png" alt="删除" />
             </el-popconfirm>
             </el-popconfirm>