| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
- <template>
- <div class="context">
- <div class="panel">
- <div class="panel-body">
- <br>
- <el-page-header @back="goBack" content="课程成绩">
- <br>
- </el-page-header>
- <span class="classNames">
- {{title}}
- </span>
- </div>
- </div>
- <div class="table">
- <el-table
- :data="tableData"
- border
- is-horizontal-resize
- :default-sort="{prop: 'date', order: 'descending'}"
- element-loading-background="rgba(0, 0, 0, 0.8)"
- class=""
- >
- >
- <el-table-column
- type="index"
- label="排名"
- align="center"
- width="50">
- </el-table-column>
- <el-table-column
- prop="head"
- label="头像"
- align="center"
- sortable
- >
- <template slot-scope="scope">
- <!--<img class="head" :src="scope.row.Head" alt="" height="51" width="51" v-if="scope.row.Head">-->
- <div class="demo-image__preview" v-if="scope.row.Head">
- <el-image
- style="width: 25px; height: 25px"
- :src="scope.row.Head"
- :preview-src-list="[scope.row.Head]"
- >
- </el-image>
- </div>
- <img src="../assets/img/nav/head.png" alt="" v-else width="25px" height="25px">
- <!--<img class="head" src="../assets/img/nav/head.png" height="51" width="51" v-else/>-->
- </template>
- </el-table-column>
- <el-table-column
- prop="Name"
- label="会员名"
- sortable
- >
- </el-table-column>
- <el-table-column
- prop="Cle"
- label="卡路里"
- :formatter="filterCle"
- sortable
- >
- </el-table-column>
- <el-table-column
- prop="Ck"
- label="ck值"
- :formatter="filterCK"
- sortable
- >
- </el-table-column>
- <el-table-column
- prop="MaxHr"
- label="最大心率"
- sortable
- >
- </el-table-column>
- <el-table-column
- prop="AvgHr"
- label="平均心率"
- sortable
- >
- </el-table-column>
- <el-table-column
- prop="Weight"
- label="体重(kg)"
- :formatter="filterWeight"
- sortable
- >
- </el-table-column>
- <el-table-column
- prop="Height"
- label="身高(cm)"
- sortable
- >
- </el-table-column>
- <el-table-column
- prop="Sex"
- label="性别"
- sortable
- >
- <template slot-scope="scope">
- <span v-if="scope.row.Sex == 1">男</span>
- <span v-if="scope.row.Sex == 2">女</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="GroupNo"
- label="队伍"
- sortable
- >
- <template slot-scope="scope">
- <span v-if="scope.row.GroupNo == 0">不分组</span>
- <span v-if="scope.row.GroupNo == 1" style="color: red">红队</span>
- <span v-if="scope.row.GroupNo == 2" style="color: blue">蓝队</span>
- <span v-if="scope.row.GroupNo == 3" style="color: goldenrod">黄队</span>
- </template>
- </el-table-column>
- </el-table>
- <br>
- <el-pagination
- background
- :total="pageination.total"
- :page-size="pageination.pageItem"
- @current-change="pageChange"
- ></el-pagination>
- </div>
- </div>
- </template>
- <script>
- import Global from '../Global.js'
- import {
- ClassOverDetailListQuery,
- FinshedDispPlanQuery,
- } from "../api/getApiRes";
- let qs = require('qs');
- export default {
- data() {
- return {
- tableData: [],
- title: '',
- pageination: {
- pageItem: 100,
- pageoptions: pageOptions(),
- total: 100,
- pageIndex: 1,
- },
- }
- },
- mounted() {
- this.getTableQuery();
- this.title = this.$route.query.ClassName + ' ' + this.$route.query.BeginStr + '-' + this.$route.query.EndStr;
- },
- methods: {
- goBack() {
- this.$router.push({
- path: '/courses', query: {}
- });
- },
- // 页面数据查询
- getTableQuery() {
- let that = this;
- that.loading = true;
- let param = {
- token: localStorage.token,
- stdId: this.$route.query.StdId,
- start: 1,//
- tableMax: 9999,//
- };
- let postdata = qs.stringify(param);
- FinshedDispPlanQuery(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.loading = false;
- if (json.Rs) {
- that.allTableData = json.Rs;
- that.recordsTotal = json.Rs.length;
- } else {
- that.allTableData = [];
- that.recordsTotal = 0;
- }
- // 设置分页数据
- that.setPaginations();
- } else {
- that.$message.error(json.Memo + '错误码:' + json.Code);
- }
- })
- },
- // 设置分页数据
- setPaginations() {
- // 分页属性
- let that = this;
- that.pageination.total = that.recordsTotal;
- // 默认分页
- that.tableData = that.allTableData.filter((item, index) => {
- return index < that.pageination.pageItem;
- });
- },
- // 每页显示数量
- handleSizeChange() {
- let that = this;
- that.tableData = that.allTableData.filter((item, index) => {
- return index < that.pageination.pageItem;
- });
- that.draw = that.pageination.pageItem;
- // that.getTableQuery();
- },
- // 翻页
- pageChange(pageIndex) {
- let that = this;
- // 获取当前页
- let index = that.pageination.pageItem * (pageIndex - 1);
- // 数据总数
- let nums = that.pageination.pageItem * pageIndex;
- // 容器
- let tables = [];
- for (var i = index; i < nums; i++) {
- if (that.allTableData[i]) {
- tables.push(that.allTableData[i])
- }
- this.tableData = tables;
- }
- that.start = index * that.draw;
- // that.getTableQuery();
- },
- // 单位转换去6个零
- filterCle(value, row, column) {
- return parseFloat(column / 1000000).toFixed(1);
- },
- // 单位转换去6个零
- filterCK(value, row, column) {
- return parseInt(column / 1000000);
- },
- // 单位转换去1个零
- filterWeight(value, row, column) {
- return parseInt(column / 10);
- },
- },
- watch: {
- $route(to) {
- if (to.name == 'classInfoDetail') {
- this.getTableQuery();
- this.title = this.$route.query.ClassName + ' ' + this.$route.query.BeginStr + '-' + this.$route.query.EndStr;
- }
- },
- },
- }
- </script>
- <style scoped>
- @import "../assets/css/panel.css";
- .context {
- height: 770px;
- overflow-y: scroll;
- display: block;
- margin: 0 auto;
- background-color: #fff !important;
- padding: 30px;
- }
- .classNames {
- width: 211px;
- height: 25px;
- background: #f0f2f5;
- font-family: "Source Han Sans CN";
- font-weight: normal;
- font-size: 16px;
- color: #3799ff;
- border-radius: 250px;
- text-align: center;
- margin-top: 15px;
- margin-bottom: 3px;
- float: left;
- }
- .head {
- overflow: hidden;
- display: block;
- margin: 0 auto;
- border-radius: 250px;
- }
- </style>
|