Commit 8de8c5be authored by limingzhe's avatar limingzhe

fix: debug

parent 5641de1e
No preview for this file type
...@@ -83,141 +83,54 @@ ...@@ -83,141 +83,54 @@
</div> </div>
<!-- <div style="margin-top: 5px; display: flex; align-items: center; ">
<span style="">文本:</span>
<input type="text" nz-input [(ngModel)]="ques.text" (blur)="save()" style=" width: 200px;">
</div>
<div style="margin-top: 10px; display: flex; align-items: center;">
<span style="">音频:</span>
<app-audio-recorder [audioUrl]="ques.audio_url"
(audioUploaded)="onItemAudioUploadSuccess($event, ques, 'audio_url')">
</app-audio-recorder>
</div>
<div style="margin-top: 10px; display: flex; ">
<span style="">图片:</span>
<div style="width: 300px;">
<app-upload-image-with-preview [picUrl]="ques.pic_url"
(imageUploaded)="onItemImgUploadSuccess($event, ques, 'pic_url')">
</app-upload-image-with-preview>
</div>
<button *ngIf="ques.pic_url" style="float: right;" nz-button nzType="" (click)="onDeletaImg(ques, 'pic_url')">
x
</button>
</div>
<div style="margin-top: 10px; display: flex; ">
<span style="">视频:</span>
<div style="width: 300px;">
<app-upload-video [videoUrl]="ques.video_url"
(videoUploaded)="onVideoUploadSuccess($event, ques, 'video_url')">
</app-upload-video>
</div>
<button *ngIf="ques.video_url" style="float: right;" nz-button nzType="" (click)="onDeletaImg(ques, 'video_url')">
x
</button>
</div> -->
</div> </div>
<!-- <div style="margin-top:10px; border: 1px #ccc solid; border-radius: 15px; padding: 15px; background-color: rgb(248, 255, 245);"> </div>
<h3>设置选项:</h3>
<div style="margin: 10px;">
<div style="display: flex; align-items: center; justify-content:flex-start;">
<span style="margin-right: 20px;">选项类型:</span>
<label style="" nz-checkbox [(ngModel)]="ques.optionTypeText" (ngModelChange)="checkboxChange($event, ques, 'optionTypeText')">文本</label>
<label style="" nz-checkbox [(ngModel)]="ques.optionTypeAudio" (ngModelChange)="checkboxChange($event, ques, 'optionTypeAudio')">音频</label>
<label style="" nz-checkbox [(ngModel)]="ques.optionTypePic" (ngModelChange)="checkboxChange($event, ques, 'optionTypePic')">图片</label>
</div>
</div>
<div *ngFor="let option of ques.optionArr; let j = index" <div style="padding: 30px;">
style="border: 1px #ccc solid; border-radius: 15px; width: 100%; padding: 30px; "> <button nz-button nzType="dashed" (click)="addOnePageBtnClick()" style="width: 200px; height: 100px;">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>
<div style="display: flex; align-items: center; justify-content: space-between;"> 添加拖拽项
<div style="display: flex; align-items: center;"> </button>
<h4>设置选项-{{j+1}}:</h4> </div>
<div align="center" style="display: flex; align-items: center; justify-content: center;margin-top: -7px;"> </div>
<nz-radio-group [ngModel]="option.answer" (ngModelChange)="radioChange($event, option, 'answer')">
<div style="display: flex; flex-wrap: wrap; width: 100%;">
<label style="margin-left: 5px;" nz-radio [nzValue]="'isRight'">{{'正确'}}</label>
<label style="margin-left: 5px;" nz-radio [nzValue]="'isWrong'">{{'错误'}}</label>
</div>
</nz-radio-group>
</div>
</div>
<button style="float:right" nz-button nzType="danger" (click)="deleteOptionBtnClick(ques.optionArr, j)">
x
</button>
</div>
<div *ngIf="ques.optionTypeText" style="margin-top: 5px; display: flex; align-items: center; ">
<span style="">文本:</span>
<input type="text" nz-input [(ngModel)]="option.text" (blur)="save()" style=" width: 200px;">
</div>
<div *ngIf="ques.optionTypeAudio" style="margin-top: 10px; display: flex; align-items: center;">
<span style="">音频:</span>
<app-audio-recorder [audioUrl]="option.audio_url"
(audioUploaded)="onItemAudioUploadSuccess($event, option, 'audio_url')">
</app-audio-recorder>
</div>
<div *ngIf="ques.optionTypePic" style="margin-top: 10px; display: flex; ">
<span style="">图片:</span>
<div style="width: 300px;">
<app-upload-image-with-preview [picUrl]="option.pic_url"
(imageUploaded)="onItemImgUploadSuccess($event, option, 'pic_url')">
</app-upload-image-with-preview>
</div>
<button *ngIf="option.pic_url" style="float: right;" nz-button nzType="" (click)="onDeletaImg(option, 'pic_url')">
x
</button>
</div>
</div>
</div> --> <div style="border: 2px #ccc solid; border-radius: 15px; width: 1000px; margin: 30px">
<div *ngFor="let wrongData of item.wrongArr; let i = index"
style="border: 1px #ccc solid; border-radius: 15px; width: 950px; padding: 30px; margin: 30px;">
<!-- <div style="margin-top: 30px"> <div style="display: flex; align-items: center; justify-content: space-between;">
<button nz-button nzType="dashed" (click)="addOneOption(ques)" style="width: 150px; height: 50px;"> <h2>干扰项-{{i+1}}:</h2>
<i nz-icon nzType="plus-circle" nzTheme="outline"></i> <button style="float: right; margin-right: 0px;" nz-button nzType="danger" (click)="deleteWrongBtnClick(i)">
添加选项 删除
</button> </button>
</div> --> </div>
<div style="border: 1px #ccc solid; border-radius: 15px; padding: 15px; background-color: rgb(255, 250, 243);">
<div>
<div style="margin-top: 5px; display: flex; align-items: center; ">
<span style="">文本:</span>
<input type="text" nz-input [(ngModel)]="wrongData.text" (blur)="save()" style=" width: 300px;">
</div>
</div>
</div>
</div> </div>
<div style="padding: 30px;"> <div style="padding: 30px;">
<button nz-button nzType="dashed" (click)="addOnePageBtnClick()" style="width: 200px; height: 100px;"> <button nz-button nzType="dashed" (click)="addOneWrongBtnClick()" style="width: 200px; height: 100px;">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i> <i nz-icon nzType="plus-circle" nzTheme="outline"></i>
添加拖拽 添加干扰
</button> </button>
</div> </div>
...@@ -227,5 +140,4 @@ ...@@ -227,5 +140,4 @@
</div> </div>
\ No newline at end of file
...@@ -800,6 +800,18 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -800,6 +800,18 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.save(); this.save();
} }
addOneWrongBtnClick() {
if (!this.item.wrongArr) {
this.item.wrongArr = [];
}
this.item.wrongArr.push(
{}
);
this.save();
}
addOneOption(ques) { addOneOption(ques) {
if (!ques.optionArr) { if (!ques.optionArr) {
ques.optionArr = []; ques.optionArr = [];
...@@ -824,6 +836,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -824,6 +836,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.save(); this.save();
} }
deleteWrongBtnClick(i) {
this.item.wrongArr.splice(i, 1);
this.save();
}
checkboxChange(e, it, key) { checkboxChange(e, it, key) {
console.log('e: ', e); console.log('e: ', e);
......
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