<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 customBusinessList">{{ item.name }}</div>
      </overlay-scrollbars>
    </div>
    <div class="addressAssign" *ngIf="activeDictionaryKey.key=='one_connect'">
			<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.orders}}</td>
									<td>{{data.handoverName}}</td>
									<td>{{data.associationDeptDTO?.dept}}</td>
			            <td>
										{{data.handoverType?.name}}
									</td>
									<td>{{data.taskTypeDTO?.taskName}}</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="hosId" nzRequired [nzSpan]="6">院区</nz-form-label>
         <nz-form-control [nzSpan]="18" nzErrorTip="请选择院区!">
       		<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择院区" formControlName="hosId" (ngModelChange)="changeHos()">
       		  <ng-container *ngFor="let option of hospitalList">
       		    <nz-option [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
       		  </ng-container>
       		</nz-select>
         </nz-form-control>
       </nz-form-item>
       
       <nz-form-item>
         <nz-form-label [nzSpan]="6" nzFor="orders" nzRequired>排序号</nz-form-label>
         <nz-form-control [nzSpan]="18" nzErrorTip="请输入排序号!">
           <nz-input-group>
             <input formControlName="orders" nz-input placeholder="请输入排序号">
           </nz-input-group>
         </nz-form-control>
       </nz-form-item>
       
       <nz-form-item>
         <nz-form-label [nzSpan]="6" nzFor="handoverName" nzRequired>交接名称</nz-form-label>
         <nz-form-control [nzSpan]="18" nzErrorTip="请输入交接名称!">
           <nz-input-group>
             <input formControlName="handoverName" nz-input placeholder="请输入交接名称">
           </nz-input-group>
         </nz-form-control>
       </nz-form-item>
       
			 <nz-form-item>
			   <nz-form-label nzFor="associationDept" nzRequired [nzSpan]="6">关联科室</nz-form-label>
			   <nz-form-control [nzSpan]="18" nzErrorTip="请选择关联科室!">
			 		<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择关联科室" formControlName="associationDept" (nzOnSearch)="changeCommonInp($event)">
			 		  <ng-container *ngFor="let option of deptData">
			 		    <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [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="handoverType" nzRequired [nzSpan]="6">交接类型</nz-form-label>
			   <nz-form-control [nzSpan]="18" nzErrorTip="请选择交接类型!">
			 		<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择交接类型" formControlName="handoverType">
			 		  <ng-container *ngFor="let option of connectList">
			 		    <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="taskType" nzRequired [nzSpan]="6">关联任务类型</nz-form-label>
         <nz-form-control [nzSpan]="18" nzErrorTip="请选择关联任务类型!">
       		<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择关联任务类型" formControlName="taskType">
       		  <ng-container *ngFor="let option of taskTypeList">
       		    <nz-option *ngIf="!isLoading" [nzLabel]="option.taskName" [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>
      </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>
