<div class="content-heading  justify-content-between" *ngIf="step=='main'">
    <div>学校管理</div>
    <div class="float-right">
        <div class="btn-group mb-1 mr-1" dropdown>
            <button class="btn dropdown-toggle btn-secondary btn-lg" type="button" dropdownToggle>学校管理
                <span class="caret"></span>
            </button>
            <div *dropdownMenu class="dropdown-menu modal-lg" role="menu">
                <a class="dropdown-item" href="#" (click)="showModal()">新增学校</a>
                <div class="dropdown-divider"></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>
                <th>是否启用</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <tr *ngFor="let v of pager.getRecords(); let i = index">
                <td>{{v.school_code}}</td>
                <td>{{v.school_name}}</td>
                <td><a href="#" (click)="detailPage(v.school_id, 'subject')">{{v.subjectNum}}</a></td>
                <td><a href="#" (click)="detailPage(v.school_id, 'batch')">{{v.batchNum}}</a></td>
                <td>{{v.leader}}</td>
                <td [innerHTML]="v.school_status | frameStatus"></td>
                <td>
                    <span class="table-button" (click)="showModal({ResponseEntity:v})" tooltip="修改"><em
                            class="fa-lg fas fa-edit"></em></span>
                    <span class="table-button ml-3 text-danger" tooltip="删除"
                        (click)="pager.optrRecord('cf/school/delete.htm', v, {successMsg:'学校已删除！', confirmMsg: '确定要删除该学校吗？', successMsgType:'Swal'})">
                        <em class="fa-lg fas fa-trash-alt "></em></span>
                    <span class="table-button ml-3" tooltip="批次管理" (click)="detailPage(v.school_id, 'batch')"><em
                            class="fa-lg fas icon-menu"></em></span>
                    <span class="table-button ml-3" tooltip="科目管理" (click)="detailPage(v.school_id, 'subject')"><em
                            class="fa-lg fas icon-directions"></em></span>
                </td>
            </tr>
        </tbody>
    </table>
    <frame-pager [url]="'./cf/school/page.htm'" #pager></frame-pager>
</div>

<!--批次管理-->
<div class="content-heading  justify-content-between" *ngIf="step == 'batch'">
    <div>批次管理</div>
    <div class="float-right">
        <div class="btn-group mb-1 mr-1" dropdown>
            <button class="btn dropdown-toggle btn-secondary btn-lg" type="button" dropdownToggle>批次管理
                <span class="caret"></span>
            </button>
            <div *dropdownMenu class="dropdown-menu modal-lg" role="menu">
                <a class="dropdown-item" href="#" (click)="showAddEditBatch()">新增批次</a>
                <div class="dropdown-divider"></div>
            </div>
            <button class="btn btn-secondary ml-3 text-primary mr-2" type="button" (click)="goStep('main')">返回</button>
        </div>
    </div>
</div>

<div class="table-responsive bg-white" *ngIf="step=='batch'">
    <table class="table table-striped table-hover table-bordered">
        <thead>
            <tr>
                <th>批次代码</th>
                <th>批次名称</th>
                <th>学校代码</th>
                <th>学校名称</th>
                <th>是否启用</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <tr *ngFor="let v of batchPager.getRecords(); let i = index">
                <td>{{v.batch_code}}</td>
                <td>{{v.batch_name}}</td>
                <td>{{v.school_code}}</td>
                <td>{{v.school_name}}</td>
                <td [innerHTML]="v.batch_status | frameStatus"></td>
                <td>
                    <span class="table-button" (click)="showAddEditBatch(v)" tooltip="修改"><em
                            class="fa-lg fas fa-edit"></em></span>
                    <span class="table-button ml-3 text-danger" tooltip="删除"
                        (click)="batchPager.optrRecord('cf/school/batch/delete.htm', v, {successMsg:'批次已删除！', confirmMsg: '确定要删除该批次吗？', successMsgType:'Swal'})">
                        <em class="fa-lg fas fa-trash-alt "></em></span>
                </td>
            </tr>
        </tbody>
    </table>
    <frame-pager [url]="'./cf/school/batch/page.htm'" [pagerParams]="{school_id: query.school_id}" #batchPager>
    </frame-pager>
</div>


<!--科目管理-->
<div class="content-heading  justify-content-between" *ngIf="step == 'subject'">
    <div>科目管理</div>
    <div class="float-right">
        <button class="btn btn-secondary ml-3 text-primary" type="button" (click)="goStep('main')">返回</button>
    </div>
</div>

<div class="table-responsive bg-white" *ngIf="step=='subject'">
    <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>
            </tr>
        </thead>
        <tbody>
            <tr *ngFor="let v of subjectPager.getRecords(); let i = index">
                <td>{{v.school_code}}</td>
                <td>{{v.school_name}}</td>
                <td>{{v.subject_code}}</td>
                <td>{{v.subject_name}}</td>
                <td><a href="#" (click)="showVariety(v)">{{v.varietyNum}}</a></td>
                <td>
                    <span *ngIf="v.varietyNum-v.tracksNum == 0 && v.varietyNum!=0" class="text-success">已配置</span>
                    <span *ngIf="v.varietyNum-v.tracksNum > 0 && v.tracksNum > 0 " class="text-primary">部分配置</span>
                    <span *ngIf="v.tracksNum == 0 && v.varietyNum>0" class="text-danger">无配置</span>
                </td>
                <td [innerHTML]="v.subject_status | frameStatus"></td>
                <td>{{v.panelName}}</td>
                <td>
                    <span class="table-button" (click)="showEditSubject(v)" tooltip="修改"><em
                            class="fa-lg fas fa-edit"></em></span>
                    <span class="table-button ml-3 text-danger" tooltip="删除"
                    (click)="subjectPager.optrRecord('cf/school/subject/delete.htm', v, {successMsg:'科目已删除！', confirmMsg: '确定要删除该科目吗？', successMsgType:'Swal'})">
                    <em class="fa-lg fas fa-trash-alt "></em></span>
                </td>
            </tr>
        </tbody>
    </table>
    <frame-pager [url]="'./cf/school/subject/page.htm'" [pagerParams]="{school_id: query.school_id}" #subjectPager>
    </frame-pager>
</div>
