<template>
  <div class="app-container">
    <el-form style="background-color: #fff; padding: 15px 5px; border-radius:10px;"  :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <p class="bgtan" style="margin-top: 0;">搜索条件</p>
			<el-row>
				<el-col :span="8">
					<el-form-item label="身份证号" prop="idCard">
					        <el-input
					          v-model="queryParams.idCard"
					          placeholder="请输入身份证号"
					          clearable
					          @keyup.enter.native="handleQuery"
					        />
					      </el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="学号" prop="studentNumber">
					        <el-input
					          v-model="queryParams.studentNumber"
					          placeholder="请输入学号"
					          clearable
					          @keyup.enter.native="handleQuery"
					        />
					      </el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="姓名" prop="name">
					        <el-input
					          v-model="queryParams.name"
					          placeholder="请输入姓名"
					          clearable
					          @keyup.enter.native="handleQuery"
					        />
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="班级名称" prop="classId">
							  <el-select v-model="queryParams.classId" placeholder="请选择班级名称">
							    <el-option
							      v-for="dict in kiuesegh"
							      :key="dict.deptId"
							      :label="dict.deptName"
							      :value="dict.deptId"
								  clearable
								  @keyup.enter.native="handleQuery"
							    ></el-option>
							  </el-select>
					</el-form-item>
				</el-col>
				  
				<el-col :span="8">
					<el-form-item label="性别" prop="sex">
					        <el-select v-model="queryParams.sex" placeholder="请选择性别" clearable>
					          <el-option
					            v-for="dict in dict.type.xshsex"
					            :key="dict.value"
					            :label="dict.label"
					            :value="dict.value"
					          />
					        </el-select>
					      </el-form-item>
				</el-col>
				<el-col :span="6">
					<el-form-item>
					  <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
					  <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
					</el-form-item>
				</el-col>
				<el-col :span="6">
					
				</el-col>
				<el-col :span="6">
					
				</el-col>
				<el-col :span="6">
					
				</el-col>
				<el-col :span="6">
					
				</el-col>
				<el-col :span="6">
					
				</el-col>
				<el-col :span="6">
					
				</el-col>
			</el-row>
      
      
    </el-form>

    <el-row :gutter="10" class="mb8" style=" border-top-left-radius: 12px; border-top-right-radius: 12px; background-color: #fff;margin: 0;margin-top: 20px;padding: 10px 5px; ">
      <p class="bgtan" style="margin-top: 0;">学生成长信息</p>
	   <!-- <el-col :span="1.5">
	          <el-button
	            type="primary"
	            plain
	            icon="el-icon-plus"
	            size="mini"
	            @click="handleAdd"
	            v-hasPermi="['student:info:add']"
	          >新增</el-button>
	        </el-col> -->
	        <el-col :span="1.5">
	          <el-button
	            type="success"
	            plain
	            icon="el-icon-edit"
	            size="mini"
	            :disabled="single"
	            @click="handleUpdate"
	            v-hasPermi="['student:info:edit']"
	          >修改</el-button>
	        </el-col>
	        <el-col :span="1.5">
	          <el-button
	            type="danger"
	            plain
	            icon="el-icon-delete"
	            size="mini"
	            :disabled="multiple"
	            @click="handleDelete"
	            v-hasPermi="['student:info:remove']"
	          >删除</el-button>
	        </el-col>
	        <el-col :span="1.5">
	          <el-button
	            type="warning"
	            plain
	            icon="el-icon-download"
	            size="mini"
	            @click="handleExport"
	            v-hasPermi="['student:info:export']"
	          >导出</el-button>
			  </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
     <div class="ngtes" style="background-color: #fff; padding: 0 10px;  padding-bottom: 40px; border-bottom-left-radius: 12px; border-bottom-right-radius: 12px;">
		<el-table  :max-height="tableMaxHeight"  v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
		  <el-table-column type="selection" width="55" align="center" />
		   <!-- <el-table-column label="班级名称" align="center" prop="className" width="110"/> -->
		  <!-- <el-table-column label="ID" align="center" prop="id" /> -->
		  
		  <el-table-column type="expand">
		        <template slot-scope="props">
		          <el-form label-position="left" inline class="demo-table-expand">
		            <el-form-item label="政治面貌">
		              <span class="ngr">{{ props.row.politicalStatus }}</span>
		            </el-form-item>
					<el-form-item label="留守儿童">
					  <span class="ngr">
					  <dict-tag :options="dict.type.isjinshi" :value="props.row.isLset"/>
					  </span>
					</el-form-item>
					<el-form-item label="是否贫困">
					  <span class="ngr">
					  <dict-tag :options="dict.type.isjinshi" :value="props.row.isPoverty"/>
					  </span>
					</el-form-item>
					<el-form-item label="是否近视">
					  <span ><dict-tag :options="dict.type.isjinshi" :value="props.row.isNearsightedness"/></span>
					</el-form-item>
					<el-form-item label="近视度数">
					  <span class="ngr">{{ props.row.degreeMyopia }}</span>
					</el-form-item>
					<el-form-item label="备注">
					  <span class="ngr">{{ props.row.remark }}</span>
					</el-form-item>
					<!-- <el-table-column label="备注" align="center" prop="remark" /> -->
					<el-form-item label="心理描述">
					  <span class="ngr">{{ props.row.psychologicalDescription }}</span>
					</el-form-item>
					<el-form-item label="健康状况">
					  <span class="ngr">{{ props.row.health }}</span>
					</el-form-item>
		            <el-form-item label="过往病史">
		              <span class="ngr">{{ props.row.mind }}</span>
		            </el-form-item>
		            <el-form-item label="父亲姓名">
		              <span class="ngr">{{ props.row.fatherName }}</span>
		            </el-form-item>
		            <el-form-item label="联系方式">
		              <span class="ngr">{{ props.row.fatherTelephone }}</span>
		            </el-form-item>
		            <el-form-item label="母亲姓名">
		              <span class="ngr">{{ props.row.motherName }}</span>
		            </el-form-item>
		            <el-form-item label="联系方式">
		              <span class="ngr">{{ props.row.motherTelephone }}</span>
		            </el-form-item>
					<el-form-item label="血型">
					  <span class="ngr">{{ props.row.bloodType }}</span>
					</el-form-item>
		            <el-form-item label="居住地址" style="width:35%;">
		              <span class="ngr">{{ props.row.address }}</span>
		            </el-form-item>
		          </el-form>
		        </template>
		      </el-table-column>
		   <!-- <el-table-column label="基本信息"> -->
			<el-table-column label="身份证号" align="center" prop="idCard" width="170"/>
			<el-table-column label="姓名" align="center" prop="name" width="100" />
			<!-- <el-table-column label="学号" align="center" prop="studentNumber" width="120" show-overflow-tooltip/> -->
		 
		  <el-table-column label="年龄" align="center" prop="age" />
			<el-table-column label="性别" align="center" prop="sex">
			        <template slot-scope="scope">
			          <dict-tag :options="dict.type.xshsex" :value="scope.row.sex"/>
			        </template>
			</el-table-column>
			<el-table-column label="身高" align="center" prop="height" >
			<template slot-scope="scope">
			          <span style="color:#3a77ea;cursor:pointer;" @click="hetdt(scope.row)">{{scope.row.height}}</span>
			</template>
			</el-table-column>	
			<el-table-column label="体重" align="center" prop="weight" >
			<template slot-scope="scope">
			          <span style="color:#3a77ea;cursor:pointer;" @click="hetdtw(scope.row)">{{scope.row.weight}}</span>
			</template>
			</el-table-column>	
			<!-- <el-table-column label="政治面貌" align="center" prop="politicalStatus" /> -->
			<!-- </el-table-column> -->
			<!-- <el-table-column label="视力信息"> -->
				<!-- <el-table-column label="近视" align="center" prop="isNearsightedness">
				        <template slot-scope="scope">
				          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isNearsightedness"/>
				        </template>
				</el-table-column> -->
				<!-- <el-table-column label="近视度数" align="center" prop="degreeMyopia" /> -->
			<!-- </el-table-column> -->
			<!-- <el-table-column label="健康信息"> -->
				<!-- <el-table-column label="心理状况" align="center" prop="mind" /> -->
				<!-- <el-table-column label="过往病史" align="center" prop="mind" />
				<el-table-column label="健康状况" align="center" prop="health" /> -->
			<!-- </el-table-column> -->
			<!-- <el-table-column label="家庭信息"> -->
				<!-- <el-table-column label="父亲" align="center" prop="fatherName" />
				<el-table-column label="父亲联系方式" align="center" prop="fatherTelephone"  width="110"/>
				<el-table-column label="母亲" align="center" prop="motherName" />
				<el-table-column label="母亲联系方式" align="center" prop="motherTelephone" width="110" />
				<el-table-column label="居住地址" align="center" prop="address" width="110" show-overflow-tooltip/> -->
			<!-- </el-table-column>	 -->
			
			
			<el-table-column label="心理状态" align="center" prop="mind" >
				<template slot-scope="scope">
				<span style="cursor:pointer;" @click="getPass(scope.row)">{{scope.row.mind}}</span>
			   </template>
			</el-table-column>
			<el-table-column label="证件照"  align="center" prop="identificationPhoto" width="100">
			        <template slot-scope="scope">
			          <image-preview :src="scope.row.identificationPhoto" :width="50" :height="50"/>
			        </template>
			      </el-table-column>
			      <el-table-column  label="门禁照" align="center" prop="entrancePermit" width="100">
			        <template slot-scope="scope">
			          <image-preview :src="scope.row.entrancePermit" :width="50" :height="50"/>
			        </template>
			      </el-table-column>
		  <!-- <el-table-column label="班级id" align="center" prop="classId" /> -->
		 
		          <!-- <template slot-scope="scope">
		            <dict-tag :options="dict.type.sys_subject" :value="scope.row.discipline"/>
		          </template> -->
		        <!-- </el-table-column> -->
		  
		  <el-table-column  label="操作" align="center" class-name="small-padding fixed-width" width="120">
		    <template slot-scope="scope">
		     <!-- <el-button
		        size="mini"
		        type="text"
		        style="background: #00B034;color: #FFF;padding: 7px;"
		        @click="handleUpdate(scope.row)"
		        v-hasPermi="['student:info:edit']"
		      >添加</el-button> -->
		      <el-button
		        size="mini"
		        type="text"
		        style="background: red;color: #FFF;padding: 7px;"
		        @click="handleDelete(scope.row)"
		        v-hasPermi="['student:info:remove']"
		      >删除</el-button>
			  <el-dropdown class="nlos" style="background: #3a77ea;color: #FFF; padding: 3px 0; border-radius: 5px; margin-left: 10px;" size="mini" @command="(command) => handleCommand(command, scope.row)" >
			    <span class="el-dropdown-link">
			      <i class="el-icon-d-arrow-right el-icon--right"></i>更多
			    </span>
			    <template #dropdown>
			    <el-dropdown-menu slot="dropdown">
			     <el-dropdown-item  command="handleUpdate" icon="el-icon-circle-check"
				 v-hasPermi="['mind:old:add']"
			          >添加心理状态</el-dropdown-item>
					  <el-dropdown-item  command="handleUpdates" icon="el-icon-circle-check"
					  v-hasPermi="['live:old:add']"
					       >添加身高/体重</el-dropdown-item>
			      <!-- <template v-if="mankda == false"> -->
			      <el-dropdown-item  command="getPassd" icon="el-icon-circle-check"
			           >历史数据</el-dropdown-item>
			    </el-dropdown-menu>
			    </template>
			  </el-dropdown>
		    </template>
		  </el-table-column>
		</el-table>
		
		<pagination
		  v-show="total>0"
		  :total="total"
		  :page.sync="queryParams.pageNum"
		  :limit.sync="queryParams.pageSize"
		  @pagination="getList"
		/> 
	 </div>
    

    <!-- 添加或修改注册-老师-班级（学科）对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <!-- <el-form-item label="老师id" prop="teacherId">
          <el-input v-model="form.teacherId" placeholder="请输入老师id" />
        </el-form-item> -->
		<el-row>
			<el-col :span="8">
				 <!-- <el-form-item label="学校名称" prop="schoolId">
				  					  <el-select :disabled="fku"  style="width: 100%;"   v-model="form.schoolId" placeholder="请选择学校名称">
				  					    <el-option
				  					      v-for="dict in deptOptions"
				  					      :key="dict.deptId"
				  					      :label="dict.deptName"
				  					      :value="dict.deptId"
				  						  @click.native="mjyhes(dict)"
				  					    ></el-option>
				  					  </el-select>
				  </el-form-item> -->
			</el-col>
			<!-- <el-col :span="6">
				  <el-form-item label="班级名称" prop="classId">
				  <el-select style="width: 100%;" v-model="form.classId" placeholder="请选择班级名称">
				    <el-option
				      v-for="dict in kiuesegh"
				      :key="dict.deptId"
				      :label="dict.deptName"
				      :value="dict.deptId"
				  	@click.native="mjyhess(dict)"
				    ></el-option>
				  </el-select>
				  </el-form-item>
			</el-col> -->
			
			<el-col :span="6">
				<el-form-item label="姓名" prop="name">
					<el-select disabled style="width: 100%;" filterable v-model="form.name" placeholder="请选择学生名称">
					  <el-option
					    v-for="dict in infoListstu"
					    :key="dict.id"
					    :label="dict.studentName"
					    :value="dict.studentName"
						@click.native="mjyhesstu(dict)"
					  ></el-option>
					</el-select>
				</el-form-item>
			</el-col>
			<!-- <el-col :span="6">
				<el-form-item label="身份证号" prop="idCard">
				          <el-input @blur="idcde" v-model="form.idCard" placeholder="请输入身份证号" />
				</el-form-item>
			</el-col> -->
			<!-- <el-col :span="6">
				<el-form-item label="学校" prop="school">
					<el-select   style="width: 100%;"   v-model="form.school" placeholder="请选择学校名称">
					  <el-option
					    v-for="dict in deptOptions"
					    :key="dict.deptId"
					    :label="dict.deptName"
					    :value="dict.deptName"
						@click.native="mjyhes(dict)"
					  ></el-option>
					</el-select>
				</el-form-item>
			</el-col> -->
			<!-- <el-col :span="6">
				<el-form-item label="年龄" prop="age">
				          <el-input v-model="form.age" placeholder="请输入年龄" />
				</el-form-item>
			</el-col>
			<el-col :span="6">
				<el-form-item label="性别" prop="sex">
					<el-select v-model="form.sex" placeholder="请选择性别" clearable>
					  <el-option
					    v-for="dict in dict.type.xshsex"
					    :key="dict.value"
					    :label="dict.label"
					    :value="dict.value"
					  />
					</el-select>
				</el-form-item>
			</el-col> -->
			
			<!-- <el-col :span="6">
				<el-form-item label="学号" prop="studentNumber">
				          <el-input v-model="form.studentNumber" placeholder="请输入学号" />
				        </el-form-item>
			</el-col> -->
			
			<el-col :span="6" v-if="oert == 1">
				<el-form-item label="身高(CM)" prop="height">
				          <el-input v-model="form.height" placeholder="请输入身高" />
				        </el-form-item>
			</el-col>
			
			<el-col :span="6" v-if="oert == 1">
				<el-form-item label="体重(KG)" prop="weight">
				          <el-input v-model="form.weight" placeholder="请输入体重" />
				        </el-form-item>
			</el-col>
			<!-- <el-col :span="6">
				<el-form-item label="血型" prop="bloodType">
				          <el-input v-model="form.bloodType" placeholder="请输入血型" />
				</el-form-item>
			</el-col>
			
			<el-col :span="6">
				<el-form-item label="父亲" prop="fatherName">
				          <el-input v-model="form.fatherName" placeholder="请输入父亲" />
				        </el-form-item>
			</el-col>
			<el-col :span="6">
				<el-form-item label="联系方式" prop="fatherTelephone">
				          <el-input v-model="form.fatherTelephone" placeholder="请输入父亲联系方式" />
				</el-form-item>
			</el-col> -->
			<!-- <el-col :span="6">
				<el-form-item label="母亲" prop="motherName">
				          <el-input v-model="form.motherName" placeholder="请输入母亲" />
				        </el-form-item>
			</el-col>
			<el-col :span="6">
				<el-form-item label="联系方式" prop="motherTelephone">
				          <el-input type="number" v-model="form.motherTelephone" placeholder="请输入母亲联系方式" />
				</el-form-item>
			</el-col>
			<el-col :span="6">
				<el-form-item label="政治面貌" prop="politicalStatus">
					<el-select v-model="form.politicalStatus" placeholder="请选择政治面貌" clearable>
					  <el-option
					    v-for="dict in dict.type.political_outlook"
					    :key="dict.value"
					    :label="dict.label"
					    :value="dict.label"
					  />
					</el-select>
			</el-form-item>
			</el-col> -->
			<el-col :span="6" v-if="oert == 0">
				<el-form-item label="心理状态" prop="mind">
					<el-select v-model="form.mind" placeholder="请选择心理状态" clearable>
					  <el-option
					    v-for="dict in dict.type.psychology"
					    :key="dict.value"
					    :label="dict.label"
					    :value="dict.label"
					  />
					</el-select>
			</el-form-item>
			</el-col>
			<el-col :span="6" v-if="oert == 0">
				<el-form-item label="状态描述" prop="psychologicalDescription">
				          <el-input  v-model="form.psychologicalDescription" placeholder="请输入状态描述" />
				</el-form-item>
			</el-col>
			
			<!-- <el-col :span="6">
				<el-form-item label="近视/远视" prop="isNearsightedness">
					<el-select @change="ngekusfd" v-model="form.isNearsightedness" placeholder="请选择是否近视/远视" clearable>
					  <el-option
					    v-for="dict in dict.type.isjinshi"
					    :key="dict.value"
					    :label="dict.label"
					    :value="dict.value"
					  />
					</el-select>
			</el-form-item>
			</el-col>
			<el-col :span="6" v-if="uhgte">
				<el-form-item label="近视度数" prop="degreeMyopia">
					<el-input type="number" v-model="form.degreeMyopia" placeholder="请输入近视度数" />
			</el-form-item>
			</el-col> -->
			<!-- <el-col :span="6">
				<el-form-item label="右眼" prop="motherTelephone">
					<el-select v-model="form.motherTelephone" placeholder="请选择是否近视" clearable>
					  <el-option
					    v-for="dict in dict.type.political_outlook"
					    :key="dict.value"
					    :label="dict.label"
					    :value="dict.label"
					  />
					</el-select>
			</el-form-item>
			</el-col> -->
			<!-- <el-col :span="6">
				<el-form-item label="健康状态" prop="health">
					<el-select v-model="form.health" placeholder="请选择政治面貌" clearable>
					  <el-option
					    v-for="dict in dict.type.health_status"
					    :key="dict.value"
					    :label="dict.label"
					    :value="dict.label"
					  />
					</el-select>
			</el-form-item>
			</el-col> -->
			<!-- <el-col :span="6">
				<el-form-item label="是否贫困" prop="health">
					<el-select v-model="form.health" placeholder="请选择是否贫困" clearable>
					  <el-option
					    v-for="dict in dict.type.isjinshi"
					    :key="dict.value"
					    :label="dict.label"
					    :value="dict.label"
					  />
					</el-select>
			</el-form-item>
			</el-col> -->
			
			<el-col :span="6">
			 <el-form-item label="备注" prop="remark">
			           <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
			         </el-form-item>	
			</el-col>
			<!-- <el-col :span="24">
				<el-form-item label="居住地址" prop="address">
						  <baidu-map :center="mapCenter" :zoom="11" @click ="getLocationPoint"  class="iuey" :scroll-wheel-zoom="true" :autoViewport="true">
						           <bm-view class="bm-view"></bm-view>
						             <bm-control :offset="{width: '10px', height: '10px'}">
									<bm-geolocation anchor="BMAP_ANCHOR_BOTTOM_RIGHT" :showAddressBar="true" :autoLocation="true"></bm-geolocation>
						     
						       <el-autocomplete
						        v-model="form.address"
						        :fetch-suggestions="querySearch"
						        placeholder="请输入详细地址"
						        style="width: 100%"
						        :trigger-on-focus="false"
						        @select="handleSelect"
						      />
						    </bm-control>
						   
						    <bm-local-search :keyword="form.address" :auto-viewport="true" :location="location" :forceLocal="true" :pageCapacity = "20" @searchcomplete ="oieueo"  @markersset = "confirmf" :panel ="false" ></bm-local-search>
						  </baidu-map>
				</el-form-item>
			</el-col> -->
			
			<!-- <el-col :span="12">
				<el-form-item label="证件照" prop="identificationPhoto">
				          <image-upload v-model="form.identificationPhoto"/>
				        </el-form-item>
			</el-col>
			<el-col :span="12">
				<el-form-item label="门禁照" prop="entrancePermit">
				          <image-upload v-model="form.entrancePermit"/>
				        </el-form-item>
			</el-col> -->
			
			
		</el-row>
        <!-- <el-form-item label="班级id" prop="classId">
          <el-input v-model="form.classId" placeholder="请输入班级id" />
        </el-form-item> -->

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
	<el-drawer
	  title="历史信息"
	  :visible.sync="drawer"
	  size="56%">
	  <div>
		 <pie-charts :chart-data="beach" v-if="ngtzh" /> 
		 <pie-chartss :chart-data="beach" v-if="ngshg" /> 
		  <!-- <steps :data="lishilist" :Index="5"></steps > -->
		  <el-table v-loading="loading"  :data="lishilist"  max-width="100%" max-height="200px">
		    <el-table-column label="身高" align="center" prop="height"/>
			<el-table-column label="体重" align="center" prop="weight"/>
			<el-table-column  label="操作" align="center" class-name="small-padding fixed-width" width="80">
			  <template slot-scope="scope">
			    <el-button
			      size="mini"
			      type="text"
			      style="background: red;color: #FFF;padding: 7px;"
			      @click="deleshengao(scope.row)"
			      v-hasPermi="['student:info:remove']"
			    >删除</el-button>
			  </template>
			</el-table-column>
			
		  </el-table>
	  </div>
	  
	  
	  <div>
	   <!-- <el-button @click="innerDrawer = true">打开里面的!</el-button> -->
	   
	  </div>
	</el-drawer>
	
	<el-drawer
	  title="心理状态历史信息"
	  :append-to-body="true"
	  :visible.sync="innerDrawer">
	  <el-dropdown style="margin-bottom: 10px;">
	        <span class="el-dropdown-link">
	          心理状态<i class="el-icon-arrow-down el-icon--right"></i>
	        </span>
	        <el-dropdown-menu slot="dropdown">
	          <el-dropdown-item >身高体重</el-dropdown-item>
	          <!-- <el-dropdown-item icon="el-icon-circle-plus">狮子头</el-dropdown-item>
	          <el-dropdown-item icon="el-icon-circle-plus-outline">螺蛳粉</el-dropdown-item>
	          <el-dropdown-item icon="el-icon-check">双皮奶</el-dropdown-item>
	          <el-dropdown-item icon="el-icon-circle-check">蚵仔煎</el-dropdown-item> -->
	        </el-dropdown-menu>
	      </el-dropdown>
	  <el-card shadow="hover" v-if="lishilist.length != 0" class="box-card" v-for="(o,index) in lishilist" :key="o.id">
	    <div  class="text item">
	        <!-- {{'列表内容 ' + o }} -->
	  	  <p style="color:#aaa;" class="op">{{o.updateTime}} 
		  <span @click="delexinl(o)" v-hasPermi="['mind:old:remove']">删除</span>
		  </p>
	  	  <el-divider></el-divider>
	  	  <!-- <p><span>政治面貌:</span>{{o.politicalStatus}}</p>
	  	  <p><span>是否近视:</span>{{o.isNearsightedness == '1' ?'是' : o.isNearsightedness == '2'?'否':'暂无数据'}}</p>
	  	  <p><span>近视度数:</span>{{o.degreeMyopia == null ?'暂无数据': o.degreeMyopia }}</p>
	  	  <p><span>身高体重:</span>{{o.height == null ?'暂无数据': o.height }} CM/{{o.weight == null ?'暂无数据': o.weight }} KG</p> -->
		  <p><span>心理状态:</span>{{o.mind == null ?'暂无数据': o.mind }}</p>
		  <p><span>心理健康描述:</span>{{o.psychologicalDescription == null ?'暂无数据': o.psychologicalDescription }}</p>
		  <p><span>创建者:</span>{{o.createType == null ?'暂无数据': o.createType == 1?'家长' :'老师'}}</p>
	    </div>
	  </el-card>
		  <el-card shadow="hover" v-if="lishilist.length == 0" class="box-card" >
		    <div  class="text item">
		        <!-- {{'列表内容 ' + o }} -->
		  	  <p style="color:#aaa;">暂无数据</p>
		  	  <el-divider></el-divider>
		  	  <!-- <p><span>政治面貌:</span>{{o.politicalStatus}}</p>
		  	  <p><span>是否近视:</span>{{o.isNearsightedness == '1' ?'是' : o.isNearsightedness == '2'?'否':'暂无数据'}}</p>
		  	  <p><span>近视度数:</span>{{o.degreeMyopia == null ?'暂无数据': o.degreeMyopia }}</p>
		  	  <p><span>身高体重:</span>{{o.height == null ?'暂无数据': o.height }} CM/{{o.weight == null ?'暂无数据': o.weight }} KG</p> -->
		  		  <p><span>心理状态:</span>暂无数据</p>
		  		  <p><span>心理健康描述:</span>暂无数据</p>
		    </div>
		  </el-card>
	</el-drawer>
	
	<el-drawer
	  title="历史信息"
	  :append-to-body="true"
	  :visible.sync="innerDrawerd">
	  <el-dropdown @command="handleCommands" style="margin-bottom: 10px;">
	    <span class="el-dropdown-link">
	      {{tijet}}<i class="el-icon-arrow-down el-icon--right"></i>
	    </span>
	    <el-dropdown-menu slot="dropdown">
	      <el-dropdown-item command="xinlse">心理状态</el-dropdown-item>
	      <el-dropdown-item command="wihde">身高/体重</el-dropdown-item>
	    </el-dropdown-menu>
	  </el-dropdown>
	  <el-card shadow="hover" v-if="lishilist.length != 0" class="box-card" v-for="(o,index) in lishilist" :key="o.id">
	    <div  class="text item">
	        <!-- {{'列表内容 ' + o }} -->
	  	  <p style="color:#aaa;" class="op">{{o.updateTime}} 
		  <span v-show="oiwixin == 0" @click="delexinl(o)" v-hasPermi="['mind:old:remove']">删除</span>
		  <span v-show="oiwixin == 1" @click="deleshengao(o)" v-hasPermi="['live:old:remove']">删除</span>
		  </p>
	  	  <el-divider></el-divider>
	  	  <!-- <p><span>政治面貌:</span>{{o.politicalStatus}}</p>
	  	  <p><span>是否近视:</span>{{o.isNearsightedness == '1' ?'是' : o.isNearsightedness == '2'?'否':'暂无数据'}}</p>
	  	  <p><span>近视度数:</span>{{o.degreeMyopia == null ?'暂无数据': o.degreeMyopia }}</p> -->
	  	  <p v-show="oiwixin == 1"><span>身高:</span>{{o.height == null ?'暂无数据': o.height }} CM</p>
		  <p v-show="oiwixin == 1"><span>体重:</span>{{o.weight == null ?'暂无数据': o.weight }} KG</p>
		  <p v-show="oiwixin == 0"><span>心理状态:</span>{{o.mind == null ?'暂无数据': o.mind }}</p>
		  <p v-show="oiwixin == 0"><span>心理健康描述:</span>{{o.psychologicalDescription == null ?'暂无数据': o.psychologicalDescription }}</p>
	    </div>
	  </el-card>
		  <el-card shadow="hover" v-if="lishilist.length == 0" class="box-card" >
		    <div  class="text item">
		        <!-- {{'列表内容 ' + o }} -->
		  	  <p style="color:#aaa;">暂无数据</p>
		  	  <el-divider></el-divider>
		  	  <!-- <p><span>政治面貌:</span>{{o.politicalStatus}}</p>
		  	  <p><span>是否近视:</span>{{o.isNearsightedness == '1' ?'是' : o.isNearsightedness == '2'?'否':'暂无数据'}}</p>
		  	  <p><span>近视度数:</span>{{o.degreeMyopia == null ?'暂无数据': o.degreeMyopia }}</p>
		  	  <p><span>身高体重:</span>{{o.height == null ?'暂无数据': o.height }} CM/{{o.weight == null ?'暂无数据': o.weight }} KG</p> -->
		  		  <p><span>心理状态:</span>暂无数据</p>
		  		  <p><span>心理健康描述:</span>暂无数据</p>
		    </div>
		  </el-card>
	</el-drawer>
	
	
	
  </div>
</template>

<script>
import PieCharts from './../../dashboard/PieCharts'
import PieChartss from './../../dashboard/PieChartss'
import { listInfo, listInfostu,getInfo, delInfo, delInfoxinl,delInfoshengao,addInfo, updateInfo,updateInfoxl,updateInfoshg,listInfols,listInfolsxinl,listInfolss } from "@/api/zhihuixy/infos";
import { listDepts,listDeptode} from "@/api/system/dept";
import {regionData,CodeToText} from 'element-china-area-data'
const lineChartData = {
  newVisitis: {
    expectedData: [100, 120, 161, 134, 105, 160, 165],
    actualData: [120, 82, 91, 154, 162, 140, 145]
  },
  messages: {
    expectedData: [200, 192, 120, 144, 160, 130, 140],
    actualData: [180, 160, 151, 106, 145, 150, 130]
  },
  purchases: {
    expectedData: [80, 100, 121, 104, 105, 90, 100],
    actualData: [120, 90, 100, 138, 142, 130, 130]
  },
  shoppings: {
    expectedData: [130, 140, 141, 142, 145, 150, 160],
    actualData: [120, 82, 91, 154, 162, 140, 130]
  }
}
export default {
  name: "Info",
  dicts: ['xshsex','political_outlook','isjinshi','health_status','psychology'],
  components: {
    PieCharts,
	PieChartss
  },
  data() {
    return {
		
		stepInfo: {
		        list: [
		          {
		            status: '1',
		            title: '步骤条1',
		            description: '2021年7月7日'
		          },
		          {
		            status: '2',
		            title: '步骤条2',
		            description: '2021年11月19日'
		          },
		          {
		            status: '3',
		            title: '步骤条3',
		            description: '2021年12月31日'
		          },
		          {
		            status: '4',
		            title: '步骤条4',
		            description: '2022年4月19日'
		          },
		          {
		            status: '5',
		            title: '步骤条5',
		            description: '2022年5月1日'
		          },
		          {
		            status: '6',
		            title: '步骤条6',
		            description: '2022年5月1日'
		          },
		          
		        ],
		        step: 14
		      },
      // 遮罩层
      loading: true,
	  lineChartData: lineChartData.newVisitis,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
	  tableMaxHeight:400,
      // 学生档案信息表格数据
      infoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        studentId: null,
        name: null,
        sex: null,
        age: null,
        school: null,
        studentNumber: null,
        idCard: null,
        height: null,
        weight: null,
        bloodType: null,
        politicalStatus: null,
        identificationPhoto: null,
        entrancePermit: null,
        fatherName: null,
        fatherTelephone: null,
        motherName: null,
        motherTelephone: null,
        address: null,
		params:{
		}
      },
      // 表单参数
      form: {},
	  drawer:false,
	  innerDrawer:false,
      // 表单校验
      rules: {
		  // classId: [
		  //   { required: true, message: "不能为空", trigger: "blur" }
		  // ],
		  idCard: [
		    { required: true, message: "不能为空", trigger: "blur" }
		  ],
		  name: [
		    { required: true, message: "不能为空", trigger: "blur" }
		  ],
		  sex: [
		    { required: true, message: "不能为空", trigger: "blur" }
		  ],
		  fatherName: [
		    { required: true, message: "不能为空", trigger: "blur" }
		  ],
		  fatherTelephone: [
		    { required: true, message: "不能为空", trigger: "blur" }
		  ],
		  motherName: [
		    { required: true, message: "不能为空", trigger: "blur" }
		  ],
		  motherTelephone: [
		    { required: true, message: "不能为空", trigger: "blur" }
		  ],
		  
      },
	  kiuesegh:[],
	   kiueseghs:[],
	   options: regionData,
	     selectedOptions: [],
	     addtions:{},			//存储地址数据
	     namestwo:[],
	      keyword: '',
	   mapZoom: 15,
	   mapCenter: '潜山市',
	   mapLocation: {
	     address: undefined,
	     coordinate: undefined
	   },
	   okuyt:true,
	   nameadd:[],
	   kdourg:[{'value':'抱歉，没有搜索到位置请重新输入'}],
	   location:'',
	   pageCapacitys:20,
	   cb:undefined,
	   nameadd:[],
	   listInfostucs:{
		   params:{
		   }
	   },
	   infoListstu:[],
	   deptOptions:[],
	   uhgte:false,
	   lishilist:[],
	   beach:{},
	   hgdtesge:{},
	   ngshg:false,
	   ngtzh:false,
	   oert:0,
	   innerDrawerd:false,
	   oiwixin:0,
	   fret:{},
	   tijet:'心理状态'
    };
  },
  created() {
		window.onresize = () => {
		          this.changeTableMaxHeight()
		        }
		        this.changeTableMaxHeight()
    this.getList();
	this.getdept(0)
  },
	mounted() {
		 window.onresize = () => {
		           this.changeTableMaxHeight()
		         }
		         this.changeTableMaxHeight()
	},
  methods: {
	  
	  // 查询 心里健康历史档案信息
       getlihgw(val){
		 this.loading = true;
		 let he={}
		 he.studentId = val
		 // this.listInfostucs.classId = val
		 // this.ngshg = false,
		 // this.ngtzh = true,
		 listInfolsxinl(he).then(response => {
		   this.lishilist = response.rows;
		   this.loading = false;
		 });  
	   },
	   getlihgwd(val){
	   		 this.loading = true;
	   		 let he={}
	   		 he.studentId = val
	   		 // this.listInfostucs.classId = val
	   		 // this.ngshg = false,
	   		 // this.ngtzh = true,
	   		 listInfols(he).then(response => {
	   		   this.lishilist = response.rows;
	   		   this.loading = false;
	   		 });  
	   },
		   getlihgws(val){
		   		 this.loading = true;
		   		 let he={}
		   		 he.studentId = val
		   		 // this.listInfostucs.classId = val
		   		 listInfolss(he).then(response => {
		   		   this.beach = response.data;
				   // this.hgdtesge.x = this.beach[0]
				   // this.hgdtesge.y = this.beach[0]
				   // this.hgdtesge.x = this.beach[0]
		   		   this.loading = false;
		   		 });  
		   },
		 
	  /** 查询学生档案信息列表 */
	  getListuye(val) {
	    this.loading = true;
		this.listInfostucs.classId = val
		this.listInfostucs.params.role = this.roleqh()
	    listInfostu(this.listInfostucs).then(response => {
	      this.infoListstu = response.rows;
	      this.loading = false;
	    });
	  },
	  getdept(val){
	  		  let kuesf=  {'parentId':val}
	  		  // this.kiuesegh = []
	  			  console.log(kuesf)
	  		listDeptode(kuesf).then(response => {
	  		  this.deptOptions = this.handleTree(response.data, "deptId");
	  		  this.deptOptions.filter(rou =>{
	  			  if(rou.children != undefined){
	  			  	rou.children.filter(rour =>{
	  			  					  this.kiuesegh.push(rour)
	  			  	})		  
	  			  }
	  			  // this.kiuesegh = rou.children
	  			  // this.kiuesegh.push(rou.children)
	  			  console.log(rou.children)
	  		  })
	  		  this.kiueseghs = this.kiuesegh
	  		  // this.deptOptions = response.data
	  		  console.log(this.kiuesegh)
	  		});  
	  },
	  
    /** 查询学生档案信息列表 */
    getList() {
      this.loading = true;
	  this.queryParams.params.role=this.roleqh()
      listInfo(this.queryParams).then(response => {
        this.infoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        studentId: null,
        name: null,
        sex: null,
        age: null,
        school: null,
        studentNumber: null,
        idCard: null,
        height: null,
        weight: null,
        bloodType: null,
        politicalStatus: null,
        identificationPhoto: null,
        entrancePermit: null,
        fatherName: null,
        fatherTelephone: null,
        motherName: null,
        motherTelephone: null,
        address: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        createType: null,
		
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加学生档案信息";
	  this.mapCenter = '潜山市'
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
	  this.form = {}
      const id = row.id || this.ids
      getInfo(id).then(response => {
        this.form.studentId = response.data.studentId;
		this.form.name = response.data.name
		this.form.createType = 2
		// if(this.form.isNearsightedness == '1'){
		// 	this.uhgte =  true
		// }else {
		// 	this.uhgte =  false
		// }
		this.$set(this.form,'mind',null)
		this.$set(this.form,'psychologicalDescription',null)
		// this.$set(this.form,'height',null)
		// this.$set(this.form,'weight',null)
		// this.$set(this.form,'mind',null)
		// this.form.mind  = null
		// this.form.degreeMyopia  = null
		// this.form.isNearsightedness  = null
		// this.form.height  = null
		// this.form.weight  = null
        this.open = true;
        this.title = "添加学生成长信息";
		this.oert = 0
      });
    },
	// 身高体重
	handleUpdates(row){
		this.reset();
		this.form = {}
		const id = row.id || this.ids
		getInfo(id).then(response => {
		  this.form.studentId = response.data.studentId;
		  this.form.name = response.data.name
		  this.form.createType = 2
				// if(this.form.isNearsightedness == '1'){
				// 	this.uhgte =  true
				// }else {
				// 	this.uhgte =  false
				// }
				// this.$set(this.form,'mind',null)
				// this.$set(this.form,'psychologicalDescription',null)
				this.$set(this.form,'height',null)
				this.$set(this.form,'weight',null)
		  this.open = true;
		  this.title = "添加学生成长信息";
		  this.oert = 1
		});
	},
	// 身份证
	idcde(event) {
		console.log(event);
		// 身份证号码为15位或者18位，15位时全为数字，18位前17位为数字，最后一位是校验位，可能为数字或字符X
		let reg = /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
	  let _IDre15 =  /^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}$/;
	  // 护照
	   // let ncjsle = /^1[45][0-9]{7}$|(^[P|p|S|s]\d{7}$)|(^[S|s|G|g|E|e]\d{8}$)|(^[Gg|Tt|Ss|Ll|Qq|Dd|Aa|Ff]\d{8}$)|(^[H|h|M|m]\d{8,10}$)/;
	   let ncjsle = /^[a-zA-Z0-9]{5,17}$/
	   let nhyeli = /^[a-zA-Z]{5,17}$/
	  // 港澳
	  let gnse = /^([A-Z]\d{6,10}(\(\w{1}\))?)$/;
	  // 台湾
	  // let tw = /^\d{8}|^[a-zA-Z0-9]{10}|^\d{18}$/
	  var tw =  /^[0-9]{8}$/;
	   var twe = /^[0-9]{10}$/;
	  // 校验身份证：
	  console.log(reg.test(this.form.idCard),23741)
		if ( reg.test(this.form.idCard)|| _IDre15.test(this.form.idCard)) {
			// this.idea();
			this.go(this.form.idCard);
			// callback()
		} else {
	    if(ncjsle.test(this.form.idCard) || nhyeli.test(this.form.idCard)){
	       console.log(3)
	    }else{
	      if(gnse.test(this.form.idCard)  ){
	          console.log(4)
	      }else{
	        if(tw.test(this.form.idCard) || twe.test(this.form.idCard)){
	          console.log(5)
	        }else{
	          this.$message.error('证件格式不正确');
	        }
	      }
	
	    }
		}
	},
	// 实现自动生成生日，性别，年龄
	go(idCard) {
		 let sex = null;
		        let birth = null;
		        let myDate = new Date();
		        let month = myDate.getMonth() + 1;
		        let day = myDate.getDate();
		        let age = 0;
		
		        if (idCard.length === 18) {
		          age = myDate.getFullYear() - idCard.substring(6, 10) - 1;
		          sex = idCard.substring(16, 17);
		          birth = idCard.substring(6, 10) + "-" + idCard.substring(10, 12) + "-" + idCard.substring(12, 14);
		          if (idCard.substring(10, 12) < month || idCard.substring(10, 12) === month && idCard.substring(12, 14) <= day)
		            age++;
		
		        }
		        if (idCard.length === 15) {
		          age = myDate.getFullYear() - idCard.substring(6, 8) - 1901;
		          sex = idCard.substring(13, 14);
		          birth = "19" + idCard.substring(6, 8) + "-" + idCard.substring(8, 10) + "-" + idCard.substring(10, 12);
		          if (idCard.substring(8, 10) < month || idCard.substring(8, 10) === month && idCard.substring(10, 12) <= day)
		            age++;
		        }
		
		        if (sex % 2 === 0) sex = '2';
		        else sex = '1';
				this.form.sex = sex
				this.form.age = age
		        return {
		          age,
		          sex,
		          birth
		        }
	},
	// 请求身份证数据
	// idea() {
	// 	idces({ idCard: this.form.idCard }).then(response => {
	// 		console.log(response);
			
	// 	});
	// },
	// 更多操作触发
	handleCommand(command, row) {
	  switch (command) {
	    case "getPass":
	      this.getPass(row);
	      break;
		  case "getPassd":
		    this.getPassd(row);
		    break;
		  case "handleUpdate":
		    this.handleUpdate(row);
		    break;
		case "handleUpdates":
		  this.handleUpdates(row);
		  break;
			
		  
	    default:
	      break;
	  }
	},
	// 历史数据触发
	handleCommands(command, row) {
	  switch (command) {
	    case "xinlse":
	      this.xinlse(0);
	      break;
		  case "wihde":
		    this.wihde(1);
		    break;
	    default:
	      break;
	  }
	},
	// 心理状态
	xinlse(val){
		this.oiwixin = val
		this.tijet = '心理状态'
		this.getlihgw(this.fret.studentId)
	},
	// 身高体重
	wihde(val){
		this.oiwixin = val
		this.tijet = '身高体重'
		this.getlihgwd(this.fret.studentId)
	},
	// 历史数据
	getPass(val){
		console.log(val)
		this.innerDrawer = true
		this.getlihgw(val.studentId)
	},
	getPassd(val){
		console.log(val)
		this.innerDrawerd = true
		this.tijet = '心理状态'
		this.oiwixin = 0
		this.fret = val
		this.getlihgw(val.studentId)
	},
	// 删除心理状态
	delexinl(val){
		delInfoxinl(val.mindId).then(response => {
		 this.getlihgw(this.fret.studentId)
		 this.$modal.msgSuccess("删除成功");
		});
	},
	// 删除身高体重
	deleshengao(val){
		delInfoshengao(val.liveId).then(response => {
		 this.getlihgwd(this.fret.studentId)
		 this.$modal.msgSuccess("删除成功");
		});
	},
	
    /** 提交按钮 */
    submitForm() {
		// let redw = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
		// if (this.form.fatherTelephone == null) {
		// } else{
		//   if(this.form.fatherTelephone !== ''){
		//     if(redw.test(this.form.fatherTelephone)){
		
		//     }else{
		//       this.$message.error('父亲手机号码不正确');
		//       return false
		//     }
		//   }
		// }
		// if (this.form.motherTelephone == null) {
		// } else{
		//   if(this.form.motherTelephone !== ''){
		//     if(redw.test(this.form.motherTelephone)){
		
		//     }else{
		//       this.$message.error('母亲手机号码不正确');
		//       return false
		//     }
		//   }
		// }
      this.$refs["form"].validate(valid => {
        if (valid) {
			console.log(this.oert)
			if(this.oert == 0){
				updateInfoxl(this.form).then(response => {
				  this.$modal.msgSuccess("修改成功");
				  this.open = false;
				  this.getList();
				});
			}else if(this.oert == 1){
				// 身高体重
				// if (this.form.id != null) {
				  updateInfoshg(this.form).then(response => {
				    this.$modal.msgSuccess("修改成功");
				    this.open = false;
				    this.getList();
				  });
				// } else {
				//   addInfo(this.form).then(response => {
				//     this.$modal.msgSuccess("新增成功");
				//     this.open = false;
				//     this.getList();
				//   });
				// }
			}
          
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除学生档案信息编号为"' + ids + '"的数据项？').then(function() {
        return delInfo(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/info/export', {
        ...this.queryParams
      }, `info_${new Date().getTime()}.xlsx`)
    },
	handleChange (value) {
	        console.log(3976);
	        
	      //我们选择地址后，selectedOptions 会保存对应的区域码，例如北京的区域码为'110000'
	      //我们要取出区域码对应的汉字，就需要用CodeToText(区域码)进行输出
	        this.addtions.selectedOptions = value
	        console.log(this.selectedOptions);
	        
	        var name = ''
	
	        this.selectedOptions.map(item => name += CodeToText[item] + '/')
	        this.addtions.names = name  
	        this.namestwo = this.addtions.names.split('/')
	        // for (let index = 0; index < this.namestwo.length; index++) {
	        //   const element = this.namestwo[index];
	        //   this.form.provinceName.value = this.namestwo[0]
	        //    this.form.cityName.value = this.namestwo[1]
	        //    this.form.regionName.value = this.namestwo[2]
	        //    console.log(this.form);
	           
	        // }
	        this.form.area = this.addtions.names.split('/')
	        this.form.areaCode = this.addtions.selectedOptions
	        console.log(this.form.area);
	        for(var i = 0 ; i < this.form.area.length; i++){
	          this.mapCenter =  this.form.area[1]
	          this.location = this.form.area[1]
	        }
	        console.log(this.mapCenter);
	        console.log(this.location);
	        
	        
	         console.log(this.form.areaCode);
	        console.log(this.addtions.names.split('/'))
	
	        console.log(this.addtions.selectedOptions)
	      },
	      // 、、地图
	      getLocationPoint(e){
	       console.log(e);
	       
	      },
	      searchcomplete(e){
	        console.log(e);
	        
	      },
	      handlerBMap({ BMap, map }) {
	      this.BMap = BMap
	      this.map = map
	      console.log(BMap,map);
	      console.log(this.mapLocatio);
	      
	      // if (this.mapLocation.coordinate && this.mapLocation.coordinate.lng) {
	      //   // this.mapCenter.lng = this.mapLocation.coordinate.lng
	      //   // this.mapCenter.lat = this.mapLocation.coordinate.lat
	      //   this.mapZoom = 15
	      //   map.addOverlay(new this.BMap.Marker(this.mapLocation.coordinate))
	      // } else {
	      //   // this.mapCenter.lng = 113.271429
	      //   // this.mapCenter.lat = 23.135336
	      //   this.mapZoom = 10
	      // }
	    },
	    querySearch(queryString,cb) {
	      // console.log(e);
	      // this.keyword = e
	      // results, cb
	      // var that = this
	      // var myGeo = new this.BMap.Geocoder()
	      // console.log(queryString, cb);
	      
	      // myGeo.getPoint(queryString, function(point) {
	      //   console.log(point);
	      //   // var point = '安庆市'
	        
	      //   if (point) {
	      //     that.mapLocation.coordinate = point
	      //     that.makerCenter(point)
	      //   } else {
	      //     that.mapLocation.coordinate = null
	      //   }
	      // }, this.locationCity)
	      // console.log(this.locationCity);
	      
	      // var options = {
	      //   onSearchComplete: function(results) {
	      //     console.log(local.getStatus());
	          
	      //     if (local.getStatus() === 0) {
	      //       // 判断状态是否正确
	      //       var s = []
	      //       console.log(results.getCurrentNumPois());
	            
	      //       for (var i = 0; i < results.getCurrentNumPois(); i++) {
	      //         var x = results.getPoi(i)
	      //         console.log(x);
	              
	      //         var item = { value: x.address + x.title, point: x.point }
	      //         s.push(item)
	      //         // console.log(s);
	              
	      //         cb(s)
	      //       }
	      //       // console.log(s);
	            
	      //     } else {
	      //       cb()
	      //     }
	      //   }
	      // // this.oieueo(results)
	      console.log(queryString);
	      var item = []
	      var x = ''
	      //  this.nameadd = queryString.Ir
	      // queryString.value = ''
	       for(var i = 0 ; i <  this.nameadd.length; i++){
	         console.log(queryString[i]);
	        // var item = { value: this.nameadd[i].address + this.nameadd[i].title, point: this.nameadd[i].point }
	        // if(queryString[i].address == undefined){
	        //     queryString[i].address = ''
	        // }
	        //  x= this.nameadd[i].address + this.nameadd[i].title 
	        // item.push(x)
	       this.nameadd[i].value = this.nameadd[i].address + this.nameadd[i].title 
	       console.log(this.nameadd[i].value);
	       
	      //  this.nameadd.push( item)
	         }
	        //  this.nameadd = item
	         console.log(this.nameadd);
	        //  this.cb = cb
	      cb(this.nameadd)
	      if(this.nameadd.length != 0){
	        // console.log(local.getStatus());
	       
	      }else{
	        cb(this.kdourg)
	      }
	       
	      console.log(this.nameadd);
	      
	      // }
	      // console.log(options );
	    // var local = new this.BMap.LocalSearch('安庆市', options)
	    
	    // console.log(queryString );
	      // local.search(queryString)
	    },
	    handleSelect(item) {
	      var { point } = item
	      this.mapLocation.coordinate = point
	      console.log(this.mapLocation.coordinate);
	      
	      // this.makerCenter(point)
	    },
	    makerCenter(point) {
	      console.log(point);
	      
	      if (this.map) {
	        this.map.clearOverlays()
	        this.map.addOverlay(new this.BMap.Marker(point))
	        // this.mapCenter.lng = point.lng
	        // this.mapCenter.lat = point.lat
	        // this.mapCenter = '安庆市'
	        this.mapZoom = 15
	      }
	    },
	    oieueo(results,cb){
	    //  console.log(results,cb);
	   console.log(results);
	   console.log(this.form.address);
	
	
	    // if(this.form.address == ''){
	    //   this.nameadd = []
	    // }else{
	    //  this.nameadd = results.Ir
	    // }
	    //  console.log(type.Ir.value);
	     console.log(this.nameadd);
	    //  var cb= cb
	     this.querySearch(this.nameadd,this.cb)
	    //  results,cb
	     
	    //  this.nameadd.
	    //  var local = new this.BMap.LocalSearch(this.map, options)
	    //   local.search(queryString)
	     
	    },
	    //选中数据
	    confirmf(e){
	      console.log(143);
	      console.log(e);
	      this.nameadd = e
	      
	    },
	    boiu(){
	      // this.okuyt = false
	    },
	    //获取焦点
	    faie(){
	// this.okuyt = true
	    },
		// 学校选择器
		mjyhes(){
			
		},
		// 班级选择器
		mjyhess(val){
			this.getListuye(val.deptId)
		},
		// 学生姓名选择器
		mjyhesstu(val){
			if(this.form.classId == null){
				this.$message.error('请先选择班级');
				return
			}else if(this.form.classId == undefined){
				this.$message.error('请先选择班级');
				return
			}else if(this.form.classId == ''){
				this.$message.error('请先选择班级');
				return
			}
			this.form.studentId = val.id
			this.form.studentNumber = val.studentNumber
		},
		hetdt(val){
			this.drawer = true
			this.ngshg = false,
			this.ngtzh = true,
			this.getlihgwd(val.studentId)
			this.getlihgws(val.studentId)
		},
		hetdtw(val){
			this.drawer = true
			this.ngshg = true,
			this.ngtzh = false,
			this.getlihgwd(val.studentId)
			this.getlihgws(val.studentId)
		},
		// 获取屏幕高度
		showFilterForm () {
		      this.filterActive = !this.filterActive
		      this.changeTableMaxHeight()
		    },
		
		    changeTableMaxHeight () {
		      let height = document.body.offsetHeight // 网页可视区域高度
		      // if (this.filterActive) {
		      //   this.tableMaxHeight = height - 320
		      // } else {
		        this.tableMaxHeight = height - 250
		      // }
		      console.log(height)
		    },
			ngekusfd(){
				if(this.form.isNearsightedness == '1'){
					this.uhgte = true
				}else{
					this.uhgte = false
				}
			}
			
  }
};
</script>
<style>
	.el-drawer__header{
		margin-bottom: 15px;
	}
	.el-drawer__body{
		padding: 0 10px;
	}
	.el-card__body, .el-main{
		padding:10px;
		/* margin-bottom:10px; */
	}
	.el-divider--horizontal{
		margin:7px 0;
	}
	.text {
	    font-size: 14px;
	  }
	
	  .item {
	    /* padding: 10px 0; */
	  }
	  .item p {
		  margin:0;
		  color:#161616;
		  margin-bottom:5px;
	  }
	  .item p span{
		  color:#aaa;
		  /* padding-left:5px; */
		  margin-right:5px;
	  }
	
	  .box-card {
	    width: 100%;
		margin-bottom:10px;
	  }
	.ngtes .el-table .el-dropdown-link, .el-table .el-dropdown-selfdefine{
		margin-left:0;
	}
	.ngtes .el-button+.el-button, .el-checkbox.is-bordered+.el-checkbox.is-bordered{
		margin-right:5px;
		margin-left:5px;
	}
  .demo-table-expand {
    font-size: 0;
	.ngr{
		color: #161616;
	}
  }
  .demo-table-expand label {
    width: 90px;
	text-align: right;
    color: #666;
  }
  .demo-table-expand .el-form-item {
    margin-right: 0;
    margin-bottom: 0;
    width: 25%;
  }
</style>

<style scoped lang="scss">
	.op{
		display: flex;
		align-items: center;
		justify-content: space-between;
		span{
			color: red !important;
		}
		
	}
	.bgtan{
		border-left: 3px solid #4775EA;
		padding-left: 10px;
	}
	
	.app-container{
		background-color: #f6f6f6;
		// height: 100vh;
	}
	.bm-view {
	  width: 100%;
	  height: 300px;
	}
	.oiue{
	  height: 300px;
	}
	.pui{
	  height: 100px;
	  position: absolute;
	  top: 40px;
	  left: 0;
	  z-index: 99;
	  // overflow: hidden;
	}
	.anchorTL{
	  width: 100%;
	}
	.app-container{
	  // padding: 0 !important;
	}
	.BMap_mask{
	  // background-color: #fff !important;
	}
	.bm-view {
	  width: 100%;
	  height: 300px;
	}
	// 去除百度地图的图标 根据实际情况看是否要加样式穿透(::v-deep)
	    ::v-deep .anchorBL {
	      display: none !important;
	    }
</style>
