Pārlūkot izejas kodu

clear data before tree query

abpcoder 4 mēneši atpakaļ
vecāks
revīzija
459392dadb

+ 6 - 1
src/views/questioncenter/components/generate-tabs/paper-by-hand.vue

@@ -271,7 +271,7 @@ export default {
       // console.log('中间状态?', isKnowledgeToChapter, isChapterToKnowledge)
       if (isKnowledgeToChapter || isChapterToKnowledge) return // 这是exeBranch条件切换时的中间状态,不要触发后续查询
 
-      this.queList = []
+      this.cleanBeforeQuery()
       // refresh tree by need
       // TODO: 这里最好是由mx-condition解析依赖关系,但现在mx-condition的渲染逻辑不太方便切入
       const treeCacheObj = { ...this.queryOutput }
@@ -299,6 +299,11 @@ export default {
       console.log('call resetQuestionQuery by mx-condition')
       this.resetQuestionQuery()
     },
+    cleanBeforeQuery() {
+      this.queList = []
+      this.currentNode = null
+      this.title = ''
+    },
     setCurrentNodeAndTitle(nodeData) {
       const branchKey = this.queryParams.exeBranch + 'Id'
       const branchParam = {}

+ 7 - 1
src/views/questioncenter/components/generate-tabs/paper-by-intelligent.vue

@@ -97,9 +97,15 @@ export default {
     loadQuestionCard() {
       // override do-nothing
     },
-    queryQuestions() {
+    cleanBeforeQuery() {
       // override core query
       this.queCount = [] // clear first
+      this.tags = []
+      this.knowledgeIds = []
+      this.listBottoms = []
+    },
+    queryQuestions() {
+      // override core query
       if (this.isKnowledgeBranch) {
         this.getListBottoms()
       } else {