Commit 4fab460c41892ccfc82685ca6dd4af58989ead6c
1 parent
47a01cb6
班级归档操作交互
Showing
1 changed file
with
32 additions
and
11 deletions
src/views/standard/setUp/student.vue
... | ... | @@ -69,12 +69,11 @@ |
69 | 69 | <template v-if="!code && role !== 'ROLE_PERSONAL'"> |
70 | 70 | <el-tooltip effect="dark" content="班级归档" placement="top"> |
71 | 71 | <div class="popconfirm-box"> |
72 | - <el-popconfirm | |
73 | - title="确定要将该班级归档吗?" | |
74 | - @confirm="archivingClass(item, index)" | |
75 | - > | |
76 | - <i slot="reference" class="fa fa-file-archive-o"></i> | |
77 | - </el-popconfirm> | |
72 | + <i | |
73 | + slot="reference" | |
74 | + class="fa fa-file-archive-o" | |
75 | + @click.stop="openArchivingDia(item, index)" | |
76 | + ></i> | |
78 | 77 | </div> |
79 | 78 | </el-tooltip> |
80 | 79 | <el-tooltip effect="dark" content="修改班级" placement="top"> |
... | ... | @@ -296,6 +295,15 @@ |
296 | 295 | <el-button @click="diaUp = false">取 消</el-button> |
297 | 296 | </div> |
298 | 297 | </el-dialog> |
298 | + <el-dialog title="班级归档" :visible.sync="diaArchiving" width="400"> | |
299 | + <p>注意该操作会将该班级进行归档操作,且不可撤销,请谨慎操作!</p> | |
300 | + <div class="dialog-footer" slot="footer"> | |
301 | + <el-button type="danger" @click="archivingClass">确认归档</el-button> | |
302 | + <el-button type="primary" @click="diaArchiving = false" | |
303 | + >取 消</el-button | |
304 | + > | |
305 | + </div> | |
306 | + </el-dialog> | |
299 | 307 | </div> |
300 | 308 | </template> |
301 | 309 | |
... | ... | @@ -373,7 +381,10 @@ export default { |
373 | 381 | teacherCourseList: [], |
374 | 382 | teacherGradeList: [], |
375 | 383 | }, |
384 | + diaArchiving: false, | |
376 | 385 | archivedTotal: 0, //已归档班级 |
386 | + archivingObj: {}, //即将归档班级信息 | |
387 | + archivingIndex: 0, //即将归档班级下标 | |
377 | 388 | }; |
378 | 389 | }, |
379 | 390 | async created() { |
... | ... | @@ -519,17 +530,27 @@ export default { |
519 | 530 | 2000, |
520 | 531 | { leading: true, trailing: false } |
521 | 532 | ), |
533 | + | |
534 | + openArchivingDia(obj, index) { | |
535 | + this.archivingObj = { ...obj }; | |
536 | + this.archivingIndex = index; | |
537 | + this.diaArchiving = true; | |
538 | + }, | |
522 | 539 | //班级归档 |
523 | - async archivingClass(obj, index) { | |
540 | + async archivingClass() { | |
524 | 541 | const { data, status, info } = await this.$request.classArchiving({ |
525 | - classId: obj.id, | |
542 | + classId: this.archivingObj.id, | |
526 | 543 | }); |
544 | + this.diaArchiving = false; | |
527 | 545 | if (status === 0) { |
528 | 546 | this.$message.success("归档成功"); |
529 | - this.classList.splice(index, 1); | |
530 | - this.classDetail(this.classList[index]); | |
547 | + this.classList.splice(this.archivingIndex, 1); | |
548 | + if (this.archivingIndex == this.classList.length) { | |
549 | + this.classDetail(this.classList[this.archivingIndex - 1]); | |
550 | + } else { | |
551 | + this.classDetail(this.classList[this.archivingIndex]); | |
552 | + } | |
531 | 553 | this._QueryArchivedNum(); |
532 | - | |
533 | 554 | this._QueryData(3); |
534 | 555 | } else { |
535 | 556 | this.$message.error(info); | ... | ... |