custom-hot-zone.component.html 10.4 KB
Newer Older
limingzhe's avatar
limingzhe committed
1
<div class="p-image-children-editor">
李维's avatar
李维 committed
2
  <div style="border-right: 2px solid #ddd;" class="clearfix">
limingzhe's avatar
limingzhe committed
3

李维's avatar
李维 committed
4
    <!-- 全局音频素材 -->
李维's avatar
李维 committed
5 6 7 8
    <div nzAlign="middle" style="border-bottom: 2px solid #DDD;">
      <div class="img-box clearfix" style="border-bottom: 1px solid #DDD; padding-bottom: 10px;">
        <div style="float: left;">
          <h3>音频素材</h3>
李维's avatar
李维 committed
9 10 11 12 13
          <app-audio-recorder id="index_audio_1" [audioUrl]="bgItem.audio_url" (audioUploaded)="onAudioUploadSuccess($event, bgItem, 'audio_url')" > </app-audio-recorder>
        </div>
      </div>
    </div>

李维's avatar
李维 committed
14 15
    <!-- 标题以及题号 -->
    <div nzAlign="middle" style="border-bottom: 2px solid #DDD;">
李维's avatar
李维 committed
16
      <div class="img-box clearfix" style="border-bottom: 1px solid #DDD; padding-bottom: 10px;">
李维's avatar
李维 committed
17 18 19 20 21
        <nz-form-item>
          <nz-form-control [nzSpan]="8" style="padding: 0 5px; border-right: 1px dashed #ccc;">
            <div style="position: relative; margin-bottom: 5px;">
              <h3 style="text-align: left;">题号</h3>
              <input type="text" nz-input placeholder="" [(ngModel)]="bgItem.NO" (blur)="autoSave()" />
李维's avatar
李维 committed
22
            </div>
李维's avatar
李维 committed
23 24 25
            <div style="position: relative; margin-bottom: 5px;">
              <h3 style="text-align: left;">课件标题</h3>
              <input type="text" nz-input placeholder="" [(ngModel)]="bgItem.mainText" (blur)="autoSave()" />
李维's avatar
李维 committed
26
            </div>
李维's avatar
李维 committed
27 28 29
            <div style="position: relative; margin-bottom: 5px;">
              <h3 style="text-align: left;">标题发音</h3>
              <app-audio-recorder id="index_audio_1" [audioUrl]="bgItem.mainTextAudio" (audioUploaded)="onAudioUploadSuccess($event, bgItem,'mainTextAudio')" > </app-audio-recorder>
李维's avatar
李维 committed
30
            </div>
李维's avatar
李维 committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
          </nz-form-control>

          <nz-form-control [nzSpan]="6" style="padding: 0 5px; border-right: 1px dashed #ccc;">
            <div style="position: relative; margin-bottom: 5px;">
              <h3 style="text-align: left;">左侧单词</h3>
              <div style="display: flex; ">
                <div style="flex: 1">
                  音频
                </div>
                <div style="flex: 4">
                  <app-audio-recorder id="index_audio_1" [audioUrl]="bgItem.wordLeft_audio_url" (audioUploaded)="onAudioUploadSuccess($event, bgItem, 'wordLeft_audio_url')" > </app-audio-recorder>
                </div>
              </div>
            </div>
            <div style="position: relative;">
              <div style="display: flex; ">
                <div style="flex: 1">
                  文字
                </div>
                <div style="flex: 4">
                  <input type="text" nz-input placeholder="" [(ngModel)]="bgItem.wordLeft_text" (blur)="autoSave()" />
                </div>
              </div>
            </div>
          </nz-form-control>

          <nz-form-control [nzSpan]="8" style="padding: 0 5px;" >
            <div style="position: relative; margin-bottom: 5px;">
              <h3 style="text-align: left;">右侧单词</h3>
              <div style="display: flex; ">
                <div style="flex: 1">
                  音频
                </div>
                <div style="flex: 4">
                  <app-audio-recorder id="index_audio_1" [audioUrl]="bgItem.wordRight_audio_url" (audioUploaded)="onAudioUploadSuccess($event, bgItem, 'wordRight_audio_url')" > </app-audio-recorder>
                </div>
              </div>
            </div>
            <div style="position: relative;">
              <div style="display: flex; ">
                <div style="flex: 1">
                  文字
                </div>
                <div style="flex: 4">
                  <input type="text" nz-input placeholder="" [(ngModel)]="bgItem.wordRight_text" (blur)="autoSave()" />
                </div>
              </div>
            </div>
          </nz-form-control>
        </nz-form-item>
limingzhe's avatar
limingzhe committed
81 82
      </div>
    </div>
李维's avatar
李维 committed
83 84 85


    <!-- 选区 -->
李维's avatar
李维 committed
86
    <div nzAlign="middle" style="border-bottom: 2px solid #DDD;">
87
      <div class="img-box clearfix" style="border-bottom: 1px solid #DDD; padding-bottom: 10px;">
李维's avatar
李维 committed
88 89 90 91 92 93
        <h3>选区</h3>
        <div>
          <h5 style="margin-left: 2.5%;">预览:</h5>
          <div id="canvas-container" style="margin:5px;">
            <div class="preview-box" #wrap style="margin-bottom: 20px">
              <canvas id="canvas" #canvas></canvas>
李维's avatar
李维 committed
94 95
            </div>
          </div>
李维's avatar
李维 committed
96 97 98 99 100 101 102 103 104 105 106 107
          <div style="text-align: center">
            <button nz-button nzType="primary" [nzSize]="'small'" nzShape="round" (click)="saveClick()"
              [disabled]="!hotZoneChanged">
              <i nz-icon type="save"></i>
              Save
            </button>
          </div>
          <h5 style="border-top: 2px solid #ddd;">背景图:</h5>
          <div style="width: 200px;margin: auto;">
            <div class="bg-box">
              <app-upload-image-with-preview [picUrl]="bgItem.url" (imageUploaded)="onBackgroundUploadSuccess($event)">
              </app-upload-image-with-preview>
李维's avatar
李维 committed
108 109
            </div>
          </div>
limingzhe's avatar
limingzhe committed
110
        </div>
111 112
      </div>
    </div>
李维's avatar
李维 committed
113

李维's avatar
李维 committed
114 115 116
    <!-- 选区设置 -->
    <div nzAlign="middle" style="border-bottom: 2px solid #DDD;">
      <div *ngFor="let it of hotZoneArr; let i = index" class="img-box clearfix" style="border-bottom: 1px solid #DDD; padding-bottom: 10px;">
李维's avatar
李维 committed
117 118
        <div style="position: relative; margin-bottom: 5px;">
          <h3>选区-{{ i + 1 }}</h3>
李维's avatar
李维 committed
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
          <nz-form-item>
            <nz-form-control [nzSpan]="8" style="padding: 0 5px;">
              <div style="float: left; margin-right: 10px;">
                音频
              </div>
              <div style="float: left;">
                <app-audio-recorder id="index_audio_1" [audioUrl]="it.audio_url" (audioUploaded)="onAudioUploadSuccess($event, it, null)" > </app-audio-recorder>
              </div>
            </nz-form-control>
            <nz-form-control [nzSpan]="8" style="padding: 0 5px;">
              <div style="float: left; margin-right: 10px;">
                文字
              </div>
              <div style="float: left;">
                <input type="text" nz-input placeholder="" [(ngModel)]="it.text" (blur)="autoSave()" />
              </div>
            </nz-form-control>
            <nz-form-control [nzSpan]="8" style="padding: 0 5px;">
              <button style="float: right; margin-bottom: 5px;" nz-button nzType="danger" (click)="deleteItem($event, i)">
                <i nz-icon nzType="delete" nzTheme="outline"></i>
                删除
              </button>
            </nz-form-control>
          </nz-form-item>
limingzhe's avatar
limingzhe committed
143 144
        </div>
      </div>
李维's avatar
李维 committed
145 146 147 148 149
      <div>
        <button nz-button nzType="dashed" (click)="addBtnClick()" class="img-box clearfix" style="border-bottom: 1px solid #DDD; padding-bottom: 10px;">
          <i nz-icon nzType="plus-circle" nzTheme="outline"></i>
          添加选区
        </button>
limingzhe's avatar
limingzhe committed
150 151
      </div>
    </div>
李维's avatar
李维 committed
152

李维's avatar
李维 committed
153 154 155 156 157 158
    <!-- 题目配置 -->
    <div nzAlign="middle">
      <div class="img-box clearfix" style="border-bottom: 1px solid #DDD; padding-bottom: 10px;">
      <h3>题目配置</h3>
        <div nzAlign="middle" *ngFor="let item of bgItem.questions; let QI = index">
          <div class="img-box clearfix" style="border-bottom: 1px solid #DDD; padding-bottom: 10px; ">
李维's avatar
李维 committed
159
            <div>
李维's avatar
李维 committed
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
              <div style="float: left; margin-right: 10px;">
                <div>No.</div>
                <div style="height: 32px; padding: 5px 10px;">
                  {{QI+1}}
                </div>
              </div>
              <div style="float: left; margin-right: 10px;">
                <div>组合数</div>
                <div style="float: left;">
                  <nz-input-number [(ngModel)]="item.number" [nzMin]="1" [nzMax]="5" [nzStep]="1" (ngModelChange)="handleCombinLength(item)"></nz-input-number>
                </div>
              </div>
              <div style="float: left; margin-left: 10px;">
                <div>组合</div>
                <div>
                  <nz-select *ngFor="let part of item.combin; let i = index" [(ngModel)]="item.combin[i]" style="float: left; margin-right: 5px;" (ngModelChange)="handlePartChange($event, item, i)">
                    <nz-option [nzValue]="-1" [nzLabel]="'L-' + bgItem.wordLeft_text"></nz-option>
                    <nz-option [nzValue]="-2" [nzLabel]="'R-' + bgItem.wordRight_text"></nz-option>
                    <nz-option *ngFor="let hot of hotZoneArr; let j = index;" [nzValue]="j" [nzLabel]="(j + 1) + '-' + hot.text"></nz-option>
                  </nz-select>
                </div>
              </div>
              <div style="float: left; margin-left: 10px;">
                <div>预览</div>
                <div style="background-color: #ccc; height: 32px; padding: 5px 10px;">
                  {{getQuestionWord(item.combin)}}
                </div>
              </div>
              <div style="float: left; margin-left: 20px;">
                <div>发音</div>
                <div>
                  <app-audio-recorder id="index_audio_1" [audioUrl]="item.audio_url" (audioUploaded)="onAudioUploadSuccess($event, item, null)" > </app-audio-recorder>
                </div>
              </div>
              <div style="float: right;">
                <div>题序/删除</div>
                <div>
                  <button style="flex:1; margin-bottom: 5px;" nz-button nzType="dashed" (click)="handleMoveItemUp($event, QI)"
                    [disabled]="QI==0">
                    <i nz-icon nzType="up" nzTheme="outline"></i>
                    上移
                  </button>
                  <button style="flex:1; margin-bottom: 5px;" nz-button nzType="dashed" (click)="handleMoveItemDown($event, QI)"
                    [disabled]="QI==bgItem.questions.length-1">
                    <i nz-icon nzType="down" nzTheme="outline"></i>
                    下移
                  </button>
                  <button style="flex:1; margin-bottom: 5px;" nz-button nzType="danger" (click)="deleteQuestionItem($event, QI)">
                    <i nz-icon nzType="delete" nzTheme="outline"></i>
                    删除
                  </button>
                </div>
              </div>
李维's avatar
李维 committed
213 214 215 216
            </div>
          </div>
        </div>
      </div>
李维's avatar
李维 committed
217 218 219 220 221 222
      <div style="padding-left: 10px; padding-bottom: 10px;">
        <button nz-button nzType="dashed" (click)="addQustion()" [disabled]="bgItem.questions.length==8">
          <i nz-icon nzType="plus-circle" nzTheme="outline"></i>
          添加题目
        </button>
      </div>
李维's avatar
李维 committed
223
    </div>
limingzhe's avatar
limingzhe committed
224
  </div>
李维's avatar
李维 committed
225

226
</div>