|
@@ -4,21 +4,49 @@
|
|
:visible.sync="modalIsShow"
|
|
:visible.sync="modalIsShow"
|
|
title="选择考试对象"
|
|
title="选择考试对象"
|
|
top="10vh"
|
|
top="10vh"
|
|
- width="600px"
|
|
|
|
|
|
+ width="680px"
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
:close-on-press-escape="false"
|
|
:close-on-press-escape="false"
|
|
append-to-body
|
|
append-to-body
|
|
@opened="visibleChange"
|
|
@opened="visibleChange"
|
|
>
|
|
>
|
|
<div class="user-search">
|
|
<div class="user-search">
|
|
- <el-input
|
|
|
|
- v-model="filterLabel"
|
|
|
|
- placeholder="请输入班级名称"
|
|
|
|
- clearable
|
|
|
|
- size="mini"
|
|
|
|
- prefix-icon="el-icon-search"
|
|
|
|
- @input="labelChange"
|
|
|
|
- ></el-input>
|
|
|
|
|
|
+ <el-form inline>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="filter.courseCode"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ filterable
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in courses"
|
|
|
|
+ :key="item.code"
|
|
|
|
+ :value="item.code"
|
|
|
|
+ :label="`${item.name}(${item.code})`"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="filter.teacher"
|
|
|
|
+ placeholder="任课老师"
|
|
|
|
+ clearable
|
|
|
|
+ style="width: 160px"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="filter.className"
|
|
|
|
+ placeholder="班级名称(教学班)"
|
|
|
|
+ clearable
|
|
|
|
+ style="width: 160px"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button type="primary" @click="getStudents">查询</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<el-row type="flex" :gutter="10">
|
|
<el-row type="flex" :gutter="10">
|
|
@@ -76,6 +104,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { uploadOrFindExamTaskStudent } from "../../api";
|
|
import { uploadOrFindExamTaskStudent } from "../../api";
|
|
|
|
+import { courseQuery } from "../../../base/api";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "modify-exam-task-student",
|
|
name: "modify-exam-task-student",
|
|
@@ -98,6 +127,7 @@ export default {
|
|
return {
|
|
return {
|
|
courseCode: "",
|
|
courseCode: "",
|
|
examId: "",
|
|
examId: "",
|
|
|
|
+ teachingRoomId: "",
|
|
};
|
|
};
|
|
},
|
|
},
|
|
},
|
|
},
|
|
@@ -109,12 +139,18 @@ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
modalIsShow: false,
|
|
modalIsShow: false,
|
|
- filterCache: {},
|
|
|
|
|
|
+ filter: {
|
|
|
|
+ courseCode: "",
|
|
|
|
+ examId: "",
|
|
|
|
+ teacher: "",
|
|
|
|
+ className: "",
|
|
|
|
+ },
|
|
dataTree: [],
|
|
dataTree: [],
|
|
userTree: [],
|
|
userTree: [],
|
|
selectedUsers: [],
|
|
selectedUsers: [],
|
|
filterLabel: "",
|
|
filterLabel: "",
|
|
loading: false,
|
|
loading: false,
|
|
|
|
+ courses: [],
|
|
defaultProps: {
|
|
defaultProps: {
|
|
children: "children",
|
|
children: "children",
|
|
label: "label",
|
|
label: "label",
|
|
@@ -123,11 +159,40 @@ export default {
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ async visibleChange() {
|
|
|
|
+ this.filter = this.$objAssign(this.filter, this.filterParams);
|
|
|
|
+ await this.getStudents();
|
|
|
|
+ await this.getCourses();
|
|
|
|
+
|
|
|
|
+ this.$refs.UserTree.setCheckedKeys([]);
|
|
|
|
+ this.selectedUsers = [];
|
|
|
|
+ this.userTree = this.getUserTree();
|
|
|
|
+ // this.updateUserTreeDisableInfo(this.disabledIds);
|
|
|
|
+
|
|
|
|
+ if (this.selectedIds && this.selectedIds.length) {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.UserTree.setCheckedKeys(this.selectedIds);
|
|
|
|
+ this.checkChange();
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async search() {
|
|
|
|
+ await this.getStudents();
|
|
|
|
+
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.setTreeSelectedKeys();
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ async getCourses() {
|
|
|
|
+ this.courses = [];
|
|
|
|
+ if (!this.filterParams.teachingRoomId) return;
|
|
|
|
+ const res = await courseQuery({
|
|
|
|
+ teachingRoomId: this.filterParams.teachingRoomId,
|
|
|
|
+ });
|
|
|
|
+ this.courses = res || [];
|
|
|
|
+ },
|
|
async getStudents() {
|
|
async getStudents() {
|
|
- let datas = {
|
|
|
|
- ...this.filterParams,
|
|
|
|
- };
|
|
|
|
- const data = await uploadOrFindExamTaskStudent(datas);
|
|
|
|
|
|
+ const data = await uploadOrFindExamTaskStudent(this.filter);
|
|
this.dataTree = this.parseStudentData(data);
|
|
this.dataTree = this.parseStudentData(data);
|
|
},
|
|
},
|
|
parseStudentData(data) {
|
|
parseStudentData(data) {
|
|
@@ -230,27 +295,6 @@ export default {
|
|
});
|
|
});
|
|
this.$refs.UserTree.setCheckedKeys(selectedUserIds);
|
|
this.$refs.UserTree.setCheckedKeys(selectedUserIds);
|
|
},
|
|
},
|
|
- async visibleChange() {
|
|
|
|
- if (
|
|
|
|
- this.filterCache.courseCode !== this.filterParams.courseCode ||
|
|
|
|
- this.filterCache.examId !== this.filterParams.examId
|
|
|
|
- ) {
|
|
|
|
- await this.getStudents();
|
|
|
|
- }
|
|
|
|
- this.filterCache = { ...this.filterParams };
|
|
|
|
-
|
|
|
|
- this.$refs.UserTree.setCheckedKeys([]);
|
|
|
|
- this.selectedUsers = [];
|
|
|
|
- this.userTree = this.getUserTree();
|
|
|
|
- this.updateUserTreeDisableInfo(this.disabledIds);
|
|
|
|
-
|
|
|
|
- if (this.selectedIds && this.selectedIds.length) {
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this.$refs.UserTree.setCheckedKeys(this.selectedIds);
|
|
|
|
- this.checkChange();
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
labelChange() {
|
|
labelChange() {
|
|
if (this.filterLabel) {
|
|
if (this.filterLabel) {
|
|
const escapeRegexpString = (value = "") =>
|
|
const escapeRegexpString = (value = "") =>
|