Parcourir la source

mock转接口

shilipojs il y a 3 ans
Parent
commit
5ed02e31d4

+ 0 - 1
mock/modules/elective-subject.js

@@ -331,7 +331,6 @@ module.exports = [
                 ]
               }
             ]
-
         }
       }
     }

+ 14 - 3
src/api/webApi/elective/ selected-subject.js

@@ -4,14 +4,24 @@ import request from '@/utils/request'
 // 学生获取自选专业及匹配情况
 export function getOptionalMajors(params) {
   return request({
-    url: '/mock/front/elective/optionalMajors',
+    url: '/front/elective/enroll/getOptionalMajors',
     method: 'get',
     params
   })
 }
 
 // 学生获取选科状态数据,得到是每个组合最终状态和结果
-export function getStudentElectiveModels(params) {
+export function getPrimaryElectivesModels(params) {
+  return request({
+    url: '/front/elective/enroll/getPrimaryElectives',
+    method: 'get',
+    params
+  })
+}
+
+
+// 学生获取选科状态数据,得到是每个组合最终状态和结果
+export function getData(params) {
   return request({
     url: '/mock/front/elective/studentElectiveModels',
     method: 'get',
@@ -22,7 +32,7 @@ export function getStudentElectiveModels(params) {
 // 学生获取评测推荐专业
 export function getRecommendMajor(params) {
   return request({
-    url: '/mock/front/elective/evaluationMajors',
+    url: '/front/elective/enroll/getTestMajors',
     method: 'get',
     params
   })
@@ -33,3 +43,4 @@ export function getRecommendMajor(params) {
 
 
 
+

+ 3 - 1
src/views/system/user/profile/components/groups-match.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-    :title="`${type == 1 ? '自选专业' : '测评专业'}整体组合匹配`"
+    :title="`整体组合匹配(${type == 1 ? '自选专业' : '测评专业'})`"
     :visible.sync="show"
     width="70%"
   >
@@ -42,6 +42,8 @@ export default {
       })
     },
     propDefines() {
+        if(!this.majors.length) return {}
+        console.log(this.majors)
         const props = {}
         this.majors.map(item => {
           props[`a${item.majorCategoryCode}`] = {label:item.majorCategoryName }

+ 25 - 14
src/views/system/user/profile/round-select.vue

@@ -108,7 +108,8 @@ import ReportTable from '@/views/system/user/profile/components/report-table'
 import {
   getOptionalMajors,
   getRecommendMajor,
-  getStudentElectiveModels
+  getData,
+  getPrimaryElectivesModels
 } from '@/api/webApi/elective/ selected-subject'
 
 export default {
@@ -137,7 +138,8 @@ export default {
       //
       selectObj: null,
       allowSelect: true,
-      submitting: false
+      submitting: false,
+      propData: {},
     }
   },
   computed: {
@@ -154,22 +156,31 @@ export default {
     this.getOptionalMajors()
     this.getReportList()
     this.getRecommendMajor()
+    this.getData()
   },
   methods: {
-    async getRecommendMajor() {
-      const res = await getRecommendMajor()
-      this.evaluationMajors= res.data
+    async getData() {
+      const res = await getData()
+      this.propData = res.data
     },
-    async getReportList() {
-      const res = await getStudentElectiveModels()
-      this.reportInfo = res.data
-      this.$refs.reportRef.init(this.reportInfo)
+    getRecommendMajor() {
+      getRecommendMajor().then(res => {
+        this.evaluationMajors= res.data
+      })
     },
-    async getOptionalMajors() {
-      const res = await getOptionalMajors()
-      this.optionalMajors = res.data
-      this.$refs.reportRef.initOption(this.optionalMajors)
-      console.log(res)
+    getReportList() {
+      getPrimaryElectivesModels().then(res => {
+        this.reportInfo= res.data
+        this.$refs.reportRef.init(this.reportInfo)
+      })
+
+    },
+    getOptionalMajors() {
+      getOptionalMajors().then(res => {
+        console.log(res)
+        this.optionalMajors= res.data.reverse().splice(0,6)
+        this.$refs.reportRef.initOption(this.optionalMajors)
+      })
     },
     loadStudentSelected() {
       getStudentSelected().then(res => {