Commit a328c39d authored by Tt's avatar Tt

表上传

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