parent
cfb36245dc
commit
cc629aa5b4
5 changed files with 173 additions and 17 deletions
@ -0,0 +1,89 @@ |
||||
<template> |
||||
<div> |
||||
<el-table |
||||
:cell-style="tableRowStyle" |
||||
:header-cell-style="{background:'#328aff',color:'#FFFFFF'}" |
||||
:data="tableData" |
||||
stripe |
||||
> |
||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
||||
<el-table-column prop="id" label="次序" width="120" align="center" type="index"></el-table-column> |
||||
<el-table-column prop="experimentalName" label="实验教学名称" align="center"></el-table-column> |
||||
<el-table-column prop="experimentalClassName" label="班级" align="center"></el-table-column> |
||||
<el-table-column prop="projectName" label="实验项目名称" align="center"></el-table-column> |
||||
<el-table-column prop="score" label="得分" align="center"></el-table-column> |
||||
<el-table-column prop="timeConsuming" label="耗时" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.row.timeConsuming}}分 |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="startTime" label="起始时间" align="center"></el-table-column> |
||||
<el-table-column prop="endTime" label="结束时间" align="center"></el-table-column> |
||||
<el-table-column label="操作" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="toReport(scope.row)">实验成绩报告</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background :current-page="pageNo" layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange"></el-pagination> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
data() { |
||||
return { |
||||
totals: 0, |
||||
tableData: [], |
||||
userId: this.$store.state.userId, |
||||
pageNo: 1, |
||||
pageSize: 10 |
||||
}; |
||||
}, |
||||
created() { |
||||
this.getData(); |
||||
}, |
||||
methods: { |
||||
tableRowStyle({ row, column, rowIndex, columnIndex }) { |
||||
if (rowIndex % 2 === 0) { |
||||
return 'background-color: #FFF'; |
||||
} else { |
||||
return 'background-color: #F5F2FF'; |
||||
} |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.pageNo = val |
||||
this.getData() |
||||
}, |
||||
getData() { |
||||
this.$post(this.api.fictitiousRecord, { |
||||
userId: this.userId, |
||||
page: this.pageNo, |
||||
size: this.pageSize, |
||||
source: 1, |
||||
systemId: 3 |
||||
}) |
||||
.then(res => { |
||||
let data = res.data |
||||
this.tableData = data.list |
||||
this.totals = data.totalCount |
||||
}) |
||||
.catch(err => { |
||||
console.log(err); |
||||
}); |
||||
}, |
||||
exportData() { |
||||
location.href = `${this.api.exportProjectRecord}?userId=${this.userId}` |
||||
}, |
||||
toReport(row) { |
||||
this.$router.push(`/showExperiment?id=${row.reportId}`) |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scopted> |
||||
|
||||
</style> |
Loading…
Reference in new issue