lsc 6 月之前
父節點
當前提交
394fe64d17
共有 1 個文件被更改,包括 9 次插入14 次删除
  1. 9 14
      src/components/pages/test/check/index.vue

+ 9 - 14
src/components/pages/test/check/index.vue

@@ -1490,10 +1490,9 @@ export default {
                   topic.answer2 = _answer
                   topic.answer2 = _answer
                 }
                 }
               } else if (topic.type == 11) {
               } else if (topic.type == 11) {
-                if(el2.array[i].json.answer2){
-                  let _answer = el2.array[i].json.answer2
+                  const uniqueArray = courseCount11.filter((item, index) => courseCount11.indexOf(item) === index);
+                  let _answer = uniqueArray
                   topic.answer2 = _answer
                   topic.answer2 = _answer
-                }
               }
               }
             }
             }
             console.log('topictopictopictopic',topic)
             console.log('topictopictopictopic',topic)
@@ -1519,16 +1518,16 @@ export default {
                 i.update_at = new Date(i.update_at).toLocaleString('zh-CN', {year: 'numeric',month: '2-digit',day: '2-digit',hour: '2-digit',minute: '2-digit',second: '2-digit',hour12: false}).replace(/\//g,'-')
                 i.update_at = new Date(i.update_at).toLocaleString('zh-CN', {year: 'numeric',month: '2-digit',day: '2-digit',hour: '2-digit',minute: '2-digit',second: '2-digit',hour12: false}).replace(/\//g,'-')
               })
               })
               if(topic.type == 6){
               if(topic.type == 6){
-                result.forEach(i=>{
-                  if(this.chapters.find(f=>f.type==6).nameFilters.find(c=>c.value==i.title)==undefined && topic.answer2.includes(el.courseId)){
-                    this.chapters.find(i=>i.type==6).nameFilters.push({text:i.title,value:i.title})
+                result.forEach(elc=>{
+                  if(this.chapters.find(f=>f.type==6).nameFilters.find(c=>c.value==elc.title)==undefined && topic.answer2.includes(elc.courseId)){
+                    this.chapters.find(c=>c.type==6).nameFilters.push({text:elc.title,value:elc.title})
                   }
                   }
                 })
                 })
               }else if(topic.type == 11){
               }else if(topic.type == 11){
-                result.forEach(i=>{
-                  if(this.chapters.find(f=>f.type==1).nameFilters.find(c=>c.value==i.title)==undefined && topic.answer2.includes(el.title)){
-                    this.chapters.find(i=>i.type==11).nameFilters.push({text:i.title,value:i.title})
-                  }
+                result.forEach(elc=>{
+                  if(this.chapters.find((f, index)=>index==i).nameFilters.find(c=>c.value==elc.title)==undefined && topic.answer2.includes(elc.courseId)){
+                    this.chapters.find((c, index)=>index==i).nameFilters.push({text:elc.title,value:elc.title})
+                  }                
                 })
                 })
               }
               }
 
 
@@ -1536,11 +1535,7 @@ export default {
               if(topic.answer2.length){
               if(topic.answer2.length){
                 let _answer = topic.answer2
                 let _answer = topic.answer2
                 topic.courseArray = result.filter(el => {
                 topic.courseArray = result.filter(el => {
-                  if(topic.type == 11){
-                    return _answer.includes(el.title)
-                  }else if(topic.type == 6){
                     return _answer.includes(el.courseId)
                     return _answer.includes(el.courseId)
-                  }
                 });
                 });
               }else{
               }else{
                 topic.courseArray = []
                 topic.courseArray = []