Browse Source

文本分析集成

natasha 1 năm trước cách đây
mục cha
commit
615029087b

+ 9 - 2
public/ciyun/ciyunindex.html

@@ -366,6 +366,7 @@
         var partitionKey = null;
         var searchType = null;
         var old_searchType = null
+        var userID = null
         var W_stopWordStatus = null
         var prefix = 'GCLS_Token='
         var start = document.cookie.indexOf(prefix)
@@ -382,6 +383,9 @@
                 searchType = item.split("=")[1];
                 old_searchType = item.split("=")[1];
             }
+            if (item.split("=")[0] == "userID") {
+              userID = item.split("=")[1];
+            }
         });
         // 如果是词汇  默认选中词
         if (old_searchType == 2) {
@@ -534,7 +538,9 @@
             $.ajax({
                 url: window.location.origin + "/TeachingServer/TextAnalyser/GetMyStopWordList?AccessToken=" + AccessToken,
                 // url: "/i21st-newspaper-management-test/api/user/stopVocab/get",
-                data: JSON.stringify({}),
+                data: JSON.stringify({
+                  app_user_id: userID
+                }),
                 contentType: "application/json;charset=UTF-8",
                 dataType: "json",
                 type: "post",
@@ -819,7 +825,8 @@
                 url: window.location.origin + "/TeachingServer/TextAnalyser/SetMyStopWord?AccessToken=" + AccessToken,
                 // url: "/i21st-newspaper-management-test/api/user/stopVocab/update",
                 data: JSON.stringify({
-                    word_list: userStopVocab
+                    word_list: userStopVocab,
+                    app_user_id: userID
                 }),
                 contentType: "application/json;charset=UTF-8",
                 dataType: "json",

+ 157 - 157
src/views/Textanalysis/CheckArticle.vue

@@ -1,27 +1,26 @@
 <template>
   <div v-loading="loading" class="check-article">
-    <HeaderPage />
+    <HeaderPage v-if="!userID" />
     <div class="main">
       <div class="main-top">
         <a class="go-back" @click="$router.go(-1)">
-            <i class="el-icon-arrow-left"></i>
-            返回
+          <i class="el-icon-arrow-left"></i>
+          返回
         </a>
         <b>校对</b>
         <div class="btn-box">
-            <el-button @click="checkPos">校对词性</el-button>
-            <el-button @click="checkPinyin">校对拼音</el-button>
-            <el-button type="primary" @click="checkWord">校对分词</el-button>
+          <el-button @click="checkPos">校对词性</el-button>
+          <el-button @click="checkPinyin">校对拼音</el-button>
+          <el-button type="primary" @click="checkWord">校对分词</el-button>
         </div>
       </div>
-      <div class="paragraph" v-for="(item, index) in indexArr" :key="index + 'paragraph'" >
-        <label>段 {{index+1}}</label>
+      <div class="paragraph" v-for="(item, index) in indexArr" :key="index + 'paragraph'">
+        <label>段 {{ index + 1 }}</label>
         <div class="sentence-box" v-for="(items, indexs) in item" :key="indexs + 'words'">
-            <div class="sentence" v-for="(itemss, indexss) in items" :key="indexss + 'words'">
-                <b>{{itemss.index}}.</b>
-                <div class="sentence" v-html="itemss.text">
-                </div>
-            </div>
+          <div class="sentence" v-for="(itemss, indexss) in items" :key="indexss + 'words'">
+            <b>{{ itemss.index }}.</b>
+            <div class="sentence" v-html="itemss.text"></div>
+          </div>
         </div>
       </div>
     </div>
@@ -42,89 +41,91 @@ export default {
       id: '',
       ArticelData: null,
       indexArr: [], // 索引数组
+      userID: this.$route.query.userID,
     };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
   created() {
     this.routerData = JSON.parse(JSON.stringify(this.$route.query));
-    this.id = this.routerData.id
-    this.getArticleData()
+    this.id = this.routerData.id;
+    this.getArticleData();
   },
   methods: {
     // 获取分析结果
     getArticleData() {
       this.loading = true;
-      publicMethods('/TeachingServer/TextAnalyser/GetParsedTextInfo',{
-          analyse_record_id: this.id,
-        }
-      )
+      publicMethods('/TeachingServer/TextAnalyser/GetParsedTextInfo', {
+        analyse_record_id: this.id,
+      })
         .then((res) => {
-            if(res.status===1){
-                let newdata = [];
-                res.parsed_text.paragraph_list.forEach((item) => {
-                    if (item.length !== 0) {
-                        newdata.push(item);
-                    }
-                });
-                this.ArticelData = newdata;
-                let arr = []
-                let indexS = 0;
-                // 添加索引
-                this.ArticelData.forEach((item,index) => {
-                    arr.push([])
-                    item.forEach((items,indexs) => {
-                        arr[index].push([])
-                        indexS += 1;
-                        let str = ''
-                        items.forEach((itemss,indexss)=>{
-                            itemss.text.forEach(itemT=>{
-                                str += itemT.word
-                            })
-                            if(indexss!==items.length-1) str+='&nbsp;&nbsp;'
-                        })
-                        let obj = {
-                            text: str,
-                            index: JSON.parse(JSON.stringify(indexS))
-                        }
-                        arr[index][indexs].push(obj)
-                    });
+          if (res.status === 1) {
+            let newdata = [];
+            res.parsed_text.paragraph_list.forEach((item) => {
+              if (item.length !== 0) {
+                newdata.push(item);
+              }
+            });
+            this.ArticelData = newdata;
+            let arr = [];
+            let indexS = 0;
+            // 添加索引
+            this.ArticelData.forEach((item, index) => {
+              arr.push([]);
+              item.forEach((items, indexs) => {
+                arr[index].push([]);
+                indexS += 1;
+                let str = '';
+                items.forEach((itemss, indexss) => {
+                  itemss.text.forEach((itemT) => {
+                    str += itemT.word;
+                  });
+                  if (indexss !== items.length - 1) str += '&nbsp;&nbsp;';
                 });
-                this.indexArr = arr
-                this.loading = false;
-            }
-          
+                let obj = {
+                  text: str,
+                  index: JSON.parse(JSON.stringify(indexS)),
+                };
+                arr[index][indexs].push(obj);
+              });
+            });
+            this.indexArr = arr;
+            this.loading = false;
+          }
         })
         .catch(() => {
           this.loading = false;
         });
     },
     // 校对拼音
-    checkPinyin(){
-        this.$router.push({
-            path: "/textanalysis/checkPinyin",
-            query: {
-                id: this.id
-            },
-        });
+    checkPinyin() {
+      this.$router.push({
+        path: '/textanalysis/checkPinyin',
+        query: {
+          id: this.id,
+          userID: this.userID,
+        },
+      });
     },
     // 校对分词
-    checkWord(){
-        this.$router.push({
-            path: "/textanalysis/checkWord",
-            query: {
-                id: this.id
-            },
-        });
+    checkWord() {
+      this.$router.push({
+        path: '/textanalysis/checkWord',
+        query: {
+          id: this.id,
+          userID: this.userID,
+        },
+      });
     },
     // 校对词性
-    checkPos(){
-        this.$router.push({
-            path: "/textanalysis/checkPos",
-            query: {
-                id: this.id
-            },
-        });
-    }
+    checkPos() {
+      this.$router.push({
+        path: '/textanalysis/checkPos',
+        query: {
+          id: this.id,
+          userID: this.userID,
+        },
+      });
+    },
   },
 };
 </script>
@@ -141,99 +142,98 @@ export default {
   .main {
     width: 1200px;
     margin: 23px auto;
-    background: #FFF;
+    background: #fff;
     padding: 24px;
-    &-top{
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        margin-bottom: 24px;
-        position: relative;
-        b{
-            color: #000;
-            font-size: 24px;
-            font-weight: 500;
-            line-height: 34px;
-            position: absolute;
-            width: 600px;
-            text-align: center;
-            top: 0;
-            left: 50%;
-            margin-left: -300px;
-        }
-        .el-button{
-            padding: 5px 16px;
-            border-radius: 2px;
-            border: 1px solid #165DFF;
-            color: #165DFF;
-            font-size: 14px;
-            font-weight: 400;
-            line-height: 22px;
-            &.el-button--primary{
-                background: #165DFF;
-                color: #FFF;
-            }
+    &-top {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      margin-bottom: 24px;
+      position: relative;
+      b {
+        color: #000;
+        font-size: 24px;
+        font-weight: 500;
+        line-height: 34px;
+        position: absolute;
+        width: 600px;
+        text-align: center;
+        top: 0;
+        left: 50%;
+        margin-left: -300px;
+      }
+      .el-button {
+        padding: 5px 16px;
+        border-radius: 2px;
+        border: 1px solid #165dff;
+        color: #165dff;
+        font-size: 14px;
+        font-weight: 400;
+        line-height: 22px;
+        &.el-button--primary {
+          background: #165dff;
+          color: #fff;
         }
+      }
+    }
+    .go-back {
+      border-radius: 4px;
+      border: 1px solid #d9d9d9;
+      background: #fff;
+      box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.02);
+      display: flex;
+      width: 60px;
+      color: #333;
+      font-size: 14px;
+      font-weight: 400;
+      line-height: 22px;
+      padding: 5px 8px;
+      align-items: center;
+      cursor: pointer;
+      .el-icon-arrow-left {
+        font-size: 16px;
+        margin-right: 8px;
+      }
     }
-    .go-back{
-        border-radius: 4px;
-        border: 1px solid #D9D9D9;
-        background: #FFF;
-        box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.02);
-        display: flex;
-        width: 60px;
-        color: #333;
+    .paragraph {
+      margin-bottom: 8px;
+      text-align: center;
+      > label {
+        border-radius: 2px;
+        border: 1px solid #175dff;
+        background: #e7eeff;
+        padding: 1px 8px;
+        color: var(--blue-05, #175dff);
         font-size: 14px;
         font-weight: 400;
         line-height: 22px;
-        padding: 5px 8px;
-        align-items: center;
-        cursor: pointer;
-        .el-icon-arrow-left{
+      }
+      .sentence-box {
+        .sentence {
+          display: flex;
+          margin-top: 8px;
+          b {
+            width: 32px;
+            line-height: 24px;
+            flex-shrink: 0;
+            color: #000;
             font-size: 16px;
-            margin-right: 8px;
-        }
-    }
-    .paragraph{
-        margin-bottom: 8px;
-        text-align: center;
-        >label{
-            border-radius: 2px;
-            border: 1px solid #175DFF;
-            background: #E7EEFF;
-            padding: 1px 8px;
-            color: var(--blue-05, #175DFF);
-            font-size: 14px;
             font-weight: 400;
-            line-height: 22px;
-        }
-        .sentence-box{
-            .sentence{
-                display: flex;
-                margin-top: 8px;
-                b{
-                    width: 32px;
-                    line-height: 24px;
-                    flex-shrink: 0;
-                    color: #000;
-                    font-size: 16px;
-                    font-weight: 400;
-                    margin-top: 16px;
-                }
-                .sentence{
-                    flex: 1;
-                    padding: 8px;
-                    background: #F7F7F7;
-                    color: #000;
-                    font-size: 16px;
-                    font-weight: 400;
-                    line-height: 24px;
-                    text-align: left;
-                }
-            }
+            margin-top: 16px;
+          }
+          .sentence {
+            flex: 1;
+            padding: 8px;
+            background: #f7f7f7;
+            color: #000;
+            font-size: 16px;
+            font-weight: 400;
+            line-height: 24px;
+            text-align: left;
+          }
         }
+      }
     }
   }
 }
 </style>
-

+ 346 - 326
src/views/Textanalysis/CheckPinyin.vue

@@ -1,74 +1,86 @@
 <template>
   <div v-loading="loading" class="check-article">
-    <HeaderPage />
+    <HeaderPage v-if="!userID" />
     <div class="main">
       <div class="main-top">
         <div style="display: flex">
-            <a class="go-back" @click="$router.go(-1)">
-                <i class="el-icon-arrow-left"></i>
-                返回
-            </a>
-            <b>校对拼音</b>
+          <a class="go-back" @click="$router.go(-1)">
+            <i class="el-icon-arrow-left"></i>
+            返回
+          </a>
+          <b>校对拼音</b>
         </div>
         <div class="btn-box">
-            <el-button type="info" @click="$router.go(-1)">取消</el-button>
-            <el-button type="primary" @click="savePinyin(id)">保存</el-button>
+          <el-button type="info" @click="$router.go(-1)">取消</el-button>
+          <el-button type="primary" @click="savePinyin(id)">保存</el-button>
         </div>
       </div>
       <div class="article">
-        <div class="paragraph" v-for="(item, index) in indexArr" :key="index + 'paragraph'" >
-            <div class="sentence-box" v-for="(items, indexs) in item" :key="indexs + 'words'">
-                <div class="sentence" @click="selectItem(items,index)" :style="{marginRight:items.marginRight?'8px':'',color: activeIndex === index+'_'+items.sentenceIndex+'_'+items.wordIndex?'#F2555A':''}">
-                    <span class="pinyin">{{items.pinyin_lt?items.pinyin_lt:items.pinyin}}</span>
-                    <span class="words" :class="[/^[0-9]*$/.test(items.text)]?/^[\u4e00-\u9fa5]/.test(items.text)?'hanzi':'en':''">
-                        {{items.text}}
-                    </span>
-                </div>
+        <div class="paragraph" v-for="(item, index) in indexArr" :key="index + 'paragraph'">
+          <div class="sentence-box" v-for="(items, indexs) in item" :key="indexs + 'words'">
+            <div
+              class="sentence"
+              @click="selectItem(items, index)"
+              :style="{
+                marginRight: items.marginRight ? '8px' : '',
+                color: activeIndex === index + '_' + items.sentenceIndex + '_' + items.wordIndex ? '#F2555A' : '',
+              }"
+            >
+              <span class="pinyin">{{ items.pinyin_lt ? items.pinyin_lt : items.pinyin }}</span>
+              <span
+                class="words"
+                :class="[/^[0-9]*$/.test(items.text)] ? (/^[\u4e00-\u9fa5]/.test(items.text) ? 'hanzi' : 'en') : ''"
+              >
+                {{ items.text }}
+              </span>
             </div>
+          </div>
         </div>
       </div>
     </div>
     <el-dialog
-        :visible.sync="dialogFlag"
-        :show-close="false"
-        :close-on-click-modal="false"
-        :modal-append-to-body="false"
-        :modal="false"
-        width="250px"
-        class="login-dialog"
-        v-if="dialogFlag">
-        <div class="check-box">
-            <div class="content">
-                <template v-if="itemActive.pinyin_lt">
-                    <div class="words-box">
-                        <span class="pinyin">
-                            {{itemActive.pinyin_lt}}
-                        </span>
-                        <span class="words">
-                            {{itemActive.text}}
-                        </span>
-                    </div>
-                </template>
-                <template v-else>
-                    <div class="words-box">
-                        <span class="pinyin">
-                            {{itemActive.pinyin}}
-                        </span>
-                        <span class="words">
-                            {{itemActive.text}}
-                        </span>
-                    </div>
-                </template>
+      :visible.sync="dialogFlag"
+      :show-close="false"
+      :close-on-click-modal="false"
+      :modal-append-to-body="false"
+      :modal="false"
+      width="250px"
+      class="login-dialog"
+      v-if="dialogFlag"
+    >
+      <div class="check-box">
+        <div class="content">
+          <template v-if="itemActive.pinyin_lt">
+            <div class="words-box">
+              <span class="pinyin">
+                {{ itemActive.pinyin_lt }}
+              </span>
+              <span class="words">
+                {{ itemActive.text }}
+              </span>
             </div>
-            <el-input v-model="checkPinyinInput" type="text" class="checkPinyinInput" />
-            <p class="tips">
-                一到四声分别用数字1-4表示,轻声用0表示。拼音间用空格隔开,例如“北语社”,输入“bei3 yu3 she4”;若需要连在一起显示,用_隔开,例如“哪儿”,输入“na3_er”
-            </p>
-            <div class="btn-box">
-                <el-button type="info" size="small" @click="cancleDialog">取消</el-button>
-                <el-button type="primary" size="small" @click="surePinyin">保存</el-button>
+          </template>
+          <template v-else>
+            <div class="words-box">
+              <span class="pinyin">
+                {{ itemActive.pinyin }}
+              </span>
+              <span class="words">
+                {{ itemActive.text }}
+              </span>
             </div>
+          </template>
         </div>
+        <el-input v-model="checkPinyinInput" type="text" class="checkPinyinInput" />
+        <p class="tips">
+          一到四声分别用数字1-4表示,轻声用0表示。拼音间用空格隔开,例如“北语社”,输入“bei3 yu3
+          she4”;若需要连在一起显示,用_隔开,例如“哪儿”,输入“na3_er”
+        </p>
+        <div class="btn-box">
+          <el-button type="info" size="small" @click="cancleDialog">取消</el-button>
+          <el-button type="primary" size="small" @click="surePinyin">保存</el-button>
+        </div>
+      </div>
     </el-dialog>
   </div>
 </template>
@@ -94,107 +106,105 @@ export default {
       checkPinyinInput: '',
       oldInput: '',
       tableData: [
-        ["ā", "á", "ǎ", "à", "a"],
-        ["ō", "ó", "ǒ", "ò", "o"],
-        ["ē", "é", "ě", "è", "e"],
-        ["ī", "í", "ǐ", "ì", "i"],
-        ["ū", "ú", "ǔ", "ù", "u"],
-        ["ǖ", "ǘ", "ǚ", "ǜ", "ü"],
-        ["Ā", "Á", "Â", "À", "A"],
-        ["Ō", "Ó", "Ô", "Ò", "O"],
-        ["Ē", "É", "Ê", "È", "E"],
-        ["Ī", "Í", "Î", "Ì", "I"],
-        ["Ū", "Ú", "Û", "Ù", "U"],
+        ['ā', 'á', 'ǎ', 'à', 'a'],
+        ['ō', 'ó', 'ǒ', 'ò', 'o'],
+        ['ē', 'é', 'ě', 'è', 'e'],
+        ['ī', 'í', 'ǐ', 'ì', 'i'],
+        ['ū', 'ú', 'ǔ', 'ù', 'u'],
+        ['ǖ', 'ǘ', 'ǚ', 'ǜ', 'ü'],
+        ['Ā', 'Á', 'Â', 'À', 'A'],
+        ['Ō', 'Ó', 'Ô', 'Ò', 'O'],
+        ['Ē', 'É', 'Ê', 'È', 'E'],
+        ['Ī', 'Í', 'Î', 'Ì', 'I'],
+        ['Ū', 'Ú', 'Û', 'Ù', 'U'],
       ],
+      userID: this.$route.query.userID,
     };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
   created() {
     this.routerData = JSON.parse(JSON.stringify(this.$route.query));
-    this.id = this.routerData.id
-    this.getArticleData()
+    this.id = this.routerData.id;
+    this.getArticleData();
   },
   methods: {
     // 获取分析结果
     getArticleData() {
       this.loading = true;
-      publicMethods('/TeachingServer/TextAnalyser/GetParsedTextInfo',{
-          analyse_record_id: this.id,
-        }
-      )
+      publicMethods('/TeachingServer/TextAnalyser/GetParsedTextInfo', {
+        analyse_record_id: this.id,
+      })
         .then((res) => {
-            if(res.status===1){
-                let newdata = [];
-                res.parsed_text.paragraph_list.forEach((item) => {
-                    if (item.length !== 0) {
-                        newdata.push(item);
-                    }
-                });
-                // this.ArticelData = JSON.parse(JSON.stringify(newdata));
-                let saveArr = []
-                let arr = []
-                let saveIndex = 0
-                // 添加索引
-                newdata.forEach((item,index) => {
-                    arr.push([])
-                    item.forEach((items,indexs) => {
-                        items.forEach((itemss,indexss)=>{
-                            let str = ''
-                            let pinyinStr = ''
-                            let pinyinNo = ''
-                            itemss.text.forEach((itemT,indexT)=>{
-                                str += itemT.word
-                                pinyinStr += itemT.pinyin + ','
-                                pinyinNo += itemT.pinyin
-                            })
-                            let obj = {
-                                text: str,
-                                pinyin: pinyinNo,
-                                paraIndex: index,
-                                sentenceIndex: indexs,
-                                wordIndex: indexss,
-                                wordArr: itemss.text,
-                                marginRight: true,
-                                saveIndex: saveIndex,
-                                pinyin_lt: itemss.pinyin_lt
-                            }
-                            arr[index].push(obj)
-                            let saveObj = {
-                                word: str,
-                                pinyin: pinyinStr.substring(0,pinyinStr.length-1),
-                                // pinyin_lt: itemss.pinyin_lt?itemss.pinyin_lt:''
-                            }
-                            saveArr.push(saveObj)
-                            saveIndex++
-                        })
-                        
-                    });
+          if (res.status === 1) {
+            let newdata = [];
+            res.parsed_text.paragraph_list.forEach((item) => {
+              if (item.length !== 0) {
+                newdata.push(item);
+              }
+            });
+            // this.ArticelData = JSON.parse(JSON.stringify(newdata));
+            let saveArr = [];
+            let arr = [];
+            let saveIndex = 0;
+            // 添加索引
+            newdata.forEach((item, index) => {
+              arr.push([]);
+              item.forEach((items, indexs) => {
+                items.forEach((itemss, indexss) => {
+                  let str = '';
+                  let pinyinStr = '';
+                  let pinyinNo = '';
+                  itemss.text.forEach((itemT, indexT) => {
+                    str += itemT.word;
+                    pinyinStr += itemT.pinyin + ',';
+                    pinyinNo += itemT.pinyin;
+                  });
+                  let obj = {
+                    text: str,
+                    pinyin: pinyinNo,
+                    paraIndex: index,
+                    sentenceIndex: indexs,
+                    wordIndex: indexss,
+                    wordArr: itemss.text,
+                    marginRight: true,
+                    saveIndex: saveIndex,
+                    pinyin_lt: itemss.pinyin_lt,
+                  };
+                  arr[index].push(obj);
+                  let saveObj = {
+                    word: str,
+                    pinyin: pinyinStr.substring(0, pinyinStr.length - 1),
+                    // pinyin_lt: itemss.pinyin_lt?itemss.pinyin_lt:''
+                  };
+                  saveArr.push(saveObj);
+                  saveIndex++;
                 });
-                this.indexArr = arr
-                this.ArticelData = saveArr
-                this.loading = false;
-            }
-          
+              });
+            });
+            this.indexArr = arr;
+            this.ArticelData = saveArr;
+            this.loading = false;
+          }
         })
         .catch(() => {
           this.loading = false;
         });
     },
-    selectItem(item,index){
-        this.activeIndex = index+'_'+item.sentenceIndex+'_'+item.wordIndex
-        this.itemActive = item
-        this.dialogFlag = true
+    selectItem(item, index) {
+      this.activeIndex = index + '_' + item.sentenceIndex + '_' + item.wordIndex;
+      this.itemActive = item;
+      this.dialogFlag = true;
     },
-    cancleDialog(){
-        this.activeIndex = null
-        this.itemActive = null
-        this.checkPinyinInput = ''
-        this.oldInput = ''
-        this.dialogFlag = false
+    cancleDialog() {
+      this.activeIndex = null;
+      this.itemActive = null;
+      this.checkPinyinInput = '';
+      this.oldInput = '';
+      this.dialogFlag = false;
     },
-    surePinyin(){
-        this.oldInput = JSON.parse(JSON.stringify(this.checkPinyinInput.trim()))
-        this.handleReplaceTone(this.checkPinyinInput.trim())
+    surePinyin() {
+      this.oldInput = JSON.parse(JSON.stringify(this.checkPinyinInput.trim()));
+      this.handleReplaceTone(this.checkPinyinInput.trim());
     },
     handleReplaceTone(e) {
       let _this = this;
@@ -202,23 +212,23 @@ export default {
         let value = e;
         _this.resArr = [];
         if (value) {
-            let valueArr = []
-            if(value.indexOf('_')>-1){
-                value.replace(/_{1,}/g,'_')
-                valueArr = value.split('_')
-            }else{
-                value.replace(/\s+/g, " ")
-                valueArr = value.split(' ')
-            }
-        //   let reg = /\s+/g;
-        //   valueArr = value.split(reg);
+          let valueArr = [];
+          if (value.indexOf('_') > -1) {
+            value.replace(/_{1,}/g, '_');
+            valueArr = value.split('_');
+          } else {
+            value.replace(/\s+/g, ' ');
+            valueArr = value.split(' ');
+          }
+          //   let reg = /\s+/g;
+          //   valueArr = value.split(reg);
           valueArr.forEach((item, index) => {
             this.handleValue(item);
           });
-          let str = "";
+          let str = '';
           setTimeout(() => {
             _this.resArr.forEach((item) => {
-              str += " ";
+              str += ' ';
               item.forEach((sItem) => {
                 if (sItem.number && sItem.con) {
                   let number = Number(sItem.number);
@@ -229,43 +239,56 @@ export default {
                   if (sItem.number) {
                     str += sItem.number;
                   } else if (sItem.con) {
-                    str += " " + sItem.con + " ";
+                    str += ' ' + sItem.con + ' ';
                   }
                 }
               });
             });
             this.checkPinyinInput = str.trim();
-            if(this.oldInput.indexOf('_')>-1){
-                this.ArticelData[this.itemActive.saveIndex].pinyin = this.checkPinyinInput.replace(/\s+/g, " ").split(/\s+/).join('_')
-                this.checkPinyinInput = this.checkPinyinInput.replace(/\s+/g, " ").split(/\s+/).join('_').replace('_e','').replace('_ē','').replace('_é','').replace('_ě','').replace('_è','')
-                this.itemActive.pinyin_lt = this.checkPinyinInput.replace(/\s+/g, "")
-            }else{
-                this.ArticelData[this.itemActive.saveIndex].pinyin = this.checkPinyinInput.replace(/\s+/g, " ").split(/\s+/).join(',')
-                this.itemActive.pinyin = this.checkPinyinInput.replace(/\s+/g, "")
+            if (this.oldInput.indexOf('_') > -1) {
+              this.ArticelData[this.itemActive.saveIndex].pinyin = this.checkPinyinInput
+                .replace(/\s+/g, ' ')
+                .split(/\s+/)
+                .join('_');
+              this.checkPinyinInput = this.checkPinyinInput
+                .replace(/\s+/g, ' ')
+                .split(/\s+/)
+                .join('_')
+                .replace('_e', '')
+                .replace('_ē', '')
+                .replace('_é', '')
+                .replace('_ě', '')
+                .replace('_è', '');
+              this.itemActive.pinyin_lt = this.checkPinyinInput.replace(/\s+/g, '');
+            } else {
+              this.ArticelData[this.itemActive.saveIndex].pinyin = this.checkPinyinInput
+                .replace(/\s+/g, ' ')
+                .split(/\s+/)
+                .join(',');
+              this.itemActive.pinyin = this.checkPinyinInput.replace(/\s+/g, '');
             }
             // this.ArticelData[this.itemActive.saveIndex].pinyin = this.checkPinyinInput
-            
+
             this.loading = true;
-            publicMethods('/TeachingServer/TextAnalyser/AddMyPinyinProofread',{
-                analyse_record_id: this.id,
-                word_list: [this.ArticelData[this.itemActive.saveIndex]]
+            publicMethods('/TeachingServer/TextAnalyser/AddMyPinyinProofread', {
+              analyse_record_id: this.id,
+              word_list: [this.ArticelData[this.itemActive.saveIndex]],
+            })
+              .then((res) => {
+                this.loading = false;
+                if (res.status === 1) {
+                  this.$message.success('保存成功');
+                  this.activeIndex = null;
+                  this.itemActive = null;
+                  this.checkPinyinInput = '';
+                  this.oldInput = '';
+                  this.dialogFlag = false;
+                  // this.getArticleData()
                 }
-            )
-                .then((res) => {
-                    this.loading = false;
-                    if(res.status===1){
-                        this.$message.success('保存成功')
-                        this.activeIndex = null
-                        this.itemActive = null
-                        this.checkPinyinInput = ''
-                        this.oldInput = ''
-                        this.dialogFlag = false
-                        // this.getArticleData()
-                    }
-                })
-                .catch(() => {
+              })
+              .catch(() => {
                 this.loading = false;
-                });
+              });
           }, 10);
         }
       });
@@ -274,15 +297,14 @@ export default {
       let reg = /\d/;
       let reg2 = /[A-Za-z]+\d/g;
       let numList = [];
-      let valArr = valItem.split("");
+      let valArr = valItem.split('');
       if (reg2.test(valItem)) {
         for (let i = 0; i < valArr.length; i++) {
           let item = valItem[i];
           if (reg.test(item)) {
-            let numIndex =
-              numList.length == 0 ? 0 : numList[numList.length - 1].index;
+            let numIndex = numList.length == 0 ? 0 : numList[numList.length - 1].index;
             let con = valItem.substring(numIndex, i);
-            con = con.replace(/\d/g, "");
+            con = con.replace(/\d/g, '');
             let obj = {
               index: i,
               number: item,
@@ -303,26 +325,26 @@ export default {
     },
     addTone(number, con) {
       let _this = this;
-      let zmList = ["a", "o", "e", "i", "u", "v", "A", "O", "E", "I", "U"];
+      let zmList = ['a', 'o', 'e', 'i', 'u', 'v', 'A', 'O', 'E', 'I', 'U'];
       if (number) {
         for (let i = 0; i < zmList.length; i++) {
           let zm = zmList[i];
           if (con.indexOf(zm) > -1) {
             let zm2 = _this.tableData[i][number - 1];
-            if (con.indexOf("iu") > -1) {
+            if (con.indexOf('iu') > -1) {
               zm2 = _this.tableData[4][number - 1];
-              con = con.replace("u", zm2);
-            } else if (con.indexOf("ui") > -1) {
+              con = con.replace('u', zm2);
+            } else if (con.indexOf('ui') > -1) {
               zm2 = _this.tableData[3][number - 1];
-              con = con.replace("i", zm2);
+              con = con.replace('i', zm2);
             } else if (
-              con.indexOf("yv") > -1 ||
-              con.indexOf("jv") > -1 ||
-              con.indexOf("qv") > -1 ||
-              con.indexOf("xv") > -1
+              con.indexOf('yv') > -1 ||
+              con.indexOf('jv') > -1 ||
+              con.indexOf('qv') > -1 ||
+              con.indexOf('xv') > -1
             ) {
               zm2 = _this.tableData[4][number - 1];
-              con = con.replace("v", zm2);
+              con = con.replace('v', zm2);
             } else {
               con = con.replace(zm, zm2);
             }
@@ -333,16 +355,16 @@ export default {
       }
       return con;
     },
-    savePinyin(analyse_record_id){
+    savePinyin(analyse_record_id) {
       this.loading = true;
       reparse({ analyse_record_id })
         .then(({ record }) => {
-          this.getArticleData()
+          this.getArticleData();
         })
         .finally(() => {
           this.loading = false;
         });
-    }
+    },
   },
 };
 </script>
@@ -355,162 +377,160 @@ export default {
   .wheader {
     background: #fff;
   }
-    .el-button{
-        padding: 5px 16px;
-        border-radius: 2px;
-        border: 1px solid #F2F3F5;
-        color: #4E5969;
-        font-size: 14px;
-        font-weight: 400;
-        line-height: 22px;
-        background: #F2F3F5;
-        &.el-button--primary{
-            background: #165DFF;
-            border: 1px solid #165DFF;
-            color: #FFF;
-        }
+  .el-button {
+    padding: 5px 16px;
+    border-radius: 2px;
+    border: 1px solid #f2f3f5;
+    color: #4e5969;
+    font-size: 14px;
+    font-weight: 400;
+    line-height: 22px;
+    background: #f2f3f5;
+    &.el-button--primary {
+      background: #165dff;
+      border: 1px solid #165dff;
+      color: #fff;
     }
+  }
   .main {
     width: 1200px;
     margin: 23px auto;
-    background: #FFF;
+    background: #fff;
     padding: 24px;
-    &-top{
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        margin-bottom: 24px;
-        position: relative;
-        b{
-            color: #000;
-            font-size: 24px;
-            font-weight: 500;
-            line-height: 34px;
-            margin-left: 16px;
-        }
+    &-top {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      margin-bottom: 24px;
+      position: relative;
+      b {
+        color: #000;
+        font-size: 24px;
+        font-weight: 500;
+        line-height: 34px;
+        margin-left: 16px;
+      }
     }
-    .go-back{
-        border-radius: 4px;
-        border: 1px solid #D9D9D9;
-        background: #FFF;
-        box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.02);
-        display: flex;
-        width: 60px;
-        color: #333;
-        font-size: 14px;
-        font-weight: 400;
-        line-height: 22px;
-        padding: 5px 8px;
-        align-items: center;
-        cursor: pointer;
-        .el-icon-arrow-left{
-            font-size: 16px;
-            margin-right: 8px;
-        }
+    .go-back {
+      border-radius: 4px;
+      border: 1px solid #d9d9d9;
+      background: #fff;
+      box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.02);
+      display: flex;
+      width: 60px;
+      color: #333;
+      font-size: 14px;
+      font-weight: 400;
+      line-height: 22px;
+      padding: 5px 8px;
+      align-items: center;
+      cursor: pointer;
+      .el-icon-arrow-left {
+        font-size: 16px;
+        margin-right: 8px;
+      }
     }
-    .article{
-        border-radius: 2px;
-        border: 1px solid rgba(0, 0, 0, 0.08);
-        background: #FCFCFC;
-        padding: 8px;
+    .article {
+      border-radius: 2px;
+      border: 1px solid rgba(0, 0, 0, 0.08);
+      background: #fcfcfc;
+      padding: 8px;
     }
-    .paragraph{
-        margin-bottom: 24px;
-        text-align: center;
+    .paragraph {
+      margin-bottom: 24px;
+      text-align: center;
+      display: flex;
+      flex-flow: wrap;
+      width: 100%;
+      .sentence-box {
         display: flex;
         flex-flow: wrap;
-        width: 100%;
-        .sentence-box{
-            display: flex;
-            flex-flow: wrap;
-            float: left;
-            .sentence{
-                margin-top: 8px;
-                text-align: center;
-                cursor: pointer;
-                color: #000;
-                .words{
-                    display: block;
-                    font-size: 20px;
-                    line-height: 28px;
-                    font-weight: 400;
-                }
-                .pinyin{
-                    font-family: 'League';
-                    font-size: 14px;
-                    font-weight: 400;
-                    line-height: 1;
-                    height: 14px;
-                    display: block;
-                }
-            }
+        float: left;
+        .sentence {
+          margin-top: 8px;
+          text-align: center;
+          cursor: pointer;
+          color: #000;
+          .words {
+            display: block;
+            font-size: 20px;
+            line-height: 28px;
+            font-weight: 400;
+          }
+          .pinyin {
+            font-family: 'League';
+            font-size: 14px;
+            font-weight: 400;
+            line-height: 1;
+            height: 14px;
+            display: block;
+          }
         }
+      }
     }
   }
 }
-.check-box{
-    padding: 24px;
-    border-radius: 4px;
-    background: #FFF;
-    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
-    .content{
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        .words-box{
-            text-align: center;
-            color: #000;
-            .words{
-                display: block;
-                font-size: 28px;
-                line-height: 40px;
-                font-weight: 400;
-            }
-            .pinyin{
-                font-family: 'League';
-                font-size: 20px;
-                font-weight: 400;
-                line-height: 1;
-                height: 20px;
-                display: block;
-            }
-        }
-    }
-    .checkPinyinInput{
-        margin: 16px 0 8px 0;
-    }
-    .tips{
-        color: #A0A0A0;
-        font-size: 12px;
+.check-box {
+  padding: 24px;
+  border-radius: 4px;
+  background: #fff;
+  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
+  .content {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    .words-box {
+      text-align: center;
+      color: #000;
+      .words {
+        display: block;
+        font-size: 28px;
+        line-height: 40px;
+        font-weight: 400;
+      }
+      .pinyin {
+        font-family: 'League';
+        font-size: 20px;
         font-weight: 400;
-        line-height: 18px;
-        margin: 0 0 24px 0;
+        line-height: 1;
+        height: 20px;
+        display: block;
+      }
     }
-    .btn-box{
-        text-align: right;
-        .el-button{
-            font-size: 12px;
-            padding: 2px 12px;
-            line-height: 20px;
-        }
+  }
+  .checkPinyinInput {
+    margin: 16px 0 8px 0;
+  }
+  .tips {
+    color: #a0a0a0;
+    font-size: 12px;
+    font-weight: 400;
+    line-height: 18px;
+    margin: 0 0 24px 0;
+  }
+  .btn-box {
+    text-align: right;
+    .el-button {
+      font-size: 12px;
+      padding: 2px 12px;
+      line-height: 20px;
     }
+  }
 }
 </style>
 <style lang="scss">
-.check-article{
-    .login-dialog{
-        .el-dialog__header{
-            padding: 0;
-        }
-        .el-dialog__body{
-            padding: 0;
-        }
-        .el-input__inner{
-           background: #F3F3F3; 
-           text-align: center;
-        }
+.check-article {
+  .login-dialog {
+    .el-dialog__header {
+      padding: 0;
+    }
+    .el-dialog__body {
+      padding: 0;
+    }
+    .el-input__inner {
+      background: #f3f3f3;
+      text-align: center;
     }
+  }
 }
-
 </style>
-

+ 281 - 270
src/views/Textanalysis/CheckPos.vue

@@ -1,37 +1,43 @@
 <template>
   <div v-loading="loading" class="check-article">
-    <HeaderPage />
+    <HeaderPage v-if="!userID" />
     <div class="main">
       <div class="main-top">
         <div style="display: flex; align-items: end">
-            <a class="go-back" @click="$router.go(-1)">
-                <i class="el-icon-arrow-left"></i>
-                返回
-            </a>
-            <b>校对词性</b>
-            <p class="tips">*为保证词性校对的准确性,请尽量在校对分词后校对词性。</p>
+          <a class="go-back" @click="$router.go(-1)">
+            <i class="el-icon-arrow-left"></i>
+            返回
+          </a>
+          <b>校对词性</b>
+          <p class="tips">*为保证词性校对的准确性,请尽量在校对分词后校对词性。</p>
         </div>
         <div class="btn-box">
-            <!-- <el-switch
+          <!-- <el-switch
                 class="show-pos"
                 v-model="showPos"
                 active-text="显示词性"
                 inactive-text="">
             </el-switch> -->
-            <el-button type="info" @click="$router.go(-1)">取消</el-button>
-            <el-button type="primary" @click="saveWord(id)">保存</el-button>
+          <el-button type="info" @click="$router.go(-1)">取消</el-button>
+          <el-button type="primary" @click="saveWord(id)">保存</el-button>
         </div>
       </div>
       <div v-if="showPos" class="pos-box">
         <h4>词性解释</h4>
         <ul>
-            <li v-for="(item,index) in cixingList" :key="index">
-                <label>{{item.code}}</label>
-                <span>{{item.name}}</span>
-            </li>
+          <li v-for="(item, index) in cixingList" :key="index">
+            <label>{{ item.code }}</label>
+            <span>{{ item.name }}</span>
+          </li>
         </ul>
       </div>
-      <el-input v-if="showPos" class="no-pos-content" v-model="hasPosContent" type="textarea" :autosize="{ minRows: 27 }" />
+      <el-input
+        v-if="showPos"
+        class="no-pos-content"
+        v-model="hasPosContent"
+        type="textarea"
+        :autosize="{ minRows: 27 }"
+      />
       <el-input v-else class="no-pos-content" v-model="noPosContent" type="textarea" :autosize="{ minRows: 27 }" />
     </div>
   </div>
@@ -53,137 +59,144 @@ export default {
       showPos: true,
       noPosContent: '',
       hasPosContent: '',
-      posList: ['NR','NN','JJ','AD','PU','VV','CC','SP','FW','DEC','ETC','AS'],
-      cixingList: []
+      posList: ['NR', 'NN', 'JJ', 'AD', 'PU', 'VV', 'CC', 'SP', 'FW', 'DEC', 'ETC', 'AS'],
+      cixingList: [],
+      userID: this.$route.query.userID,
     };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
   created() {
     this.routerData = JSON.parse(JSON.stringify(this.$route.query));
-    this.id = this.routerData.id
-    this.getArticleData()
-    this.getCixingList()
+    this.id = this.routerData.id;
+    this.getArticleData();
+    this.getCixingList();
   },
   methods: {
     // 获取分析结果
     getArticleData() {
       this.loading = true;
-      let str = ''
-      let posStr = ''
-      publicMethods('/TeachingServer/TextAnalyser/GetParsedTextInfo',{
-          analyse_record_id: this.id,
-        }
-      )
+      let str = '';
+      let posStr = '';
+      publicMethods('/TeachingServer/TextAnalyser/GetParsedTextInfo', {
+        analyse_record_id: this.id,
+      })
         .then((res) => {
-            if(res.status===1){
-                let newdata = [];
-                res.parsed_text.paragraph_list.forEach((item) => {
-                    if (item.length !== 0) {
-                        newdata.push(item);
-                    }
-                });
-                this.ArticelData = JSON.parse(JSON.stringify(newdata));
-                newdata.forEach((item,index) => {
-                    item.forEach((items,indexs) => {
-                        items.forEach((itemss,indexss)=>{
-                            let strWord = ''
-                            itemss.text.forEach((itemT,indexT)=>{
-                               strWord += itemT.word
-                            })
-                            str += strWord + (indexss!==items.length-1?'  ':'')
-                            posStr += strWord +(itemss.pos?'_'+itemss.pos:'') + (indexss!==items.length-1?'  ':'')
-                        })
-                        str += '\n'
-                        posStr += '\n'
-                    });
-                    if(index!==newdata.length-1){
-                        str += '\n'
-                        posStr += '\n'
-                    }
+          if (res.status === 1) {
+            let newdata = [];
+            res.parsed_text.paragraph_list.forEach((item) => {
+              if (item.length !== 0) {
+                newdata.push(item);
+              }
+            });
+            this.ArticelData = JSON.parse(JSON.stringify(newdata));
+            newdata.forEach((item, index) => {
+              item.forEach((items, indexs) => {
+                items.forEach((itemss, indexss) => {
+                  let strWord = '';
+                  itemss.text.forEach((itemT, indexT) => {
+                    strWord += itemT.word;
+                  });
+                  str += strWord + (indexss !== items.length - 1 ? '  ' : '');
+                  posStr += strWord + (itemss.pos ? '_' + itemss.pos : '') + (indexss !== items.length - 1 ? '  ' : '');
                 });
-                this.noPosContent = str
-                this.hasPosContent = posStr
-                this.loading = false;
-            }
+                str += '\n';
+                posStr += '\n';
+              });
+              if (index !== newdata.length - 1) {
+                str += '\n';
+                posStr += '\n';
+              }
+            });
+            this.noPosContent = str;
+            this.hasPosContent = posStr;
+            this.loading = false;
+          }
         })
         .catch(() => {
           this.loading = false;
         });
     },
-    saveWord(analyse_record_id){
-      let saveArr = []
-      let arr = this.showPos?this.hasPosContent.split('\n'):this.noPosContent.split('\n')
-      let indexP = 0 // 段落索引
-      let indexS = 0 // 句子索引
-      let flag = true
-      arr.forEach(item=>{
-        if(item===''){
-            saveArr.push([])
+    saveWord(analyse_record_id) {
+      let saveArr = [];
+      let arr = this.showPos ? this.hasPosContent.split('\n') : 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: this.showPos?items.lastIndexOf('_')>-1?items.substring(items.lastIndexOf('_')+1).trim():'':this.ArticelData[indexP]&&this.ArticelData[indexP][indexS]&&this.ArticelData[indexP][indexS][indexs]&&this.ArticelData[indexP][indexS][indexs].pos?this.ArticelData[indexP][indexS][indexs].pos:''
-                }
-                saveItem.push(obj)
-            })
-            saveArr[indexP].push(saveItem)
-            indexS++
+      });
+      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: this.showPos
+                ? items.lastIndexOf('_') > -1
+                  ? items.substring(items.lastIndexOf('_') + 1).trim()
+                  : ''
+                : this.ArticelData[indexP] &&
+                  this.ArticelData[indexP][indexS] &&
+                  this.ArticelData[indexP][indexS][indexs] &&
+                  this.ArticelData[indexP][indexS][indexs].pos
+                ? this.ArticelData[indexP][indexS][indexs].pos
+                : '',
+            };
+            saveItem.push(obj);
+          });
+          saveArr[indexP].push(saveItem);
+          indexS++;
         }
-      })
-    //   if(!flag){
-    //     this.$message.warning('词性有错误请检查')
-    //     return
-    //   }
+      });
+      //   if(!flag){
+      //     this.$message.warning('词性有错误请检查')
+      //     return
+      //   }
       this.loading = true;
-      publicMethods('/TeachingServer/TextAnalyser/SetFCProofreadForAnalyseRecord',{
-            analyse_record_id: this.id,
-            proofread_text: {
-                paragraph_list: saveArr
-            },
-            is_proofread_cx: "true"
-        })
+      publicMethods('/TeachingServer/TextAnalyser/SetFCProofreadForAnalyseRecord', {
+        analyse_record_id: this.id,
+        proofread_text: {
+          paragraph_list: saveArr,
+        },
+        is_proofread_cx: 'true',
+      })
         .then((res) => {
-            if(res.status===1){
-                this.$message.success('保存成功')
-                reparse({ analyse_record_id })
-                    .then(({ record }) => {
-                        this.getArticleData()
-                    })
-                    .finally(() => {
-                        this.loading = false;
-                    });
-            }
+          if (res.status === 1) {
+            this.$message.success('保存成功');
+            reparse({ analyse_record_id })
+              .then(({ record }) => {
+                this.getArticleData();
+              })
+              .finally(() => {
+                this.loading = false;
+              });
+          }
         })
         .catch(() => {
-            this.loading = false;
+          this.loading = false;
         });
     },
     // 获取词性列表
-    getCixingList(){
-        this.cixingList = []
-        publicMethods('/TeachingServer/TextAnalyser/GetCixingList',{})
+    getCixingList() {
+      this.cixingList = [];
+      publicMethods('/TeachingServer/TextAnalyser/GetCixingList', {})
         .then((res) => {
-            if(res.status===1){
-                this.cixingList = res.cixing_list
-            }
+          if (res.status === 1) {
+            this.cixingList = res.cixing_list;
+          }
         })
-        .catch(() => {
-            
-        });
-    }
+        .catch(() => {});
+    },
   },
 };
 </script>
@@ -196,182 +209,180 @@ export default {
   .wheader {
     background: #fff;
   }
-    .el-button{
-        padding: 5px 16px;
-        border-radius: 2px;
-        border: 1px solid #F2F3F5;
-        color: #4E5969;
-        font-size: 14px;
-        font-weight: 400;
-        line-height: 22px;
-        background: #F2F3F5;
-        &.el-button--primary{
-            background: #165DFF;
-            border: 1px solid #165DFF;
-            color: #FFF;
-        }
+  .el-button {
+    padding: 5px 16px;
+    border-radius: 2px;
+    border: 1px solid #f2f3f5;
+    color: #4e5969;
+    font-size: 14px;
+    font-weight: 400;
+    line-height: 22px;
+    background: #f2f3f5;
+    &.el-button--primary {
+      background: #165dff;
+      border: 1px solid #165dff;
+      color: #fff;
     }
+  }
   .main {
     width: 1200px;
     margin: 23px auto;
-    background: #FFF;
+    background: #fff;
     padding: 24px;
-    &-top{
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        margin-bottom: 24px;
-        position: relative;
-        b{
-            color: #000;
-            font-size: 24px;
-            font-weight: 500;
-            line-height: 34px;
-            margin-left: 16px;
-        }
-        .tips{
-            color: #979797;
-            font-size: 12px;
-            font-weight: 400;
-            line-height: 20px;
-            margin-left: 12px;
-        }
-        .show-pos{
-            margin-right: 24px;
-            &.is-checked{
-                .el-switch__label.is-active{
-                    color: rgba(13, 13, 13, 1);
-                }
-            }
+    &-top {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      margin-bottom: 24px;
+      position: relative;
+      b {
+        color: #000;
+        font-size: 24px;
+        font-weight: 500;
+        line-height: 34px;
+        margin-left: 16px;
+      }
+      .tips {
+        color: #979797;
+        font-size: 12px;
+        font-weight: 400;
+        line-height: 20px;
+        margin-left: 12px;
+      }
+      .show-pos {
+        margin-right: 24px;
+        &.is-checked {
+          .el-switch__label.is-active {
+            color: rgba(13, 13, 13, 1);
+          }
         }
+      }
     }
-    .go-back{
-        border-radius: 4px;
-        border: 1px solid #D9D9D9;
-        background: #FFF;
-        box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.02);
-        display: flex;
-        width: 60px;
-        color: #333;
+    .go-back {
+      border-radius: 4px;
+      border: 1px solid #d9d9d9;
+      background: #fff;
+      box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.02);
+      display: flex;
+      width: 60px;
+      color: #333;
+      font-size: 14px;
+      font-weight: 400;
+      line-height: 22px;
+      padding: 5px 8px;
+      align-items: center;
+      cursor: pointer;
+      .el-icon-arrow-left {
+        font-size: 16px;
+        margin-right: 8px;
+      }
+    }
+    .pos-box {
+      margin-bottom: 16px;
+      border-radius: 4px;
+      background: #f7f7f7;
+      padding: 16px;
+      h4 {
+        color: #000;
         font-size: 14px;
-        font-weight: 400;
+        font-weight: 600;
         line-height: 22px;
-        padding: 5px 8px;
-        align-items: center;
-        cursor: pointer;
-        .el-icon-arrow-left{
-            font-size: 16px;
+        margin: 0;
+      }
+      ul {
+        list-style: none;
+        margin: 0;
+        padding: 0;
+        display: flex;
+        flex-flow: wrap;
+        li {
+          margin: 8px 8px 0 0;
+          border-radius: 4px;
+          background: #fff;
+          padding: 4px 16px;
+          label {
+            color: #007eff;
+            font-size: 14px;
+            font-weight: 600;
+            line-height: 22px;
             margin-right: 8px;
-        }
-    }
-    .pos-box{
-        margin-bottom: 16px;
-        border-radius: 4px;
-        background: #F7F7F7;
-        padding: 16px;
-        h4{
+          }
+          span {
             color: #000;
             font-size: 14px;
-            font-weight: 600;
+            font-weight: 400;
             line-height: 22px;
-            margin: 0;
-        }
-        ul{
-            list-style: none;
-            margin: 0;
-            padding: 0;
-            display: flex;
-            flex-flow: wrap;
-            li{
-                margin: 8px 8px 0 0;
-                border-radius: 4px;
-                background: #FFF;
-                padding: 4px 16px;
-                label{
-                    color: #007EFF;
-                    font-size: 14px;
-                    font-weight: 600;
-                    line-height: 22px;
-                    margin-right: 8px;
-                }
-                span{
-                    color: #000;
-                    font-size: 14px;
-                    font-weight: 400;
-                    line-height: 22px;
-                }
-            }
+          }
         }
+      }
     }
   }
 }
-.check-box{
-    padding: 24px;
-    border-radius: 4px;
-    background: #FFF;
-    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
-    .content{
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        .words-box{
-            text-align: center;
-            color: #000;
-            .words{
-                display: block;
-                font-size: 28px;
-                line-height: 40px;
-                font-weight: 400;
-            }
-            .pinyin{
-                font-family: 'League';
-                font-size: 20px;
-                font-weight: 400;
-                line-height: 1;
-                height: 20px;
-                display: block;
-            }
-        }
-    }
-    .checkPinyinInput{
-        margin: 16px 0 8px 0;
-    }
-    .tips{
-        color: #A0A0A0;
-        font-size: 12px;
+.check-box {
+  padding: 24px;
+  border-radius: 4px;
+  background: #fff;
+  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
+  .content {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    .words-box {
+      text-align: center;
+      color: #000;
+      .words {
+        display: block;
+        font-size: 28px;
+        line-height: 40px;
         font-weight: 400;
-        line-height: 18px;
-        margin: 0 0 24px 0;
+      }
+      .pinyin {
+        font-family: 'League';
+        font-size: 20px;
+        font-weight: 400;
+        line-height: 1;
+        height: 20px;
+        display: block;
+      }
     }
-    .btn-box{
-        text-align: right;
-        .el-button{
-            font-size: 12px;
-            padding: 2px 12px;
-            line-height: 20px;
-        }
+  }
+  .checkPinyinInput {
+    margin: 16px 0 8px 0;
+  }
+  .tips {
+    color: #a0a0a0;
+    font-size: 12px;
+    font-weight: 400;
+    line-height: 18px;
+    margin: 0 0 24px 0;
+  }
+  .btn-box {
+    text-align: right;
+    .el-button {
+      font-size: 12px;
+      padding: 2px 12px;
+      line-height: 20px;
     }
+  }
 }
 </style>
 <style lang="scss">
-.check-article{
-    .show-pos{
-        .el-switch__label.is-active{
-            color: rgba(13, 13, 13, 1);
-        }
-        &.el-switch.is-checked .el-switch__core{
-            border-color: #165DFF;
-            background-color: #165DFF;
-        }
+.check-article {
+  .show-pos {
+    .el-switch__label.is-active {
+      color: rgba(13, 13, 13, 1);
     }
-    .no-pos-content{
-        .el-textarea__inner{
-            font-family: Helvetica, 'FZJCGFKTK';
-            font-size: 16px;
-            color: rgba(0, 0, 0, 0.88);
-        }
+    &.el-switch.is-checked .el-switch__core {
+      border-color: #165dff;
+      background-color: #165dff;
+    }
+  }
+  .no-pos-content {
+    .el-textarea__inner {
+      font-family: Helvetica, 'FZJCGFKTK';
+      font-size: 16px;
+      color: rgba(0, 0, 0, 0.88);
     }
+  }
 }
-
 </style>
-

+ 258 - 255
src/views/Textanalysis/CheckWord.vue

@@ -1,28 +1,34 @@
 <template>
   <div v-loading="loading" class="check-article">
-    <HeaderPage />
+    <HeaderPage v-if="!userID" />
     <div class="main">
       <div class="main-top">
         <div style="display: flex; align-items: end">
-            <a class="go-back" @click="$router.go(-1)">
-                <i class="el-icon-arrow-left"></i>
-                返回
-            </a>
-            <b>校对分词</b>
-            <p class="tips">分词:在需要分开的内容中间插入两个空格;分句:将句子另起一行;分段:两段中间加入空行。</p>
+          <a class="go-back" @click="$router.go(-1)">
+            <i class="el-icon-arrow-left"></i>
+            返回
+          </a>
+          <b>校对分词</b>
+          <p class="tips">分词:在需要分开的内容中间插入两个空格;分句:将句子另起一行;分段:两段中间加入空行。</p>
         </div>
         <div class="btn-box">
-            <!-- <el-switch
+          <!-- <el-switch
                 class="show-pos"
                 v-model="showPos"
                 active-text="显示词性"
                 inactive-text="">
             </el-switch> -->
-            <el-button type="info" @click="$router.go(-1)">取消</el-button>
-            <el-button type="primary" @click="saveWord(id)">保存</el-button>
+          <el-button type="info" @click="$router.go(-1)">取消</el-button>
+          <el-button type="primary" @click="saveWord(id)">保存</el-button>
         </div>
       </div>
-      <el-input v-if="showPos" class="no-pos-content" v-model="hasPosContent" type="textarea" :autosize="{ minRows: 27 }" />
+      <el-input
+        v-if="showPos"
+        class="no-pos-content"
+        v-model="hasPosContent"
+        type="textarea"
+        :autosize="{ minRows: 27 }"
+      />
       <el-input v-else class="no-pos-content" v-model="noPosContent" type="textarea" :autosize="{ minRows: 27 }" />
     </div>
   </div>
@@ -44,123 +50,122 @@ export default {
       showPos: false,
       noPosContent: '',
       hasPosContent: '',
-      posList: ['NR','NN','JJ','AD','PU','VV','CC','SP','FW','DEC','ETC','AS'],
+      posList: ['NR', 'NN', 'JJ', 'AD', 'PU', 'VV', 'CC', 'SP', 'FW', 'DEC', 'ETC', 'AS'],
+      userID: this.$route.query.userID,
     };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
   created() {
     this.routerData = JSON.parse(JSON.stringify(this.$route.query));
-    this.id = this.routerData.id
-    this.getArticleData()
+    this.id = this.routerData.id;
+    this.getArticleData();
   },
   methods: {
     // 获取分析结果
     getArticleData() {
       this.loading = true;
-      let str = ''
-      let posStr = ''
-      publicMethods('/TeachingServer/TextAnalyser/GetParsedTextInfo',{
-          analyse_record_id: this.id,
-        }
-      )
+      let str = '';
+      let posStr = '';
+      publicMethods('/TeachingServer/TextAnalyser/GetParsedTextInfo', {
+        analyse_record_id: this.id,
+      })
         .then((res) => {
-            if(res.status===1){
-                let newdata = [];
-                res.parsed_text.paragraph_list.forEach((item) => {
-                    if (item.length !== 0) {
-                        newdata.push(item);
-                    }
+          if (res.status === 1) {
+            let newdata = [];
+            res.parsed_text.paragraph_list.forEach((item) => {
+              if (item.length !== 0) {
+                newdata.push(item);
+              }
+            });
+            this.ArticelData = JSON.parse(JSON.stringify(newdata));
+            newdata.forEach((item, index) => {
+              item.forEach((items, indexs) => {
+                items.forEach((itemss, indexss) => {
+                  let strWord = '';
+                  itemss.text.forEach((itemT, indexT) => {
+                    strWord += itemT.word;
+                  });
+                  str += strWord + (indexss !== items.length - 1 ? '  ' : '');
+                  posStr += strWord + (itemss.pos ? '_' + itemss.pos : '') + (indexss !== items.length - 1 ? '  ' : '');
                 });
-                this.ArticelData = JSON.parse(JSON.stringify(newdata));
-                newdata.forEach((item,index) => {
-                    item.forEach((items,indexs) => {
-                        items.forEach((itemss,indexss)=>{
-                            let strWord = ''
-                            itemss.text.forEach((itemT,indexT)=>{
-                               strWord += itemT.word
-                            })
-                            str += strWord + (indexss!==items.length-1?'  ':'')
-                            posStr += strWord +(itemss.pos?'_'+itemss.pos:'') + (indexss!==items.length-1?'  ':'')
-                        })
-                        str += '\n'
-                        posStr += '\n'
-                    });
-                    if(index!==newdata.length-1){
-                        str += '\n'
-                        posStr += '\n'
-                    }
-                });
-                this.noPosContent = str
-                this.hasPosContent = posStr
-                this.loading = false;
-            }
+                str += '\n';
+                posStr += '\n';
+              });
+              if (index !== newdata.length - 1) {
+                str += '\n';
+                posStr += '\n';
+              }
+            });
+            this.noPosContent = str;
+            this.hasPosContent = posStr;
+            this.loading = false;
+          }
         })
         .catch(() => {
           this.loading = false;
         });
     },
-    saveWord(analyse_record_id){
-      let saveArr = []
-      let arr = this.showPos?this.hasPosContent.split('\n'):this.noPosContent.split('\n')
-      let indexP = 0 // 段落索引
-      let indexS = 0 // 句子索引
-      let flag = true
-      arr.forEach(item=>{
-        if(item===''){
-            saveArr.push([])
+    saveWord(analyse_record_id) {
+      let saveArr = [];
+      let arr = this.showPos ? this.hasPosContent.split('\n') : 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++
+      });
+      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
-    //   }
+      });
+      //   if(!flag){
+      //     this.$message.warning('词性有错误请检查')
+      //     return
+      //   }
       this.loading = true;
-      publicMethods('/TeachingServer/TextAnalyser/SetFCProofreadForAnalyseRecord',{
-            analyse_record_id: this.id,
-            proofread_text: {
-                paragraph_list: saveArr
-            },
-            is_proofread_cx: "false"
-        })
+      publicMethods('/TeachingServer/TextAnalyser/SetFCProofreadForAnalyseRecord', {
+        analyse_record_id: this.id,
+        proofread_text: {
+          paragraph_list: saveArr,
+        },
+        is_proofread_cx: 'false',
+      })
         .then((res) => {
-            if(res.status===1){
-                this.$message.success('保存成功')
-                reparse({ analyse_record_id })
-                    .then(({ record }) => {
-                        this.getArticleData()
-                    })
-                    .finally(() => {
-                        this.loading = false;
-                    });
-            }
+          if (res.status === 1) {
+            this.$message.success('保存成功');
+            reparse({ analyse_record_id })
+              .then(({ record }) => {
+                this.getArticleData();
+              })
+              .finally(() => {
+                this.loading = false;
+              });
+          }
         })
         .catch(() => {
-            this.loading = false;
+          this.loading = false;
         });
     },
-    
   },
 };
 </script>
@@ -173,182 +178,180 @@ export default {
   .wheader {
     background: #fff;
   }
-    .el-button{
-        padding: 5px 16px;
-        border-radius: 2px;
-        border: 1px solid #F2F3F5;
-        color: #4E5969;
-        font-size: 14px;
-        font-weight: 400;
-        line-height: 22px;
-        background: #F2F3F5;
-        &.el-button--primary{
-            background: #165DFF;
-            border: 1px solid #165DFF;
-            color: #FFF;
-        }
+  .el-button {
+    padding: 5px 16px;
+    border-radius: 2px;
+    border: 1px solid #f2f3f5;
+    color: #4e5969;
+    font-size: 14px;
+    font-weight: 400;
+    line-height: 22px;
+    background: #f2f3f5;
+    &.el-button--primary {
+      background: #165dff;
+      border: 1px solid #165dff;
+      color: #fff;
     }
+  }
   .main {
     width: 1200px;
     margin: 23px auto;
-    background: #FFF;
+    background: #fff;
     padding: 24px;
-    &-top{
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        margin-bottom: 24px;
-        position: relative;
-        b{
-            color: #000;
-            font-size: 24px;
-            font-weight: 500;
-            line-height: 34px;
-            margin-left: 16px;
-        }
-        .tips{
-            color: #979797;
-            font-size: 12px;
-            font-weight: 400;
-            line-height: 20px;
-            margin-left: 12px;
-        }
-        .show-pos{
-            margin-right: 24px;
-            &.is-checked{
-                .el-switch__label.is-active{
-                    color: rgba(13, 13, 13, 1);
-                }
-            }
+    &-top {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      margin-bottom: 24px;
+      position: relative;
+      b {
+        color: #000;
+        font-size: 24px;
+        font-weight: 500;
+        line-height: 34px;
+        margin-left: 16px;
+      }
+      .tips {
+        color: #979797;
+        font-size: 12px;
+        font-weight: 400;
+        line-height: 20px;
+        margin-left: 12px;
+      }
+      .show-pos {
+        margin-right: 24px;
+        &.is-checked {
+          .el-switch__label.is-active {
+            color: rgba(13, 13, 13, 1);
+          }
         }
+      }
     }
-    .go-back{
-        border-radius: 4px;
-        border: 1px solid #D9D9D9;
-        background: #FFF;
-        box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.02);
-        display: flex;
-        width: 60px;
-        color: #333;
+    .go-back {
+      border-radius: 4px;
+      border: 1px solid #d9d9d9;
+      background: #fff;
+      box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.02);
+      display: flex;
+      width: 60px;
+      color: #333;
+      font-size: 14px;
+      font-weight: 400;
+      line-height: 22px;
+      padding: 5px 8px;
+      align-items: center;
+      cursor: pointer;
+      .el-icon-arrow-left {
+        font-size: 16px;
+        margin-right: 8px;
+      }
+    }
+    .pos-box {
+      margin-bottom: 16px;
+      border-radius: 4px;
+      background: #f7f7f7;
+      padding: 16px;
+      h4 {
+        color: #000;
         font-size: 14px;
-        font-weight: 400;
+        font-weight: 600;
         line-height: 22px;
-        padding: 5px 8px;
-        align-items: center;
-        cursor: pointer;
-        .el-icon-arrow-left{
-            font-size: 16px;
+        margin: 0;
+      }
+      ul {
+        list-style: none;
+        margin: 0;
+        padding: 0;
+        display: flex;
+        flex-flow: wrap;
+        li {
+          margin: 8px 8px 0 0;
+          border-radius: 4px;
+          background: #fff;
+          padding: 4px 16px;
+          label {
+            color: #007eff;
+            font-size: 14px;
+            font-weight: 600;
+            line-height: 22px;
             margin-right: 8px;
-        }
-    }
-    .pos-box{
-        margin-bottom: 16px;
-        border-radius: 4px;
-        background: #F7F7F7;
-        padding: 16px;
-        h4{
+          }
+          span {
             color: #000;
             font-size: 14px;
-            font-weight: 600;
+            font-weight: 400;
             line-height: 22px;
-            margin: 0;
-        }
-        ul{
-            list-style: none;
-            margin: 0;
-            padding: 0;
-            display: flex;
-            flex-flow: wrap;
-            li{
-                margin: 8px 8px 0 0;
-                border-radius: 4px;
-                background: #FFF;
-                padding: 4px 16px;
-                label{
-                    color: #007EFF;
-                    font-size: 14px;
-                    font-weight: 600;
-                    line-height: 22px;
-                    margin-right: 8px;
-                }
-                span{
-                    color: #000;
-                    font-size: 14px;
-                    font-weight: 400;
-                    line-height: 22px;
-                }
-            }
+          }
         }
+      }
     }
   }
 }
-.check-box{
-    padding: 24px;
-    border-radius: 4px;
-    background: #FFF;
-    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
-    .content{
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        .words-box{
-            text-align: center;
-            color: #000;
-            .words{
-                display: block;
-                font-size: 28px;
-                line-height: 40px;
-                font-weight: 400;
-            }
-            .pinyin{
-                font-family: 'League';
-                font-size: 20px;
-                font-weight: 400;
-                line-height: 1;
-                height: 20px;
-                display: block;
-            }
-        }
-    }
-    .checkPinyinInput{
-        margin: 16px 0 8px 0;
-    }
-    .tips{
-        color: #A0A0A0;
-        font-size: 12px;
+.check-box {
+  padding: 24px;
+  border-radius: 4px;
+  background: #fff;
+  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
+  .content {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    .words-box {
+      text-align: center;
+      color: #000;
+      .words {
+        display: block;
+        font-size: 28px;
+        line-height: 40px;
+        font-weight: 400;
+      }
+      .pinyin {
+        font-family: 'League';
+        font-size: 20px;
         font-weight: 400;
-        line-height: 18px;
-        margin: 0 0 24px 0;
+        line-height: 1;
+        height: 20px;
+        display: block;
+      }
     }
-    .btn-box{
-        text-align: right;
-        .el-button{
-            font-size: 12px;
-            padding: 2px 12px;
-            line-height: 20px;
-        }
+  }
+  .checkPinyinInput {
+    margin: 16px 0 8px 0;
+  }
+  .tips {
+    color: #a0a0a0;
+    font-size: 12px;
+    font-weight: 400;
+    line-height: 18px;
+    margin: 0 0 24px 0;
+  }
+  .btn-box {
+    text-align: right;
+    .el-button {
+      font-size: 12px;
+      padding: 2px 12px;
+      line-height: 20px;
     }
+  }
 }
 </style>
 <style lang="scss">
-.check-article{
-    .show-pos{
-        .el-switch__label.is-active{
-            color: rgba(13, 13, 13, 1);
-        }
-        &.el-switch.is-checked .el-switch__core{
-            border-color: #165DFF;
-            background-color: #165DFF;
-        }
+.check-article {
+  .show-pos {
+    .el-switch__label.is-active {
+      color: rgba(13, 13, 13, 1);
     }
-    .no-pos-content{
-        .el-textarea__inner{
-            font-family: Helvetica, 'FZJCGFKTK';
-            font-size: 16px;
-            color: rgba(0, 0, 0, 0.88);
-        }
+    &.el-switch.is-checked .el-switch__core {
+      border-color: #165dff;
+      background-color: #165dff;
+    }
+  }
+  .no-pos-content {
+    .el-textarea__inner {
+      font-family: Helvetica, 'FZJCGFKTK';
+      font-size: 16px;
+      color: rgba(0, 0, 0, 0.88);
     }
+  }
 }
-
 </style>
-

+ 5 - 2
src/views/Textanalysis/WordTable.vue

@@ -1,6 +1,6 @@
 <template>
   <div v-loading="loading" class="WordTable">
-    <div class="wheader">
+    <div class="wheader" v-if="!userID">
       <HeaderPage />
     </div>
     <div class="main">
@@ -432,6 +432,7 @@ export default {
       alldata: null,
       id: '',
       allLevels: [],
+      userID: this.$route.query.userID,
     };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
@@ -506,6 +507,7 @@ export default {
       data.remarks = JSON.stringify(arr);
       data.color = color;
       data.leftNavIndex = this.typeIndex;
+      data.userID = this.userID;
       sessionStorage.setItem('tablehighlight', true);
 
       window.open(
@@ -691,7 +693,8 @@ export default {
 
   .main {
     width: 1200px;
-    margin: 23px auto;
+    margin: 0 auto;
+    padding: 23px 0;
     .go-back {
       border-radius: 4px;
       border: 1px solid #d9d9d9;

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 531 - 500
src/views/Textanalysis/index.vue


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

@@ -1,7 +1,7 @@
 <template>
   <div v-loading="loading" class="TextAnalysis">
-    <HeaderPage v-if="!AccessToken" />
-    <div class="main" v-if="showPage">
+    <HeaderPage v-if="!userID" />
+    <div v-if="showPage" class="main">
       <div class="title">文本分析</div>
       <div class="input_main">
         <el-input
@@ -108,8 +108,8 @@ export default {
       recordLoading: false,
       AccessToken: this.$route.query.AccessToken,
       AppID: this.$route.query.AppID,
-      UserID: this.$route.query.UserID,
       showPage: false,
+      userID: this.$route.query.UserID ? this.$route.query.UserID : '',
     };
   },
   computed: {
@@ -151,6 +151,7 @@ export default {
         this.$refs.upload.clearFiles();
         AddTextFile({
           file_id_list: this.file_id_list,
+          app_user_id: this.userID,
         })
           .then(() => {
             this.$message.success('上传成功');
@@ -205,6 +206,7 @@ export default {
             // vocabulary_difficulty: item.vocabulary_difficulty,
             type: '文本分析',
             id: item.id,
+            userID: this.userID,
           },
         }).href,
         '_blank',
@@ -251,6 +253,7 @@ export default {
       this.loading = true;
       analyse({
         text: this.txt,
+        app_user_id: this.userID,
       })
         .then(({ record }) => {
           //   this.txt = '';
@@ -281,7 +284,7 @@ export default {
       PageQueryMyTextAnalyseRecordList({
         page_capacity: this.pageSize,
         cur_page: this.data?.cur_page ?? 1,
-        app_user_id: this.UserID ? this.UserID : '',
+        app_user_id: this.userID,
       })
         .then((data) => {
           this.data = data;

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác