From 8e90549e0be0535c048089400dd42828bfd18881 Mon Sep 17 00:00:00 2001 From: liujiangnan <695541723@qq.com> Date: Sun, 29 Mar 2020 11:57:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=84=9A=E6=89=8B=E6=9E=B6=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/form/form.component.html | 316 +------------------------------ src/app/form/form.component.ts | 6 +- 2 files changed, 6 insertions(+), 316 deletions(-) diff --git a/src/app/form/form.component.html b/src/app/form/form.component.html index a862d49..a51aa6b 100644 --- a/src/app/form/form.component.html +++ b/src/app/form/form.component.html @@ -19,319 +19,7 @@ <app-upload-video></app-upload-video> <app-lesson-title-config></app-lesson-title-config> </div> - - - - <!-- div style="position: absolute; left: 1000px; top: 100px; width: 300px;"> - - <input type="text" nz-input [(ngModel)]="item.text_2" (blur)="save()"> - - <app-upload-image-with-preview - [picUrl]="item.pic_url_2" - (imageUploaded)="onImageUploadSuccess($event, 'pic_url_2')" - ></app-upload-image-with-preview> - - <app-audio-recorder - [audioUrl]="item.audio_url_2" - (audioUploaded)="onAudioUploadSuccess($event, 'audio_url_2')" - ></app-audio-recorder> - - </div --> - - - - + </div> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<!--<app-audio-recorder--> - <!--[audioUrl]="item.audio_url"--> - <!--(audioUploaded)="onAudioUploadSuccess($event)"--> -<!--></app-audio-recorder>--> - - <!--<div *ngFor="let it of picArr; let i = index"--> - <!--nz-col nzSpan="8" >--> - - - - <!--<div class="item-box">--> - - - <!--<app-upload-image-with-preview--> - <!--style="width: 100%"--> - <!--[picUrl]="it.pic_url"--> - <!--(imageUploaded)="onImageUploadSuccessByItem($event, it)"--> - <!--></app-upload-image-with-preview>--> - - - - <!--<div style="display: flex; justify-items: center; padding-top: 10px">--> - <!--<app-audio-recorder--> - <!--[audioUrl]="it.audio_url"--> - <!--(audioUploaded)="onAudioUploadSuccessByItem($event, it)">--> - <!--</app-audio-recorder>--> - - <!--<button style="margin-left: 10px;" nz-button nzType="danger" (click)="deleteItem(it)">--> - <!--<i nz-icon type="close"></i>--> - <!--</button>--> - <!--</div>--> - - <!--</div>--> - - <!--<!–<h5> id-{{i+1}} </h5>–>--> - - <!--<!–<div style="display: flex; align-items: center; justify-content: center; padding-bottom: 5px">–>--> - <!--<!–<input type="text" nz-input placeholder="" [(ngModel)]="it.text" (blur)="saveItem()">–>--> - <!--<!–<button style="margin-left: 10px;" nz-button nzType="danger" (click)="deleteItem(it)">–>--> - <!--<!–<i nz-icon type="close"></i>–>--> - <!--<!–</button>–>--> - <!--<!–</div>–>--> - - - <!--<!–<app-upload-image-with-preview–>--> - <!--<!–style="width: 100%"–>--> - <!--<!–[picUrl]="it.pic_url"–>--> - <!--<!–(imageUploaded)="onImageUploadSuccessByItem($event, it)"–>--> - <!--<!–></app-upload-image-with-preview>–>--> - - - <!--<!–<div style="display: flex; align-items: center; justify-content: center">–>--> - - <!--<!–<span style="width: 80px;">–>--> - <!--<!–question:–>--> - <!--<!–</span>–>--> - <!--<!–<app-audio-recorder–>--> - <!--<!–[audioUrl]="it['q_audio_url']"–>--> - <!--<!–(audioUploaded)="onAudioUploadSuccessByItem($event, it, 'q')">–>--> - <!--<!–</app-audio-recorder>–>--> - - <!--<!–</div>–>--> - - <!--<!–<div style="display: flex; align-items: center; justify-content: center">–>--> - - <!--<!–<span style="width: 80px;">–>--> - <!--<!–answer:–>--> - <!--<!–</span>–>--> - <!--<!–<app-audio-recorder–>--> - <!--<!–[audioUrl]="it['a_audio_url']"–>--> - <!--<!–(audioUploaded)="onAudioUploadSuccessByItem($event, it, 'a')">–>--> - <!--<!–</app-audio-recorder>–>--> - - <!--<!–</div>–>--> - - - - <!--<!–<nz-radio-group [(ngModel)]="it.radioValue" >–>--> - <!--<!–<label nz-radio nzValue="A" (click)="radioClick(it, 'A')"> <i nz-icon nzType="check" nzTheme="outline"></i> </label>–>--> - <!--<!–<label nz-radio nzValue="B" (click)="radioClick(it, 'B')"> <i nz-icon nzType="close" nzTheme="outline"></i> </label>–>--> - <!--<!–</nz-radio-group>–>--> - - - <!--</div>--> - - - - <!--<div nz-col nzSpan="8" class="add-btn-box" >--> - - <!--<!–<div style="width: 100%; height: 100%;">–>--> - <!--<button style=" margin: auto; width: 60%; height: 60%;" nz-button nzType="dashed" class="add-btn"--> - <!--(click)="addPic()">--> - <!--<i nz-icon nzType="plus-circle" nzTheme="outline"></i>--> - <!--Add--> - <!--</button>--> - <!--<!–</div>–>--> - - - - <!--</div>--> - - - - - - - - - - - <!--<!–<div style="padding-bottom: 30px;">–>--> - - <!--<!–<h5> title-sound: </h5>–>--> - <!--<!–<app-audio-recorder–>--> - <!--<!–[audioUrl]="item.contentObj.title_audio_url"–>--> - <!--<!–(audioUploaded)="onAudioUploadSuccessByItem($event, item.contentObj, 'title')">–>--> - <!--<!–</app-audio-recorder>–>--> - - <!--<!–</div>–>--> - - - <!--<!–<div style="padding-bottom: 30px;">–>--> - - <!--<!–<h5> bg-sound: </h5>–>--> - <!--<!–<app-audio-recorder–>--> - <!--<!–[audioUrl]="item.contentObj.bg_audio_url"–>--> - <!--<!–(audioUploaded)="onAudioUploadSuccessByItem($event, item.contentObj, 'bg')">–>--> - <!--<!–</app-audio-recorder>–>--> - - <!--<!–</div>–>--> - - <!--<!–<span style="margin-bottom: 20px"> 10 : 23 </span>–>--> - - <!--<!–<div *ngFor="let it of picArr; let i = index">–>--> - - - <!--<!–<span> pic-{{i + 1}}: </span>–>--> - <!--<!–<div style="display: flex; align-items: center; padding-bottom: 20px">–>--> - - <!--<!–<div style="width: 40%; padding-right: 20px">–>--> - <!--<!–<app-upload-image-with-preview–>--> - <!--<!–[picUrl]="it.pic_url"–>--> - <!--<!–(imageUploaded)="onImageUploadSuccessByItem($event, it)"–>--> - <!--<!–></app-upload-image-with-preview>–>--> - <!--<!–</div>–>--> - - <!--<!–<div class="pic-sound-box">–>--> - - <!--<!–<div nz-row style="width: 50%; padding-bottom: 20px;">–>--> - - <!--<!–<div *ngFor="let it2 of it.soundArr; let i2 = index" nz-col nzSpan="8">–>--> - <!--<!–<label nz-checkbox nzValue="{{'answer_' + (i2 + 1)}}" [(ngModel)]="it2.answer" (ngModelChange)="clickCheckBox()" >{{i2 + 1}}</label>–>--> - <!--<!–</div>–>--> - - <!--<!–</div>–>--> - - <!--<!–<div *ngFor="let it2 of it.soundArr; let i2 = index" style="display: flex; align-items: center; padding-bottom: 5px">–>--> - <!--<!–<span style="padding-right: 10px">sound-{{i2 + 1}}:</span>–>--> - <!--<!–<app-audio-recorder–>--> - <!--<!–[audioUrl]="it2.audio_url"–>--> - <!--<!–(audioUploaded)="onAudioUploadSuccessByItem($event, it2)">–>--> - <!--<!–</app-audio-recorder>–>--> - <!--<!–</div>–>--> - - <!--<!–</div>–>--> - - - <!--<!–</div>–>--> - - <!--<!–</div>–>--> - - - - <!--<!–<div style="margin: auto; width: 95%;" nz-row nzType="flex" nzJustify="start" nzAlign="middle">–>--> - - - <!--<!–<div *ngFor="let it of picArr; let i = index"–>--> - <!--<!–nz-col nzSpan="8" >–>--> - - <!--<!–<div class="item-box">–>--> - - - <!--<!–<h5> id-{{i+1}} </h5>–>--> - - <!--<!–<div style="display: flex; align-items: center; justify-content: center; padding-bottom: 5px">–>--> - <!--<!–<input type="text" nz-input placeholder="" [(ngModel)]="it.text" (blur)="saveItem()">–>--> - <!--<!–<button style="margin-left: 10px;" nz-button nzType="danger" (click)="deleteItem(it)">–>--> - <!--<!–<i nz-icon type="close"></i>–>--> - <!--<!–</button>–>--> - <!--<!–</div>–>--> - - - <!--<!–<app-upload-image-with-preview–>--> - <!--<!–style="width: 100%"–>--> - <!--<!–[picUrl]="it.pic_url"–>--> - <!--<!–(imageUploaded)="onImageUploadSuccessByItem($event, it)"–>--> - <!--<!–></app-upload-image-with-preview>–>--> - - - <!--<!–<div style="display: flex; align-items: center; justify-content: center">–>--> - - <!--<!–<span style="width: 80px;">–>--> - <!--<!–question:–>--> - <!--<!–</span>–>--> - <!--<!–<app-audio-recorder–>--> - <!--<!–[audioUrl]="it['q_audio_url']"–>--> - <!--<!–(audioUploaded)="onAudioUploadSuccessByItem($event, it, 'q')">–>--> - <!--<!–</app-audio-recorder>–>--> - - <!--<!–</div>–>--> - - <!--<!–<div style="display: flex; align-items: center; justify-content: center">–>--> - - <!--<!–<span style="width: 80px;">–>--> - <!--<!–answer:–>--> - <!--<!–</span>–>--> - <!--<!–<app-audio-recorder–>--> - <!--<!–[audioUrl]="it['a_audio_url']"–>--> - <!--<!–(audioUploaded)="onAudioUploadSuccessByItem($event, it, 'a')">–>--> - <!--<!–</app-audio-recorder>–>--> - - <!--<!–</div>–>--> - - - - <!--<!–<nz-radio-group [(ngModel)]="it.radioValue" >–>--> - <!--<!–<label nz-radio nzValue="A" (click)="radioClick(it, 'A')"> <i nz-icon nzType="check" nzTheme="outline"></i> </label>–>--> - <!--<!–<label nz-radio nzValue="B" (click)="radioClick(it, 'B')"> <i nz-icon nzType="close" nzTheme="outline"></i> </label>–>--> - <!--<!–</nz-radio-group>–>--> - - - <!--<!–</div>–>--> - - - - - <!--<!–</div>–>--> - - - - - - -<!--</div>--> + \ No newline at end of file diff --git a/src/app/form/form.component.ts b/src/app/form/form.component.ts index c4f6d3d..8bf084e 100644 --- a/src/app/form/form.component.ts +++ b/src/app/form/form.component.ts @@ -1,4 +1,4 @@ -import {Component, EventEmitter, Input, OnDestroy, OnChanges, OnInit, Output, ApplicationRef} from '@angular/core'; +import {Component, EventEmitter, Input, OnDestroy, OnChanges, OnInit, Output, ApplicationRef, ChangeDetectorRef} from '@angular/core'; @@ -15,7 +15,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { item; - constructor(private appRef: ApplicationRef) { + constructor(private appRef: ApplicationRef,private changeDetectorRef: ChangeDetectorRef) { } @@ -32,6 +32,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { } this.init(); + this.changeDetectorRef.markForCheck(); + this.changeDetectorRef.detectChanges(); this.refresh(); }, this.saveKey); -- 2.21.0