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

Add delete fuc

parent 5607f5d2
......@@ -33,9 +33,8 @@
<div *ngIf="audioUrl && needRemove; then truthyTemplate else falsyTemplate"></div>
<ng-template #truthyTemplate >
<div class="btn-delete" (click)="onBtnDeleteAudio()">
<fa-icon icon="close"></fa-icon>
<i nz-icon nzType="delete" nzTheme="outline"></i>
</div>
</ng-template>
......
......@@ -145,11 +145,14 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
// 开始录音
onBtnRecord = () => {
}
// 切换模式
onBtnSwitchType() {
}
onBtnClearAudio() {
this.audioUrl = null;
this.audioRemoved.emit();
......
......@@ -18,7 +18,7 @@
<span>音频</span>
</div>
<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>
......
......@@ -151,6 +151,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.save();
}
onAudioDeleteByItem(e, item, key) {
item[key] = "";
this.save();
}
onAudioUploadSuccessByItem(e, item, key) {
item[key] = e.url;
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