فهرست منبع

generation + new command buttons

hare8999@163.com 3 سال پیش
والد
کامیت
ae38c6709f

+ 29 - 17
src/views/elective/generation/components/elective-generation-commands.vue

@@ -3,17 +3,17 @@
     <div class="fx-1">
       <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>
+      <el-button v-if="showForceAdjust" type="primary" @click="goDetailPage">查看/调剂</el-button>
     </div>
     <div>
       <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>
-<!--      <el-button type="primary" @click="jumpTerminate">查看分班结果</el-button>-->
-<!--      <el-button type="primary" @click="jumpTerminate">查看选科数据</el-button>-->
+      <el-button v-if="showClassDispatch" type="primary" @click="terminateAndJumpDispatch">选科分班</el-button>
+      <el-button v-else type="primary" @click="jumpDispatch">选科分班</el-button>
     </div>
-    <el-dialog :visible.sync="pushSettingFormVisible" :title="nextStepName+'设置'" width="350">
+    <el-dialog v-if="pushSettingFormVisible" :visible.sync="pushSettingFormVisible"
+               :title="nextStepName+'设置'" width="350">
       <elective-generation-push-setting ref="settingForm"/>
       <div class="fx-row fx-end-cen mt15">
         <el-button @click="pushSettingFormVisible=false">取消</el-button>
@@ -32,8 +32,10 @@ import {
 } from '@/api/webApi/elective/generation'
 import config from '@/common/mx-config'
 import ElectiveGenerationPushSetting from '@/views/elective/generation/components/elective-generation-push-setting'
+import transferMixin from '@/components/mx-transfer-mixin'
 
 export default {
+  mixins: [transferMixin],
   name: 'elective-generation-commands',
   components: { ElectiveGenerationPushSetting },
   inject: ['refreshData'],
@@ -81,19 +83,23 @@ export default {
     }
   },
   methods: {
+    notifyRootRefresh() {
+      this.refreshData()
+    },
     applyAlgorithm() {
       // 暂时只支持一种算法,不排队以后会支持多种
       const algorithm = config.electiveDMAlgorithm.rankFirst.value
-      applyElectiveDMAlgorithm(algorithm).then(res => {
-        this.refreshData()
+      applyElectiveDMAlgorithm(algorithm).finally(() => {
+        this.notifyRootRefresh()
       })
     },
     goDetailPage() {
-      //
+      // 默认跳第1个可查询项 // 外抛让table子组件处理
+      this.$emit('jumpDetail')
     },
     flushIntoDM() {
-      flushIntoGenerationDM().then(_ => {
-        this.refreshData()
+      flushIntoGenerationDM().finally(() => {
+        this.notifyRootRefresh()
       })
     },
     pushGeneration() {
@@ -104,18 +110,24 @@ export default {
     async commitPushSetting() {
       const setting = await this.$refs.settingForm.validate()
       setting.roundId = this.status.roundId
-      const res = await pushGenerationSetting(setting)
-      this.refreshData()
+      pushGenerationSetting(setting).finally(() => {
+        this.notifyRootRefresh()
+      })
     },
     jumpRankBalance() {
-      jumpGenerationRankBalance().then(res => {
-        this.refreshData()
+      jumpGenerationRankBalance().finally(() => {
+        this.notifyRootRefresh()
       })
     },
-    jumpTerminate() {
+    terminateAndJumpDispatch() {
       terminateGeneration().then(res => {
-        this.refreshData()
-      })
+        // this.refreshData()
+        this.jumpDispatch()
+      }).catch(_ => this.notifyRootRefresh())
+    },
+    jumpDispatch() {
+      const path = '/evaluating/master-manage/permission/elective/dispatch/index'
+      this.transferTo(path)
     }
   }
 }

+ 18 - 4
src/views/elective/generation/components/elective-generation-master.vue

@@ -8,15 +8,18 @@
         </div>
         <div class="fx-1">
           <slot :name="activeKey+'-header'" v-bind="chartBinding">
-            <elective-generation-commands v-if="!stepDisabled" :chart-binding="chartBinding"/>
+            <elective-generation-commands v-if="!stepDisabled" :chart-binding="chartBinding"
+                                          @jumpDetail="handleJumpDetail"/>
           </slot>
         </div>
         <div>
-          <slot name="header-suffix"></slot>
+          <slot name="header-suffix">
+            <el-button type="primary" @click="jumpReport" class="ml10">选科数据</el-button>
+          </slot>
         </div>
       </div>
       <slot :name="activeKey" v-bind="chartBinding">
-        <elective-generation-table :chart-binding="chartBinding"></elective-generation-table>
+        <elective-generation-table :chart-binding="chartBinding" ref="gTable"></elective-generation-table>
       </slot>
       <slot name="footer-prefix"></slot>
       <slot :name="activeKey+'-footer'" v-bind="chartBinding">
@@ -32,8 +35,10 @@
 import ElectiveGenerationTable from '@/views/elective/generation/components/elective-generation-table'
 import ElectiveGenerationCharts from '@/views/elective/generation/components/elective-generation-charts'
 import ElectiveGenerationCommands from '@/views/elective/generation/components/elective-generation-commands'
+import transferMixin from '@/components/mx-transfer-mixin'
 
 export default {
+  mixins: [transferMixin],
   name: 'elective-generation-master',
   components: { ElectiveGenerationCommands, ElectiveGenerationCharts, ElectiveGenerationTable },
   props: {
@@ -87,7 +92,16 @@ export default {
       }
     }
   },
-  methods: {}
+  methods: {
+    jumpReport() {
+      // 跳转选科数据
+      // TODO: 页面还没有定义好
+    },
+    handleJumpDetail() {
+      // 跳列表,模拟点击第一列
+      this.$refs.gTable.simulateGoDetails()
+    }
+  }
 }
 </script>
 

+ 20 - 0
src/views/elective/generation/components/elective-generation-table.vue

@@ -158,6 +158,26 @@ export default {
         groups: this.chartBinding.generation.roundGroups.map(rg => ({ groupId: rg.groupId, groupName: rg.groupName }))
       }
       this.transferTo(path, nextData)
+    },
+    simulateGoDetails() {
+      if (this.resolvedTable.rows.length == 0) {
+        this.msgInfo('没有数据')
+        return
+      }
+      const current = this.chartBinding.generation.current
+      for (const column of Object.values(this.resolvedTable.columns)) {
+        if (column.children) {
+          for (const subColProp of Object.keys(column.children)) {
+            for (const row of this.resolvedTable.rows) {
+              const val = row[subColProp]
+              if (val?.generation == current) {
+                this.goDetails(val)
+                return
+              }
+            }
+          }
+        }
+      }
     }
   }
 }

+ 13 - 0
src/views/elective/report/index.vue

@@ -0,0 +1,13 @@
+<template>
+
+</template>
+
+<script>
+export default {
+  name: 'report-index'
+}
+</script>
+
+<style scoped>
+
+</style>