Bläddra i källkod

rename generation api - wait for test

hare8999@163.com 3 år sedan
förälder
incheckning
1816e1c9f7

+ 67 - 3
src/api/webApi/elective/generation.js

@@ -10,7 +10,7 @@ export function getElectiveStatus(params) {
 
 
 export function getElectiveSummary(params) {
 export function getElectiveSummary(params) {
   return request({
   return request({
-    url: '/mock/front/report/getElectiveSummary',
+    url: '/front/elective/generation/getElectiveSummary',
     method: 'get',
     method: 'get',
     params
     params
   })
   })
@@ -18,7 +18,7 @@ export function getElectiveSummary(params) {
 
 
 export function getElectiveGenerationDetails(params) {
 export function getElectiveGenerationDetails(params) {
   return request({
   return request({
-    url: '/mock/front/report/getElectiveGenerationDetails',
+    url: '/front/elective/generation/getElectiveGenerationDetails',
     method: 'get',
     method: 'get',
     params
     params
   })
   })
@@ -26,8 +26,72 @@ export function getElectiveGenerationDetails(params) {
 
 
 export function getGenerationOptionalMajorsBatch(params) {
 export function getGenerationOptionalMajorsBatch(params) {
   return request({
   return request({
-    url: '/mock/front/report/getGenerationOptionalMajorsBatch',
+    url: '/front/elective/generation/getGenerationOptionalMajorsBatch',
     method: 'get',
     method: 'get',
     params
     params
   })
   })
 }
 }
+
+// /prod-api/front/elective/generation/applyElectiveDMAlgorithm
+// 执行选科匹配算法。为减少错误,对DM代数据全删全加可能好点。
+export function applyElectiveDMAlgorithm(algorithm) {
+  return request({
+    url: '/front/elective/generation/applyElectiveDMAlgorithm?algorithm=' + algorithm,
+    method: 'post'
+  })
+}
+
+// /prod-api/front/elective/generation/cancelEnrollByForce
+// 取消强制调剂操作
+export function cancelEnrollByForce(id) {
+  return request({
+    url: '/front/elective/generation/cancelEnrollByForce?id=' + id,
+    method: 'post'
+  })
+}
+
+// /front/elective/generation/enrollByForce
+// 决策阶段,强制调剂录取
+export function enrollByForce(groupId, studentId) {
+  return request({
+    url: '/front/elective/generation/enrollByForce?groupId=' + id + '&studentId=' + studentId,
+    method: 'post'
+  })
+}
+
+// /front/elective/generation/flushIntoGenerationDM
+// 在任意报名阶段,如果校长发现数据已经完全OK,则可以强制推进进程,提前进入决策
+export function flushIntoGenerationDM() {
+  return request({
+    url: '/front/elective/generation/flushIntoGenerationDM',
+    method: 'post'
+  })
+}
+
+// /front/elective/generation/jumpGenerationRankBalance
+// 如果在所有学生全部录取的情况,可以在任意决策结点跳转至排名均衡
+export function jumpGenerationRankBalance() {
+  return request({
+    url: '/front/elective/generation/jumpGenerationRankBalance',
+    method: 'post'
+  })
+}
+
+// /prod-api/front/elective/generation/pushGenerationSetting
+// 决策完毕时,推进下一代进行
+export function pushGenerationSetting(data) {
+  return request({
+    url: '/front/elective/generation/pushGenerationSetting',
+    method: 'post',
+    data
+  })
+}
+
+// /front/elective/generation/terminateGeneration
+// 如果在所有学生全部录取的情况,可以在任意决策结点跳转至终止态,封存数据
+export function terminateGeneration() {
+  return request({
+    url: '/front/elective/generation/terminateGeneration',
+    method: 'post'
+  })
+}

+ 11 - 2
src/common/mx-config.js

@@ -79,6 +79,7 @@ export default {
     init: {
     init: {
       key: 'init',
       key: 'init',
       value: 0,
       value: 0,
+      code: 'Init',
       decisionMaking: false,
       decisionMaking: false,
       stepsVisible: false,
       stepsVisible: false,
       title: '未开启',
       title: '未开启',
@@ -88,6 +89,7 @@ export default {
     primary: {
     primary: {
       key: 'primary',
       key: 'primary',
       value: 1,
       value: 1,
+      code: 'Primary',
       decisionMaking: false,
       decisionMaking: false,
       stepsVisible: true,
       stepsVisible: true,
       title: '初录数据',
       title: '初录数据',
@@ -97,6 +99,7 @@ export default {
     primaryDM: {
     primaryDM: {
       key: 'primaryDM',
       key: 'primaryDM',
       value: 2,
       value: 2,
+      code: 'PrimaryDM',
       decisionMaking: true,
       decisionMaking: true,
       stepsVisible: true,
       stepsVisible: true,
       title: '通知补录',
       title: '通知补录',
@@ -106,6 +109,7 @@ export default {
     backTracking: {
     backTracking: {
       key: 'backTracking',
       key: 'backTracking',
       value: 3,
       value: 3,
+      code: 'BackTracking',
       decisionMaking: false,
       decisionMaking: false,
       stepsVisible: true,
       stepsVisible: true,
       title: '补录数据',
       title: '补录数据',
@@ -115,6 +119,7 @@ export default {
     backTrackingDM: {
     backTrackingDM: {
       key: 'backTrackingDM',
       key: 'backTrackingDM',
       value: 4,
       value: 4,
+      code: 'BackTrackingDM',
       decisionMaking: true,
       decisionMaking: true,
       stepsVisible: true,
       stepsVisible: true,
       title: '通知二次补录',
       title: '通知二次补录',
@@ -124,6 +129,7 @@ export default {
     finalAdjust: {
     finalAdjust: {
       key: 'finalAdjust',
       key: 'finalAdjust',
       value: 5,
       value: 5,
+      code: 'FinalAdjust',
       decisionMaking: false,
       decisionMaking: false,
       stepsVisible: true,
       stepsVisible: true,
       title: '二次补录数据',
       title: '二次补录数据',
@@ -133,6 +139,7 @@ export default {
     finalAdjustDM: {
     finalAdjustDM: {
       key: 'finalAdjustDM',
       key: 'finalAdjustDM',
       value: 6,
       value: 6,
+      code: 'FinalAdjustDM',
       decisionMaking: true,
       decisionMaking: true,
       stepsVisible: true,
       stepsVisible: true,
       title: '调剂决策',
       title: '调剂决策',
@@ -142,6 +149,7 @@ export default {
     rankBalance: {
     rankBalance: {
       key: 'rankBalance',
       key: 'rankBalance',
       value: 7,
       value: 7,
+      code: 'RankBalance',
       decisionMaking: true,
       decisionMaking: true,
       stepsVisible: true,
       stepsVisible: true,
       title: '排名均衡',
       title: '排名均衡',
@@ -151,6 +159,7 @@ export default {
     terminate: {
     terminate: {
       key: 'terminate',
       key: 'terminate',
       value: 8,
       value: 8,
+      code: 'Terminate',
       decisionMaking: false,
       decisionMaking: false,
       stepsVisible: false,
       stepsVisible: false,
       title: '选科结束',
       title: '选科结束',
@@ -161,12 +170,12 @@ export default {
   electiveDMAlgorithm: {
   electiveDMAlgorithm: {
     rankFirst: {
     rankFirst: {
       key: 'rankFirst',
       key: 'rankFirst',
-      value: 0,
+      value: 'RankFirst',
       title: '按成绩'
       title: '按成绩'
     },
     },
     majorFirst: {
     majorFirst: {
       key: 'majorFirst',
       key: 'majorFirst',
-      value: 1,
+      value: 'MajorFirst',
       title: '按专业'
       title: '按专业'
     }
     }
   }
   }

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

@@ -1,20 +1,28 @@
 <template>
 <template>
   <div class="fx-row fx-bet-cen">
   <div class="fx-row fx-bet-cen">
     <div class="fx-1">
     <div class="fx-1">
-      <el-button v-if="showDMAlgorithm" type="primary">智能匹配</el-button>
-      <el-button v-if="showDMAlgorithmResults" type="primary">查看匹配明细</el-button>
-      <el-button v-if="showForceAdjust" type="primary">调剂/提醒</el-button>
+      <el-button v-if="showDMAlgorithm" type="primary" @click="applyAlgorithm">智能匹配</el-button>
+      <el-button v-if="showDMAlgorithmResults" type="primary" @click="goDetailPage">查看匹配明细</el-button>
+      <el-button v-if="showForceAdjust" type="primary" @click="goDetailPage">调剂/提醒</el-button>
     </div>
     </div>
     <div>
     <div>
-      <el-button v-if="showFastPush" type="primary">提前进入{{ nextStepName }}</el-button>
-      <el-button v-if="showSend" type="primary">发送</el-button>
-      <el-button v-if="showRankBalance" type="primary">排名均衡</el-button>
-      <el-button v-if="showClassDispatch" type="primary">选科分班</el-button>
+      <el-button v-if="showFastPush" type="primary" @click="flushIntoDM">提前进入{{ nextStepName }}</el-button>
+      <el-button v-if="showSend" type="primary" @click="pushGeneration">发送</el-button>
+      <el-button v-if="showRankBalance" type="primary" @click="jumpRankBalance">排名均衡</el-button>
+      <el-button v-if="showClassDispatch" type="primary" @click="jumpTerminate">选科分班</el-button>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
+import {
+  applyElectiveDMAlgorithm,
+  flushIntoGenerationDM,
+  jumpGenerationRankBalance,
+  terminateGeneration
+} from '@/api/webApi/elective/generation'
+import config from '@/common/mx-config'
+
 export default {
 export default {
   name: 'elective-generation-commands',
   name: 'elective-generation-commands',
   inject: ['refreshData'],
   inject: ['refreshData'],
@@ -56,7 +64,37 @@ export default {
       return this.status.allMatched && this.generation.current <= options.rankBalance.value
       return this.status.allMatched && this.generation.current <= options.rankBalance.value
     }
     }
   },
   },
-  methods: {}
+  methods: {
+    applyAlgorithm() {
+      // 暂时只支持一种算法,不排队以后会支持多种
+      const algorithm = config.electiveDMAlgorithm.rankFirst.value
+      applyElectiveDMAlgorithm(algorithm).then(res => {
+        this.refreshData()
+      })
+    },
+    goDetailPage() {
+      //
+    },
+    flushIntoDM() {
+      flushIntoGenerationDM().then(_ => {
+        this.refreshData()
+      })
+    },
+    pushGeneration() {
+      // show dialog form for push settings
+      // then call push api
+    },
+    jumpRankBalance() {
+      jumpGenerationRankBalance().then(res => {
+        this.refreshData()
+      })
+    },
+    jumpTerminate() {
+      terminateGeneration().then(res => {
+        this.refreshData()
+      })
+    }
+  }
 }
 }
 </script>
 </script>