<div class="panel panel-default">
    <!--标题-->
    <div class="panel-title">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
                <!-- TODO -->
                <li class="breadcrumb-item">毕业统计分析</li>
                <li class="breadcrumb-item active" aria-current="page">毕业生名册</li>
            </ol>
        </nav>
    </div>
    <div class="panel-body ml-sm" [hidden]="editShowType=='only'">
        <div class="card card-default">
            <div class="card-body">
                <!--查询条件-->
                <div class="row mb-3 ml-1" [hidden]="editShowType=='only'">
                    <div class="col-lg-12">
                        <form (ngSubmit)="framePager.goSearch()" class="form-inline">
                             <table>
                                 <tr>
                                    <td>
                            <div class="input-group mr-1 input-group-sm">
                                <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;关键字：</label>
                                <input name="keyword" [(ngModel)]="query.query" class="input-sm form-control" type="text"
                                            value="" maxlength="50" placeholder="请输入查询关键字" width="60">
                            </div>
                        </td>
                        <td>
                            <div class="input-group mr-1 input-group-sm">
                                <label>毕业批次：</label>
                                <flex-select [allowClear]="true"
                                    [url]= "'pl/plExamTime/listPlExamTimeForBy.htm'"
                                    respDataPath= "array"
                                    optionValueField="id"
                                    optionTextField="exam_year_month"
                                    [(ngModel)]="query.exam_time_id"
                                    placeholder="请选择"
                                    [ngModelOptions]="{standalone: true}"
                                    width = "150"
                                    noResultsFound = "无数据"
                                    (ngModelChange)="chooseMajor()"
                                    >
                                </flex-select>
                            </div>
                        </td>
                        <td>
                            <div class="input-group mr-1 input-group-sm" *ngIf="logOrgType == 0">
                                <label>受理单位：</label>
                                <flex-select [allowClear]="true" [url]="ORG_URL" respDataPath="array" optionValueField="org_id"
                                  optionTextField="org_name" [(ngModel)]="query.org_id" placeholder="请选择" width="150"
                                  noResultsFound="无数据" [ngModelOptions]="{standalone: true}" (ngModelChange)="chooseMajor()">
                                </flex-select>
                            </div>
                        </td>
                        </tr>
                        <tr>
                            <td>
                            <div class="input-group mr-1 input-group-sm" *ngIf="logOrgType == 0">
                                <label>主考学校：</label>
                                <flex-select [allowClear]="true" [url]="SCHOOL_URL" respDataPath="array" optionValueField="id"
                                  optionTextField="org_name" [(ngModel)]="query.school_id" placeholder="请选择" width="150"
                                  noResultsFound="无数据" [ngModelOptions]="{standalone: true}">
                                </flex-select>
                              </div>
                            </td>
                            <td>
                            <div class="input-group mr-1 input-group-sm">
                                <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;专业：</label>
                                <flex-select [allowClear]="true"
                                    [(items)] = "majorList"
                                    respDataPath= "array"
                                    optionValueField="id"
                                    optionTextField="major_full_name"
                                    [(ngModel)]="query.major_id"
                                    placeholder="请选择"
                                    [ngModelOptions]="{standalone: true}"
                                    width = "150"
                                    noResultsFound = "无数据"
                                    >
                                </flex-select>
                            </div>
                        </td>
                        <td>
                            <div class="input-group mr-1 input-group-sm">
                                <label>毕业状态：</label>
                                    <select name="status" 
                                        width = "150"
                                        [(ngModel)]="query.status" 
                                        frameDict [dictName]="'ByStatus'" 
                                        [ngModelOptions]="{standalone: true}"
                                        class="form-control">
                                    </select>
                            </div>
                        </td>
                        <td>
                            <button class="btn btn-primary btn-rounded btn-outline btn-sm  mr-1" (click)="framePager.goSearch()">
                                <i class="fa fa-search"></i> 查询</button>
                            <button class="btn btn-primary btn-rounded btn-outline btn-sm  mr-1" (click)="reset()">
                                <i class="fa fa-undo"></i> 重置</button>
                            </td>
                            </tr>
                            </table>
                            </form>
                    </div>
                </div>

                <!-- 工具栏 -->
                <div class="row mb-2" [hidden]="editShowType=='only'">
                    <div class="col-lg-12">
                        <div class="pull-left" style="text-align: right;">
                            <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left"
                                (click)="exportNameList()" title="毕业生名册pdf">
                                <i class="fa fa-plus"></i> 毕业生名册pdf</button>   
                                <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left"
                                (click)="exportNameListForXls()" title="毕业生包括社会和助学考生">
                                <i class="fa fa-plus"></i> 毕业生信息xls</button>  
                                <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left"
                                (click)="exportNameListForJpg()" title="毕业生包括社会和助学考生">
                                <i class="fa fa-plus"></i> 毕业生照片导出</button>                                                             
                        </div>
                    </div>
                </div>

                <!--表格-->
                <div class="row">
                    <div class="col-lg-12 ml-0" [hidden]="editShowType=='only'">
                        <table class="table table-sm table-striped table-hover table-bordered bg-white">
                            <thead>
                                <tr>
                                    <th>序号</th>
                                    <th>毕业证书号</th>
                                    <th>身份证号</th>
                                    <th>准考证号</th>
                                    <th>姓名</th>
                                    <th>性别</th>
                                    <th>年龄</th>
                                    <th>党团</th>
                                    <th>职业代码</th>
                                    <th>专业名称</th>
                                    <th>考前学历</th>
                                    <th>民族</th>
                                    <th>健康状况</th>
                                    <th>通讯地址</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr *ngFor="let item of framePager.getRecords(); let i = index">
                                    <td>{{framePager.pageStart + i}}</td>
                                    <td>{{item.diaplma_no}}</td>
                                    <td>{{item.cert_no}}</td>
                                    <td>{{item.ticket_no}}</td>
                                    <td>{{item.std_name}}</td>
                                    <td>{{item.std_sex}}</td>
                                    <td>{{item.std_age}}</td>
                                    <td>{{item.political}}</td>
                                    <td>{{item.std_occupation}}</td>
                                    <td>{{item.major_name}}</td>
                                    <td>{{item.pre_edu}}</td>
                                    <td>{{item.nation}}</td>
                                    <td>{{item.std_healthy}}</td>
                                    <td>{{item.address}}</td>
                                </tr>
                            </tbody>
                        </table>
                        <!-- TODO -->
                        <frame-pager [url]="QUERY_URL" hideSearch="true" hasCheck="true" #framePager (preReqEvent)="search($event)"></frame-pager>
                    </div>

                    <!-- 编辑页面 -->
                    <div class="col-lg-12" *ngIf="item && editShowType != null && editShowType!='modal'">
                        <ng-container *ngTemplateOutlet="editTemplateModal">
                        </ng-container>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- only 审核界面-->
    <div class="col-lg-12" *ngIf="item && editShowType != null && editShowType =='only'">
        <ng-container *ngTemplateOutlet="editTemplateModal">
        </ng-container>
    </div>
</div>
