瀏覽代碼

elective commmands + roundId url parameters; multiple choose for preference simulate

hare8999@163.com 2 年之前
父節點
當前提交
d062fa273b

+ 17 - 11
src/api/webApi/elective/generation.js

@@ -34,10 +34,12 @@ export function getGenerationOptionalMajorsBatch(params) {
 
 // /prod-api/front/elective/generation/applyElectiveDMAlgorithm
 // 执行选科匹配算法。为减少错误,对DM代数据全删全加可能好点。
-export function applyElectiveDMAlgorithm(algorithm) {
+export function applyElectiveDMAlgorithm(algorithm, roundId) {
+  const params = {algorithm, roundId}
   return request({
-    url: '/front/elective/generation/applyElectiveDMAlgorithm?algorithm=' + algorithm,
-    method: 'post'
+    url: '/front/elective/generation/applyElectiveDMAlgorithm',
+    method: 'post',
+    params
   })
 }
 
@@ -61,28 +63,31 @@ export function enrollByForce(groupId, studentId) {
 
 // /front/elective/generation/flushIntoGenerationDM
 // 在任意报名阶段,如果校长发现数据已经完全OK,则可以强制推进进程,提前进入决策
-export function flushIntoGenerationDM() {
+export function flushIntoGenerationDM(params) {
   return request({
     url: '/front/elective/generation/flushIntoGenerationDM',
-    method: 'post'
+    method: 'post',
+    params
   })
 }
 
 // /front/elective/generation/jumpGenerationForceAdjust
 // 二次补录结果(或者提前录取完毕时)跳转到强制调剂
-export function jumpGenerationForceAdjust() {
+export function jumpGenerationForceAdjust(params) {
   return request({
     url: '/front/elective/generation/jumpGenerationForceAdjust',
-    method: 'post'
+    method: 'post',
+    params
   })
 }
 
 // /front/elective/generation/jumpGenerationRankBalance
 // 如果在所有学生全部录取的情况,可以在任意决策结点跳转至排名均衡
-export function jumpGenerationRankBalance() {
+export function jumpGenerationRankBalance(params) {
   return request({
     url: '/front/elective/generation/jumpGenerationRankBalance',
-    method: 'post'
+    method: 'post',
+    params
   })
 }
 
@@ -98,10 +103,11 @@ export function pushGenerationSetting(data) {
 
 // /front/elective/generation/terminateGeneration
 // 如果在所有学生全部录取的情况,可以在任意决策结点跳转至终止态,封存数据
-export function terminateGeneration() {
+export function terminateGeneration(params) {
   return request({
     url: '/front/elective/generation/terminateGeneration',
-    method: 'post'
+    method: 'post',
+    params
   })
 }
 

+ 2 - 2
src/utils/request.js

@@ -21,8 +21,8 @@ service.interceptors.request.use(config => {
     config.headers['Authorization'] = 'Bearer ' + auth.getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
   }
 
-  // get请求映射params参数
-  if (config.method === 'get' && config.params) {
+  // 映射params参数
+  if (config.params) {
     let url = config.url + '?'
     for (const propName of Object.keys(config.params)) {
       const value = config.params[propName]

+ 14 - 10
src/views/career/zhiyuan/components/recommend.vue

@@ -10,7 +10,7 @@
       </div>
       <div class="filters">
         <!-- 院校筛选条件 -->
-        <filter-form :filter="filter_form" :levelHide="true"></filter-form>
+        <filter-form :filter="filter_form" :levelHide="true" multiple></filter-form>
 
         <!-- 专业 -->
         <el-row class="radioInput">
@@ -137,10 +137,10 @@ export default {
       indeterminate: false,
       checkedList: [],
       filter_form: {
-        location: '',
-        natureTypeCN: '',
-        type: '',
-        features: '',
+        location: [],
+        natureTypeCN: [],
+        type: [],
+        features: [],
         pickType: '',
         name: ''
       },
@@ -379,11 +379,11 @@ export default {
         batchMinScore: this.batch.score2 || this.batch.score1,
         university: {
           // "code": "string",
-          features: this.filter_form.features,
-          level: this.filter_form.level,
-          location: this.filter_form.location,
-          type: this.filter_form.type,
-          natureTypeCN: this.filter_form.natureTypeCN,
+          features: this.filter_form.features?.toString(),
+          level: this.filter_form.level?.toString(),
+          location: this.filter_form.location?.toString(),
+          type: this.filter_form.type?.toString(),
+          natureTypeCN: this.filter_form.natureTypeCN?.toString(),
           name: this.filter_form.name
           // "status": 0,
           // "type": "string"
@@ -587,6 +587,10 @@ em {
     box-shadow: none;
   }
 
+  .el-radio-button {
+    margin-left: 10px;
+  }
+
   .radiaTitle {
     display: inline-block;
     width: 80px;

+ 8 - 5
src/views/elective/generation/components/elective-generation-commands.vue

@@ -53,6 +53,9 @@ export default {
     status() {
       return this.generation?.status || {}
     },
+    commitParams() {
+      return { roundId: this.status.roundId }
+    },
     // buttons control
     showDMAlgorithm() {
       return this.status.allowDMAlgorithm
@@ -100,7 +103,7 @@ export default {
     applyAlgorithm() {
       // 暂时只支持一种算法,不排队以后会支持多种
       const algorithm = config.electiveDMAlgorithm.rankFirst.value
-      applyElectiveDMAlgorithm(algorithm).finally(() => {
+      applyElectiveDMAlgorithm(algorithm, this.commitParams.roundId).finally(() => {
         this.notifyRootRefresh()
       })
     },
@@ -109,7 +112,7 @@ export default {
       this.$emit('jumpDetail')
     },
     flushIntoDM() {
-      flushIntoGenerationDM().finally(() => {
+      flushIntoGenerationDM(this.commitParams).finally(() => {
         this.notifyRootRefresh(true)
       })
     },
@@ -127,19 +130,19 @@ export default {
     },
     async jumpForceAdjust() {
       await this.$confirm('确认进入调剂阶段?')
-      jumpGenerationForceAdjust().finally(() => {
+      jumpGenerationForceAdjust(this.commitParams).finally(() => {
         this.notifyRootRefresh(true)
       })
     },
     async jumpRankBalance() {
-      jumpGenerationRankBalance().finally(() => {
+      jumpGenerationRankBalance(this.commitParams).finally(() => {
         this.notifyRootRefresh(true)
       })
     },
     async terminateAndJumpDispatch() {
       await this.$confirm('确认进入选科分班?该操作将锁定所有选科录取状态,且不可逆')
       this.lockPage()
-      terminateGeneration().then(res => {
+      terminateGeneration(this.commitParams).then(res => {
         this.jumpDispatch()
       }).finally(() => {
         this.unlockPage()