<div class="content-heading  justify-content-between" *ngIf="step=='main'">
    <div>评委管理</div>
    <div class="float-right">
        <div class="row">
            <div class="wd-xl wd-sm">
                <ngx-select [items]="schoolArray" [(ngModel)]="param.school_id" (ngModelChange)="requestBatch(param.school_id)"
                    [autoClearSearch]="true" optionValueField="school_id" optionTextField="school_name">
                </ngx-select>
            </div>
            <div class="wd-xl wd-sm ml-3">
                <ngx-select [items]="batchArray" [(ngModel)]="param.batch_id" (ngModelChange)="requestGroup()"
                    [autoClearSearch]="true" optionValueField="batch_id" optionTextField="batch_name">
                </ngx-select>
            </div>
            <div class="btn-group ml-3 mr-3" dropdown>
                <button class="btn dropdown-toggle btn-secondary" type="button" dropdownToggle>评委 管理
                    <span class="caret"></span>
                </button>
                <div *dropdownMenu class="dropdown-menu modal-lg" role="menu">
                    <a class="dropdown-item" href="#" (click)="goStep('detail')">评委详情</a>
                    <div class="dropdown-divider"></div>
                    <a class="dropdown-item" href="#" (click)="export()">导出分组考场</a>
                    <div class="dropdown-divider"></div>
                    <a class="dropdown-item" href="#" (click)="ModalService.showUploadWindow(bsService,'ex/judge/room/upload.htm',
                        param,{
                        uploadTitle:'评委上传',
                        templateFile:'模板-评委导入.xlsx',
                        uploadCallback:uploadCallback.bind(this),
                        autoClose:true
                     })">导入评委</a>
                </div>
            </div>
        </div>
    </div>

</div>

<div class="table-responsive bg-white" *ngIf="step=='main'">
    <table class="table table-striped table-hover table-bordered">
        <thead>
            <tr>
                <th>学校名称</th>
                <th>批次名称</th>
                <th>分组名称</th>
                <th>考场数量</th>
                <th>评委数量</th>
            </tr>
        </thead>
        <tbody>
            <tr *ngFor="let v of groupPager.getRecords(); let i = index">
                <td>{{v.school_name}}</td>
                <td>{{v.batch_name}}</td>
                <td>{{v.group_name}}</td>
                <td>{{v.room_num}}</td>
                <td><a href="#" (click)="goStep('detail', v.ly_group_id)">{{v.room_judge_num}}</a></td>
            </tr>
        </tbody>
    </table>
    <frame-pager [url]="'./ex/judge/room/group/page.htm'" [pagerParams]="{school_id: param.school_id, batch_id: param.batch_id}" #groupPager></frame-pager>
</div>


<div class="content-heading  justify-content-between" *ngIf="step=='detail'">
    <div>评委详情管理</div>
    <div class="float-right">
        <div class="row">
            <div class="wd-xl wd-sm">
                <ngx-select [items]="schoolArray" [(ngModel)]="param.school_id" (ngModelChange)="requestJudgeBatch(param.school_id)"
                    [autoClearSearch]="true" optionValueField="school_id" optionTextField="school_name">
                </ngx-select>
            </div>
            <div class="wd-xl wd-sm ml-3">
                <ngx-select [items]="batchArray" [(ngModel)]="param.batch_id" (ngModelChange)="requestJudge()"
                    [autoClearSearch]="true" optionValueField="batch_id" optionTextField="batch_name">
                </ngx-select>
            </div>
            <div class="btn-group ml-3" dropdown>
                <button class="btn dropdown-toggle btn-secondary" type="button" dropdownToggle>评委管理
                    <span class="caret"></span>
                </button>
                <div *dropdownMenu class="dropdown-menu modal-lg" role="menu">
                    <a class="dropdown-item" href="#" (click)="showAddEditJudge()">新增评委</a>
                    <div class="dropdown-divider"></div>
                </div>
                <button class="btn btn-secondary ml-3 text-primary mr-3" type="button" (click)="goStep('main')">返回</button>
            </div>
        </div>
    </div>

</div>

<div class="table-responsive bg-white" *ngIf="step=='detail'">
    <table class="table table-striped table-hover table-bordered">
        <thead>
            <tr>
                <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 v of judgePager.getRecords(); let i = index">
                <td>{{v.school_name}}</td>
                <td>{{v.batch_name}}</td>
                <td>{{v.group_name}}</td>
                <td>{{v.judge_name}}</td>
                <td>{{v.login_name}}</td>
                <td>{{v.judge_mobile}}</td>
                <td>第{{v.room_seq}}考场</td>
                <td>{{v.judge_seq}}</td>
                <td [innerHTML]="v.judge_enable | frameStatus"></td>
                <td>
                    <span class="table-button" (click)="showAddEditJudge(v)" tooltip="修改"><em
                        class="fa-lg fas fa-edit"></em></span>
                    <span class="table-button ml-3 text-danger" tooltip="删除"
                    (click)="judgePager.optrRecord('ex/judge/room/delete.htm', v, {successMsg:'评委已删除！', confirmMsg: '确定要删除该评委吗？', successMsgType:'Swal'})">
                    <em class="fa-lg fas fa-trash-alt "></em></span>
                </td>
            </tr>
        </tbody>
    </table>
    <frame-pager [url]="'./ex/judge/room/page.htm'" [pagerParams]="{school_id: param.school_id, batch_id: param.batch_id,ly_group_id: param.ly_group_id}" #judgePager></frame-pager>
</div>