Commit a328c39d authored by Tt's avatar Tt

表上传

parent 07b64184
This diff is collapsed.
......@@ -9,23 +9,18 @@ import { MetaFormCreator } from './mataFormCreator';
})
export class FormComponent extends ComponentBase implements OnInit, OnChanges, OnDestroy {
// 储存数据用
saveKey = "hy01_danci";
saveKey = "hy_04";
item = {
recordFlag: false,
onlineFlg: false,
title: "",
questionText: "",
questionTextAudio: "",
questions: [{
questionAudio: "",
duration: 120,
options: []
}],
questions: [],
bgAudio: "",
bgAudioName: "",
audioName: ""
};
isVisible = false;
deleteTitle = "是否删除题目";
deleteCallback = function () { };
......@@ -44,31 +39,25 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
init(): void {
console.log(new MetaFormCreator().create());
/* console.log(new MetaFormCreator().create()); */
}
removeoption(i, j) {
this.openDelete("确定删除选项?", () => {
this.item.questions[i].options.splice(j, 1);
this.openDelete("确定减少选项?", () => {
this.item.questions[i].letterList.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)));
let data = this.item.questions[i].letterList[j];
this.item.questions[i].letterList.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.item.questions[i].letterList.push({
text: ''
})
this.save();
}
......@@ -83,7 +72,12 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
this.item.questions.push({
questionAudio: "",
duration: 120,
options: []
type: "img",
image: "",
audio: "",
text: "",
right: false,
letterList: [],
});
this.save();
}
......@@ -93,7 +87,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
this.item.bgAudioName = "";
this.save();
}
ngChange(i, j) {
ngChange(i) {
this.save();
}
}
\ No newline at end of file
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