<template>
	<div class="analysis-table">
		<!-- 表格组件 -->
		<Table border ref="table" :data="tableData" :columns="dataColumns"></Table>



	</div>
</template>
<script>
	export default {
		props: {
			analysisJson: {
				type: Object,
				default: () => {}
			},

		},
		data() {
			return {
				tableData: [],
				dataColumns: [
					{
						title: this.$t('totalAnalysis.sca_table_text6'),
						key: 'areaName',
						align: 'center'
					},
					{
						title: this.$t('totalAnalysis.ta_table_text4'),
						key: 'score',
						align: 'center'
					},
					{
						title: this.$t('totalAnalysis.ta_table_text5'),
						key: 'diff',
						align: 'center',
						render: function(h, params) {
							return h('span', (Number(params.row.diff)).toFixed(2))
						}
					},
					{
						title: this.$t('totalAnalysis.ta_table_text6'),
						key: 'identify',
						align: 'center',
						render: function(h, params) {
							return h('span', (Number(params.row.identify)).toFixed(2))
						}
					},
					{
						title: this.$t('totalAnalysis.trueAnswerRate'),
						align: 'center',
						key: 'classScoreRate'
					},
					{
						title: this.$t('totalAnalysis.PHAnswerRate'),
						align: 'center',
						key: 'PH',
						render: function(h, params) {
							return h('span', ((Number(params.row.PH)) * 100).toFixed(0) + '%')
						}
					},
					{
						title: this.$t('totalAnalysis.PLAnswerRate'),
						align: 'center',
						key: 'PL',
						render: function(h, params) {
							return h('span', ((Number(params.row.PL)) * 100).toFixed(0) + '%')
						}
					},
					{
						title: 'R1',
						align: 'center',
						key: 'R1',
						render: function(h, params) {
							return h('span', ((Number(params.row.R1)) * 100).toFixed(0) + '%')
						}
					},
					{
						title: 'R2',
						key: 'R2',
						align: 'center',
						render: function(h, params) {
							return h('span', ((Number(params.row.R2)) * 100).toFixed(0) + '%')
						}
					},
					{
						title: 'R3',
						align: 'center',
						key: 'R3',
						render: function(h, params) {
							return h('span', ((Number(params.row.R3)) * 100).toFixed(0) + '%')
						}
					},
					{
						title: 'R4',
						align: 'center',
						key: 'R4',
						render: function(h, params) {
							return h('span', ((Number(params.row.R4)) * 100).toFixed(0) + '%')
						}
					},
					{
						title: 'R5',
						align: 'center',
						key: 'R5',
						render: function(h, params) {
							return h('span', ((Number(params.row.R5)) * 100).toFixed(0) + '%')
						}
					},
					{
						title: 'R6',
						align: 'center',
						key: 'R6',
						render: function(h, params) {
							return h('span', ((Number(params.row.R6)) * 100).toFixed(0) + '%')
						}
					}
				],
			}
		},
		created() {
			
		},
		methods: {

		},
		mounted() {
			
		},
		watch: {
			analysisJson:{
				handler(n,o){
					this.tableData = [n]
				},
				immediate:true,
				deep:true
			},
		}

	}
</script>
