<div class="content" id="dictionary">
  <div class="contentInner">
    <div class="address">
      <overlay-scrollbars #osComponentRef1 class="contentBody">
        <div class="contentItem" [title]="item.name" [ngClass]="{ active: item.id === activeDictionaryKey.id }" (click)="clickDictionaryKey(item)" *ngFor="let item of voluntarilyTabList">{{ item.name }}</div>
      </overlay-scrollbars>
    </div>
    <div class="addressAssign" *ngIf="activeDictionaryKey.key=='alarmConfig'">
			<div class="list-template" id="priorityTable">
			  <div class="list-template__content">
			    <div class="list-template__bottom">
			     <div class="list-template__top" nz-row>
			        <div nz-col nzLg="24" class="list-template__btns">
			          <button nz-button class="btn default" (click)="addPriorityModal()">新增</button>
			        </div>
			      </div>
			      <nz-table class="list-template__nzTable" [nzData]="commonFaultsList" nzSize="middle" [nzShowPagination]="false"
			        [nzLoading]="loading1" [nzScroll]="{ y: tablePriorityHeight + 'px' }">
			        <thead>
			          <tr class="thead">
			            <th nzWidth="20%">告警优先级</th>
			            <th nzWidth="20%">关键字</th>
			            <th nzWidth="20%">关联故障现象</th>
									<th nzWidth="20%">处理人|组</th>
									<th nzWidth="15%">是否启用</th>
									<th nzWidth="120px">操作</th>
			          </tr>
			        </thead>
			        <tbody>
			          <tr *ngFor="let data of commonFaultsList;let i = index">
			            <td>{{data.alarmUrgency && data.alarmUrgency.name}}</td>
									<td>{{data.keywords || ''}}</td>
									<td>{{data.categoryDTO?.mutiCategory}}</td>
			            <td>
										<div>{{data.userDTO?.name}}</div>
										<div>{{data.groupDTO?.groupName}}</div>
									</td>
									<td>{{data.flag?'是':'否'}}</td>
			            <td>
			              <div class="coop">
			                <span (click)="showDelModal(data,'您确认要删除吗？','删除','delPriority')">删除</span>
			                <span (click)="editPriority(data)">编辑</span>
			              </div>
			            </td>
			          </tr>
			        </tbody>
			      </nz-table>
			    </div>
			  </div>
			</div>
    </div>
  </div>
</div>

<!-- 操作成功/失败提示框 -->
<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
  [info]="promptInfo">
</app-prompt-modal>

<!-- 删除模态框 -->
<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>

<!-- 新增/编辑模态框 -->
<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalPriority">
  <div class="modalBody">
    <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hidePriorityModal()"></i></div>
    <div class="content">
      <form nz-form [formGroup]="validatePriorityForm" class="addForm">
        <nz-form-item>
          <nz-form-label nzFor="alarmUrgency" nzRequired [nzSpan]="6">告警优先级</nz-form-label>
          <nz-form-control [nzSpan]="18">
        		<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择告警优先级" formControlName="alarmUrgency">
        		  <ng-container *ngFor="let option of emergencyData">
        		    <nz-option [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
        		  </ng-container>
        		</nz-select>
          </nz-form-control>
        </nz-form-item>
				<nz-form-item>
				  <nz-form-label [nzSpan]="6" nzFor="keywords">关键字</nz-form-label>
				  <nz-form-control [nzSpan]="18" nzErrorTip="请输入关键字!">
				    <nz-input-group>
				      <input formControlName="keywords" nz-input placeholder="请输入关键字">
				    </nz-input-group>
				  </nz-form-control>
				</nz-form-item>
        <nz-form-item>
          <nz-form-label nzFor="categoryId" nzRequired [nzSpan]="6">故障现象</nz-form-label>
          <nz-form-control [nzSpan]="18">
						<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择故障现象" formControlName="categoryId" (nzOnSearch)="changeCommonInp('category', $event)">
						  <ng-container *ngFor="let option of malfunctionData">
						    <nz-option *ngIf="!isLoading" [nzLabel]="option.mutiCategory" [nzValue]="option.id"></nz-option>
						  </ng-container>
						  <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
						    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
						  </nz-option>
						</nz-select>
          </nz-form-control>
        </nz-form-item>
				<nz-form-item>
				  <nz-form-label nzFor="groupId" nzRequired [nzSpan]="6">处理组</nz-form-label>
				  <nz-form-control [nzSpan]="18">
						<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择处理组" formControlName="groupId" (ngModelChange)="changeGroup($event)">
						  <ng-container *ngFor="let option of groupList">
						    <nz-option [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
						  </ng-container>
						</nz-select>
				  </nz-form-control>
				</nz-form-item>
				
				<nz-form-item>
				  <nz-form-label nzFor="userId" [nzSpan]="6">处理人</nz-form-label>
				  <nz-form-control [nzSpan]="18">
						<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择处理人" formControlName="userId">
						  <ng-container *ngFor="let option of userList">
						    <nz-option [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
						  </ng-container>
						</nz-select>
				  </nz-form-control>
				</nz-form-item>
				
				<nz-form-item>
				  <nz-form-label nzFor="flag" nzRequired [nzSpan]="6">是否启用</nz-form-label>
				  <nz-form-control [nzSpan]="18">
						<nz-radio-group class="formItem" formControlName="flag">
						  <label nz-radio [nzValue]="0">否</label>
						  <label nz-radio [nzValue]="1">是</label>
						</nz-radio-group>
				  </nz-form-control>
				</nz-form-item>
      </form>
    </div>
    <div class=" display_flex justify-content_flex-center">
      <button nzType="primary" nz-button (click)="submitPriorityForm()" [nzLoading]="btnLoading">确认</button>
      <button class="btn cancel" nz-button nzType="default" (click)="hidePriorityModal()">取消</button>
    </div>
  </div>
</div>
