|
@@ -69,8 +69,14 @@
|
|
|
|
|
|
<el-row type="flex" :gutter="10">
|
|
<el-row type="flex" :gutter="10">
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
- <h3 class="user-part-title">
|
|
|
|
- {{ showStudent ? "班级/学生" : "班级" }}
|
|
|
|
|
|
+ <h3 class="user-part-title title-select">
|
|
|
|
+ <el-checkbox
|
|
|
|
+ v-model="allSelect"
|
|
|
|
+ class="title-checkbox"
|
|
|
|
+ @change="allSelectChange"
|
|
|
|
+ >全选</el-checkbox
|
|
|
|
+ >
|
|
|
|
+ <div>{{ showStudent ? "班级/学生" : "班级" }}</div>
|
|
</h3>
|
|
</h3>
|
|
<div class="user-tree">
|
|
<div class="user-tree">
|
|
<el-tree
|
|
<el-tree
|
|
@@ -182,6 +188,7 @@ export default {
|
|
filterLabel: "",
|
|
filterLabel: "",
|
|
loading: false,
|
|
loading: false,
|
|
courses: [],
|
|
courses: [],
|
|
|
|
+ allSelect: false,
|
|
defaultProps: {
|
|
defaultProps: {
|
|
children: "children",
|
|
children: "children",
|
|
label: "label",
|
|
label: "label",
|
|
@@ -191,6 +198,7 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
async visibleChange() {
|
|
async visibleChange() {
|
|
|
|
+ this.allSelect = false;
|
|
this.filter = this.$objAssign(this.filter, this.filterParams);
|
|
this.filter = this.$objAssign(this.filter, this.filterParams);
|
|
await this.getStudents();
|
|
await this.getStudents();
|
|
|
|
|
|
@@ -272,6 +280,16 @@ export default {
|
|
return nitem;
|
|
return nitem;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ allSelectChange() {
|
|
|
|
+ if (this.allSelect) {
|
|
|
|
+ this.$refs.UserTree.setCheckedKeys(
|
|
|
|
+ this.userTree.map((item) => item.id)
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ this.$refs.UserTree.setCheckedKeys([]);
|
|
|
|
+ }
|
|
|
|
+ this.checkChange();
|
|
|
|
+ },
|
|
checkChange() {
|
|
checkChange() {
|
|
// console.log("check click");
|
|
// console.log("check click");
|
|
const selectedKeys = this.$refs.UserTree.getCheckedKeys(true);
|
|
const selectedKeys = this.$refs.UserTree.getCheckedKeys(true);
|