Browse Source

添加根据工种查询数据

aaa 3 years ago
parent
commit
a488a944bd
2 changed files with 17 additions and 4 deletions
  1. 6 2
      src/views/home/exam/page-exam.vue
  2. 11 2
      src/views/home/learn/page-learn-child.vue

+ 6 - 2
src/views/home/exam/page-exam.vue

@@ -58,7 +58,8 @@ export default {
   },
   computed: {
     ...mapState({
-      exam: state => state.exam
+      exam: state => state.exam,
+      chooseEngneeringWork: state => state.user.chooseEngneeringWork
     })
   },
   created() {
@@ -68,8 +69,11 @@ export default {
     // 查询:考试场次的列表信息
     getExamListFun() {
       this.$store.commit("toggleLoading", true);
+      let params = {
+        type: this.chooseEngneeringWork.value
+      };
       this.$_http
-        .get(this.$pathParams(this.$_API.GET_JTXT_GET_EXAMS, {}))
+        .get(this.$_API.GET_JTXT_GET_EXAMS, { params })
         .then(res => {
           if (res.data) {
             res.data.forEach(item => {

+ 11 - 2
src/views/home/learn/page-learn-child.vue

@@ -57,6 +57,7 @@
 
 <script>
 import { getTodayStr } from "@/utils/date";
+import { mapState } from "vuex";
 export default {
   name: "page-learn-child",
   components: {},
@@ -80,7 +81,11 @@ export default {
       learnChildList: []
     };
   },
-  computed: {},
+  computed: {
+    ...mapState({
+      chooseEngneeringWork: state => state.user.chooseEngneeringWork
+    })
+  },
   created() {},
   mounted() {
     this.getChildList();
@@ -113,12 +118,16 @@ export default {
       let path = {
         categoryId: this.learnChildList[this.choosedChildIndex].id
       };
+      let params = {
+        type: this.chooseEngneeringWork.value
+      };
       this.$_http
         .get(
           this.$pathParams(
             this.$_API.JTXT_GET_CATEGORIES_CATEGROYID_MATERIALS,
             path
-          )
+          ),
+          { params }
         )
         .then(res => {
           this.formatNeedStudyTodayFun(res.data);