Browse Source

跨句不让选

natasha 1 year ago
parent
commit
284a658994
1 changed files with 21 additions and 17 deletions
  1. 21 17
      src/views/content_manage/newspaper_manage/CheckArticle.vue

+ 21 - 17
src/views/content_manage/newspaper_manage/CheckArticle.vue

@@ -129,7 +129,8 @@ export default {
         saveLoaing: false,
         wordId:'',
         activeItem: null,
-        highInclude: null
+        highInclude: null,
+        highSentenceId: null
     }
   },
   //计算属性 类似于data概念
@@ -145,6 +146,7 @@ export default {
         this.wordId = item.id
         // item.highIndex = true
         this.highInclude = item.bind_sent_data.bind_sents[0].sel_token_idxes
+        this.highSentenceId = item.bind_sent_data.bind_sents[0].sent_id
         this.$forceUpdate()
     },
     handleChangeTabs(value){
@@ -409,23 +411,25 @@ export default {
         })
     },
     changeWordName(item){
-        let highArr = this.activeItem.bind_sent_data.bind_sents[0].sel_token_idxes
-        if(highArr.indexOf(item.tokenIndex)==-1){
-            highArr.push(item.tokenIndex)
-        }else{
-            highArr.splice(highArr.indexOf(item.tokenIndex),1)
+        if(item.sent_id===this.highSentenceId){
+            let highArr = this.activeItem.bind_sent_data.bind_sents[0].sel_token_idxes
+            if(highArr.indexOf(item.tokenIndex)==-1){
+                highArr.push(item.tokenIndex)
+            }else{
+                highArr.splice(highArr.indexOf(item.tokenIndex),1)
+            }
+            let word_name = ''
+            highArr.sort().forEach(item=>{
+                word_name=word_name+this.activeItem.bind_sent_data.bind_sents[0].sent_bean.tokens[item][2]+this.activeItem.bind_sent_data.bind_sents[0].sent_bean.tokens[item][9]
+            })
+            this.activeItem.exp_title = word_name
+            this.activeItem.bind_sent_data.bind_sents[0].sel_token_idxes = highArr.sort()
+            this.highInclude = highArr
+            item.highIndex = !item.highIndex
+            item.word_id = this.activeItem.id
+            item.type = this.activeItem.type
+            this.changeTypes(this.activeItem)
         }
-        let word_name = ''
-        highArr.sort().forEach(item=>{
-            word_name=word_name+this.activeItem.bind_sent_data.bind_sents[0].sent_bean.tokens[item][2]+this.activeItem.bind_sent_data.bind_sents[0].sent_bean.tokens[item][9]
-        })
-        this.activeItem.exp_title = word_name
-        this.activeItem.bind_sent_data.bind_sents[0].sel_token_idxes = highArr.sort()
-        this.highInclude = highArr
-        item.highIndex = !item.highIndex
-        item.word_id = this.activeItem.id
-        item.type = this.activeItem.type
-        this.changeTypes(this.activeItem)
     },
     changeTypes(item){
         let MethodName = '/PaperServer/Manager/ArticleManager/CheckWordExplainInArt'