Commit d67de88b authored by asdf's avatar asdf

表单:答案开关

parent f972a842
......@@ -85,6 +85,10 @@
<div class="section" style="margin-top: 10px"></div>
<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)">
<span>复制本页</span>
</button>
......
......@@ -31,7 +31,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
contentObj = {
"version": "1.1",
bgm_url: "",
letter:"",
letter: "",
dataArray: []
}
/**
......@@ -39,6 +39,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
* text:'apple',
* shortAudio_url:'',
* image_url:'',
* isRight:false,
* words:[]
* }
*/
......@@ -144,13 +145,17 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.save()
}
onSwitchChange() {
this.save()
}
deleteItem(item, index) {
item.splice(index, 1)
this.save()
}
addItem(item) {
item.push({ text: "",shortAudio_url: '', image_url: "",words:{} })
item.push({ text: "", isRight: false, shortAudio_url: '', image_url: "", words: {} })
this.saveItem();
setTimeout(() => {
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