|
@@ -304,7 +304,11 @@
|
|
|
</div>
|
|
|
<div class="batch_add_group">
|
|
|
<span>批量添加小组:</span>
|
|
|
- <el-input-number v-model="addGroupNum" @change="handleAddGroupNumChange" label="批量添加小组"></el-input-number>
|
|
|
+ <el-input-number v-model="addGroupNum"
|
|
|
+ :min="0"
|
|
|
+ label="批量添加小组"></el-input-number>
|
|
|
+ <el-button style="margin-left:5px" type="primary" size="small" @click="handleAddGroupNumChange()">
|
|
|
+ 批量添加</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="groupContent">
|
|
@@ -454,21 +458,13 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- handleAddGroupNumChange(currentValue, oldValue){
|
|
|
- let num = currentValue-oldValue;
|
|
|
- if(num>0){
|
|
|
- for(let i=0;i<num;i++){
|
|
|
- this.groupJson2.group.push({
|
|
|
- name: "第" + (this.groupJson2.group.length + 1) + "组",
|
|
|
- id: this.guid()
|
|
|
- });
|
|
|
- }
|
|
|
- }else{
|
|
|
- num=Math.abs(num);
|
|
|
- for(let i=0;i<num;i++){
|
|
|
- this.groupJson2.group.pop();
|
|
|
- }
|
|
|
- }
|
|
|
+ handleAddGroupNumChange(){
|
|
|
+ for(let i=0;i<this.addGroupNum;i++){
|
|
|
+ this.groupJson2.group.push({
|
|
|
+ name: "第" + (this.groupJson2.group.length + 1) + "组",
|
|
|
+ id: this.guid()
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
handleClose2(done) {
|
|
|
this.$emit('update:dialogVisibleGroup', false)
|