<ion-header>
    <ion-navbar>
        <ion-title>信息查询</ion-title>
        <ion-buttons end>
            <button ion-button icon-only class="toolbar-signUp">
                <ion-select [(ngModel)]="option.type" cancelText="取消" okText="确定" placeholder="选择"
                            (ngModelChange)="changeType()">
                    <ng-container *ngFor="let item of option.list">
                        <ion-option [value]="item.type">{{item.name}}</ion-option>
                    </ng-container>
                </ion-select>
            </button>
        </ion-buttons>
    </ion-navbar>
    <ion-navbar class="input-search">
        <div class="search-input">
            <!--选择-->
            <ion-item class="select">
                <ion-select [(ngModel)]="info.type" (ngModelChange)="switchType()" interface="popover" placeholder="请选择">
                    <div *ngFor="let typeData of info.typeDataArr">
                        <ion-option [value]="typeData?.id">{{typeData?.lable}}</ion-option>
                    </div>
                </ion-select>
            </ion-item>
            <!--input框-->
            <ion-input type="text" placeholder="请输入" [(ngModel)]="info.search"></ion-input>
            <span *ngIf="option.type != '3'" class="clear search" [ngStyle]="{'right': option.type != '3' ? '19%' : '7%'}" tappable (click)="getList()">
                <img src="./assets/icon/search.png" />
            </span>
            <span *ngIf="option.type != '3'" class="clear filter" tappable (click)="filterConditions()">筛选</span>
        </div>
    </ion-navbar>
    <p [ngStyle]="{'display': searchState ? 'block': 'none'}" style="background: #fff;text-align: center;color: #999;padding: 10px 0;">共查询到{{info.totalCount}}条</p>
</ion-header>

<ion-content>
    <ul *ngIf="!searchState && option.type != '3'" class="history">
        <h6>历史记录</h6>
        <li *ngFor="let item of option.history" (click)="historyField(item)">{{item}}</li>
    </ul>
    <div *ngIf="searchState || info.list && option.type != '3'">
        <ion-refresher (ionRefresh)="getList($event)">
            <ion-refresher-content pullingText="下拉刷新" refreshingSpinner="bubbles"></ion-refresher-content>
        </ion-refresher>
        <div class="list">
            <div *ngFor="let item of info.list" (click)="goToDetail(item)">
                <div class="group">
                    <div class="inner-group">
                        <p *ngIf="option.viewType == '1'" class="person-name">{{item?.mc}}</p>
<!--                            <ion-icon *ngIf="option.type == '3'" name="build-outline" style="color:chartreuse;"></ion-icon>-->
                            <!--<ion-icon [name]="item.filenumber ? 'close-circle-outline' : 'checkmark-circle-outline'" ></ion-icon>-->

                        <p *ngIf="option.viewType == '2'" class="person-name">{{item?.name}}</p>
                        <span [ngStyle]="{'color': item.filenumber ? 'gray' : '#008000', 'border-color': item.filenumber ? 'gray' : '#008000a8' }">{{item.filenumber ? '撤销' : '正常'}}</span>

                    </div>
                </div>
            </div>
        </div>
        <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
            <ion-infinite-scroll-content loadingSpinner="bubbles" loadingText="加载中"></ion-infinite-scroll-content>
        </ion-infinite-scroll>
    </div>
    <div *ngIf="option.type == '3'" style="display: flex;width: 100%;height: 100%;align-items: center;justify-content: center;flex-direction: column;">
        <img src="./assets/imgs/construction.png" style="width: 100px;height: 100px;"/>
        <p style="font-size: 24px;color: #999;">建设中...</p>
    </div>
</ion-content>

