Commit d588e12a authored by Tt's avatar Tt

表单修改

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