Commit 10d1ee3d authored by 李维's avatar 李维

Add delete fuc

parent 5607f5d2
...@@ -33,9 +33,8 @@ ...@@ -33,9 +33,8 @@
<div *ngIf="audioUrl && needRemove; then truthyTemplate else falsyTemplate"></div> <div *ngIf="audioUrl && needRemove; then truthyTemplate else falsyTemplate"></div>
<ng-template #truthyTemplate > <ng-template #truthyTemplate >
<div class="btn-delete" (click)="onBtnDeleteAudio()"> <div class="btn-delete" (click)="onBtnDeleteAudio()">
<fa-icon icon="close"></fa-icon> <i nz-icon nzType="delete" nzTheme="outline"></i>
</div> </div>
</ng-template> </ng-template>
......
...@@ -145,11 +145,14 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy { ...@@ -145,11 +145,14 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
// 开始录音 // 开始录音
onBtnRecord = () => { onBtnRecord = () => {
} }
// 切换模式 // 切换模式
onBtnSwitchType() { onBtnSwitchType() {
} }
onBtnClearAudio() { onBtnClearAudio() {
this.audioUrl = null; this.audioUrl = null;
this.audioRemoved.emit(); this.audioRemoved.emit();
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<span>音频</span> <span>音频</span>
</div> </div>
<div style="flex:11"> <div style="flex:11">
<app-audio-recorder [audioUrl]="item.audio_url1" (audioUploaded)="onAudioUploadSuccessByItem($event, item, 'audio_url1')" ></app-audio-recorder> <app-audio-recorder [audioUrl]="item.audio_url1" (audioUploaded)="onAudioUploadSuccessByItem($event, item, 'audio_url1')" :needRemove="true" (audioRemoved)="onAudioDeleteByItem($event, item, 'audio_url1')" ></app-audio-recorder>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -151,6 +151,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -151,6 +151,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.save(); this.save();
} }
onAudioDeleteByItem(e, item, key) {
item[key] = "";
this.save();
}
onAudioUploadSuccessByItem(e, item, key) { onAudioUploadSuccessByItem(e, item, key) {
item[key] = e.url; item[key] = e.url;
this.save(); this.save();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment