Commit d588e12a authored by Tt's avatar Tt

表单修改

parent b719705e
......@@ -77,7 +77,7 @@
<div style="display: flex;margin-top: 20px;"><!-- 左右布局 开始 -->
<div class="border-solid" style="min-width: 1000px;"><!-- 内容框体 开始 -->
<div class="word-type-title">
单页{{i+1}}
题目{{i+1}}
</div>
<!-- <div class="option-audio">
......@@ -107,8 +107,16 @@
</div> -->
<div style="margin-top: 20px;width: 1200px;">
<app-custom-hot-zone [bgItem]="question.bgItem" [hotZoneItemArr]="question.hotZoneItemArr"
[customTypeGroupArr]="customTypeGroupArr" (save)="saveHotZone(question, $event)">
<div style="font-size: 30px;">左侧页</div>
<app-custom-hot-zone [bgItem]="question.leftPage.bgItem" [hotZoneItemArr]="question.leftPage.hotZoneItemArr"
[customTypeGroupArr]="customTypeGroupArr" (save)="saveHotZone(question.leftPage, $event)">
</app-custom-hot-zone>
</div>
<div style="margin-top: 20px;width: 1200px;">
<div style="font-size: 30px;">右侧页</div>
<app-custom-hot-zone [bgItem]="question.rightPage.bgItem"
[hotZoneItemArr]="question.rightPage.hotZoneItemArr" [customTypeGroupArr]="customTypeGroupArr"
(save)="saveHotZone(question.rightPage, $event)">
</app-custom-hot-zone>
</div>
......
......@@ -10,7 +10,7 @@ import { NzMessageService } from 'ng-zorro-antd';
})
export class FormComponent extends ComponentBase implements OnInit, OnChanges, OnDestroy {
// 储存数据用
saveKey = "dg04_dyxx";
saveKey = "dg_book_voice_1001";
/*
整体配置部分解析
......@@ -23,7 +23,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
2.横版 每一个页面 两页内容 测评多个内容 冲突点,单词卡是跟着什么在走, 每两页显示一组 还是 每页都一组
*/
*/
customTypeGroupArr = [
......@@ -35,24 +35,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
]
item = {
imgAni: {
ske: {},
tex: {},
png: {}
},
tipSwitch: 1,//提示功能开关
startAudio: "",
audioName: "",
title: "听音选择",
questions: [],
// bgItem: '',
// hotZoneItemArr: [],
// questionText: "",
};
constructor(public nzMessageService: NzMessageService, public appRef: ApplicationRef, public changeDetectorRef: ChangeDetectorRef) {
......@@ -81,19 +64,19 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
}
}
removeoption(i, j) {
removeOption(i, j) {
this.openDelete("确定删除选项?", () => {
this.item.questions[i].options.splice(j, 1);
this.save();
})
}
copyoption(i, j) {
copyOption(i, j) {
let data = this.item.questions[i].options[j];
this.item.questions[i].options.push(JSON.parse(JSON.stringify(data)));
this.save();
}
addoption(i) {
addOption(i) {
this.item.questions[i].options.push({
type: "img",
image: "",
......@@ -124,40 +107,40 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
}
addQuestion() {
this.item.questions.push({
// options: [],
bgItem: "",
hotZoneItemArr: [],
text: "",
audio:"",
audioName:""
leftPage: {
bgItem: "",
hotZoneItemArr: [],
},
rightPage: {
bgItem: "",
hotZoneItemArr: [],
},
options: [],
});
// while (this.item.questions[0].options.length < 3) {
// this.addoption(0);
// }
this.save();
}
ngChange(i, j) {
this.save();
}
saveHotZone(group, e) {
saveHotZone(question, e) {
console.log('e: ', e);
const { bgItem, hotZoneItemArr } = e;
group.bgItem = bgItem;
group.hotZoneItemArr = hotZoneItemArr;
question.bgItem = bgItem;
question.hotZoneItemArr = hotZoneItemArr;
this.nzMessageService.success('保存成功');
this.save();
}
onDragonBoneSave(e, item) {
console.log(e);
this.save();
}
dataSave() {
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