<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>测试数据</title>
	<link rel="stylesheet" href="/css/bootstrap.min.css">
	<link rel="stylesheet" href="/font-awesome/css/font-awesome.min.css">
	<link rel="stylesheet" href="/css/common.css">
	<link rel="stylesheet" href="/css/testdata.css">
	<script src="/js/jquery.min.js"></script>
	<script src="/js/bootstrap.min.js"></script>
	<script src="/js/vue.js"></script>
	<!--<script src="/js/axios.min.js"></script>-->
	<script src="/js/layer.js"></script>
	<script src="/js/echarts.min.js"></script>
</head>

<body>
	<div id="app" v-cloak>
		<!--主要信息，tab标签页-->
		<div id="main-con">
			<!--左侧显示人员数据-->
			<div id="con-left" class="col-sm-2">
				<h3 style="margin-top: 0;color: #8a8a8a;">
					<span><img src="/img/people.png" style="width: 40px;padding-bottom: 8px;" alt=""></span>&nbsp;&nbsp;人员列表
				</h3>
				<hr>
				<div id="con-left-up">
					<div class="input-group" style="padding-left: 15px;padding-right: 15px;width: 100%;">
						<div class="input-group row" style="margin-left: 0;width: 100%;">
							<input type="text" class="form-control" placeholder="请输入用户姓名/编号" @keyup="personSearch" v-model="person_search">
						</div>
					</div>
					<div id="person_list" style="overflow-y: auto;">
						<img style="position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);width: 40px" v-if="person_loading"
						 src="/img/loading.gif" alt="">
						<ul>
							<li @click="currentData(person.name,person.UID)" v-for="(person,index) in persons" :key="index">
								<span><img style="width: 25px" :src="checkSex(person.sex)" alt=""></span>
								&nbsp;&nbsp;{{ person.name }}&nbsp;&nbsp;
							</li>
						</ul>
					</div>
				</div>
			</div>

			<!--右侧数据显示-->
			<div id="con-right" class="col-sm-10">

				<!--标签分页-->
				<ul class="nav nav-tabs">
					<li class="active">
						<a href="#current_data" data-toggle="tab">
							<span class="glyphicon glyphicon-list"></span> 当前数据</a>
					</li>
					<li>
						<a href="#fit_list" data-toggle="tab">
							<span class="glyphicon glyphicon-list-alt"></span> 机能评定数据</a>
					</li>
					<li>
						<a href="#fit_curve" data-toggle="tab">
							<i class="fa fa-line-chart"></i> 机能曲线</a>
					</li>
					<li>
						<a href="#bca_list" data-toggle="tab">
							<span class="glyphicon glyphicon-list-alt"></span> 体成分数据</a>
					</li>
					<li>
						<a href="#bca_curve" data-toggle="tab">
							<i class="fa fa-line-chart"></i></span> 体成分曲线</a>
					</li>
					<li>
						<a href="#all_fit_data" data-toggle="tab">
							<span class="glyphicon glyphicon-list"> 全部机能评定数据</span>
						</a>
					</li>
					<li>
						<a href="#all_bca_data" data-toggle="tab">
							<span class="glyphicon glyphicon-list"> 全部体成分数据</span>
						</a>
					</li>
				</ul>

				<!-- 选中用户展示栏 -->
				<div style="margin-top: -1px" v-if="tool_show === 'simple'">
					<table class="table" style="margin-bottom: 0">
						<tr>
							<td width="5%">
								<p style="height: 34px;line-height: 34px;text-align: center">姓名</p>
							</td>
							<td width="20%">
								<input type="text" class="form-control" v-model="name" readonly>
							</td>
							<td width="5%">
								<p style="height: 34px;line-height: 34px;text-align: center">用户编号</p>
							</td>
							<td width="20%">
								<input type="text" class="form-control" v-model="uid" readonly>
							</td>
							<td width="50%" colspan="2">
								<div class="pull-right" v-if="flag==='fit_list' || flag==='bca_list'">
									<button class="btn btn-warning" @click="report" style="border-radius: 20px;padding-left: 20px;padding-right: 20px;"><span
										 class="glyphicon glyphicon-list"></span> 查看报告
									</button>
								</div>
                                <div class="pull-right" v-else-if="flag==='current_data' || flag===''">
                                    <button class="btn btn-warning" @click="foodAdvice" style="border-radius: 20px;padding-left: 20px;padding-right: 20px;margin-right: 20px;"><span
                                            class="glyphicon glyphicon-list"></span> 膳食建议
                                    </button>
                                    <button class="btn btn-primary" @click="sportAdvice" style="border-radius: 20px;padding-left: 20px;padding-right: 20px;"><span
                                            class="glyphicon glyphicon-list"></span> 运动建议
                                    </button>
                                </div>
							</td>
						</tr>
					</table>
				</div>

				<div id="tool" v-else>
					<div class="pull-left input-group" style="margin-left: 20px">
						<div class="input-group row">
							<input type="text" class="form-control" placeholder="请输入用户编号" style="width: 35%" v-model="test_uid">
							<input type="text" class="form-control" placeholder="请输入用户姓名" style="width: 35%;margin-left: 15px" v-model="test_name">
							<span class="btn btn-primary" @click="testDataSearch" style="margin-left: 15px;"><i class="fa fa-search">&nbsp;&nbsp;搜索</i></span>
						</div>
						<!--<button></button>-->
					</div>
					<div class="pull-right">
						<button class="btn btn-warning" @click="reportTest">
							<span class="glyphicon glyphicon-list"></span>
							查看报告
						</button>
                        <button class="btn btn-warning" @click="printData">
                            <span class="glyphicon glyphicon-print"></span>
                            打印
                        </button>
						<button class="btn btn-success" @click="reportImport">
							<span class="glyphicon glyphicon-log-in"></span>
							导入
						</button>
						<button class="btn btn-success" @click="exportPortData">
							<span class="glyphicon glyphicon-share"></span>
							部分导出
						</button>
						<button class="btn btn-success" @click="exportAllData">
							<span class="glyphicon glyphicon-share"></span>
							全部导出
						</button>
						<button class="btn btn-danger" @click="delData">
							<span class="glyphicon glyphicon-trash"></span>
							删除
						</button>
					</div>
				</div>

				<!--主要数据列表-->
				<div id="myTabContent" class="tab-content">
					<!--当前数据，每个人测试的最新数据-->
					<div id="current_data" class="tab-pane fade in active">
						<table class="table">
							<tr>
								<td colspan="6" class="tr_title" @click="fitReport">体测最新数据 <i style="color: #31b0d5;font-size: 16px;">
										<-- 点击看报告</i> </td> </tr> <tr>
								<td>身高(cm)</td>
								<td><input type="text" :value="MY_CURRENT_FIT_DATA.Height"></td>
								<td>体重(kg)</td>
								<td><input type="text" :value="MY_CURRENT_FIT_DATA.Weight"></td>
								<td>握力(kg)</td>
								<td><input type="text" :value="MY_CURRENT_FIT_DATA.WOLI"></td>
							</tr>
							<tr>
								<td>肺活量(ml)</td>
								<td><input type="text" :value="MY_CURRENT_FIT_DATA.FHL"></td>
								<td>坐位体前屈(cm)</td>
								<td><input type="text" :value="MY_CURRENT_FIT_DATA.TQQ"></td>
								<td>纵跳(cm)</td>
								<td><input type="text" :value="MY_CURRENT_FIT_DATA.ZT"></td>
							</tr>
							<tr>
								<td>反应时(ms)</td>
								<td><input type="text" :value="MY_CURRENT_FIT_DATA.FYS"></td>
								<td>俯卧撑(个)</td>
								<td><input type="text" :value="MY_CURRENT_FIT_DATA.FWC"></td>
								<td>仰卧起坐(个)</td>
								<td><input type="text" :value="MY_CURRENT_FIT_DATA.YWQZ"></td>
							</tr>
							<tr>
								<td>闭眼单脚站立(s)</td>
								<td><input type="text" :value="MY_CURRENT_FIT_DATA.BYDJ"></td>
								<td>台阶指数</td>
								<td><input type="text" :value="MY_CURRENT_FIT_DATA.TZ"></td>
								<td>背肌力(kg)</td>
								<td><input type="text" :value="MY_CURRENT_FIT_DATA.BJL"></td>
							</tr>
							<tr>
								<td>胸围(cm)</td>
								<td><input type="text" :value="MY_CURRENT_FIT_DATA.XW"></td>
								<td>腰围(cm)</td>
								<td><input type="text" :value="MY_CURRENT_FIT_DATA.YW"></td>
								<td>臀围(cm)</td>
								<td><input type="text" :value="MY_CURRENT_FIT_DATA.TW"></td>
							</tr>
							<tr>
								<td colspan="6" class="tr_title" @click="bcaReport">
									<hr>
									体成分最新数据 <i style="color: #31b0d5;font-size: 16px;">
										<-- 点击看报告</i> 
								</td>
							</tr> 
							<tr>
								<td>水分(kg)</td>
								<td><input type="text" :value="MY_CURRENT_BCA_DATA.water"></td>
								<td>脂肪(kg)</td>
								<td><input type="text" :value="MY_CURRENT_BCA_DATA.fat"></td>
								<td>蛋白质(kg)</td>
								<td><input type="text" :value="MY_CURRENT_BCA_DATA.protein"></td>
							</tr>
							<tr>
								<td>骨质(kg)</td>
								<td><input type="text" :value="MY_CURRENT_BCA_DATA.bone"></td>
								<td>肌肉(kg)</td>
								<td><input type="text" :value="MY_CURRENT_BCA_DATA.muscle"></td>
								<td>骨骼肌(kg)</td>
								<td><input type="text" :value="MY_CURRENT_BCA_DATA.SMM"></td>
							</tr>
							<tr>
								<td>四肢骨骼肌指数(ASMI)</td>
								<td><input type="text" :value="MY_CURRENT_BCA_DATA.ASMI"></td>
								<td>体质指数(BMI)</td>
								<td><input type="text" :value="MY_CURRENT_BCA_DATA.BMI"></td>
								<td>体脂率(%)</td>
								<td><input type="text" :value="MY_CURRENT_BCA_DATA.PBF"></td>
							</tr>
							<tr>
								<td>去脂体重(kg)</td>
								<td><input type="text" :value="MY_CURRENT_BCA_DATA.LBM"></td>
								<td>基础代谢(kcal)</td>
								<td><input type="text" :value="MY_CURRENT_BCA_DATA.BMR"></td>
								<td></td>
								<td></td>
						</table>
                        <!--<button class="btn btn-primary center-block">运动建议</button>-->
					</div>

					<!--机能测试数据-->
					<div id="fit_list" class="tab-pane fade">
						<table class="table table-striped table-bordered">
							<tr>
								<th>测试编号</th>
								<th>测试日期</th>
								<th>身高(cm)</th>
								<th>体重(kg)</th>
								<th>握力(kg)</th>
								<th>肺活量(ml)</th>
								<th>坐位体前屈(cm)</th>
								<th>纵跳(cm)</th>
								<th>反应时(ms)</th>
								<th>俯卧撑(个)</th>
								<th>仰卧起坐(个)</th>
								<th>闭眼单脚站立(s)</th>
								<th>台阶指数</th>
								<th>背肌力(kg)</th>
								<th>胸围(cm)</th>
								<th>腰围(cm)</th>
								<th>臀围(cm)</th>
							</tr>
							<tr v-for="(my_fit_data,index) in MY_FIT_DATAS" :key="index" @click="fitCheck" :id="my_fit_data.testID" style="cursor: pointer">
								<td>{{ my_fit_data.testID }}</td>
								<td>{{ my_fit_data.testDate }}</td>
								<td>{{ my_fit_data.Height }}</td>
								<td>{{ my_fit_data.Weight }}</td>
								<td>{{ my_fit_data.WOLI }}</td>
								<td>{{ my_fit_data.FHL }}</td>
								<td>{{ my_fit_data.TQQ }}</td>
								<td>{{ my_fit_data.ZT }}</td>
								<td>{{ my_fit_data.FYS }}</td>
								<td>{{ my_fit_data.FWC }}</td>
								<td>{{ my_fit_data.YWQZ }}</td>
								<td>{{ my_fit_data.BYDJ }}</td>
								<td>{{ my_fit_data.TZ }}</td>
								<td>{{ my_fit_data.BJL }}</td>
								<td>{{ my_fit_data.XW }}</td>
								<td>{{ my_fit_data.YW }}</td>
								<td>{{ my_fit_data.TW }}</td>
							</tr>
						</table>
					</div>

					<!--机能曲线-->
					<div id="fit_curve" class="tab-pane fade center-block"></div>

					<!--体成分测试数据-->
					<div id="bca_list" class="tab-pane fade">
						<table class="table table-striped table-bordered">
							<thead>
								<tr>
									<th>测试序号</th>
									<th>性别</th>
									<th>身高(cm)</th>
									<th>测试日期</th>
									<th>体重(kg)</th>
									<th>标准体重(kg)</th>
									<th>体重控制(kg)</th>
									<th>瘦体重(kg)</th>
									<th>身体年龄</th>
									<th>健康评分</th>
									<th>总水分(kg)</th>
									<th>脂肪(kg)</th>
									<th>体脂率(%)</th>
									<th>蛋白质(kg)</th>
									<th>肌肉(kg)</th>
									<th>骨质(kg)</th>
									<th>BMI</th>
									<th>基础代谢(kcal)</th>
									<th>内脏脂肪指数</th>
									<th>四肢骨骼肌指数</th>
									<th>腰臀比</th>
									<th>骨骼肌(kg)</th>
									<th>体型判定</th>
								</tr>
							</thead>
							<tbody>
								<tr v-for="(my_bca_data,index) in MY_BCA_DATAS" :key="index" @click="bcaCheck" :id="my_bca_data.testID" style="cursor: pointer">
									<td>{{ my_bca_data.testID }}</td>
									<td>{{ my_bca_data.sex }}</td>
									<td>{{ my_bca_data.height }}</td>
									<td>{{ my_bca_data.testDate }}</td>
									<td>{{ my_bca_data.Weight }}</td>
									<td>{{ my_bca_data.targetWeight }}</td>
									<td>{{ my_bca_data.weightControl }}</td>
									<td>{{ my_bca_data.LBM }}</td>
									<td>{{ my_bca_data.bodyAge }}</td>
									<td>{{ my_bca_data.score }}</td>
									<td>{{ my_bca_data.water }}</td>
									<td>{{ my_bca_data.fat }}</td>
									<td>{{ my_bca_data.PBF }}</td>
									<td>{{ my_bca_data.protein }}</td>
									<td>{{ my_bca_data.muscle }}</td>
									<td>{{ my_bca_data.bone }}</td>
									<td>{{ my_bca_data.BMI }}</td>
									<td>{{ my_bca_data.BMR }}</td>
									<td>{{ my_bca_data.VFI }}</td>
									<td>{{ my_bca_data.ASMI }}</td>
									<td>{{ my_bca_data.WHR }}</td>
									<td>{{ my_bca_data.SMM }}</td>
									<td>{{ my_bca_data.bodyType }}</td>
								</tr>
							</tbody>
						</table>
					</div>

					<!--体成分曲线-->
					<div id="bca_curve" class="tab-pane fade center-block"></div>

					<!--全部机能测试数据-->
					<div id="all_fit_data" class="tab-pane fade">
						<div id="fit_table" style="overflow: auto">
							<table class="table table-striped table-bordered">
								<thead>
									<tr>
										<th>
											<input type="checkbox" name="checkbox" v-model="all_fit_checked" @click="allCheck"> 全选
										</th>
										<th>用户编号</th>
										<th>测试编号</th>
										<th>用户姓名</th>
										<th>性别</th>
										<th>测试日期</th>
										<th>身高(cm)</th>
										<th>体重(kg)</th>
										<th>握力(kg)</th>
										<th>肺活量(ml)</th>
										<th>坐位体前屈(cm)</th>
										<th>纵跳(cm)</th>
										<th>反应时(ms)</th>
										<th>俯卧撑(个)</th>
										<th>仰卧起坐(个)</th>
										<th>闭眼单脚站立(s)</th>
										<th>台阶指数</th>
										<th>背肌力(kg)</th>
										<th>胸围(cm)</th>
										<th>腰围(cm)</th>
										<th>臀围(cm)</th>
									</tr>
								</thead>
								<tbody>
									<tr v-if="fit_loading">
										<td><img style="position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);" src="/img/loading.gif"
											 alt=""></td>
									</tr>
									<tr v-for="(fitdata,index) in ALL_FIT_DATAS" :key="index">
										<td style="text-align: center">
											<input type="checkbox" name="checkbox" v-model="all_fit_checks" :value="fitdata">
										</td>
										<td>{{ fitdata.UID}}</td>
										<td>{{ fitdata.testID }}</td>
										<td>{{ fitdata.name }}</td>
										<td>{{ fitdata.sex }}</td>
										<td>{{ fitdata.testDate }}</td>
										<td>{{ fitdata.Height }}</td>
										<td>{{ fitdata.Weight }}</td>
										<td>{{ fitdata.WOLI }}</td>
										<td>{{ fitdata.FHL }}</td>
										<td>{{ fitdata.TQQ }}</td>
										<td>{{ fitdata.ZT }}</td>
										<td>{{ fitdata.FYS }}</td>
										<td>{{ fitdata.FWC }}</td>
										<td>{{ fitdata.YWQZ }}</td>
										<td>{{ fitdata.BYDJ }}</td>
										<td>{{ fitdata.TZ }}</td>
										<td>{{ fitdata.BJL }}</td>
										<td>{{ fitdata.XW }}</td>
										<td>{{ fitdata.YW }}</td>
										<td>{{ fitdata.TW }}</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="page-bar center-block" style="margin-top: 20px;">
							<button class="pull-left btn btn-primary" @click="prePage" :disabled="fit_pre">上一页</button>
							<button class="pull-right btn btn-primary" @click="nextPage" :disabled="fit_next">下一页</button>
						</div>
					</div>

					<!--全部体成分数据-->
					<div id="all_bca_data" class="tab-pane fade">
						<div id="bca_table" style="overflow: auto">
							<table class="table table-striped table-bordered">
								<thead>
									<tr>
										<th>
											<input type="checkbox" name="checkbox" v-model="all_bca_checked" @click="allCheck"> 全选
										</th>
										<th>用户编号</th>
										<th>测试序号</th>
										<th>姓名</th>
										<th>性别</th>
										<th>身高(cm)</th>
										<th>测试日期</th>
										<th>体重(kg)</th>
										<th>标准体重(kg)</th>
										<th>体重控制(kg)</th>
										<th>瘦体重(kg)</th>
										<th>身体年龄</th>
										<th>健康评分</th>
										<th>总水分(kg)</th>
										<th>脂肪(kg)</th>
										<th>体脂率(%)</th>
										<th>蛋白质(kg)</th>
										<th>肌肉(kg)</th>
										<th>骨质(kg)</th>
										<th>BMI</th>
										<th>基础代谢(kcal)</th>
										<th>内脏脂肪指数</th>
										<th>四肢骨骼肌指数</th>
										<th>腰臀比</th>
										<th>骨骼肌(kg)</th>
										<th>体型判定</th>
									</tr>
								</thead>
								<tbody>
									<tr v-if="bca_loading">
										<td><img style="position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);" src="/img/loading.gif"
											 alt=""></td>
									<tr v-for="(bcadata,index) in ALL_BCA_DATAS" :key="index">
										<td style="text-align: center">
											<input type="checkbox" name="checkbox" v-model="all_bca_checks" :value="bcadata">
										</td>
										<td>{{ bcadata.UID }}</td>
										<td>{{ bcadata.testID }}</td>
										<td>{{ bcadata.name }}</td>
										<td>{{ bcadata.sex }}</td>
										<td>{{ bcadata.height }}</td>
										<td>{{ bcadata.testDate }}</td>
										<td>{{ bcadata.Weight }}</td>
										<td>{{ bcadata.targetWeight }}</td>
										<td>{{ bcadata.weightControl }}</td>
										<td>{{ bcadata.LBM }}</td>
										<td>{{ bcadata.bodyAge }}</td>
										<td>{{ bcadata.score }}</td>
										<td>{{ bcadata.water }}</td>
										<td>{{ bcadata.fat }}</td>
										<td>{{ bcadata.PBF }}</td>
										<td>{{ bcadata.protein }}</td>
										<td>{{ bcadata.muscle }}</td>
										<td>{{ bcadata.bone }}</td>
										<td>{{ bcadata.BMI }}</td>
										<td>{{ bcadata.BMR }}</td>
										<td>{{ bcadata.VFI }}</td>
										<td>{{ bcadata.ASMI }}</td>
										<td>{{ bcadata.WHR }}</td>
										<td>{{ bcadata.SMM }}</td>
										<td>{{ bcadata.bodyType }}</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="page-bar center-block" style="margin-top: 20px;">
							<button class="pull-left btn btn-primary" @click="prePage" :disabled="bca_pre">上一页</button>
							<button class="pull-right btn btn-primary" @click="nextPage" :disabled="bca_next">下一页</button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script src="/js/common.js"></script>
	<script>
		let vm = new Vue({
			el: '#app',
			data: {
				// 选中人员标识
				name: '',
				uid: '',
				// testID: '',
				// 查询输入内容 => 人员查询
				person_search: '',

				// 测试数据查询
				test_uid: '',
				test_name: '',
				// 选中标识 => 个人测试数据
				fit_check: '',
				bca_check: '',
				// loading显示标志
				person_loading: true,
				// 后台返回数据
				MY_CURRENT_FIT_DATA: {},
				MY_CURRENT_BCA_DATA: {},
				MY_FIT_DATAS: [],
				MY_BCA_DATAS: [],
				ALL_FIT_DATAS: [],
				ALL_BCA_DATAS: [],

				// 加载图
				fit_loading: true,
				bca_loading: true,

				// 全部数据选中数组
				all_fit_checks: [],
				all_bca_checks: [],

				// 功能栏展示
				tool_show: 'simple',

				persons: [],
				// tab页标签标志
				flag: '',
				//折线图初始化数据
				option: {
					title: {
						text: '测试数据折线图'
					},
					tooltip: {
						trigger: 'axis'
					},
					legend: {
						data: []
					},
					grid: {
						left: '4%',
						right: '4%',
						bottom: '3%',
						containLabel: true
					},
					toolbox: {
						feature: {

						}
					},
					xAxis: {
						type: 'category',
						boundaryGap: false,
						data: []
					},
					yAxis: {
						type: 'value'
					},
					series: []
				},

				// 分页请求数据参数
				single_num: 16, // 每页条数
				fit_start_num: 1, // 每页起始数字
				bca_start_num: 1, // 每页起始数字
				fit_pre: true,
				fit_next: false,
				bca_pre: true,
				bca_next: false,

				// 全选
				all_fit_checked: false,
				all_bca_checked: false,

				search_union: '' // 联合查询临时变量存储
			},
			watch: {
				all_fit_checks() {
					if (this.all_fit_checks.length < this.ALL_FIT_DATAS.length) {
						this.all_fit_checked = false;
					} else if (this.all_fit_checks.length === this.ALL_FIT_DATAS.length && this.ALL_FIT_DATAS.length !== 0) {
						this.all_fit_checked = true;
					}
				},
				all_bca_checks() {
					if (this.all_bca_checks.length < this.ALL_BCA_DATAS.length) {
						this.all_bca_checked = false;
					} else if (this.all_bca_checks.length === this.ALL_BCA_DATAS.length && this.ALL_BCA_DATAS.length !== 0) {
						this.all_bca_checked = true;
					}
				},
			},
			mounted() {
				let _this = this;
				// 调整大小
				$('#myTabContent').css('height', ($('#con-right').height() - 103) + 'px');
				$('#myTabContent #all_fit_data #fit_table').css('height', ($('#con-right').height() - 177) + 'px');
				$('#myTabContent #all_bca_data #bca_table').css('height', ($('#con-right').height() - 177) + 'px');
				$('#fit_curve').css('height', ($('#con-right').height() - 157) + 'px');
				$('#fit_curve').css('width', ($('#con-right').height() - 157) + 'px');
				$('#bca_curve').css('height', ($('#con-right').height() - 157) + 'px');
				$('#bca_curve').css('width', ($('#con-right').height() - 157) + 'px');
				$('#person_list').css('height', ($('#con-left').height() - 134) + 'px');
				window.onresize = () => {
					$('#myTabContent').css('height', ($('#con-right').height() - 103) + 'px');
					$('#myTabContent #all_fit_data #fit_table').css('height', ($('#con-right').height() - 177) + 'px');
					$('#myTabContent #all_bca_data #bca_table').css('height', ($('#con-right').height() - 177) + 'px');
					$('#fit_curve').css('height', ($('#con-right').height() - 157) + 'px');
					$('#fit_curve').css('width', ($('#con-right').height() - 157) + 'px');
					$('#bca_curve').css('height', ($('#con-right').height() - 157) + 'px');
					$('#bca_curve').css('width', ($('#con-right').height() - 157) + 'px');
					$('#person_list').css('height', ($('#con-left').height() - 134) + 'px');
				};

				$('#myTabContent input').attr('readonly', 'readonly'); //设置当前数据下的输入框为只读
				// 标签切换
				$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
					// console.log(this);
					_this.flag = $(e.target).attr('href').replace('#', '');
					if (_this.flag === 'current_data') {
						_this.tool_show = 'simple';
						_this.myCurrentFitData();
						_this.myCurrentBCAData();
						return;
					}
					if (_this.flag === 'fit_list' || _this.flag === 'fit_curve') {
						_this.tool_show = 'simple';
						_this.myFitDatas();
						return;
					}
					if (_this.flag === 'bca_list' || _this.flag === 'bca_curve') {
						_this.tool_show = 'simple';
						_this.myBCADatas();
						return;
					}
					if (_this.flag === 'all_fit_data') {
						_this.test_uid = _this.test_name = '';
						_this.tool_show = 'all';
						_this.fitDataList();
						return;
					}
					if (_this.flag === 'all_bca_data') {
						_this.test_uid = _this.test_name = '';
						_this.tool_show = 'all';
						_this.bcaDataList();
						return;
					}
				});

				ws.onopen = function () {
					_this.personList();
				};

				ws.onmessage = function (e) {
					console.log(e.data);
					let data = JSON.parse(e.data);
					let legend = {
						selected: {},
					};
					let series = [];
					if (data.length > 0) {
						switch (data[0].title) {
							case 'PERSON_LIST_DATA':
								if (!data[0].noValue) {
									_this.persons = data;
								}
								_this.person_loading = false;
								break;
							case 'PERSON_DATA_SEARCH_IDName':
								if (!data[0].noValue) {
									_this.persons = data;
								} else {
									_this.persons = [];
								}
								_this.person_loading = false;
								break;
							case 'MY_CURRENT_FIT_DATA':
								if (!data[0].noValue) {
									_this.MY_CURRENT_FIT_DATA = data[0];
									_this.fit_check = data[0].testID;
								} else {
									_this.fit_check = '';
								}
								break;
							case 'MY_CURRENT_BCA_DATA':
								if (!data[0].noValue) {
									_this.MY_CURRENT_BCA_DATA = data[0];
									_this.bca_check = data[0].testID;
								} else {
									_this.bca_check = '';
								}
								break;
							case 'MY_FIT_DATAS':
								let fit_echarts = echarts.init(document.getElementById('fit_curve'));
								fit_echarts.clear();
								if (!data[0].noValue) {
									_this.ALL_FIT_DATAS = data;
									// console.log(data);
									let fit_date = [];
									let grid = {
										right: '14%',
										left: '2%',
										bottom: '3%',
										containLabel: true
									};
									let height_data = []; // 身高
									let weight_data_fit = []; // 体重
									let woli_data = []; // 握力
									let fhl_data = []; // 肺活量
									let tqq_data = []; // 坐位体前屈
									let zt_data = []; // 纵跳
									let fys_data = []; // 反应时
									let fwc_data = []; // 俯卧撑
									let ywqz_data = []; // 仰卧起坐
									let bydj_data = []; // 闭眼单脚站立
									let tz_data = []; // 台阶指数
									let bjl_data = []; // 背肌力
									let xw_data = []; // 胸围
									let yw_data = []; // 腰围
									let tw_data = []; // 臀围

									_this.MY_FIT_DATAS = data;
									legend.top = '8%';
									legend.right = 'right';
									legend.orient = 'vertical';
									legend.data = ['身高', '体重', '握力', '肺活量', '坐位体前屈', '纵跳', '反应时', '俯卧撑', '仰卧起坐',
										'闭眼单脚站立', '台阶指数', '背肌力', '胸围', '腰围', '臀围'
									];
									for (let i = 0; i < data.length; i++) {
										height_data.push(data[i].Height);
										weight_data_fit.push(data[i].Weight);
										fit_date.push(data[i].testDate);
										woli_data.push(data[i].WOLI);
										fhl_data.push(data[i].FHL);
										tqq_data.push(data[i].TQQ);
										zt_data.push(data[i].ZT);
										fys_data.push(data[i].FYS);
										fwc_data.push(data[i].FWC);
										ywqz_data.push(data[i].YWQZ);
										bydj_data.push(data[i].BYDJ);
										tz_data.push(data[i].TZ);
										bjl_data.push(data[i].BJL);
										xw_data.push(data[i].XW);
										yw_data.push(data[i].YW);
										tw_data.push(data[i].TW);
									}

									let map_fit = new Map([
										['身高', height_data.reverse()],
										['体重', weight_data_fit.reverse()],
										['握力', woli_data.reverse()],
										['肺活量', fhl_data.reverse()],
										['坐位体前屈', tqq_data.reverse()],
										['纵跳', zt_data.reverse()],
										['反应时', fys_data.reverse()],
										['俯卧撑', fwc_data.reverse()],
										['仰卧起坐', ywqz_data.reverse()],
										['闭眼单脚站立', bydj_data.reverse()],
										['台阶指数', tz_data.reverse()],
										['背肌力', bjl_data.reverse()],
										['胸围', xw_data.reverse()],
										['腰围', yw_data.reverse()],
										['臀围', tw_data.reverse()],
									]);

									for (let i = 0; i < legend.data.length; i++) {
										if (legend.data[i] !== '身高' && legend.data[i] !== '体重') {
											legend.selected[legend.data[i]] = false;
										}
										series.push({
											name: legend.data[i],
											type: 'line',
											stack: '总量',
											data: map_fit.get(legend.data[i]),
										})
									}
									_this.option.legend = legend;
									_this.option.series = series;
									_this.option.grid = grid;
									_this.option.xAxis.data = fit_date.reverse();
									// let fit_echarts = echarts.init(document.getElementById('fit_curve'));
									fit_echarts.setOption(_this.option);
								} else {
									_this.ALL_FIT_DATAS = [];
								}
								break;
							case 'MY_BCA_DATAS':
								let bca_echarts = echarts.init(document.getElementById('bca_curve'));
								bca_echarts.clear();
								if (!data[0].noValue) {
									_this.ALL_BCA_DATAS = data;
									let bca_date = []; //横坐标
									let weight_data = [];
									let water_data = [];
									let muscle_data = [];
									let pbf_data = [];

									_this.MY_BCA_DATAS = data;
									legend.data = ['体重', '水分', '肌肉', '体脂率']; //统计项
									for (let i = 0; i < data.length; i++) {
										bca_date.push(data[i].testDate);
										weight_data.push(data[i].Weight);
										water_data.push(data[i].water);
										muscle_data.push(data[i].muscle);
										pbf_data.push(data[i].PBF);
									}

									let map_bca = new Map([
										['体重', weight_data.reverse()],
										['水分', water_data.reverse()],
										['肌肉', muscle_data.reverse()],
										['体脂率', pbf_data.reverse()],
									]);

									for (let i = 0; i < legend.data.length; i++) {
										// legend.selected[legend.data[i]] = false;
										series.push({
											name: legend.data[i],
											type: 'line',
											stack: '总量',
											data: map_bca.get(legend.data[i]),
										})
									}
									_this.option.legend = legend;
									_this.option.series = series;
									_this.option.xAxis.data = bca_date.reverse();
									// let bca_echarts = echarts.init(document.getElementById('bca_curve'));
									bca_echarts.setOption(_this.option);
								} else {
									_this.ALL_BCA_DATAS = [];
								}
								break;
							case 'FIT_DATA_LIST':
								// console.log(data[0].noValue);
								if (!data[0].noValue) {
									_this.ALL_FIT_DATAS = data;
									_this.fit_next = data.length < _this.single_num ? true : false;
								}
								_this.fit_loading = false;
								break;
							case 'BCA_DATA_LIST':
								if (!data[0].noValue) {
									_this.ALL_BCA_DATAS = data;
									_this.bca_next = data.length < _this.single_num ? true : false;
								}
								_this.bca_loading = false;
								break;
							case 'NEW_FIT_DATA':
								_this.ALL_FIT_DATAS = _this.ALL_FIT_DATAS.concat(data);
								if (_this.uid === data[0].UID) {
									_this.MY_FIT_DATAS = _this.MY_FIT_DATAS.concat(data);
									_this.MY_CURRENT_FIT_DATA = data[0];
								}
								break;
							case 'NEW_BCA_DATA':
								_this.ALL_BCA_DATAS = _this.ALL_BCA_DATAS.concat(data);
								if (_this.uid === data[0].UID) {
									_this.MY_BCA_DATAS = _this.MY_BCA_DATAS.concat(data);
									_this.MY_CURRENT_BCA_DATA = data[0];
								}
								break;
							case 'BCA_DATA_DELETED':
								layer.msg('删除成功');
								// _this.bcaDataList();
								let del_bca_list = data[0].delList.split(',');
								for (let i = 0; i < _this.ALL_BCA_DATAS.length; i++) {
									if (del_bca_list.indexOf(_this.ALL_BCA_DATAS[i].testID) > -1) {
										_this.ALL_BCA_DATAS.splice(i, 1);
										i--;
									}
								}
								_this.all_bca_checks = []; // 删除后清空选中数组框，以免造成下次删除或导出等非空选中无提示
								_this.ALL_BCA_DATAS.length === 0 ? _this.all_bca_checked = false : void 0;
								break;
							case 'FIT_DATA_DELETED':
								layer.msg('删除成功');
								// _this.fitDataList();
								let del_fit_list = data[0].delList.split(',');
								for (let i = 0; i < _this.ALL_FIT_DATAS.length; i++) {
									if (del_fit_list.indexOf(_this.ALL_FIT_DATAS[i].testID) > -1) {
										_this.ALL_FIT_DATAS.splice(i, 1);
										i--;
									}
								}
								_this.all_fit_checks = [];
								_this.ALL_FIT_DATAS.length === 0 ? _this.all_fit_checked = false : void 0;
								break;
							case 'SPORT_ADVISE_CONTENT':
							    localStorage.setItem('advice',JSON.stringify(data[0]));
							    break;
						}
					} else {
						_this.prePage();
						if (_this.flag === 'all_fit_data') {
							layer.msg('已至最后一页');
							_this.fit_loading = false;
						} else if (_this.flag === 'all_bca_data') {
							layer.msg('已至最后一页');
							_this.bca_loading = false;
						}
					}
				};
			},
			methods: {
				//膳食建议
                foodAdvice() {
	                location.href = '/api/diet?sex=' + this.MY_CURRENT_FIT_DATA.sex + '&weight=' + this.MY_CURRENT_FIT_DATA.Weight;
                },
				// 运动建议
				sportAdvice() {
					location.href = '/api/advise?testid=' + this.MY_CURRENT_FIT_DATA.testID;
                },
				// 全选
				allCheck() {
					if (this.flag === 'all_fit_data') {
						if (this.all_fit_checked) {
							this.all_fit_checks = [];
						} else {
							this.all_fit_checks = JSON.parse(JSON.stringify(this.ALL_FIT_DATAS));
						}
					}
					if (this.flag === 'all_bca_data') {
						if (this.all_bca_checked) {
							this.all_bca_checks = [];
						} else {
							this.all_bca_checks = JSON.parse(JSON.stringify(this.ALL_BCA_DATAS));
						}
					}
				},
				// 前一页
				prePage() {
					if (this.flag === 'all_fit_data') {
						// 页面切换清空之前页面选中结果，并让全选按钮回复默认状态
						this.all_fit_checks = [];
						this.all_fit_checked = false;

						this.fit_start_num -= this.single_num;
						if (this.fit_start_num <= 1) {
							this.fit_pre = true;
						}
						this.fit_next = this.fit_next ? false : void 0;
						this.fitDataList();
					}
					if (this.flag === 'all_bca_data') {
						this.all_bca_checks = [];
						this.all_bca_checked = false;
						this.bca_start_num -= this.single_num;
						if (this.bca_start_num <= 1) {
							this.bca_pre = true;
						}
						this.bca_next = this.bca_next ? false : void 0;
						this.bcaDataList();
					}
				},
				// 后一页
				nextPage() {
					if (this.flag === 'all_fit_data') {
						// 页面切换清空之前页面选中结果，并让全选按钮回复默认状态
						this.all_fit_checks = [];
						this.all_fit_checked = false;

						this.fit_start_num += this.single_num;
						this.fit_pre = this.fit_pre ? false : void 0;
						this.fitDataList();
					}
					if (this.flag === 'all_bca_data') {
						this.all_bca_checks = [];
						this.all_bca_checked = false;
						this.bca_start_num += this.single_num;
						this.bca_pre = this.bca_pre ? false : void 0;
						this.bcaDataList();
					}
				},
				// 根据性别显示图标
				checkSex(sex) {
					if (sex === '男' || sex === '1') {
						return '/img/men.png';
					}
					if (sex === '女' || sex === '2') {
						return '/img/women.png';
					}
				},
				// 选中体势能数据
				fitCheck(e) {
					$(e.target.parentNode).addClass('bgColor').siblings('tr').removeClass('bgColor');
					// console.log($(e.target.parentNode).attr('id'));
					this.fit_check = $(e.target.parentNode).attr('id');
				},
				// 选中体成分数据
				bcaCheck(e) {
					$(e.target.parentNode).addClass('bgColor').siblings('tr').removeClass('bgColor');
					// console.log($(e.target.parentNode).attr('id'));
					this.bca_check = $(e.target.parentNode).attr('id');
				},
				currentData(name, uid) {
					// 点击先清空上一人的信息
					this.MY_CURRENT_FIT_DATA = {};
					this.MY_CURRENT_BCA_DATA = {};
					this.MY_FIT_DATAS = [];
					this.MY_BCA_DATAS = [];
					this.name = name;
					this.uid = uid;

					if (this.flag === '' || this.flag === 'current_data') {
						this.myCurrentFitData();
						this.myCurrentBCAData();
						return;
					}
					if (this.flag === 'fit_list' || this.flag === 'fit_curve') {
						this.myFitDatas();
						return;
					}
					if (this.flag === 'bca_list' || this.flag === 'bca_curve') {
						this.myBCADatas();
						return;
					}
				},
				// 查看报告
				report() {
					if (this.flag === 'fit_list') {
						if (this.fit_check === '') {
							layer.msg('请选择数据');
						} else {
							this.fitReport();
						}
						return;
					}
					if (this.flag === 'bca_list') {
						if (this.bca_check === '') {
							layer.msg('请选择数据');
						} else {
							this.bcaReport();
						}
						return;
					}
				},
				// 最新的机能评定数据
				myCurrentFitData() {
					subject.title = 'MY_CURRENT_FIT_DATA';
					subject.params = this.uid;
					ws.send(JSON.stringify(subject));
				},
				// 最新的体成分数据
				myCurrentBCAData() {
					subject.title = "MY_CURRENT_BCA_DATA";
					subject.params = this.uid;
					ws.send(JSON.stringify(subject));
				},
				// 个人所有机能评定数据
				myFitDatas() {
					subject.title = 'MY_FIT_DATAS';
					subject.params = this.uid;
					ws.send(JSON.stringify(subject));
				},
				// 个人所有体成分数据
				myBCADatas() {
					subject.title = 'MY_BCA_DATAS';
					subject.params = this.uid;
					ws.send(JSON.stringify(subject));
				},
				// 查看机能报告
				fitReport() {
					if (this.name === '' && this.uid === '') {
						layer.msg('选择人员查看数据');
					} else {
						subject.title = "FIT_REPORT";
						subject.params = this.fit_check;
						ws.send(JSON.stringify(subject));
					}
					/*subject.title = "FIT_REPORT";
					subject.params = this.fit_check;
					ws.send(JSON.stringify(subject));*/
				},
				// 查看体成分报告
				bcaReport() {
					if (this.name === '' && this.uid === '') {
						layer.msg('选择人员查看数据');
					} else {
						subject.title = "BCA_REPORT";
						subject.params = this.bca_check;
						ws.send(JSON.stringify(subject));
					}
					/*subject.title = "BCA_REPORT";
					subject.params = this.bca_check;
					ws.send(JSON.stringify(subject));*/
				},
				// 人员初始化
				personList() {
					subject.title = "PERSON_LIST_DATA";
					subject.id = "";
					subject.name = "";
					subject.sex = "";
					subject.birthYear = "";
					subject.height = "";
					subject.phone = "";
					subject.note = "";
					ws.send(JSON.stringify(subject));
				},
				// 人员编号搜索
				personSearch() {
					this.person_loading = true;
					subject.title = this.person_search === '' ? "PERSON_LIST_DATA" : "PERSON_DATA_SEARCH_IDName";
					subject.params = this.person_search;
					ws.send(JSON.stringify(subject));
				},
				// 机能数据初始化
				fitDataList() {
					this.fit_loading = true;
					subject.title = "FIT_DATA_LIST";
					subject.params = this.fit_start_num + ',' + this.single_num;
					ws.send(JSON.stringify(subject));
				},
				// 体成分数据初始化
				bcaDataList() {
					this.bca_loading = true;
					subject.title = "BCA_DATA_LIST";
					subject.params = this.bca_start_num + ',' + this.single_num;
					ws.send(JSON.stringify(subject));
				},
				// 导入数据
				reportImport() {
					this.flag === 'all_fit_data' ? this.fitDataImport() : this.bcaDataImport();
				},
				// 导入体测数据
				fitDataImport() {
					subject.title = 'FIT_DATA_IMPORT';
					ws.send(JSON.stringify(subject));
				},
				// 导入体成分数据
				bcaDataImport() {
					subject.title = 'BCA_DATA_IMPORT';
					ws.send(JSON.stringify(subject));
				},
				// 2018-11-28
				//打印
				printData(){
					let _this = this;
					if (_this.flag === 'all_fit_data') {
						if (_this.all_fit_checks.length === 0) {
							layer.msg('请选择要打印的数据');
						} else {
							let testid_fit = [];
							for (let i = 0; i < _this.all_fit_checks.length; i++) {
								testid_fit.push(_this.all_fit_checks[i].testID);
							}
							_this.fitDataPrint(testid_fit.join(','));
						}
						return;
					}
					if (_this.flag === 'all_bca_data') {
						if (_this.all_bca_checks.length === 0) {
							layer.msg('请选择要打印的数据');
						} else {
							let testid_bca = [];
							for (let i = 0; i < _this.all_bca_checks.length; i++) {
								testid_bca.push(_this.all_bca_checks[i].testID);
							}
							_this.bcaDataPrint(testid_bca.join(','));
						}
						return;
					}
				},
				// 机能测试数据打印
				fitDataPrint(testid){
					subject.title = "FIT_PRINT";
					subject.params = testid;
					ws.send(JSON.stringify(subject));
				},
				// 体成分数据打印
				bcaDataPrint(testid){
					subject.title = "BCA_PRINT";
					subject.params = testid;
					ws.send(JSON.stringify(subject));
				},
				// 导出全部数据
				exportAllData() {
					let _this = this;
					if (_this.flag === 'all_fit_data') {
						_this.fitDataExport('all');
						return;
					}
					if (_this.flag === 'all_bca_data') {
						_this.bcaDataExport('all');
					}
				},
				// 导出部分数据
				exportPortData() {
					let _this = this;
					if (_this.flag === 'all_fit_data') {
						if (_this.all_fit_checks.length === 0) {
							layer.msg('请选择要导出的数据');
						} else {
							let testid_fit = [];
							for (let i = 0; i < _this.all_fit_checks.length; i++) {
								testid_fit.push(_this.all_fit_checks[i].testID);
							}
							_this.fitDataExport(testid_fit.join(','));
						}
						return;
					}
					if (_this.flag === 'all_bca_data') {
						if (_this.all_bca_checks.length === 0) {
							layer.msg('请选择要导出的数据');
						} else {
							let testid_bca = [];
							for (let i = 0; i < _this.all_bca_checks.length; i++) {
								testid_bca.push(_this.all_bca_checks[i].testID);
							}
							_this.bcaDataExport(testid_bca.join(','));
						}
						return;
					}
				},
				// 机能测试数据导出
				fitDataExport(testid) {
					subject.title = "FIT_DATA_EXPORT";
					subject.params = testid;
					ws.send(JSON.stringify(subject));
				},
				// 体成分测试数据导出
				bcaDataExport(testid) {
					subject.title = "BCA_DATA_EXPORT";
					subject.params = testid;
					ws.send(JSON.stringify(subject));
				},
				// 删除数据
				delData() {
					let _this = this;
					if (_this.flag === 'all_fit_data') {
						let testid_fit = [];
						if (_this.all_fit_checks.length === 0) {
							layer.msg('请选择要删除的数据');
						} else {
							layer.confirm('您确定要删除吗？', {
								icon: 5,
								btn: ['确定', '取消'] //按钮
							}, function () {
								for (let i = 0; i < _this.all_fit_checks.length; i++) {
									testid_fit.push(_this.all_fit_checks[i].testID);
								}
								_this.fitDataDel(testid_fit.join(','));
							}, function () {
								layer.msg('那您再考虑下吧');
							});
						}
						return;
					}
					if (_this.flag === 'all_bca_data') {
						let testid_bca = [];
						if (_this.all_bca_checks.length === 0) {
							layer.msg('请选择要删除的数据');
						} else {
							layer.confirm('您确定要删除吗？', {
								icon: 5,
								btn: ['确定', '取消'] //按钮
							}, function () {
								for (let i = 0; i < _this.all_bca_checks.length; i++) {
									testid_bca.push(_this.all_bca_checks[i].testID);
								}
								_this.bcaDataDel(testid_bca.join(','));
							}, function () {
								layer.msg('那您再考虑下吧');
							});
						}
					}
				},
				// 机能数据删除
				fitDataDel(testid) {
					subject.title = "FIT_DATA_DEL";
					subject.params = testid;
					ws.send(JSON.stringify(subject));
				},
				// 体成分数据删除
				bcaDataDel(testid) {
					subject.title = "BCA_DATA_DEL";
					subject.params = testid;
					ws.send(JSON.stringify(subject));
				},
				// 测试数据搜索
				testDataSearch() {
					if (this.flag === 'all_fit_data') {
						this.all_fit_checks = []; // -> 作用：当选中一条时，搜索，选中的那条选中状态会清空，然后再选会有两条数据
						if (this.test_uid === '' && this.test_name === '') {
							this.fitDataList();
						}
						if (this.test_uid !== '' && this.test_name === '') {
							this.fitDataSearchID(this);
						}
						if (this.test_name !== '' && this.test_uid === '') {
							this.search_union = this.test_name;
							this.fitDataSearchName();
						}
						if (this.test_name !== '' && this.test_uid !== '') {
							this.search_union = this.test_uid + ',' + this.test_name;
							this.fitDataSearchName();
						}
					}
					if (this.flag === 'all_bca_data') {
						this.all_bca_checks = [];
						if (this.test_uid === '' && this.test_name === '') {
							this.bcaDataList();
						}
						if (this.test_uid !== '' && this.test_name === '') {
							this.bcaDataSearchID();
						}
						if (this.test_name !== '' && this.test_uid === '') {
							this.search_union = this.test_name;
							this.bcaDataSearchName();
						}
						if (this.test_name !== '' && this.test_uid !== '') {
							this.search_union = this.test_uid + ',' + this.test_name;
							this.bcaDataSearchName();
						}
					}
				},
				// 搜索
				fitDataSearchName() {
					subject.title = "FIT_DATA_SEARCH_NAME";
					subject.params = this.search_union;
					ws.send(JSON.stringify(subject));
				},
				fitDataSearchID() {
					subject.title = "FIT_DATA_SEARCH_ID";
					subject.params = this.test_uid;
					ws.send(JSON.stringify(subject));
				},
				bcaDataSearchName() {
					subject.title = "BCA_DATA_SEARCH_NAME";
					subject.params = this.search_union;
					ws.send(JSON.stringify(subject));
				},
				bcaDataSearchID() {
					subject.title = "BCA_DATA_SEARCH_ID";
					subject.params = this.test_uid;
					ws.send(JSON.stringify(subject));
				},
				// 查看报告
				reportTest() {
					if (this.flag === 'all_fit_data') {
						if (this.all_fit_checks.length === 0) {
							layer.msg('请选择数据');
						} else if (this.all_fit_checks.length > 1) {
							layer.msg('请选择一条数据查看报告');
						} else {
							this.fitReportTest();
						}
						return;
					}
					if (this.flag === 'all_bca_data') {
						if (this.all_bca_checks.length === 0) {
							layer.msg('请选择数据');
						} else if (this.all_bca_checks.length > 1) {
							layer.msg('请选择一条数据查看报告');
						} else {
							this.bcaReportTest();
						}
						return;
					}
				},
				// 查看机能报告
				fitReportTest() {
					subject.title = "FIT_REPORT";
					subject.params = this.all_fit_checks[0].testID;
					ws.send(JSON.stringify(subject));
				},
				// 查看体成分报告
				bcaReportTest() {
					subject.title = "BCA_REPORT";
					subject.params = this.all_bca_checks[0].testID;
					ws.send(JSON.stringify(subject));
				},
			}
		})
	</script>
</body>

</html>