|
@@ -31,6 +31,12 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div class="part-box-action">
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ icon="el-icon-circle-plus-outline"
|
|
|
+ @click="toBatchDelete"
|
|
|
+ >批量删除</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
icon="el-icon-circle-plus-outline"
|
|
@@ -41,7 +47,16 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="part-box part-box-pad">
|
|
|
- <el-table ref="TableList" :data="studentList">
|
|
|
+ <el-table
|
|
|
+ ref="TableList"
|
|
|
+ :data="studentList"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ width="55"
|
|
|
+ align="center"
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column
|
|
|
type="index"
|
|
|
label="序号"
|
|
@@ -112,6 +127,7 @@ export default {
|
|
|
current: 1,
|
|
|
size: this.GLOBAL.pageSize,
|
|
|
total: 0,
|
|
|
+ multipleSelection: [],
|
|
|
studentList: [],
|
|
|
curStudent: {}
|
|
|
};
|
|
@@ -147,9 +163,13 @@ export default {
|
|
|
this.total = data.total;
|
|
|
},
|
|
|
toPage(page) {
|
|
|
+ this.multipleSelection = [];
|
|
|
this.current = page;
|
|
|
this.getList();
|
|
|
},
|
|
|
+ handleSelectionChange(val) {
|
|
|
+ this.multipleSelection = val.map(item => item.id);
|
|
|
+ },
|
|
|
toAdd() {
|
|
|
this.curStudent = { teachClazzId: this.clazz.id };
|
|
|
this.$refs.ModifyStudentSimple.open();
|
|
@@ -164,6 +184,23 @@ export default {
|
|
|
this.deletePageLastItem();
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
+ },
|
|
|
+ toBatchDelete() {
|
|
|
+ if (!this.multipleSelection.length) {
|
|
|
+ this.$message.error("请选择要删除的学生");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$confirm(`确定要删除选中的这些学生吗?`, "提示", {
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ await deleteStudentSimple(this.multipleSelection);
|
|
|
+ this.$message.success("操作成功!");
|
|
|
+ this.deletePageLastItem(this.multipleSelection.length);
|
|
|
+ this.multipleSelection = [];
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
}
|
|
|
}
|
|
|
};
|