Commit bc5295c6 authored by LikG21's avatar LikG21

游戏配置更换

parent b1dd2c8f
This diff is collapsed.
......@@ -9,7 +9,7 @@ import { MetaFormCreator } from './mataFormCreator';
})
export class FormComponent extends ComponentBase implements OnInit, OnChanges, OnDestroy {
// 储存数据用
saveKey = "hy_06";
saveKey = "hy_08";
item = {
onlineFlg: false,
......@@ -21,6 +21,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
bgAudioName: "",
audioName: ""
};
isVisible = false;
deleteTitle = "是否删除题目";
deleteCallback = function () { };
......@@ -39,35 +40,29 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
init(): void {
/* console.log(new MetaFormCreator().create()); */
console.log(new MetaFormCreator().create());
}
removeoption(i, j) {
if ((this.item.questions[i].optionsType == "img" || this.item.questions[i].optionsType == "shortTxt") && this.item.questions[i].letterList.length > 2) {
this.openDelete("确定减少选项?", () => {
this.item.questions[i].letterList.splice(j, 2);
this.save();
})
} else {
this.openDelete("确定减少选项?", () => {
this.item.questions[i].letterList.splice(j, 1);
this.openDelete("确定删除选项?", () => {
this.item.questions[i].options.splice(j, 1);
this.save();
})
}
}
copyOption(i, j) {
let data = this.item.questions[i].letterList[j];
this.item.questions[i].letterList.push(JSON.parse(JSON.stringify(data)));
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].letterList.push({
answer: '',
this.item.questions[i].options.push({
type: "",
image: "",
shortText: "",
longText: "",
})
audio: "",
text: "",
right: false
});
this.save();
}
......@@ -80,32 +75,19 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
addquestion() {
this.item.questions.push({
optionsType: "img",
questionAudio: "",
duration: 120,
type: "img",
image: "",
index: '',
audio: "",
text: "",
right: false,
letterList: [],
options: []
});
this.save();
}
deleteBgAudio() {
this.item.bgAudio = "";
this.item.bgAudioName = "";
this.save();
}
button1() {
console.log(this.item, '456')
}
ngChange(i) {
for (let a = 0; a < this.item.questions[i].letterList.length; a++) {
this.item.questions[i].letterList[a].answer = false
}
this.item.questions[i].letterList[this.item.questions[i].index].answer = true
ngChange(i, j) {
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