Преглед на файлове

fix: 修复筛选逻辑并补充调试日志

1. 给多个页面的时间筛选逻辑增加了仅初始化时赋值的判断,避免覆盖用户已选择的时间
2. 在考核列表页面补充了根据选中时间过滤数据的逻辑
3. 增加了两处调试用的console日志用于开发排查
SanHQin преди 2 дни
родител
ревизия
9352a6f637
променени са 3 файла, в които са добавени 11 реда и са изтрити 5 реда
  1. 7 3
      src/components/pages/liyuan/page/examine/index.vue
  2. 2 0
      src/components/pages/test/check/index.vue
  3. 2 2
      src/components/pages/test/examine/index.vue

+ 7 - 3
src/components/pages/liyuan/page/examine/index.vue

@@ -480,7 +480,7 @@ export default {
         typ: this.pType,
         org: this.org,
         oid: this.oid,
-        time:this.pType==1?this.timeA:this.timeB
+        time:""
       };
       this.ajax
         .get(this.$store.state.api + "selectTestExamineBase2", params)
@@ -493,6 +493,7 @@ export default {
           testExamineBaseList.sort((a,b)=>{
             return new Date(b.create_at) - new Date(a.create_at)
           })
+
           this.testExamineBaseList = testExamineBaseList;
           console.log("selectTestExamineBase", res.data[0][0]);
           this.PageBaseData = JSON.parse(res.data[0][0].json);
@@ -502,18 +503,21 @@ export default {
             this.timeListA.sort((a,b)=>{
               return new Date(b.createAt) - new Date(a.createAt)
             })
-            if(this.timeListA.length>0)this.timeA = this.timeListA[0].value;
+            if(this.timeListA.length>0 && !this.timeA)this.timeA = this.timeListA[0].value;
+            this.testExamineBaseList = this.testExamineBaseList.filter(i=>i.time === this.timeA)
           }else {
             this.bArray = res.data[0];
             this.timeListB = this.bArray.map(i=>{return {value:i.time,label:i.timeLabel,createAt:i.create_at,time:i.value}})
             this.timeListB.sort((a,b)=>{
               return new Date(b.createAt) - new Date(a.createAt)
             })
-            if(this.timeListB.length>0)this.timeB = this.timeListB[0].value;
+            if(this.timeListB.length>0 && !this.timeB)this.timeB = this.timeListB[0].value;
             if(!this.bArray.length){
               this.pType = 1
             }
+            this.testExamineBaseList = this.testExamineBaseList.filter(i=>i.time === this.timeB)
           }
+          // this.testExamineBaseList = this.testExamineBaseList.filter(i=>i.type == this.pType)
           // 先获取基础模板,然后再获取用户又没有填写过,填写过就开始循环赋值给基础模板,最后提交基础模板
           this.getData();
         })

+ 2 - 0
src/components/pages/test/check/index.vue

@@ -3747,6 +3747,7 @@ ${JSON.stringify(forAllList)}
 
 
           if(this.timeLimit){
+          console.log("this.timeLimit",this.timeLimit)
             if(this.works[0]){
               let _data = JSON.parse(this.works[0].courseJson)
               console.log("this.works",this.works)
@@ -3755,6 +3756,7 @@ ${JSON.stringify(forAllList)}
                   let time = this.timeLimit.split(",");
                   this.tableDatePicker[index] = [new Date(time[0]),new Date(time[1])]
                 }
+                console.log("this.tableDatePicker",this.tableDatePicker)
               })
 
               // if(!_flag){

+ 2 - 2
src/components/pages/test/examine/index.vue

@@ -151,14 +151,14 @@ export default {
             this.timeListA.sort((a,b)=>{
               return new Date(b.createAt) - new Date(a.createAt)
             })
-            if(this.timeListA.length>0)this.timeA = this.timeListA[0].value;
+            if(this.timeListA.length>0 && !this.timeA)this.timeA = this.timeListA[0].value;
           }else {
             this.bArray = res.data[0];
             this.timeListB = this.bArray.map(i=>{return {value:i.time,label:i.timeLabel,createAt:i.create_at}})
             this.timeListB.sort((a,b)=>{
               return new Date(b.createAt) - new Date(a.createAt)
             })
-            if(this.timeListB.length>0)this.timeB = this.timeListB[0].value;
+            if(this.timeListB.length>0 && !this.timeB)this.timeB = this.timeListB[0].value;
             if(!this.bArray.length){
               this.pType = 1
             }