Sfoglia il codice sorgente

测评推荐专业mock

shilipojs 3 anni fa
parent
commit
6729c8471f

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

@@ -54,6 +54,99 @@ module.exports = [
       }
     }
   },
+  {
+    url: '/mock/front/elective/optionalMajors',
+    type:'get',
+    response: config => {
+      return {
+        code: 200,
+        msg: 'success',
+        data:[
+          {
+            collegeId: 1,
+            collegeName: '北京大学',
+            majorCategoryName: '计算机技术',  // 专业类别
+            majorCategoryCode: '1',  // 专业编码
+            majors: [],          // 类别下分类
+            limitationA: '',
+            limitationB: '',
+            matchedGroupIds: [3,2], // 匹配哪几个组合?
+          },
+          {
+            collegeId: 2,
+            collegeName: '湖南大学',
+            majorCategoryName: '医学',  // 专业类别
+            majorCategoryCode: '2',  // 专业编码
+            majors: [],          // 类别下分类
+            limitationA: '',
+            limitationB: '',
+            matchedGroupIds: [2], // 匹配哪几个组合?
+          },
+          {
+            collegeId: 3,
+            collegeName: '中南大学',
+            majorCategoryName: '法学',  // 专业类别
+            majorCategoryCode: '3',  // 专业编码
+            majors: [],          // 类别下分类
+            limitationA: '',
+            limitationB: '',
+            matchedGroupIds: [1,2], // 匹配哪几个组合?
+          },
+          {
+            collegeId: 3,
+            collegeName: '中南大学',
+            majorCategoryName: '土木工程',  // 专业类别
+            majorCategoryCode: 'a',  // 专业编码
+            majors: [],          // 类别下分类
+            limitationA: '',
+            limitationB: '',
+            matchedGroupIds: [1], // 匹配哪几个组合?
+          }
+        ]
+      }
+    }
+  },
+  // 评测推荐专业
+  {
+    url: '/mock/front/elective/evaluationMajors',
+    type:'get',
+    response: config => {
+      return {
+        code: 200,
+        msg: 'success',
+        data:[
+          {
+            majorCategoryName: '法学',  // 专业类别
+            majorCategoryCode: '1',  // 专业编码
+            limitationA: '',
+            limitationB: '',
+            matchedGroupIds: [3,2], // 匹配哪几个组合?
+          },
+          {
+            majorCategoryName: '心理学',  // 专业类别
+            majorCategoryCode: '2',  // 专业编码
+            limitationA: '',
+            limitationB: '',
+            matchedGroupIds: [2], // 匹配哪几个组合?
+          },
+          {
+            majorCategoryName: '管理学',  // 专业类别
+            majorCategoryCode: '3',  // 专业编码
+            limitationA: '',
+            limitationB: '',
+            matchedGroupIds: [1,2], // 匹配哪几个组合?
+          },
+          {
+            majorCategoryName: '土木工程',  // 专业类别
+            majorCategoryCode: 'a',  // 专业编码
+            limitationA: '',
+            limitationB: '',
+            matchedGroupIds: [1,3], // 匹配哪几个组合?
+          }
+        ]
+      }
+    }
+  },
   {
     url: '/mock/front/elective/primaryElectives',
     type:'get',

+ 10 - 0
src/api/webApi/elective/ selected-subject.js

@@ -19,5 +19,15 @@ export function getPrimaryElectives(params) {
   })
 }
 
+// 学生获取评测推荐专业
+export function getEvaluationMajors(params) {
+  return request({
+    url: '/mock/front/elective/evaluationMajors',
+    method: 'get',
+    params
+  })
+}
+
+
 
 

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

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-    title="整体组合匹配"
+    :title="`${type == 1 ? '自选专业' : '测评专业'}整体组合匹配`"
     :visible.sync="show"
     width="70%"
   >
@@ -20,6 +20,7 @@ export default {
     return {
       show: false,
       majors: [],
+      type: 1,
       reports: [],
     }
   },
@@ -30,7 +31,7 @@ export default {
         let tempProp = {}
         this.majors.map(major => {
           if(major.matchedGroupIds.findIndex(gi => item.groupId == gi) != -1) {
-            tempProp[`a${major.majorCategoryCode}`] = `符合(${major.collegeName})`
+            tempProp[`a${major.majorCategoryCode}`] = `符合${major.collegeName ? `(${major.collegeName})` : '' }`
           }
         })
         return {
@@ -57,8 +58,9 @@ export default {
     },
   },
   methods: {
-    open(reports,majors) {
+    open(reports,majors,type) {
       this.show = true
+      this.type = type
       this.reports = reports
       this.majors = majors
     },

+ 26 - 6
src/views/system/user/profile/components/select-subject.vue

@@ -5,7 +5,7 @@
         <template #header>
           <div class="fx-row fx-bet-cen">
             您的自选专业:
-            <el-button @click="toMatch">整体匹配</el-button>
+            <el-button @click="toMatch(1)">整体匹配</el-button>
           </div>
         </template> <div>
         <el-popover
@@ -27,9 +27,22 @@
         <template #header>
           <div class="fx-row fx-bet-cen">
             您的测评推荐专业:
-            <el-button>整体匹配</el-button>
+            <el-button @click="toMatch(2)">整体匹配</el-button>
           </div>
         </template>
+        <div>
+          <el-popover
+            placement="bottom"
+            trigger="hover"
+            v-for="item in evaluationMajors"
+            popper-class="zero-padding-popover"
+          >
+            <div class="fx-column">
+              <el-button plain type="text" @click="toGroupMatch(item)">匹配组合</el-button>
+            </div>
+            <el-tag class="mr10 mb10" type="success" slot="reference">{{ item.majorCategoryName }}</el-tag>
+          </el-popover>
+        </div>
       </el-card>
     </el-col>
     <!-- 整体组合匹配 -->
@@ -49,11 +62,15 @@ export default {
   props: {
     list: {
       type:Array,
-      default: _ => {}
+      default: _ => []
     },
     optionalMajors: {
       type:Array,
-      default: _ => {}
+      default: _ => []
+    },
+    evaluationMajors: {
+      type:Array,
+      default: _ => []
     }
   },
   data() {
@@ -66,8 +83,11 @@ export default {
   },
   methods: {
     // 整体组合匹配
-    toMatch() {
-      this.$refs.groupMatch.open(this.list,this.optionalMajors)
+    toMatch(type) {
+      // type 1 自选 2 测评
+      if(type == 1) this.$refs.groupMatch.open(this.list,this.optionalMajors,type)
+      if(type == 2) this.$refs.groupMatch.open(this.list,this.evaluationMajors,type)
+
     },
     // 单组合匹配
     toGroupMatch(major) {

+ 1 - 1
src/views/system/user/profile/components/single-group-match.vue

@@ -37,7 +37,7 @@ export default {
       if (!this.major) return {}
       return {
         groupName: {
-          label: `${this.major.majorCategoryName}(${this.major.collegeName})`
+          label: `${this.major.majorCategoryName}${this.major.collegeName ? `(${this.major.collegeName})`: '' }`
         },
         status: {
           label: '符合'

+ 8 - 2
src/views/system/user/profile/round-select.vue

@@ -25,7 +25,7 @@
       </el-row>
     </el-card>
     <!--  自选专业 推荐专业  -->
-    <select-subject class="mt20" :optionalMajors="optionalMajors" :list="reportList"></select-subject>
+    <select-subject class="mt20" :evaluationMajors="evaluationMajors" :optionalMajors="optionalMajors" :list="reportList"></select-subject>
     <!--  选科报名表  -->
     <report-table class="mt20"  ref="reportRef" :list="reportList"></report-table>
     <test-summary></test-summary>
@@ -105,7 +105,7 @@ import TestResult from '@/views/elective/test/components/test-result'
 import TestSummary from '@/views/elective/test/components/test-summary'
 import SelectSubject from '@/views/system/user/profile/components/select-subject'
 import ReportTable from '@/views/system/user/profile/components/report-table'
-import { getOptionalMajors, getPrimaryElectives } from '@/api/webApi/elective/ selected-subject'
+import { getOptionalMajors, getPrimaryElectives, getEvaluationMajors } from '@/api/webApi/elective/ selected-subject'
 
 export default {
   components: { SelectSubject, TestSummary, TestResult, TestEntry,ReportTable },
@@ -120,6 +120,7 @@ export default {
       },
       reportList: [],
       optionalMajors: [],
+      evaluationMajors: [],
       form: {
         groupId: ''
       },
@@ -148,8 +149,13 @@ export default {
 
     this.getOptionalMajors()
     this.getReportList()
+    this.getEvaluationMajors()
   },
   methods: {
+    async getEvaluationMajors() {
+      const res = await getEvaluationMajors()
+      this.evaluationMajors= res.data
+    },
     async getReportList() {
       const res = await getPrimaryElectives()
       this.reportList = res.data