<template>
	<view class="content">
		<view class="time text_c bold">{{create_time}}</view>
		<!-- 估分 -->
		<view class="box">
			<view class="title bold">本次估分成绩为</view>
			<view class="charts">
				<qiun-data-charts type="arcbar" :chartData="chartData" :Height="140" :Width="140"/>
				<view class="name">{{score}}</view>
			</view>
			<view class="title bold" v-if="Max_score">该地区体育总成绩为:{{Max_score}}分</view>
		</view>
		<!--  -->
		<view v-for="(item,index) in selectllist">
			<view class="titleName bold mt-15 ml-15 size16">{{item.name}}</view>
			<view class="indexCarList">
				<view class="card" v-for="(ite,ind) in item.list">
					<view class="title">
						<view class="name">{{ite.name}}</view>
					</view>
					<view class="item3" v-for="(it,id) in ite.list" v-if="ite.list.length>1">
						<view class="name">{{it.name}}</view>
						<view class="weight">
							<view class="input">{{it.value?it.value:'-'}}</view>
							<view class="cblue bold">{{it.proportion_value?it.proportion_value:'-'}}</view>
							<view class="cblue bold">{{it.total_score?it.total_score:'-'}}</view>
						</view>
					</view>

				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue';
	export default {
		data() {
			return {
				chartData: {
					series: [{
						name: "正确率",
						color: "#4687F9",
						data: 0.8
					}]
				},
				score: 0,
				Max_score: 0,
				create_time: "",
				selectllist: []
			}
		},
		components: {
			qiunDataCharts
		},
		onLoad(options) {
			let that = this
			that.getList(options.id)
		},
		methods: {
			getList(id) {
				let that = this
				that.$model.getSportshistorydetail({
					id: Number(id),
				}).then((res) => {
					console.log("历史记录详情", res)
					if (res.code != 0) return
					that.selectllist = res.data.list
					that.score = Number(res.data.score)
					that.Max_score = res.data.max_score
					that.create_time = res.data.create_time
					that.chartData.series[0].data = Number(res.data.score) / Number(that.Max_score)
				})
			},

		}
	}
</script>

<style scoped lang="scss">
	@import "@/scss/report.scss";
	.content {
		min-height: 100vh;
		padding-top: 15px;
		padding-bottom: 15px;
		background-color: #f7f7f7;
	}
</style>