<ion-header [translucent]="true">
  <ion-toolbar>
    <ion-title>
      任务集执行展示
    </ion-title>
  </ion-toolbar>
</ion-header>

<ion-content [fullscreen]="true">
 <ion-button (click)="doPoemTask()">执行诗文意境绘制任务集</ion-button>
 <ion-button (click)="doInqueryTask()">执行问诊任务集</ion-button>
  <ion-button (click)="testJSON()">测试JSON</ion-button>


 <ul>
  @for(step of taskList;track step.title;){
    <div>
      <!-- 待开始 -->
      @if(step.progress==0 && !step.error){
        <ion-icon name="radio-button-off-outline"></ion-icon>
      }
      <!-- 进行中 -->
      @if(step.progress!=0 && step.progress!=1){
        <ion-icon name="reload-outline"></ion-icon>
      }
      <!-- 已完成 -->
      @if(step.progress==1){
        <ion-icon name="checkmark-circle-outline"></ion-icon>
      }
      <!-- 已出错 -->
      @if(step.error){
        <ion-icon name="close-circle-outline"></ion-icon>
      }
      {{step.title}}  @if(step.progress){<span>{{step.progress * 100 | number:"2.0-0"}}%</span>}

      @if(step.error){
        <span style="color:red;">{{step.error}}</span>
      }
    </div>   
  }
  </ul>

  <!-- 诗词意境绘画生成结果 -->
  @if(shareData.images) {
    @for(imageUrl of shareData.images;track imageUrl){
      <img [src]="imageUrl" alt="" srcset="">
    }
  }

  <!-- 问诊报告生成结果 -->
  @if(shareData.diagResult){
    <h1>{{shareData.diagResult.title}}</h1>
    <h2>{{shareData.diagResult.desc}}</h2>
    <p>{{shareData.diagResult.content}}</p>
  }

</ion-content>
