form.component.html 2.66 KB
Newer Older
范雪寒's avatar
范雪寒 committed
1
<div class="model-content">
Li Mingzhe's avatar
Li Mingzhe committed
2
  <div style="padding: 10px;">
范雪寒's avatar
范雪寒 committed
3 4 5
    <div class="border" style="width: 1000px;">
      <textarea style="width: 955px; height: 300px;" (blur)="load()" #itemTextarea>{{itemStr}}</textarea>
      <button (click)="copyData();">Copy</button>
Li Mingzhe's avatar
Li Mingzhe committed
6 7
    </div>

范雪寒's avatar
范雪寒 committed
8 9 10 11 12 13
    <div class="border" style="width: 1000px;">
      <span style="font-size: 20px;">标题: </span>
      <input type="text" nz-input [(ngModel)]="item.title" (blur)="save()">
      <span style="font-size: 20px;">题目说明: </span>
      <input type="text" nz-input [(ngModel)]="item.questionText" (blur)="save()">
      <span style="font-size: 20px;">题目说明音频: </span>
14 15 16 17 18 19
      <app-audio-recorder 
        [audioUrl]="item.questionTextAudio"
        (audioUploaded)="onAssetUploadSuccess($event, 'questionTextAudio')"
        [_audioName]="item.audioFileName"
        (audioName)="saveAudioFileName($event)"
      ></app-audio-recorder>
范雪寒's avatar
范雪寒 committed
20
    </div>
Li Mingzhe's avatar
Li Mingzhe committed
21

范雪寒's avatar
范雪寒 committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35
    <div class="border" style="width: 1000px;">
      <div *ngFor="let question of item.questions; let i = index">
        <div class="border" style="width: 950px;">
          <span style="font-size: 20px;">选项类型: </span>
          <div *ngIf="question.type=='img'">
            <button class="button-right">图片</button>
            &nbsp;
            <button class="button-disable" (click)="question.type='txt'; save();">文字</button>
          </div>
          <div *ngIf="question.type=='txt'">
            <button class="button-disable" (click)="question.type='img'; save();">图片</button>
            &nbsp;
            <button class="button-right">文字</button>
          </div>
Li Mingzhe's avatar
Li Mingzhe committed
36

范雪寒's avatar
范雪寒 committed
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
          <div *ngIf="question.type=='img'">
            图片:
            <div style="width: 300px;">
              <app-upload-image-with-preview [picUrl]="question.image"
                (imageUploaded)="onAssetUploadSuccess($event, 'questions', i, 'image')">
              </app-upload-image-with-preview>
            </div>
          </div>
          <span>音频: </span>
          <app-audio-recorder [audioUrl]="question.audio"
            (audioUploaded)="onAssetUploadSuccess($event, 'questions', i, 'audio')">
          </app-audio-recorder>
          <div *ngIf="question.type=='txt'">
            <span>文本: </span>
            <input type="text" nz-input [(ngModel)]="question.text" (blur)="save()">
          </div>
            <br>
          <button style="width: 900px; height: 30px; color: red;" (click)="removeQuestion(i)">删除题目</button>
        </div>
      </div>
      <div class="border" style="width: 950px;">
        <button style="width: 900px; height: 100px;" (click)="addQuestion()">增加题目</button>
      </div>
    </div>
范雪寒's avatar
范雪寒 committed
61
  </div>
范雪寒's avatar
范雪寒 committed
62
</div>