<div class="content-heading justify-content-between">
  <div>框架配置 - 参数管理</div>
  <div frameRole res="0" >
    <a href="#" (click) ="showDetail({},'add')"><em class="fa-lg fas icon-plus "></em></a>
    <a class="ml-3" href="#" (click) ="frameParam.optr('frame/param/reloadGx.htm',{RequestLoading: true}, '确定重新加载框架参数吗？该操作将会消耗较多系统资源，请勿在系统繁忙时间进行此操作！','框架参数已重新加载，重新登录可生效！')"><em class="fa-lg fas icon-refresh "></em></a>
    <a class="ml-3" href="#" title="刷新考生端参数缓存" (click) ="freshFrameParamsCache()"><em class="fa-lg fas icon-refresh "></em></a>

  </div>
</div>
<div class="row">
  <div [class]="mode==='page'?'col-lg-12':'col-lg-7'">
    <div class="ml-0 table-responsive bg-white">
      <table class="table table-striped table-hover table-bordered">
        <thead>
        <tr>
          <th>#</th>
          <th><a  (click)="frameParam.sort('param_name')">参数名称</a></th>
          <th>参数值</th>
          <th>值类型</th>
          <th>状态</th>
          <th>所属工程</th>
          <th>描述信息</th>
          <th style="width:40px;"></th>
        </tr>
        </thead>
        <tbody>
        <tr *ngFor="let param of frameParam.getRecords(); let i = index">
          <td>{{i + 1}}</td>
          <td>{{param.param_name}}</td>
          <td title="{{param.param_value}}">{{carouselContentFilter(param.param_value)}}</td>
      
          <td [innerHTML]="param.param_value_type | frameDict : 'FrameValueType'"></td>
          <td [innerHTML]="param.protect_status | frameStatus "></td>
          <td>{{param.project_owner}}</td>
          <td>{{param.param_desc}}</td>
          <td>
            <a href="#" frameRole res="0" (click)="showDetail(param,'edit')"><em class="fa-lg fas fa-edit "></em></a>
          </td>
        </tr>
        </tbody>
      </table>
      <frame-pager [url]="'frame/param/pageGx.htm'" [hidePager]="true" [pageLimit]="9999" #frameParam></frame-pager>
    </div>
  </div>

  <div class="col-lg-5" [hidden]="mode === 'page' ">
    <div class="col-lg-12">
      <form [formGroup]="valForm" class="form-validate form-horizontal" novalidate="">
        <div class="card card-default">
          <div class="card-body">
            <div class="form-group row">
              <label class="col-lg-4 col-form-label text-lg-right">参数名称</label>
              <div class="col-lg-8">
                <input class="form-control" type="text" #elParamName formControlName="param_name" [formControl]="valForm.controls['param_name']" [(ngModel)]="param.param_name" />
                <span class="text-danger" *ngIf="valForm.controls['param_name'].hasError('required') && (valForm.controls['param_name'].dirty || valForm.controls['param_name'].touched)">字典中文值不允许为空</span>
              </div>
            </div>
            <div class="form-group row">
              <label class="col-lg-4 col-form-label text-lg-right">参数值</label>
              <div class="col-lg-8">
                <input class="form-control" type="text" formControlName="param_value" [formControl]="valForm.controls['param_value']" [(ngModel)]="param.param_value" />
                <span class="text-danger" *ngIf="valForm.controls['param_value'].hasError('required') && (valForm.controls['param_value'].dirty || valForm.controls['param_value'].touched)">字典唯一值不允许为空</span>
              </div>
            </div>
            <div class="form-group row">
              <label class="col-lg-4 col-form-label text-lg-right">中文描述信息</label>
              <div class="col-lg-8">
                <input class="form-control" type="text" formControlName="param_desc" [formControl]="valForm.controls['param_desc']" [(ngModel)]="param.param_desc" />
                <span class="text-danger" *ngIf="valForm.controls['param_desc'].hasError('required') && (valForm.controls['param_desc'].dirty || valForm.controls['param_desc'].touched)">中文描述信息不允许为空</span>
              </div>
            </div>
            <div class="form-group row">
              <label class="col-lg-4 col-form-label text-lg-right">参数值类型</label>
              <div class="col-lg-8">
                <select class="custom-select" formControlName="param_value_type" [formControl]="valForm.controls['param_value_type']" [(ngModel)]="param.param_value_type" frameDict [dictName]="'FrameValueType'" [tipMsg]="'请选择值类型'"></select>
                <span class="text-danger" *ngIf="valForm.controls['param_value_type'].hasError('required') && (valForm.controls['param_value_type'].dirty || valForm.controls['param_value_type'].touched)">请选择值类型</span>
              </div>
            </div>
            <div class="form-group row">
              <label class="col-lg-4 col-form-label text-lg-right">状态</label>
              <div class="col-lg-8">
                <select class="custom-select" formControlName="protect_status" [formControl]="valForm.controls['protect_status']" [(ngModel)]="param.protect_status" frameDict [dictName]="'FrameStatus'" [tipMsg]="'请选择'"></select>
                <span class="text-danger" *ngIf="valForm.controls['protect_status'].hasError('required') && (valForm.controls['protect_status'].dirty || valForm.controls['protect_status'].touched)">请确认是否需要框架保护</span>
              </div>
            </div>
            <div class="form-group row">
              <label class="col-lg-4 col-form-label text-lg-right">所属工程</label>
              <div class="col-lg-8">
                <input class="form-control" type="text" formControlName="project_owner" [formControl]="valForm.controls['project_owner']" [(ngModel)]="param.project_owner" />
              </div>
            </div>
          </div>
          <div class="card-footer text-center">
            <button class="btn btn-info" (click)="submitForm(valForm.value)">{{mode + '框架参数'}}</button>&nbsp;&nbsp;&nbsp;
            <button class="btn btn-default" (click)="cancleDetail()">取消操作</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>

