Browse Source

分班完善

shilipojs 3 years ago
parent
commit
e78a387a49

+ 15 - 0
src/views/elective/dispatch/components/choose-class.vue

@@ -0,0 +1,15 @@
+<template>
+  <el-dialog>
+
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  name: 'choose-class'
+}
+</script>
+
+<style scoped>
+
+</style>

+ 8 - 4
src/views/elective/dispatch/components/dispatch-table.vue

@@ -1,6 +1,9 @@
 <template>
   <el-row>
-    <mx-table :propDefines="propDefines" :rows="round.enrollGroupCount">
+    <mx-table :propDefines="propDefines" :rows="round">
+      <template #group="{row}">
+        <span>{{ listGroupsOptions.filter(item => item.value == row.groupId)[0].text}}</span>
+      </template>
       <template #edit>
         <el-button
           type="success"
@@ -34,10 +37,11 @@ export default {
     return {
       settingList: [],
       propDefines: {
-        group: {
+        groupId: {
           label: "组合",
+          slot: 'group'
         },
-        count: {
+        number: {
           label: "人数",
         },
         classNum: {
@@ -83,4 +87,4 @@ export default {
 };
 </script>
 <style scoped>
-</style>
+</style>

+ 29 - 3
src/views/elective/dispatch/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <dispatch-table :round="round" :allowDispatch="round.allowDispatch"></dispatch-table>
+    <dispatch-table :round="formatRound" :allowDispatch="round.allowDispatch"></dispatch-table>
   </div>
 </template>
 <script>
@@ -12,13 +12,39 @@ export default {
   created() {
   },
   methods: {},
+  computed: {
+    formatRound() {
+      if(!this.round.allowDispatch)return
+      for (const key in this.round.enrollGroupCount) {
+        console.log(key)
+        this.round.roundGroups.filter(item => {
+          if (item.groupId == key) {
+            item['number'] = this.round.enrollGroupCount[key]
+          }
+        })
+      }
+      return this.round.roundGroups
+    }
+  },
   data() {
     return {
       round: {
+        roundId: '1',
         allowDispatch: true,
+        roundGroups: [{
+          groupId: '1', // 组合
+          classNum: 5  // 班级数
+        },{
+          groupId: '2',
+          classNum: 0
+        },{
+          groupId: '4',
+          classNum: 5
+        }],
         enrollGroupCount:{
-          groupIds: '1,2,3',
-          roundGroups: []
+          '1': 250, // 录取人数
+          '2': 122,
+          '4': 100
         }
       }
     };