<div class="content priority">
  <div class="contentInner">
    <div class="list-template" id="wechatTable">
      <div class="list-template__content">
        <div class="list-template__bottom">
          <nz-table class="list-template__nzTable" [nzData]="messageList" nzSize="middle" [nzShowPagination]="false"
            [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }">
            <thead>
              <tr class="thead">
                <th nzWidth="5%">序号</th>
                <th nzWidth="20%">通知描述</th>
                <th nzWidth="20%">被通知人</th>
                <th nzWidth="20%">通知模式</th>
                <th nzWidth="20%">是否开启</th>
                <th nzWidth="15%">操作</th>
              </tr>
            </thead>
            <tbody>
              <tr *ngFor="let data of messageList;let i = index">
                <td>{{i + 1}}</td>
                <td>{{data.noticeNode}}</td>
                <td>{{data.noticeDetails}}</td>
                <td>
                  {{data.messageStationFlag == 1 ? '站内消息' : ''}}
                  {{data.shortMessageFlag == 1 ? '短信' : ''}}
                  {{data.wechatMessageFlag ==1 ? '微信' : ''}}
                </td>
                <td>{{data.flag ==1 ? '是' : '否'}}</td>
                <td>
                  <div class="coop">
                    <span (click)="edit(data)">编辑</span>
                  </div>
                </td>
              </tr>
            </tbody>
          </nz-table>
        </div>
      </div>
    </div>
  </div>
</div>

<!-- 新增/编辑模态框 -->
<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalMessage">
  <div class="modalBody">
    <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideMessageModal()"></i></div>
    <div class="content">
      <div class="message_head">
        <span class="head_item">流程描述：{{ editData.noticeNode }}</span>
        <span class="head_item">被通知人：{{ editData.noticeDetails }}</span>
        <span class="head_item">
          <ng-container  *ngIf="editData.noticeRule !== 'no'&&(editData.noticeCode == 'user_receive_overresp' || editData.noticeCode == 'manager_receive_overresp')">
            <i class="icon_transport transport-required red"></i>逾期响应时长<nz-input-number class="inputNumber" nzSize="small" [(ngModel)]="editData.noticeRule"></nz-input-number>分钟
          </ng-container>
          <ng-container  *ngIf="editData.noticeRule !== 'no'&&(editData.noticeCode == 'user_doing_overresp' || editData.noticeCode == 'manager_doing_overresp')">
            <i class="icon_transport transport-required red"></i>解决时长剩余<nz-input-number class="inputNumber" nzSize="small" [(ngModel)]="editData.noticeRule"></nz-input-number>%
          </ng-container>
        </span>
      </div>
      <div class="message_tab">
        <div class="tab" *ngFor="let item of tabs;let i = index;" (click)="selectTab(i)" [ngClass]="{ active: i == currentIndex }" [hidden]="item.hidden">
          <label nz-checkbox [(ngModel)]="item.checkboxFlag" (ngModelChange)="selectThis($event, i)"></label><span class="ml8">{{item.tabName}}</span>
        </div>
      </div>
      <div class="message_body">
        <div class="message_body_list" *ngFor="let item of tabs;let i = index;" [hidden]="i != currentIndex">
          <div class="message_body_list_title" *ngIf="!(i == 1)">
            <span>通知标题：</span><input nz-input placeholder="请输入通知标题" [(ngModel)]="item.processTitle" [disabled]="item.disable" />
          </div>
          <div class="message_body_list_body">
            <span>通知内容：</span><textarea class="wd" rows="10" nz-input placeholder="请输入通知内容" [(ngModel)]="item.processContent" [disabled]="item.disable"></textarea>
          </div>
          <div class="message_body_list_configure">
            <span style="visibility: hidden">变量名称{{currentIndex}}：</span>
            <p>备注：[$变量名称$]可添加<em *ngFor="let v of varArr;let first = first;let last = last;"><span (click)="writeIn(item, v, $event, 'processContent')">{{v}}</span><i *ngIf="!last">、</i><i *ngIf="last">。</i></em></p>
          </div>
          <!-- <div class="message_body_list_wechatConfig" *ngIf="currentIndex == 2">
            <span><i class="icon_transport transport-required red"></i>配置类型：</span>
            <nz-select class="w100" [nzDropdownMatchSelectWidth]="false" nzAllowClear [(ngModel)]="editData.wechatConfigTypeId"
              nzPlaceHolder="请选择微信配置类型" nzServerSearch>
              <ng-container *ngFor="let data of wechatConfigTypeList">
                <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
              </ng-container>
              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
              </nz-option>
            </nz-select>
          </div> -->
          <div class="message_body_list_title">
            <span><i class="icon_transport transport-required red"></i>是否开启：</span>
            <nz-radio-group [(ngModel)]="editData.flag">
              <label nz-radio [nzValue]="true">是</label>
              <label nz-radio [nzValue]="false">否</label>
            </nz-radio-group>
          </div>
        </div>
      </div>
    </div>
    <div class=" display_flex justify-content_flex-center">
      <button nzType="primary" nz-button (click)="submitMessageForm()" [nzLoading]="btnLoading">确认</button>
      <button class="btn cancel" nz-button nzType="default" (click)="hideMessageModal()">取消</button>
    </div>
  </div>
</div>

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