|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <p style="margin-bottom: 10px;">该组合录取人数为:{{roundGroup.number}}</p>
|
|
|
+ <p style="margin-bottom: 10px;">该组合录取人数为:{{roundGroup.number}}</p>
|
|
|
<el-table
|
|
|
:data="formatSetting"
|
|
|
style="width: 100%"
|
|
@@ -105,7 +105,19 @@ export default {
|
|
|
this.roundGroup = roundGroup
|
|
|
this.settingContainer = settingContainer
|
|
|
this.roundId = roundGroup.roundId
|
|
|
- this.settingContainer = settingContainer.filter(item => item.groupId == roundGroup.groupId)
|
|
|
+ const remainder = roundGroup.number % roundGroup.classCount // 余数
|
|
|
+ const divide = Math.floor(roundGroup.number / roundGroup.classCount) // 向下取整的除数
|
|
|
+ this.settingContainer = settingContainer.filter(item => item.groupId == roundGroup.groupId).map((item,index) => {
|
|
|
+ if (index + 1 <= remainder) {
|
|
|
+ // 余数平分给前面
|
|
|
+ item.expectedCount = divide + 1
|
|
|
+ }else {
|
|
|
+ // 余数分完
|
|
|
+ item.expectedCount = divide
|
|
|
+ }
|
|
|
+ return item
|
|
|
+ console.log(item)
|
|
|
+ })
|
|
|
},
|
|
|
valid() {
|
|
|
// 验证
|