Commit 1ef70890 authored by Tt's avatar Tt

配置调整

parent 18b2060d
......@@ -93,7 +93,7 @@
</div> -->
</div>
<div class="border-dashed" style="margin: 20px;width: 1000px;">
<!-- <div class="border-dashed" style="margin: 20px;width: 1000px;">
<div style="font-size: 20px;">游戏模式: </div>
<nz-radio-group [(ngModel)]="item.recordFlag" (ngModelChange)="save()">
<label nz-radio [nzValue]="true">
......@@ -104,7 +104,7 @@
</label>
</nz-radio-group>
</div>
</div> -->
<!-- <div class="border-dashed" style="margin: 20px;width: 1000px;">
<div class="word-input-title">
......@@ -135,132 +135,33 @@
<div *ngFor="let question of item.questions; let i = index">
<div style="display: flex;margin-top: 20px;">
<div class="border-solid" style="min-width: 1000px;">
<!-- <div class="word-type-title">
题目{{i+1}}
</div> -->
<!-- <div>
<div class="word-type-option-title" style="margin-top:10px;">题目音频:</div>
<div style="display:flex ;">
<div>
<app-audio-recorder [audioUrl]="question.questionAudio"
(audioUploaded)="onAudioUploadSuccess($event, 'questionAudio',question,'audioName')">
</app-audio-recorder>
</div>
<div style="margin: 5px">
<span>{{ question.audioName}}</span>
</div>
</div>
</div> -->
<!-- <div style="margin-top:20px">
<div class="word-type-option-title">倒计时: </div>
<input type="number" nz-input [(ngModel)]="question.duration" (blur)="save()">
</div> -->
<div class="word-type-option-title" style="margin-top:20px;">
题目内容:
<div class="option-title">
题目{{i+1}}
</div>
<div class="option-content" style="padding: 15px 30px;">
<div style="width: 200px">
<span style="font-size: 20px;">文本</span>
<input type="text" nz-input [(ngModel)]="question.text" (blur)="save()">
</div>
<div *ngFor="let option of question.options; let j = index">
<div style="display: flex;margin-top:20px">
<div class="option-title">
题目{{j+1}}
</div>
<div class="option-content" style="padding: 15px 30px;">
<!-- <div style="margin:-15px -30px;width: calc(100%+60px);height: 40px;padding:10px 20px;" [style]="{
backgroundColor: option.right ?'#169BD5':'#eee'}">
<label nz-checkbox [(ngModel)]="option.right" (ngModelChange)="save()"
[style]="{color: option.right ?'#fff':'#000'}">正确答案</label>
</div> -->
<div style="margin-top: 20px;">
<div class="word-type-option-title">
类型:
</div>
<div style="margin-top: 5px;">
<nz-radio-group [(ngModel)]="option.type" (ngModelChange)="ngChange(i,j)">
<label nz-radio nzValue="img">
<span [style]="{color:option.type=='img' ? '#169BD5':'#000'}">图片</span>
</label>
<label nz-radio nzValue="img_txt">
<span [style]="{color:option.type=='img_txt' ? '#169BD5':'#000'}">图片+文本</span>
</label>
<label nz-radio nzValue="img_audio">
<span [style]="{color:option.type=='img_audio' ? '#169BD5':'#000'}">图片+音频</span>
</label>
<label nz-radio nzValue="img_txt_audio">
<span [style]="{color:option.type=='img_txt_audio' ? '#169BD5':'#000'}">图片+文本+音频</span>
</label>
</nz-radio-group>
</div>
</div>
<div style="margin-top: 25px;">
<div class="option-img">
<div style="width: 200px;">
<span style="font-size: 20px;">图片:</span>
<app-upload-image-with-preview [picUrl]="option.image"
(imageUploaded)="onImageUploadSuccess($event, 'image',option)">
</app-upload-image-with-preview>
</div>
</div>
<div class="option-text">
<div *ngIf="option.type=='img_txt'|| option.type=='img_txt_audio' " style="width: 200px">
<span style="font-size: 20px;">文本</span>
<input type="text" nz-input [(ngModel)]="option.text" (blur)="save()">
</div>
</div>
<div class="option-audio" *ngIf="option.type=='img_audio' || option.type=='img_txt_audio'">
<span style="font-size: 20px;">选项音频:</span>
<div style="display: flex">
<div>
<app-audio-recorder [audioUrl]="option.audio"
(audioUploaded)="onAudioUploadSuccess($event,'audio',option,'audioName')">
</app-audio-recorder>
</div>
<div style="margin: 5px">
<span>
{{ option.audioName}}
</span>
</div>
</div>
</div>
<div class="option-time" *ngIf="item.recordFlag==true">
<div class="word-type-option-title">录音倒计时: </div>
<input type="number" nz-input [(ngModel)]="option.duration" (blur)="save()">
<span style="font-size: 20px;">录音文本</span>
<input type="text" nz-input [(ngModel)]="option.content" (blur)="save()">
</div>
</div>
</div>
<div class="option-btns">
<button class="btn-red" nz-button nzType="default" nzDanger (click)="removeoption(i,j)">删除题目</button>
<button class="btn-blue" style="margin-top: 10px;" nz-button nzType="default" nzDanger
(click)="copyOption(i,j)">复制题目</button>
</div>
<div style="width: 200px">
<span style="font-size: 20px;">录音时长</span>
<input type="number" nz-input [(ngModel)]="question.time" (blur)="save()">
</div>
</div>
<div style="margin-left: 69px;margin-top: 15px;">
<button class="btn-blue" nz-button nzType="default" nzDanger (click)="addoption(i)">+增加题目</button>
</div>
</div>
<div style="margin:0 20px">
<!-- <button class="btn-red" nz-button nzType="default" nzDanger (click)="removequestion(i)">删除题目</button> -->
<button class="btn-red" nz-button nzType="default" nzDanger (click)="removequestion(i)">删除题目</button>
</div>
</div>
</div>
<!-- <button class="btn-blue" style="margin-top:10px;width: 1000px; height: 50px;" nz-button nzType="default" nzDanger
(click)="addquestion()">+增加题目</button> -->
<button class="btn-blue" style="margin-top:10px;width: 1000px; height: 50px;" nz-button nzType="default" nzDanger
(click)="addquestion()">+增加题目</button>
</div>
......
......@@ -9,7 +9,7 @@ import { MetaFormCreator } from './mataFormCreator';
})
export class FormComponent extends ComponentBase implements OnInit, OnChanges, OnDestroy {
// 储存数据用
saveKey = "hy01_danci";
saveKey = "hy17_hds";
item = {
recordFlag: false,
......@@ -17,9 +17,8 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
questionText: "",
questionTextAudio: "",
questions: [{
questionAudio: "",
duration: 120,
options: []
text: "",
time: 10
}],
bgAudio: "",
bgAudioName: "",
......@@ -47,30 +46,6 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
console.log(new MetaFormCreator().create());
}
removeoption(i, j) {
this.openDelete("确定删除选项?", () => {
this.item.questions[i].options.splice(j, 1);
this.save();
})
}
copyOption(i, j) {
let data = this.item.questions[i].options[j];
this.item.questions[i].options.push(JSON.parse(JSON.stringify(data)));
this.save();
}
addoption(i) {
this.item.questions[i].options.push({
type: "",
image: "",
audio: "",
text: "",
duration: '',
content: '',
right: false
});
this.save();
}
removequestion(i) {
this.openDelete("确定删除题目?", () => {
......@@ -81,9 +56,8 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
addquestion() {
this.item.questions.push({
questionAudio: "",
duration: 120,
options: []
text: "",
time: 10,
});
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