async saveNewGroup() {
if (!this.newGroupName) {
this.$message.error("请输入分组名称");
return;
}
//新增分组
let addRes = await addNewGroup({name: this.newGroupName});
if (addRes.data.code == '0') {
this.newGroupName = "";
this.showAddGroup = false;
//重新获取分组
let listRes = await getAllGroup();
if (listRes.data.code == "0") {
this.groupList = listRes.data.data
this.checkIndex = this.groupList.length - 1;
this.moveToGroup = this.groupList[this.groupList.length - 1].id;
}
}
},
```javascript
在这里插入代码片