lsc 1 week ago
parent
commit
21c3ab58b6

+ 8 - 6
src/components/pages/test/index.vue

@@ -561,22 +561,24 @@ export default {
     },
     methods: {
         // 获取基础页面数据
-        getPageBase() {
+         getPageBase(type = 1) {
             let params = {
-                typ: 2,
+                typ: type,
                 org: this.org,
                 oid: this.oid
             };
-            // console.log(params);
             this.ajax
                 .get(this.$store.state.api + "selectTestExamineBase", params)
                 .then(res => {
-                    console.log('selectTestExamineBase',res.data[0]);
-                    this.examineData=res.data[0]
+                this.examineData = res.data[0];
+                if(type == 1 && !res.data[0].length){
+                    this.getPageBase(2)
+                }
+                // console.log("selectTestExamineBase", res.data);
                 })
                 .catch(error => {
                 console.log(error);
-                });
+            });
         },
         random() {
             return Math.random().toString(36).substr(2);

+ 9 - 7
src/components/pages/test/smarter.vue

@@ -367,22 +367,24 @@ export default {
             done();
         },
         // 获取基础页面数据
-        getPageBase() {
+        getPageBase(type = 1) {
             let params = {
-                typ: 2,
+                typ: type,
                 org: this.org,
                 oid: this.oid
             };
-            // console.log(params);
             this.ajax
                 .get(this.$store.state.api + "selectTestExamineBase", params)
                 .then(res => {
-                    console.log('selectTestExamineBase', res.data[0]);
-                    this.examineData = res.data[0]
+                this.examineData = res.data[0];
+                if(type == 1 && !res.data[0].length){
+                    this.getPageBase(2)
+                }
+                // console.log("selectTestExamineBase", res.data);
                 })
                 .catch(error => {
-                    console.log(error);
-                });
+                console.log(error);
+            });
         },
         deleteMenuItem(index) {
             this.menuList.splice(index, 1);

+ 18 - 16
src/components/pages/trainCourse/course.vue

@@ -422,22 +422,24 @@ export default {
   },
   methods: {
     // 获取基础页面数据
-    getPageBase() {
-      let params = {
-          typ: 2,
-          org: this.org,
-          oid: this.oid
-      };
-      // console.log(params);
-      this.ajax
-          .get(this.$store.state.api + "selectTestExamineBase", params)
-          .then(res => {
-              console.log('selectTestExamineBase',res.data[0]);
-              this.examineData=res.data[0]
-          })
-          .catch(error => {
-          console.log(error);
-          });
+    getPageBase(type = 1) {
+        let params = {
+            typ: type,
+            org: this.org,
+            oid: this.oid
+        };
+        this.ajax
+            .get(this.$store.state.api + "selectTestExamineBase", params)
+            .then(res => {
+            this.examineData = res.data[0];
+            if(type == 1 && !res.data[0].length){
+                this.getPageBase(2)
+            }
+            // console.log("selectTestExamineBase", res.data);
+            })
+            .catch(error => {
+            console.log(error);
+        });
     },
     change(val) {
       console.log(val);