<div class="home-container" *ngIf="initMap" [hidden]="viewStep !== 'page'">
  <div class="jumbotron">
    <div class="row">
      <div class="col-xl-3 col-lg-4">
        <div class="text-center">
          <img alt="Angular" class="img-fluid home-logo"
               [src]="'./assets/img/school/' + initMap.SchoolReg.school_short_img"/>
        </div>
      </div>
      <div class="col-xl-9 col-lg-8 home-text">
        <h1 class="home-text-big">{{initMap.SchoolReg.school_name}}</h1>
        <p class="lead home-title-big"><strong>{{appTitle}}</strong>
          <br>
          <small>综合管理平台</small>
        </p>
        <p [hidden]="viewStep === 'edit'"><a class="btn btn-info btn-lg" href="#"
                                             (click)="goViewStep('edit', {}, 'school/school/info/find.htm')">修改信息</a><a
          class="btn btn-success btn-lg ml-5" href="#" (click)="goPass()">修改密码</a><a
          class="btn btn-primary btn-lg ml-5" href="#" (click)="logout()">退出系统</a></p>
      </div>
    </div>
  </div>
  <div class="row">
    <div class="col-lg-4">
      <div class="card b">
        <div class="card-header">
          <h3>学校信息</h3>
        </div>
        <div class="card-body">
          <div>学校简称：{{initMap.SchoolReg.school_short_name}}</div>
          <div class="mt-2">招生代码：{{initMap.SchoolReg.school_code}}</div>
          <div class="mt-2">学校地址：{{initMap.SchoolReg.school_addr}}</div>
        </div>
      </div>
    </div>
    <div class="col-lg-4">
      <div class="card b">
        <div class="card-header">
          <h3>报考信息</h3>
        </div>
        <div class="card-body">
          <div>招生简章：<span *ngIf="initMap.SchoolReg.doc_url"><a href="#" (click)="openUrl('doc_url')">点击这里打开简章</a></span>
            <span *ngIf="initMap.SchoolReg.doc_url === undefined" class="text-danger">未设置简章链接</span></div>
          <div class="mt-2">开始时间：{{initMap.SchoolReg.enrol_start_time}}</div>
          <div class="mt-2">结束时间：{{initMap.SchoolReg.enrol_end_time}}</div>
        </div>
      </div>
    </div>
    <div class="col-lg-4">
      <div class="card b">
        <div class="card-header">
          <h3>学校附加信息</h3>
        </div>
        <div class="card-body">
          <div>学校官网：<span *ngIf="initMap.SchoolReg.school_url"><a href="#" (click)="openUrl('school_url')">点击这里打开官网</a></span>
            <span *ngIf="initMap.SchoolReg.school_url === undefined" class="text-danger">未设置官网地址</span></div>
          <div class="mt-2">联系电话：{{initMap.SchoolReg.school_tel}}</div>
          <div class="mt-2">传真号码：{{initMap.SchoolReg.school_fax}}</div>
        </div>
      </div>
    </div>
  </div>
  <div class="row">
    <div class="col-lg-4">
      <div class="card b">
        <div class="card-header">
          <h3>开设专业</h3>
        </div>
        <div class="card-body">
          <div *ngFor="let ap of initMap.AspectArray;let i = index;">
            <div [class]="i>0?'mt-2':''">{{i+1}}. {{ap.aspect_name}}（{{ap.fee_amount /100 | currency : 'CNY' :
              'symbol-narrow'}}）
              <span><span class="text-success"> {{ap.pay_count}}</span> <span
                *ngIf=" ap.pay_count && ap.pay_count>0">/</span> {{ap.enrol_count}} </span>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="col-lg-4">
      <div class="card b">
        <div class="card-header">
          <h3>收费统计</h3>
        </div>
        <div class="card-body">
          <div>收费总额：{{initMap.TotalFee.i01 /100 | currency : 'CNY' : 'symbol-narrow'}}</div>
          <div class="mt-2">今日收费：{{initMap.TotalFee.i02 /100 | currency : 'CNY' : 'symbol-narrow'}}</div>
        </div>
      </div>
    </div>
    <div class="col-lg-4">
      <div class="card b">
        <div class="card-header">
          <h3>准考证打印时段</h3>
        </div>
        <div class="card-body">
          <div>开始时间：{{initMap.SchoolReg.ticket_start_time?initMap.SchoolReg.ticket_start_time:'未设置'}}</div>
          <div class="mt-2">结束时间：{{initMap.SchoolReg.ticket_end_time?initMap.SchoolReg.ticket_end_time:'未设置'}}</div>
        </div>
      </div>
    </div>
  </div>
</div>


<div [hidden]="viewStep !== 'edit'">
  <div class=" card card-default">
    <div class="card-body">
      <form [formGroup]="valForm" class="form-validate form-horizontal" novalidate="">
        <div class="row">
          <label class="col-lg-1 col-form-label text-lg-right">学校名称</label>
          <div class="col-lg-7">
            <input class="form-control" #elAutoFocus type="text" formControlName="school_name"
                   [formControl]="valForm.controls['school_name']" [(ngModel)]="currentEntity.school_name"/>
            <form-msg [valForm]="valForm" [fieldName]="'school_name'" [errorCode]="'required'"></form-msg>
            <form-msg [valForm]="valForm" [fieldName]="'school_name'" [errorCode]="'minlength'"></form-msg>
            <form-msg [valForm]="valForm" [fieldName]="'school_name'" [errorCode]="'maxlength'"></form-msg>
          </div>
          <label class="col-lg-1 col-form-label text-lg-right">学校简称</label>
          <div class="col-lg-3">
            <input class="form-control" type="text" formControlName="school_short_name"
                   [formControl]="valForm.controls['school_short_name']" [(ngModel)]="currentEntity.school_short_name"/>
            <form-msg [valForm]="valForm" [fieldName]="'school_short_name'" [errorCode]="'required'"></form-msg>
            <form-msg [valForm]="valForm" [fieldName]="'school_short_name'" [errorCode]="'minlength'"></form-msg>
            <form-msg [valForm]="valForm" [fieldName]="'school_short_name'" [errorCode]="'maxlength'"></form-msg>

          </div>
        </div>
      </form>
      <div class="row mt-3">
        <label class="col-lg-1 col-form-label text-lg-right">学校地址</label>
        <div class="col-lg-7">
          <input class="form-control" type="text" [(ngModel)]="currentEntity.school_addr"/>
        </div>
        <label class="col-lg-1 col-form-label text-lg-right">联系电话</label>
        <div class="col-lg-3">
          <input class="form-control" type="text" [(ngModel)]="currentEntity.school_tel"/>
        </div>
      </div>

      <div class="row mt-3">

        <label class="col-lg-1 col-form-label text-lg-right">学校网址</label>
        <div class="col-lg-7">
          <input class="form-control" type="text" [(ngModel)]="currentEntity.school_url"/>
        </div>
        <label class="col-lg-1 col-form-label text-lg-right">传真号码</label>
        <div class="col-lg-3">
          <input class="form-control" type="text" [(ngModel)]="currentEntity.school_fax"/>
        </div>
      </div>

      <div class="row mt-3">

        <label class="col-lg-1 col-form-label text-lg-right">简章地址</label>
        <div class="col-lg-7">
          <input class="form-control" type="text" [(ngModel)]="currentEntity.doc_url"/>
        </div>
        <label class="col-lg-1 col-form-label text-lg-right">专业限制</label>
        <div class="col-lg-3">
          <input class="form-control" type="number" [(ngModel)]="currentEntity.aspect_limit"/>
        </div>
      </div>


      <div class="row mt-3">
        <label class="col-lg-2 col-form-label text-lg-right">报考开始时间</label>
        <div class="col-lg-4">
          <input class="form-control" type="text" [(ngModel)]="currentEntity.enrol_start_time"/>
        </div>
        <label class="col-lg-2 col-form-label text-lg-right">报考结束时间</label>
        <div class="col-lg-4">
          <input class="form-control" type="text" [(ngModel)]="currentEntity.enrol_end_time"/>
        </div>
      </div>


      <div class="row mt-3">
        <label class="col-lg-2 col-form-label text-lg-right">准考证开放时间</label>
        <div class="col-lg-4">
          <input class="form-control" type="text" [(ngModel)]="currentEntity.ticket_start_time"/>
        </div>
        <label class="col-lg-2 col-form-label text-lg-right">准考证关闭时间</label>
        <div class="col-lg-4">
          <input class="form-control" type="text" [(ngModel)]="currentEntity.ticket_end_time"/>
        </div>
      </div>

      <div class="card-footer mt-2 text-center">
        <button class="btn btn-info"
                (click)="submitForm('school/school/info/edit.htm',{confirmMsg:'确定要保存信息吗？如果您修改了报名时间和准考证打印时间，将实时生效！',RequestWithLoading:false},initData)">
          修改学校基础信息
        </button>
        <button class="btn btn-default ml-5" (click)="viewStep ='page'">取消操作</button>
      </div>
    </div>
  </div>
</div>

<div [hidden]="viewStep !== 'pass'">
  <div class=" card card-default">
    <div class="card-body">
      <form [formGroup]="passForm" class="form-validate form-horizontal" novalidate="">
        <div class="form-group">
          <label>旧密码</label>
          <input class="form-control" type="password" formControlName="old_pass" [formControl]="passForm.get('old_pass')"
                 [(ngModel)]="pass.old_pass"/>
          <span class="text-danger"
                *ngIf="passForm.get('old_pass').hasError('required') && (passForm.get('old_pass').dirty || passForm.get('old_pass').touched)">请输入旧密码</span>

        </div>
        <div class="form-group">
          <label>登录密码</label>
          <input class="form-control" type="password" formControlName="new_pass"
                 [formControl]="passForm.get('new_pass')"
                 [(ngModel)]="pass.new_pass"/>
          <span class="text-danger"
                *ngIf="passForm.get('new_pass').hasError('required') && (passForm.get('new_pass').dirty || passForm.get('new_pass').touched)">请输入操作员登录密码</span>
          <span class="text-danger"
                *ngIf="passForm.get('new_pass').hasError('rangewords') && (passForm.get('new_pass').dirty || passForm.get('new_pass').touched) ">登录密码最少需要6个字符，最大允许24个字符</span>
        </div>
        <div class="form-group">
          <label>密码确认</label>
          <input class="form-control" type="password" formControlName="confirmPassword"
                 [formControl]="passForm.get('confirmPassword')" [(ngModel)]="pass.confirmPassword"/>
          <span class="text-danger" *ngIf="passForm.get('confirmPassword').hasError('equalTo')">登录密码两次输入不一致</span>
        </div>
        <p class="text-center"><a
          class="btn btn-info ml-5" href="#" (click)="goSavePass()">确定修改密码</a></p>
      </form>
    </div>
  </div>
</div>
