feat: 答题记录导出
This commit is contained in:
parent
c805e1dc9c
commit
cf38fbd5e3
File diff suppressed because one or more lines are too long
|
@ -222,6 +222,15 @@ export function updateExamRecord(id, data) {
|
|||
data
|
||||
})
|
||||
}
|
||||
|
||||
//导出考试记录
|
||||
export function exportRecord(data) {
|
||||
return request({
|
||||
url: `/exam/examrecord/export/`,
|
||||
method: 'get',
|
||||
params: data,
|
||||
})
|
||||
}
|
||||
//删除考试记录
|
||||
export function deleteExamRecord(id) {
|
||||
return request({
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getExamRecordList, exportTest, exportwTest, deleteExamRecord,issue } from "@/api/exam";
|
||||
import { getExamRecordList, exportRecord, exportwTest, deleteExamRecord,issue } from "@/api/exam";
|
||||
import checkPermission from "@/utils/permission";
|
||||
import Pagination from "@/components/Pagination";
|
||||
|
||||
|
@ -236,7 +236,7 @@
|
|||
type: "error"
|
||||
})
|
||||
.then(async () => {
|
||||
await deleteExamtest(scope.row.id);
|
||||
await deleteExamRecord(scope.row.id);
|
||||
this.getList()
|
||||
this.$message({
|
||||
type: "success",
|
||||
|
@ -256,10 +256,12 @@
|
|||
},
|
||||
exportTest() {
|
||||
const loading = this.$loading();
|
||||
exportTest(this.listQuery).then(response => {
|
||||
loading.close()
|
||||
window.open(response.data.path, "_blank");
|
||||
});
|
||||
this.listQuery.page = Number.MAX_SAFE_INTEGER;
|
||||
this.listQuery.limit = Number.MAX_SAFE_INTEGER;
|
||||
exportRecord(this.listQuery).then(res=>{
|
||||
loading.close()
|
||||
window.open(res.data.path, "_blank");
|
||||
}).catch(e=>{loading.close()})
|
||||
},
|
||||
setTimeRange(){
|
||||
this.listQuery.start = this.value[0],
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<el-button slot="reference">Excel导入</el-button>
|
||||
</el-popover>
|
||||
<el-button type="primary" icon="el-icon-download" @click="exportQuestions">导出Excel</el-button>
|
||||
<el-button type="danger" :disabled="this.selects.length==0" @click="batchDelete()">批量删除</el-button>
|
||||
<el-button type="danger" v-if="checkPermission(['question_batch_delete'])" :disabled="this.selects.length==0" @click="batchDelete()">批量删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="tableData" style="width: 100%;margin-top:10px;" border stripe fit v-loading="listLoading"
|
||||
|
@ -240,7 +240,8 @@ export default {
|
|||
const loading = this.$loading({
|
||||
text: '正在准备..'
|
||||
});
|
||||
console.log(this.listQuery)
|
||||
this.listQuery.page = Number.MAX_SAFE_INTEGER;
|
||||
this.listQuery.limit = Number.MAX_SAFE_INTEGER;
|
||||
exportQuestion(this.listQuery).then(response => {
|
||||
loading.close()
|
||||
window.open(response.data.path, "_blank");
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
:value="item.key"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select
|
||||
<!-- <el-select
|
||||
v-model="listQuery.roles"
|
||||
placeholder="角色"
|
||||
style="width: 90px"
|
||||
|
@ -55,7 +55,7 @@
|
|||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-select> -->
|
||||
<el-input
|
||||
v-model="listQuery.search"
|
||||
placeholder="姓名/邮箱"
|
||||
|
@ -147,7 +147,7 @@
|
|||
scope.row.dept_name
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="header-center" label="角色">
|
||||
<!-- <el-table-column align="header-center" label="角色">
|
||||
<template slot-scope="scope">
|
||||
<el-tag
|
||||
style="margin: 2px"
|
||||
|
@ -158,7 +158,7 @@
|
|||
{{ item.name }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="创建日期">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.date_joined }}</span>
|
||||
|
@ -232,7 +232,7 @@
|
|||
placeholder="所属部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色" prop="roles">
|
||||
<!-- <el-form-item label="角色" prop="roles">
|
||||
<el-select
|
||||
v-model="user.roles"
|
||||
multiple
|
||||
|
@ -246,7 +246,7 @@
|
|||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="头像" prop="dept">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
|
@ -327,7 +327,7 @@ export default {
|
|||
upHeaders: upHeaders(),
|
||||
upUrl: upUrl(),
|
||||
userList: { count: 0 },
|
||||
roles: [],
|
||||
// roles: [],
|
||||
saveLoading:false,
|
||||
fileList: [],
|
||||
impDialogVisible: false,
|
||||
|
@ -361,7 +361,7 @@ export default {
|
|||
{ header: '姓名', key: 'name', wpx: 60 },
|
||||
{ header: '账户', key: 'username', wch: 32 },
|
||||
{ header: '部门', key: 'dept_name', width: 30 },
|
||||
{ header: '角色', key: 'roles', width: 70 }
|
||||
// { header: '角色', key: 'roles', width: 70 }
|
||||
],
|
||||
};
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue