|
|
@@ -23,7 +23,22 @@
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
<div class="topbox_area" v-if="boxType == 1">
|
|
|
- <span>兴趣班列表</span>
|
|
|
+ <span
|
|
|
+ v-if="interestType == 0"
|
|
|
+ >兴趣班列表</span
|
|
|
+ >
|
|
|
+ <template v-if="interestType == 1">
|
|
|
+ <span
|
|
|
+ style="cursor: pointer"
|
|
|
+ @click="
|
|
|
+ interestType = 0;
|
|
|
+ refresh();
|
|
|
+ "
|
|
|
+ >兴趣班列表</span
|
|
|
+ >
|
|
|
+ <i class="el-icon-arrow-right"></i>
|
|
|
+ <span>学生列表</span>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
<div class="topbox_area" v-if="boxType == 2">
|
|
|
<span>学生列表</span>
|
|
|
@@ -51,15 +66,19 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 处理学生相关操作 -->
|
|
|
+ <div
|
|
|
+ @click="exportStudent"
|
|
|
+ class="action_btn"
|
|
|
+ v-if="boxType == 0 || (boxType == 1 && interestType == 1)"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ src="../../../../assets/stuImg/share.svg"
|
|
|
+ alt="导出"
|
|
|
+ class="action_img"
|
|
|
+ />
|
|
|
+ 导出
|
|
|
+ </div>
|
|
|
<template v-if="boxType == 0">
|
|
|
- <div @click="exportStudent" class="action_btn">
|
|
|
- <img
|
|
|
- src="../../../../assets/stuImg/share.svg"
|
|
|
- alt="导出"
|
|
|
- class="action_img"
|
|
|
- />
|
|
|
- 导出
|
|
|
- </div>
|
|
|
<template v-if="selectedData.length">
|
|
|
<div class="action_btn action_btn2" @click="resetPassword">
|
|
|
<i class="el-icon-lock"></i>
|
|
|
@@ -74,7 +93,7 @@
|
|
|
style="background: #ff4d4f; color: #fff"
|
|
|
@click="removeSelStu"
|
|
|
>
|
|
|
- <i class="el-icon-remove-outline"></i>
|
|
|
+ <i class="el-icon-remove-outline"></i>
|
|
|
移除
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -90,8 +109,16 @@
|
|
|
|
|
|
<!-- 处理兴趣班相关操作 -->
|
|
|
<div
|
|
|
- @click="editInterestCla(0)"
|
|
|
- v-if="boxType == 1"
|
|
|
+ @click="addInterestCla()"
|
|
|
+ v-if="boxType == 1 && interestType == 0"
|
|
|
+ class="action_btn"
|
|
|
+ >
|
|
|
+ <i class="el-icon-plus"></i>
|
|
|
+ 添加兴趣班
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ @click="addStudent"
|
|
|
+ v-if="boxType == 1 && interestType == 1"
|
|
|
class="action_btn"
|
|
|
>
|
|
|
<i class="el-icon-plus"></i>
|
|
|
@@ -110,7 +137,11 @@
|
|
|
class="tableList"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
>
|
|
|
- <el-table-column type="selection" v-if="boxType == 0" width="55px">
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ v-if="boxType == 0 || (boxType == 1 && interestType == 1)"
|
|
|
+ width="55px"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
v-for="(item, index) in tableColumns"
|
|
|
@@ -118,7 +149,10 @@
|
|
|
:label="item.label"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <div class="cla_box" v-if="item.label == '班级' && boxType == 0">
|
|
|
+ <div
|
|
|
+ class="cla_box"
|
|
|
+ v-if="item.label == '班级' && (boxType == 0 || boxType == 1)"
|
|
|
+ >
|
|
|
<span
|
|
|
class="cla_span"
|
|
|
v-for="(cla, ind) in scope.row.classname"
|
|
|
@@ -127,7 +161,7 @@
|
|
|
{{ cla }}
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div v-else-if="item.label == '账号' && boxType == 0">
|
|
|
+ <div v-else-if="item.label == '账号' && (boxType == 0 || boxType == 2)">
|
|
|
<span>{{ scope.row.acc.split("@")[0] }}</span>
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
@@ -147,17 +181,23 @@
|
|
|
popper-class="student-manage-action-popover"
|
|
|
>
|
|
|
<div class="action_box">
|
|
|
- <template v-if="boxType == 0 || boxType == 2">
|
|
|
+ <template
|
|
|
+ v-if="
|
|
|
+ boxType == 0 ||
|
|
|
+ boxType == 2 ||
|
|
|
+ (boxType == 1 && interestType == 1)
|
|
|
+ "
|
|
|
+ >
|
|
|
<div @click="editStudent(scope.row)">编辑</div>
|
|
|
<div @click="deleteStudentL(scope.row, scope.row.state)">
|
|
|
删除
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template v-if="boxType == 1">
|
|
|
- <div @click="editInterestCla(1,scope.row)">编辑</div>
|
|
|
+ <template v-if="boxType == 1 && interestType == 0">
|
|
|
+ <div @click="viewStudent(scope.row)">查看</div>
|
|
|
+ <div @click="editInterestCla(scope.row)">编辑</div>
|
|
|
<div @click="deleteCla(scope.row.id)">删除</div>
|
|
|
</template>
|
|
|
-
|
|
|
</div>
|
|
|
<img
|
|
|
src="../../../../assets/stuImg/act.svg"
|
|
|
@@ -171,7 +211,10 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <div class="page_box" v-if="boxType == 2 || boxType == 1">
|
|
|
+ <div
|
|
|
+ class="page_box"
|
|
|
+ v-if="boxType == 2 || (boxType == 1 && interestType == 0)"
|
|
|
+ >
|
|
|
<el-pagination
|
|
|
background
|
|
|
@size-change="handleSizeChange"
|
|
|
@@ -184,10 +227,19 @@
|
|
|
>
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
- <div class="page_box" v-if="boxType == 0 && selectedData.length">
|
|
|
+ <div
|
|
|
+ class="page_box"
|
|
|
+ v-if="
|
|
|
+ (boxType == 0 || (boxType == 1 && interestType == 1)) &&
|
|
|
+ selectedData.length
|
|
|
+ "
|
|
|
+ >
|
|
|
<div class="page_box_area">
|
|
|
- <div style="display: flex; align-items: center; gap: 10px;">
|
|
|
- <el-checkbox @change="handleCheckedAllSelection" v-model="checkedAllSelection"></el-checkbox>
|
|
|
+ <div style="display: flex; align-items: center; gap: 10px">
|
|
|
+ <el-checkbox
|
|
|
+ @change="handleCheckedAllSelection"
|
|
|
+ v-model="checkedAllSelection"
|
|
|
+ ></el-checkbox>
|
|
|
<div @click="cancelAllSelection" class="action_btn">取消全选</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -202,19 +254,25 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <!-- 编辑兴趣班弹框 -->
|
|
|
- <el-dialog :visible.sync="InterestClaEditvisible" width="700px">
|
|
|
+ <!-- 添加兴趣班弹框 -->
|
|
|
+ <el-dialog :visible.sync="addInterestClaVisible" width="500px">
|
|
|
<template slot="title">
|
|
|
<div class="dia_title_box">
|
|
|
- <span>{{ interIsAdd == 0 ? '添加学生' : '编辑兴趣班' }}</span>
|
|
|
+ <span>添加兴趣班</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
<div class="dia_box_item">
|
|
|
-
|
|
|
+ <div class="addcla_box_item">
|
|
|
+ <span>兴趣班名称:</span>
|
|
|
+ <el-input
|
|
|
+ v-model="interestName"
|
|
|
+ placeholder="请输入兴趣班名称"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="InterestClaEditvisible = false">取消</el-button>
|
|
|
- <el-button type="primary" @click="confirmInterestClaEdit">确定</el-button>
|
|
|
+ <el-button @click="addInterestClaVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="addInterestCla">确定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!-- 移动班级学生弹框 -->
|
|
|
@@ -324,21 +382,27 @@
|
|
|
<el-button type="primary" @click="confirmEditStu">确定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <!-- 编辑兴趣班 -->
|
|
|
+ <editInterstcla ref="editInterstcla" @getInterestClass="getInterestClass" :interestClaEditInfo="InterestClaEditInfo" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import editInterstcla from "./editInterstcla.vue";
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ editInterstcla,
|
|
|
+ },
|
|
|
props: {
|
|
|
GrapTableData: {
|
|
|
type: Array,
|
|
|
default: () => [],
|
|
|
},
|
|
|
- activeId: {
|
|
|
+ activeIdL: {
|
|
|
type: String,
|
|
|
default: "",
|
|
|
},
|
|
|
- activeinfo: {
|
|
|
+ activeinfoData: {
|
|
|
type: Object,
|
|
|
default: () => {},
|
|
|
},
|
|
|
@@ -353,6 +417,15 @@ export default {
|
|
|
org: this.$route.query.org,
|
|
|
oid: this.$route.query.oid,
|
|
|
role: this.$route.query.role,
|
|
|
+ activeId: "", // 当前选中的班级id
|
|
|
+
|
|
|
+ interestName: "", // 兴趣班名称
|
|
|
+ interestType: 0, // 0 班级 1 班级内学生
|
|
|
+ InterestClaAddInfo: {}, // 兴趣班添加信息
|
|
|
+ addInterestClaVisible: false, // 兴趣班添加弹框
|
|
|
+
|
|
|
+
|
|
|
+ InterestClaEditInfo: {}, // 兴趣班编辑信息
|
|
|
|
|
|
cascaderData: [], // 班级级联数据
|
|
|
cascaderDataPath: [], // 班级级联选中数据路径
|
|
|
@@ -368,10 +441,6 @@ export default {
|
|
|
moveClaInfo: {}, // 移动班级学生信息
|
|
|
moveClaCascaderDataPath: [], // 移动班级学生级联选中数据路径
|
|
|
|
|
|
- InterestClaEditInfo: {}, // 兴趣班编辑信息
|
|
|
- InterestClaEditvisible: false, // 兴趣班编辑信息
|
|
|
- interIsAdd: 0, // 0 添加 1 编辑
|
|
|
-
|
|
|
tableData: [], //表格数据
|
|
|
selectedData: [], //选中数据
|
|
|
|
|
|
@@ -434,16 +503,91 @@ export default {
|
|
|
},
|
|
|
immediate: true,
|
|
|
},
|
|
|
- activeId(newVal) {
|
|
|
- this.inp = "";
|
|
|
- this.refresh();
|
|
|
+ activeinfoData:{
|
|
|
+ handler(newVal) {
|
|
|
+ this.activeinfo = newVal;
|
|
|
+ },
|
|
|
+ immediate: true,
|
|
|
+ },
|
|
|
+ activeIdL: {
|
|
|
+ handler(newVal) {
|
|
|
+ this.activeId = newVal;
|
|
|
+ this.inp = "";
|
|
|
+ this.interestType = 0;
|
|
|
+ this.refresh();
|
|
|
+ },
|
|
|
+ immediate: true,
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+
|
|
|
+
|
|
|
+ // 编辑兴趣班
|
|
|
+ editInterestCla(row) {
|
|
|
+ this.$refs.editInterstcla.InterestClaEditvisible = true;
|
|
|
+ this.InterestClaEditInfo = JSON.parse(JSON.stringify(row));
|
|
|
+ this.$refs.editInterstcla.getdata();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 查看兴趣班学生
|
|
|
+ viewStudent(row) {
|
|
|
+ this.interestType = 1;
|
|
|
+ this.tableColumns = this.studentColumns;
|
|
|
+ this.activeId = row.id;
|
|
|
+ this.refresh();
|
|
|
+ this.activeinfo = row;
|
|
|
+ },
|
|
|
+ // 新增班级
|
|
|
+ addInterestCla() {
|
|
|
+ if (!this.interestName) {
|
|
|
+ this.$message({
|
|
|
+ message: "请输入兴趣班名称",
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //新增班级
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ claName: this.interestName,
|
|
|
+ gid: "",
|
|
|
+ oid: this.oid,
|
|
|
+ uid: this.userid,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ console.log(params);
|
|
|
+
|
|
|
+ this.ajax
|
|
|
+ .post(this.$store.state.api + "addClassgra", params)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data[0] && res.data[0][0].classname == 1) {
|
|
|
+ this.$message({
|
|
|
+ message: this.lang.Cannotsameothercla,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: this.lang.AddSuccessful,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.addInterestClaVisible = false;
|
|
|
+ this.interestName = "";
|
|
|
+ this.refresh();
|
|
|
+ this.$emit("getGrade");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.$message({
|
|
|
+ message: this.lang.Additionfailed,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
handleCheckedAllSelection(val) {
|
|
|
if (val) {
|
|
|
// 全选所有表格数据
|
|
|
- this.tableData.forEach(row => {
|
|
|
+ this.tableData.forEach((row) => {
|
|
|
this.$refs.tableData.toggleRowSelection(row, true);
|
|
|
});
|
|
|
} else {
|
|
|
@@ -451,29 +595,29 @@ export default {
|
|
|
this.$refs.tableData.clearSelection();
|
|
|
}
|
|
|
},
|
|
|
- editInterestCla(type,row) {
|
|
|
- this.InterestClaEditvisible = true;
|
|
|
- this.InterestClaEditInfo = row;
|
|
|
- this.interIsAdd = type;
|
|
|
- },
|
|
|
- // 编辑兴趣班确定
|
|
|
- confirmInterestClaEdit() {
|
|
|
- this.InterestClaEditvisible = false;
|
|
|
- this.InterestClaEditInfo = {};
|
|
|
+ // 添加兴趣班
|
|
|
+ addInterestCla(row) {
|
|
|
+ this.addInterestClaVisible = true;
|
|
|
+ this.InterestClaAddInfo = row;
|
|
|
},
|
|
|
+
|
|
|
// 删除班级
|
|
|
deleteCla(cid) {
|
|
|
let params = {
|
|
|
id: cid,
|
|
|
};
|
|
|
if (this.time()) {
|
|
|
- this.$confirm("此操作将删除该班级,及班级所有已产生的授课数据, 是否继续?", "", {
|
|
|
- cancelButtonText: "取消",
|
|
|
- confirmButtonText: "确定",
|
|
|
- showClose: false,
|
|
|
- type: "warning",
|
|
|
- customClass: "student-manage-delete-msgbox",
|
|
|
- })
|
|
|
+ this.$confirm(
|
|
|
+ "此操作将删除该班级,及班级所有已产生的授课数据, 是否继续?",
|
|
|
+ "",
|
|
|
+ {
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ showClose: false,
|
|
|
+ type: "warning",
|
|
|
+ customClass: "student-manage-delete-msgbox",
|
|
|
+ }
|
|
|
+ )
|
|
|
.then(() => {
|
|
|
this.ajax
|
|
|
.get(this.$store.state.api + "deleteClass", params)
|
|
|
@@ -511,7 +655,7 @@ export default {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- this.$confirm("确定要移动该班级吗?", "提示", {
|
|
|
+ this.$confirm("确定要移动到该班级吗?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
@@ -535,6 +679,8 @@ export default {
|
|
|
...item.classid.split(","),
|
|
|
this.moveClaCascaderDataPath[1],
|
|
|
];
|
|
|
+ box = box.filter((item) => item != '');
|
|
|
+ console.log("box", box);
|
|
|
return this.moveClassStudentPromise(item, box.join(","));
|
|
|
});
|
|
|
Promise.all(promises2)
|
|
|
@@ -893,10 +1039,16 @@ export default {
|
|
|
this.tableData = [];
|
|
|
if (this.boxType == 0) {
|
|
|
// 清除选中数据
|
|
|
- this.cancelAllSelection();
|
|
|
+ if (this.selectedData.length > 0) {
|
|
|
+ this.cancelAllSelection();
|
|
|
+ }
|
|
|
this.getStudent();
|
|
|
} else if (this.boxType == 1) {
|
|
|
- this.getInterestClass();
|
|
|
+ if (this.interestType == 0) {
|
|
|
+ this.getInterestClass();
|
|
|
+ } else if (this.interestType == 1) {
|
|
|
+ this.getStudent();
|
|
|
+ }
|
|
|
} else if (this.boxType == 2) {
|
|
|
this.getAllStudent();
|
|
|
}
|
|
|
@@ -1066,6 +1218,13 @@ export default {
|
|
|
},
|
|
|
// 导出学生
|
|
|
exportStudent() {
|
|
|
+ if (this.selectedData.length == 0) {
|
|
|
+ this.$message({
|
|
|
+ message: "请先选中要导出的学生",
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
var res = this.selectedData;
|
|
|
//如果value的json字段的key值和想要的headers值不一致时,可做如下更改
|
|
|
//将和下面的Object.fromEntries结合,将json字段的key值改变为要求的excel的header值
|
|
|
@@ -1102,7 +1261,8 @@ export default {
|
|
|
handleSelectionChange(val) {
|
|
|
this.selectedData = val;
|
|
|
// 同步全选复选框状态:当选中数量等于表格数据数量时,全选复选框应该被选中
|
|
|
- this.checkedAllSelection = val.length > 0 && val.length === this.tableData.length;
|
|
|
+ this.checkedAllSelection =
|
|
|
+ val.length > 0 && val.length === this.tableData.length;
|
|
|
},
|
|
|
|
|
|
cancelAllSelection() {
|
|
|
@@ -1470,4 +1630,13 @@ export default {
|
|
|
.addcla_box_item >>> .el-cascader-menu:first-child .el-cascader-menu__item {
|
|
|
padding-left: 20px !important;
|
|
|
}
|
|
|
+.selected_stu_box {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 10px;
|
|
|
+}
|
|
|
+.selected_stu_box_item {
|
|
|
+ background: #e8f3ff;
|
|
|
+ padding: 5px 10px;
|
|
|
+}
|
|
|
</style>
|