提交 e7b62f29 authored 作者: lihuihui's avatar lihuihui

update

上级 42f9d249
......@@ -2,7 +2,12 @@
<el-dialog v-bind="$attrs" v-on="$listeners" width="600px">
<el-tabs v-model="activeName">
<el-tab-pane :label="`全部(${students.length})`" name="0">
<VueExcelXlsx :data="students" :columns="exportColumns" :file-name="data.paper_title + '_全部'" sheet-name="全部">
<VueExcelXlsx
:data="students"
:columns="exportColumns"
:file-name="data.paper_title + '_全部'"
sheet-name="全部"
>
<el-button type="primary">导出</el-button>
</VueExcelXlsx>
<AppList v-bind="tableOptions" :data="students">
......@@ -17,7 +22,12 @@
</ul> -->
</el-tab-pane>
<el-tab-pane :label="`未批阅(${unreviewedStudents.length})`" name="1">
<VueExcelXlsx :data="unreviewedStudents" :columns="exportColumns" :file-name="data.paper_title + '_未批阅'" sheet-name="未批阅">
<VueExcelXlsx
:data="unreviewedStudents"
:columns="exportColumns"
:file-name="data.paper_title + '_未批阅'"
sheet-name="未批阅"
>
<el-button type="primary">导出</el-button>
</VueExcelXlsx>
<AppList v-bind="tableOptions" :data="unreviewedStudents">
......@@ -32,7 +42,12 @@
</ul> -->
</el-tab-pane>
<el-tab-pane :label="`已批阅(${reviewedStudents.length})`" name="2">
<VueExcelXlsx :data="reviewedStudents" :columns="exportColumns" :file-name="data.paper_title + '_已批阅'" sheet-name="已批阅">
<VueExcelXlsx
:data="reviewedStudents"
:columns="exportColumns"
:file-name="data.paper_title + '_已批阅'"
sheet-name="已批阅"
>
<el-button type="primary">导出</el-button>
</VueExcelXlsx>
<AppList v-bind="tableOptions" :data="reviewedStudents">
......@@ -46,6 +61,21 @@
</li>
</ul> -->
</el-tab-pane>
<el-tab-pane :label="`未作答(${data.un_commit_students?.length})`" name="3">
<VueExcelXlsx
:data="data.un_commit_students"
:columns="exportColumns"
:file-name="data.paper_title + '_已批阅'"
sheet-name="已批阅"
>
<el-button type="primary">导出</el-button>
</VueExcelXlsx>
<AppList v-bind="tableOptions2" :data="data.un_commit_students">
<template #table-action="{ row }">
<el-button type="text" @click="$emit('studentReview', row)">查看</el-button>
</template>
</AppList>
</el-tab-pane>
</el-tabs>
</el-dialog>
</template>
......@@ -65,6 +95,13 @@ export default {
{ label: '操作', align: 'right', slots: 'table-action' }
]
},
tableOptions2: {
columns: [
{ label: '姓名', prop: 'personal_name' },
{ label: '分数', prop: 'score', computed: () => 0 }
// { label: '操作', align: 'right', slots: 'table-action' }
]
},
exportColumns: [
{ label: '姓名', field: 'name' },
{ label: '分数', field: 'score' }
......
......@@ -9,7 +9,8 @@
:index="subitem.path"
v-for="subitem in item.children"
:key="subitem.path"
v-permission="subitem.tag">
v-permission="subitem.tag"
>
<template v-if="subitem.href">
<a :href="subitem.href" target="_blank">{{ subitem.name }}</a>
</template>
......
......@@ -116,3 +116,10 @@ export function updateClassExam(data) {
export function updateCourseStatus(data) {
return httpRequest.post('/api/zy-admin/school/class/set-course-is-open', data)
}
/**
* 学员删除
*/
export function deleteStudent(data) {
return httpRequest.post('/api/zy-admin/school/student/delete', data)
}
<template>
<!-- 学员 -->
<app-list v-bind="tableOptions" ref="list">
<app-list v-bind="tableOptions" ref="list" @selection-change="handleSelectionChange">
<template #header-aside>
<el-button type="primary" icon="el-icon-plus" @click="addStudent" v-permission="'menu_class_add_student'">添加</el-button>
<el-button type="primary" icon="el-icon-upload2" style="margin-left: 20px" @click="importStudent" v-permission="'menu_class_import_student'">导入</el-button>
<el-button type="primary" icon="el-icon-plus" @click="addStudent" v-permission="'menu_class_add_student'"
>添加</el-button
>
<el-button
type="primary"
icon="el-icon-upload2"
style="margin-left: 20px"
@click="importStudent"
v-permission="'menu_class_import_student'"
>导入</el-button
>
<el-button
:disabled="!multipleSelection.length"
style="margin-left: 20px"
type="danger"
icon="el-icon-delete"
plain
@click="handleRemoves()"
>删除</el-button
>
</template>
<template v-slot:table-x="{ row }">
<el-button @click="onRemove(row)" type="danger" size="mini" plain>删除</el-button>
......@@ -22,7 +40,8 @@ export default {
props: { id: { type: String } },
data() {
return {
isShowDialog: false
isShowDialog: false,
multipleSelection: []
}
},
computed: {
......@@ -42,6 +61,7 @@ export default {
}
},
columns: [
{ type: 'selection' },
{ label: '姓名', align: 'center', prop: 'personal_name' },
{ label: '学号', align: 'center', prop: 'sno' },
{ label: '手机号', align: 'center', prop: 'telephone' },
......@@ -52,6 +72,9 @@ export default {
}
},
methods: {
handleSelectionChange(selection) {
this.multipleSelection = selection
},
success() {
this.$refs.list.refetch(true)
},
......@@ -85,6 +108,22 @@ export default {
this.$message({ type: 'success', message: '删除成功' })
}
})
},
// 批量删除
handleRemoves() {
const ids = this.multipleSelection.reduce((a, b) => a.push(b.id) && a, [])
const params = {
id: this.id,
students_id: ids.toString(),
type: 'delete'
}
// 删除学员
addStudents(params).then(res => {
if (res.code === 0) {
this.success()
this.$message({ type: 'success', message: '删除成功' })
}
})
}
}
}
......
......@@ -5,7 +5,12 @@
<el-link type="primary">{{ row.paper_title }}</el-link>
</template>
</app-list>
<review-students @studentReview="studentReview" :visible.sync="visible" :data="currentClickRow" :students="currentClickRow.students"></review-students>
<review-students
@studentReview="studentReview"
:visible.sync="visible"
:data="currentClickRow"
:students="currentClickRow.students"
></review-students>
</app-card>
</template>
......@@ -43,6 +48,7 @@ export default {
methods: {
handleRowClick(row) {
this.currentClickRow = row
console.log(row, 'row')
window.localStorage.examStudentsList = JSON.stringify(row.students)
this.visible = true
},
......
<template>
<app-card>
<app-list v-bind="tableOptions" ref="list">
<app-list v-bind="tableOptions" ref="list" @selection-change="handleSelectionChange">
<template>
<el-row style="margin-bottom: 20px">
<el-button
......@@ -20,6 +20,15 @@
v-permission="'menu_school_students_import'"
>导入</el-button
>
<el-button
:disabled="!multipleSelection.length"
style="margin-left: 20px"
type="danger"
icon="el-icon-delete"
plain
@click="handleRemoves()"
>删除</el-button
>
<!-- <el-button type="primary" icon="el-icon-download" style="margin-left: 20px" @click="downLoad" size="mini">下载</el-button> -->
</el-row>
</template>
......@@ -39,7 +48,8 @@
</router-link>
<router-link
:to="{ path: 'student/update', query: { id: row.id } }"
v-permission="'menu_school_students_update'">
v-permission="'menu_school_students_update'"
>
<el-button type="success" style="margin-left: 10px" size="mini" plain>更新</el-button>
</router-link>
<el-button
......@@ -63,7 +73,9 @@ import queryString from 'query-string'
export default {
data() {
return {}
return {
multipleSelection: []
}
},
computed: {
// 列表配置
......@@ -90,6 +102,7 @@ export default {
{ slots: 'expiration_time_max', prop: 'expiration_time_end' }
],
columns: [
{ type: 'selection' },
{ label: '姓名', prop: 'personal_name', align: 'center' },
{ label: '所属班级', prop: 'class_name', align: 'center' },
{ label: '手机号', prop: 'telephone', align: 'center' },
......@@ -108,6 +121,9 @@ export default {
}
},
methods: {
handleSelectionChange(selection) {
this.multipleSelection = selection
},
add() {
this.$router.push({ name: 'addStudents' })
},
......@@ -121,16 +137,20 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.handleRemove(row)
this.handleRemove(row.id)
})
},
// 删除
handleRemove(row) {
deleteStudent({ id: row.id }).then(() => {
handleRemove(id) {
deleteStudent({ id: id }).then(() => {
this.$message({ type: 'success', message: '删除成功' })
this.$refs.list.refetch()
})
},
handleRemoves() {
const ids = this.multipleSelection.reduce((a, b) => a.push(b.id) && a, [])
this.handleRemove(ids.toString())
},
// 下载学生
downLoad() {
Object.keys(this.tableOptions.remote.params).forEach(key => {
......
<template>
<app-card>
<app-list v-bind="tableOptions" ref="list">
<app-list v-bind="tableOptions" ref="list" @selection-change="handleSelectionChange">
<template>
<el-row style="margin-bottom: 20px">
<el-button
......@@ -20,6 +20,15 @@
v-permission="'menu_school_teacher_import'"
>导入</el-button
>
<el-button
:disabled="!multipleSelection.length"
style="margin-left: 20px"
type="danger"
icon="el-icon-delete"
plain
@click="handleRemoves()"
>删除</el-button
>
</el-row>
</template>
<template v-slot:table-x="{ row }">
......@@ -28,7 +37,8 @@
</router-link>
<router-link
:to="{ path: 'teacher/update', query: { id: row.id } }"
v-permission="'menu_school_teacher_update'">
v-permission="'menu_school_teacher_update'"
>
<el-button type="success" style="margin-left: 10px" size="mini" plain>更新</el-button>
</router-link>
<el-button
......@@ -51,7 +61,9 @@ import { getTeacherList, deleteTeacher } from '../api'
export default {
data() {
return {}
return {
multipleSelection: []
}
},
computed: {
// 列表配置
......@@ -84,6 +96,7 @@ export default {
}
],
columns: [
{ type: 'selection' },
{ label: '姓名', align: 'center', prop: 'personal_name' },
{ label: '手机号', align: 'center', prop: 'telephone' },
{ label: '邮箱', align: 'center', prop: 'email' },
......@@ -94,6 +107,9 @@ export default {
}
},
methods: {
handleSelectionChange(selection) {
this.multipleSelection = selection
},
add() {
this.$router.push({ path: 'teacher/update' })
},
......@@ -109,15 +125,19 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.handleRemove(row)
this.handleRemove(row.id)
})
},
// 删除
handleRemove(row) {
deleteTeacher({ id: row.id }).then(() => {
handleRemove(id) {
deleteTeacher({ id: id }).then(() => {
this.$message({ type: 'success', message: '删除成功' })
this.$refs.list.refetch()
})
},
handleRemoves() {
const ids = this.multipleSelection.reduce((a, b) => a.push(b.id) && a, [])
this.handleRemove(ids.toString())
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论