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