Commit d67de88b authored by asdf's avatar asdf

表单:答案开关

parent f972a842
...@@ -85,6 +85,10 @@ ...@@ -85,6 +85,10 @@
<div class="section" style="margin-top: 10px"></div> <div class="section" style="margin-top: 10px"></div>
<div style="text-align: right; padding-right: 10px;padding-top: 0;"> <div style="text-align: right; padding-right: 10px;padding-top: 0;">
<span style="margin-bottom: 10px;margin-right: 20px;">是否是正确答案? : </span>
<nz-switch style="margin-bottom: 10px;margin-right: 200px;" [(ngModel)]="item.isRight"
(ngModelChange)="onSwitchChange()"></nz-switch>
<button style="margin-right: 20px;" nz-button nzType="primary" (click)="onCopyData(i)"> <button style="margin-right: 20px;" nz-button nzType="primary" (click)="onCopyData(i)">
<span>复制本页</span> <span>复制本页</span>
</button> </button>
......
...@@ -31,7 +31,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -31,7 +31,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
contentObj = { contentObj = {
"version": "1.1", "version": "1.1",
bgm_url: "", bgm_url: "",
letter:"", letter: "",
dataArray: [] dataArray: []
} }
/** /**
...@@ -39,6 +39,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -39,6 +39,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
* text:'apple', * text:'apple',
* shortAudio_url:'', * shortAudio_url:'',
* image_url:'', * image_url:'',
* isRight:false,
* words:[] * words:[]
* } * }
*/ */
...@@ -144,13 +145,17 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -144,13 +145,17 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.save() this.save()
} }
onSwitchChange() {
this.save()
}
deleteItem(item, index) { deleteItem(item, index) {
item.splice(index, 1) item.splice(index, 1)
this.save() this.save()
} }
addItem(item) { addItem(item) {
item.push({ text: "",shortAudio_url: '', image_url: "",words:{} }) item.push({ text: "", isRight: false, shortAudio_url: '', image_url: "", words: {} })
this.saveItem(); this.saveItem();
setTimeout(() => { setTimeout(() => {
window.scrollTo(0, document.body.scrollHeight); window.scrollTo(0, document.body.scrollHeight);
......
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