factory_web/src/views/edu/examrecord.vue

121 lines
2.3 KiB
Vue

<template>
<el-container>
<el-header>
<div class="right-panel">
<el-input
style="margin-right: 5px"
v-model="query.search"
placeholder="考试名称或用户"
clearable
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
:query="query"
>
<el-table-column
label="考试名称"
prop="exam_name"
></el-table-column>
<el-table-column
label="用户"
prop="create_by_name"
>
</el-table-column>
<el-table-column
label="得分"
prop="score"
></el-table-column>
<el-table-column
label="总分"
prop="total_score"
></el-table-column>
<el-table-column
label="耗时(秒)"
prop="took"
></el-table-column>
<el-table-column
label="答题时间"
prop="start_time"
></el-table-column>
<el-table-column
label="是否通过"
prop="is_pass"
:formatter="formatBoolean"
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="150"
>
<template #default="scope">
<el-popconfirm
title="确定删除吗?"
@confirm="table_del(scope.row, scope.$index)"
>
<template #reference>
<el-button
link
size="small"
v-auth="'examrecord.delete'"
type="danger"
>删除</el-button
>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
data() {
return {
paperOptions:[],
examDialog: false,
apiObj: this.$API.edu.examrecord.list,
query: {
search: "",
},
};
},
mounted() {
this.getPaperOptions();
},
methods: {
getPaperOptions() {
this.$API.edu.paper.list.req({
page: 0
}).then(res => {
this.paperOptions = res;
});
},
formatBoolean(row) {
return row.isTrue ? '是' : '否';
},
handleQuery() {
this.$refs.table.queryData(this.query);
},
table_del(row) {
this.$API.edu.examrecord.delete.req(row.id).then(() => {
this.handleQuery();
});
},
},
};
</script>