Commit dc56294d29bd11823823ae7b58e67b5024b8c9a7
1 parent
0454f787
班级分班
Showing
5 changed files
with
386 additions
and
3 deletions
src/assets/images/fenban.png
0 → 100644
6.98 KB
src/router/index.js
| ... | ... | @@ -42,8 +42,9 @@ const SetUpConglomerate = () => import("@/views/standard/setUp/conglomerate") |
| 42 | 42 | const SetUpSchool = () => import("@/views/standard/setUp/school") |
| 43 | 43 | const SetUpTeacher = () => import("@/views/standard/setUp/teacher") |
| 44 | 44 | const SetUpStudent = () => import("@/views/standard/setUp/student") |
| 45 | -const SetUpClazz = () => import("@/views/standard/setUp/clazz") | |
| 46 | 45 | const ArchivedClazz = () => import("@/views/standard/setUp/archivedClazz") |
| 46 | +const SetUpClazz = () => import("@/views/standard/setUp/clazz") | |
| 47 | +const Archived = () => import("@/views/standard/setUp/archived") | |
| 47 | 48 | |
| 48 | 49 | const PersonalAsk = () => import("@/views/personal/ask/index") |
| 49 | 50 | const PersonalAskAnalysis = () => import("@/views/personal/ask/analysis") |
| ... | ... | @@ -324,6 +325,14 @@ let addrouters = [ |
| 324 | 325 | hidden: true, |
| 325 | 326 | children: [] |
| 326 | 327 | }, |
| 328 | + { | |
| 329 | + path: "/archived", | |
| 330 | + iconCls: "fa fa-list-ul", | |
| 331 | + name: '分班', | |
| 332 | + component: Archived, | |
| 333 | + hidden: true, | |
| 334 | + children: [] | |
| 335 | + }, | |
| 327 | 336 | ] |
| 328 | 337 | }, |
| 329 | 338 | { | ... | ... |
src/views/standard/setUp/archived.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div> | |
| 3 | + <back-box> | |
| 4 | + <template slot="title"> | |
| 5 | + <span>分班</span> | |
| 6 | + </template> | |
| 7 | + </back-box> | |
| 8 | + <div class="page-content"> | |
| 9 | + <el-steps :active="step" align-center class="step"> | |
| 10 | + <el-step title="1 班级归档"></el-step> | |
| 11 | + <el-step title="2 分班后学生名单"></el-step> | |
| 12 | + <el-step title="3 分班后任课老师"></el-step> | |
| 13 | + <el-step title="4 授课端指引"></el-step> | |
| 14 | + </el-steps> | |
| 15 | + <ul v-loading="loading"> | |
| 16 | + <li v-show="step == 0"> | |
| 17 | + <div class="form-item"> | |
| 18 | + <span class="s-txt">选择分班年级:</span> | |
| 19 | + <el-select | |
| 20 | + class="sel" | |
| 21 | + v-model="gradeName" | |
| 22 | + placeholder="选择年级" | |
| 23 | + @change="changeGrade" | |
| 24 | + > | |
| 25 | + <el-option | |
| 26 | + v-for="item in gradeList" | |
| 27 | + :key="item.value" | |
| 28 | + :label="item.label" | |
| 29 | + :value="item.value" | |
| 30 | + > | |
| 31 | + </el-option> | |
| 32 | + <el-option label="未分配" :value="80"></el-option> | |
| 33 | + <el-option label="已毕业" :value="81"></el-option> | |
| 34 | + </el-select> | |
| 35 | + </div> | |
| 36 | + <div class="form-item"> | |
| 37 | + <span class="s-txt">确定班级:</span> | |
| 38 | + <i class="el-icon-loading" v-show="loadingClass"></i> | |
| 39 | + <el-checkbox-group v-model="classIds"> | |
| 40 | + <el-checkbox v-for="item in classList" :label="item.id">{{ | |
| 41 | + item.className | |
| 42 | + }}</el-checkbox> | |
| 43 | + </el-checkbox-group> | |
| 44 | + </div> | |
| 45 | + <div class="form-item"> | |
| 46 | + <span class="s-txt"></span> | |
| 47 | + <p class="tips"> | |
| 48 | + <i class="el-icon-warning"></i | |
| 49 | + >请谨慎操作,班级归档后,学生解除班级关系且相关老师任课信息将不存在。 | |
| 50 | + </p> | |
| 51 | + </div> | |
| 52 | + <div class="btn-box"> | |
| 53 | + <el-button class="btn" round @click="classIds = []">取消</el-button> | |
| 54 | + <el-popconfirm | |
| 55 | + confirm-button-text="确定" | |
| 56 | + cancel-button-text="取消" | |
| 57 | + icon="el-icon-info" | |
| 58 | + icon-color="red" | |
| 59 | + title="确定要将所选班级归档吗?" | |
| 60 | + @confirm="_ClassArchiving" | |
| 61 | + > | |
| 62 | + <el-button class="btn" slot="reference" type="primary" round | |
| 63 | + >归档</el-button | |
| 64 | + > | |
| 65 | + </el-popconfirm> | |
| 66 | + </div> | |
| 67 | + </li> | |
| 68 | + <li v-show="step == 1"> | |
| 69 | + <div class="step-item"> | |
| 70 | + <up-load | |
| 71 | + id="downTeacher" | |
| 72 | + :url="urlStudent" | |
| 73 | + @upSuccess="upStudentSuccess" | |
| 74 | + fileName="学生名单模板" | |
| 75 | + > | |
| 76 | + <p class="down-txt" slot="down"> | |
| 77 | + 通过Excel名单导入学生名单模板,点击 | |
| 78 | + <el-link type="primary" @click="downStudentExcel" | |
| 79 | + >导出未分配学生</el-link | |
| 80 | + > | |
| 81 | + 。 | |
| 82 | + </p> | |
| 83 | + </up-load> | |
| 84 | + </div> | |
| 85 | + </li> | |
| 86 | + <li v-show="step == 2"> | |
| 87 | + <div class="step-item"> | |
| 88 | + <up-load | |
| 89 | + id="downTeacher" | |
| 90 | + :url="urlTeacher" | |
| 91 | + @upSuccess="upTeacherSuccess" | |
| 92 | + fileName="任课老师名单模板" | |
| 93 | + > | |
| 94 | + <p class="down-txt" slot="down"> | |
| 95 | + 通过Excel名单导入任课老师名单模板,点击 | |
| 96 | + <el-link type="primary" @click="downTeacherExcel" | |
| 97 | + >导出分班后任课老师</el-link | |
| 98 | + > | |
| 99 | + 。 | |
| 100 | + </p> | |
| 101 | + </up-load> | |
| 102 | + </div> | |
| 103 | + </li> | |
| 104 | + <li v-show="step == 3"> | |
| 105 | + <div class="step-item2"> | |
| 106 | + <p class="p2"> | |
| 107 | + <el-button | |
| 108 | + class="btn" | |
| 109 | + type="success" | |
| 110 | + icon="el-icon-check" | |
| 111 | + circle | |
| 112 | + size="small" | |
| 113 | + ></el-button | |
| 114 | + >恭喜您,分班已经完成,分班后老师第一次上课时注意事项: | |
| 115 | + </p> | |
| 116 | + <p class="p1"> | |
| 117 | + 1、点击授课端的设置—应用设置—初始化设置—重新选择绑定班级。 | |
| 118 | + </p> | |
| 119 | + <p class="p1"> | |
| 120 | + 2、点击授课端的设置—班级名册—基站登录—学生完成基站绑定。 | |
| 121 | + </p> | |
| 122 | + </div> | |
| 123 | + </li> | |
| 124 | + | |
| 125 | + <li v-show="step != 0"> | |
| 126 | + <div class="btn-box"> | |
| 127 | + <el-button class="btn" round @click="step -= 1">上一步</el-button> | |
| 128 | + <el-button | |
| 129 | + v-show="step != 3" | |
| 130 | + class="btn" | |
| 131 | + type="primary" | |
| 132 | + round | |
| 133 | + @click="step += 1" | |
| 134 | + >下一步</el-button | |
| 135 | + ><el-button | |
| 136 | + v-show="step == 3" | |
| 137 | + class="btn" | |
| 138 | + type="primary" | |
| 139 | + round | |
| 140 | + @click="toClazz" | |
| 141 | + >完成</el-button | |
| 142 | + > | |
| 143 | + </div> | |
| 144 | + </li> | |
| 145 | + </ul> | |
| 146 | + </div> | |
| 147 | + </div> | |
| 148 | +</template> | |
| 149 | + | |
| 150 | +<script> | |
| 151 | +export default { | |
| 152 | + data() { | |
| 153 | + return { | |
| 154 | + loading: false, | |
| 155 | + loadingClass: false, | |
| 156 | + step: 1, | |
| 157 | + gradeName: "", | |
| 158 | + gradeList: [], | |
| 159 | + classIds: [], | |
| 160 | + classList: [], | |
| 161 | + urlStudent: "", | |
| 162 | + urlTeacher: "", | |
| 163 | + }; | |
| 164 | + }, | |
| 165 | + created() { | |
| 166 | + this._QueryDataGrade(); | |
| 167 | + }, | |
| 168 | + methods: { | |
| 169 | + toClazz() { | |
| 170 | + this.$router.push({ | |
| 171 | + path: "/setUpClazz", | |
| 172 | + }); | |
| 173 | + }, | |
| 174 | + //切换年级 | |
| 175 | + changeGrade() { | |
| 176 | + this._QueryClass(); | |
| 177 | + }, | |
| 178 | + //学生名单上传成功回调 | |
| 179 | + upStudentSuccess(res) { | |
| 180 | + this.$message.closeAll(); | |
| 181 | + this.$message({ | |
| 182 | + showClose: true, | |
| 183 | + message: `成功(${res.data.success})`, | |
| 184 | + type: "success", | |
| 185 | + duration: 10000, | |
| 186 | + }); | |
| 187 | + }, | |
| 188 | + //任课老师名单上传成功回调 | |
| 189 | + upTeacherSuccess(res) { | |
| 190 | + this.$message.closeAll(); | |
| 191 | + this.$message({ | |
| 192 | + showClose: true, | |
| 193 | + message: `成功(${res.data.success})`, | |
| 194 | + type: "success", | |
| 195 | + duration: 10000, | |
| 196 | + }); | |
| 197 | + }, | |
| 198 | + //导出学生名单 | |
| 199 | + async downStudentExcel() { | |
| 200 | + this.loadingDown = true; | |
| 201 | + let { data, info, status } = | |
| 202 | + await this.$request.studentClickerTemplateUrl(); | |
| 203 | + this.loadingDown = false; | |
| 204 | + if (status == 0) { | |
| 205 | + const a = document.createElement("a"); | |
| 206 | + a.href = data.downloadUrl; | |
| 207 | + document.body.appendChild(a); | |
| 208 | + a.click(); | |
| 209 | + a.remove(); | |
| 210 | + } else { | |
| 211 | + this.$message.error(info); | |
| 212 | + } | |
| 213 | + }, | |
| 214 | + //导出任课老师名单 | |
| 215 | + async downTeacherExcel() { | |
| 216 | + this.loadingDown = true; | |
| 217 | + let { data, info, status } = | |
| 218 | + await this.$request.teacherClickerTemplateUrl(); | |
| 219 | + this.loadingDown = false; | |
| 220 | + if (status == 0) { | |
| 221 | + const a = document.createElement("a"); | |
| 222 | + a.href = data.downloadUrl; | |
| 223 | + document.body.appendChild(a); | |
| 224 | + a.click(); | |
| 225 | + a.remove(); | |
| 226 | + } else { | |
| 227 | + this.$message.error(info); | |
| 228 | + } | |
| 229 | + }, | |
| 230 | + //班级归档 | |
| 231 | + async _ClassArchiving() { | |
| 232 | + if (!this.classIds.length) { | |
| 233 | + this.$message.warning("班级不能为空,请选择班级~"); | |
| 234 | + return; | |
| 235 | + } | |
| 236 | + this.loading = true; | |
| 237 | + const { status, info } = await this.$request.classArchiving({ | |
| 238 | + classIds: [...this.classIds], | |
| 239 | + }); | |
| 240 | + this.loading = false; | |
| 241 | + if (status === 0) { | |
| 242 | + this.$message.success("班级归档成功!"); | |
| 243 | + this.step = 1; | |
| 244 | + this._QueryDataGrade(); | |
| 245 | + } else { | |
| 246 | + this.$message.error(info); | |
| 247 | + } | |
| 248 | + }, | |
| 249 | + //年级列表 | |
| 250 | + async _QueryDataGrade() { | |
| 251 | + const { data, status, info } = await this.$request.gradeList(); | |
| 252 | + if (status === 0) { | |
| 253 | + this.gradeList = | |
| 254 | + data.list?.map((item) => { | |
| 255 | + return { | |
| 256 | + value: item.gradeName, | |
| 257 | + label: item.gradeName, | |
| 258 | + }; | |
| 259 | + }) || []; | |
| 260 | + this.gradeName = this.gradeList[0]?.value; | |
| 261 | + this._QueryClass(); | |
| 262 | + } else { | |
| 263 | + this.$message.error(info); | |
| 264 | + } | |
| 265 | + }, | |
| 266 | + //班级列表 | |
| 267 | + async _QueryClass() { | |
| 268 | + this.classList = []; | |
| 269 | + this.loadingClass = true; | |
| 270 | + const { data, status, info } = await this.$request.schoolClassList({ | |
| 271 | + gradeName: this.gradeName, | |
| 272 | + }); | |
| 273 | + this.loadingClass = false; | |
| 274 | + if (status === 0) { | |
| 275 | + this.classList = [...data.list] || []; | |
| 276 | + this.classIds = []; | |
| 277 | + } else { | |
| 278 | + this.$message.error(info); | |
| 279 | + } | |
| 280 | + }, | |
| 281 | + }, | |
| 282 | +}; | |
| 283 | +</script> | |
| 284 | + | |
| 285 | +<style lang="scss" scoped> | |
| 286 | +.page-content { | |
| 287 | + width: 100%; | |
| 288 | + padding: 20px; | |
| 289 | + box-sizing: border-box; | |
| 290 | +} | |
| 291 | +.step { | |
| 292 | + margin-bottom: 40px; | |
| 293 | +} | |
| 294 | +.form-item { | |
| 295 | + width: 70%; | |
| 296 | + display: flex; | |
| 297 | + margin: 0 auto 20px; | |
| 298 | + &:first-of-type { | |
| 299 | + .s-txt { | |
| 300 | + line-height: 40px; | |
| 301 | + } | |
| 302 | + } | |
| 303 | + .s-txt { | |
| 304 | + width: 160px; | |
| 305 | + flex-shrink: 0; | |
| 306 | + } | |
| 307 | + .sel { | |
| 308 | + :deep(.el-input__inner) { | |
| 309 | + border-radius: 20px; | |
| 310 | + } | |
| 311 | + } | |
| 312 | + :deep(.el-checkbox) { | |
| 313 | + margin-bottom: 12px; | |
| 314 | + } | |
| 315 | + .tips { | |
| 316 | + display: flex; | |
| 317 | + align-items: center; | |
| 318 | + color: #666; | |
| 319 | + } | |
| 320 | + .el-icon-warning { | |
| 321 | + font-size: 20px; | |
| 322 | + color: #ec7f8c; | |
| 323 | + margin-right: 10px; | |
| 324 | + } | |
| 325 | +} | |
| 326 | +.btn-box { | |
| 327 | + width: 80%; | |
| 328 | + margin: 60px auto 0; | |
| 329 | + display: flex; | |
| 330 | + justify-content: flex-end; | |
| 331 | + .btn { | |
| 332 | + margin: 0 10px; | |
| 333 | + } | |
| 334 | +} | |
| 335 | +.step-item { | |
| 336 | + text-align: center; | |
| 337 | +} | |
| 338 | +.step-item2 { | |
| 339 | + width: 100%; | |
| 340 | + display: flex; | |
| 341 | + flex-direction: column; | |
| 342 | + align-items: center; | |
| 343 | + color: #000; | |
| 344 | + font-weight: 500; | |
| 345 | + .p2 { | |
| 346 | + font-size: 16px; | |
| 347 | + margin: 0 0 20px -68px; | |
| 348 | + .btn { | |
| 349 | + margin-right: 14px; | |
| 350 | + } | |
| 351 | + } | |
| 352 | + .p1 { | |
| 353 | + width: 450px; | |
| 354 | + text-align: left; | |
| 355 | + margin-bottom: 20px; | |
| 356 | + } | |
| 357 | +} | |
| 358 | +:deep(.down-txt) { | |
| 359 | + justify-content: center; | |
| 360 | + padding-left: 0; | |
| 361 | +} | |
| 362 | +</style> | |
| 0 | 363 | \ No newline at end of file | ... | ... |
src/views/standard/setUp/clazz.vue
| ... | ... | @@ -25,6 +25,9 @@ |
| 25 | 25 | @click="exportTeacherExl" |
| 26 | 26 | ></el-button> |
| 27 | 27 | </el-tooltip> |
| 28 | + <el-tooltip effect="dark" content="分班" placement="bottom"> | |
| 29 | + <img @click="toArchived" src="../../../assets/images/fenban.png" class="fenban" alt="" /> | |
| 30 | + </el-tooltip> | |
| 28 | 31 | </template> |
| 29 | 32 | </back-box> |
| 30 | 33 | <div class="page-content"> |
| ... | ... | @@ -241,6 +244,11 @@ export default { |
| 241 | 244 | this._QuerySubject(); |
| 242 | 245 | }, |
| 243 | 246 | methods: { |
| 247 | + toArchived(){ | |
| 248 | + this.$router.push({ | |
| 249 | + path:'/archived' | |
| 250 | + }) | |
| 251 | + }, | |
| 244 | 252 | openSubject(obj) { |
| 245 | 253 | this.formClass.gradeName = obj.gradeName; |
| 246 | 254 | this.subjectNames = [...obj.subjectNames]; |
| ... | ... | @@ -350,7 +358,7 @@ export default { |
| 350 | 358 | }); |
| 351 | 359 | if (status === 0) { |
| 352 | 360 | this.$message.success(info); |
| 353 | - let idx = this.subjectNames.findIndex(sub => item==sub) | |
| 361 | + let idx = this.subjectNames.findIndex((sub) => item == sub); | |
| 354 | 362 | this.subjectNames.splice(idx, 1, item.value); |
| 355 | 363 | item.default = item.value; |
| 356 | 364 | } else { |
| ... | ... | @@ -461,6 +469,11 @@ export default { |
| 461 | 469 | </script> |
| 462 | 470 | |
| 463 | 471 | <style lang="scss" scoped> |
| 472 | +.fenban{ | |
| 473 | + width:28px; | |
| 474 | + margin-left:10px; | |
| 475 | + cursor: pointer; | |
| 476 | +} | |
| 464 | 477 | .page-tit { |
| 465 | 478 | margin-bottom: 20px; |
| 466 | 479 | } | ... | ... |
src/views/standard/setUp/student.vue