{ { username }}
心率
{ { xinludata }}
力竭状态
{ {status}}
{ { peisudata }}
返回
import moment from 'moment'
import { STable } from '@/components'
import { getRoleList } from '@/api/manage'
import { getTrainingRecordPrecise } from '@/api/training'
export default {
name: 'TrainingStatus',
components: {
STable,
},
data() {
return {
dateList: [],
valueList: [],
peopleparameterdata: [],//原生跑后台数据
sourceData2:[], //原生化跑整理数据
keydata:[],
widthData: 0,//力竭状态数据
status: '',
xinludata: '',
peisudata: '',
username: '' // 队员名字
}
},
props: ['record'],
created () {
// console.log('record是个啥:' + JSON.stringify(this.record))
const getparam = {
course_training_id: this.record.course_training_id,
kind: 1
}
getRoleList({ t: new Date() })
// console.log('向后台传递的参数' + JSON.stringify(getparam))
getTrainingRecordPrecise(getparam).then(res => {
// console.log('返回的状态数据' + JSON.stringify(res))
this.username = res.data[0].name
if (res.data[0].status == 0) {
this.status = '暂无状态数据!'
} else {
this.widthData = res.data[0].status
}
if (res.data[0].heart_rate.xaxis.length !== 0) {
// this.trainingdata = res.data[0].heart_rate
this.dateList = res.data[0].heart_rate.xaxis
this.valueList = res.data[0].heart_rate.data
this.drawLine()
} else {
this.xinludata = '暂无心率数据'<