Commit 7cd01494 authored by limingzhe's avatar limingzhe

fix: 表单修改

parent ec8f0cf6
...@@ -16,19 +16,6 @@ export class FormGroupComponent implements OnDestroy, OnChanges { ...@@ -16,19 +16,6 @@ export class FormGroupComponent implements OnDestroy, OnChanges {
@Input() @Input()
isChildren = false; isChildren = false;
uploading = false;
progress = 0;
@Input()
btnName = '配置龙骨动画';
@Input()
animaNames = [];
@Input()
skeJsonData = {};
@Input()
texJsonData = {};
@Input()
texPngData = {};
@Output() @Output()
save = new EventEmitter(); save = new EventEmitter();
...@@ -46,11 +33,7 @@ export class FormGroupComponent implements OnDestroy, OnChanges { ...@@ -46,11 +33,7 @@ export class FormGroupComponent implements OnDestroy, OnChanges {
uploadUrl; uploadUrl;
uploadData; uploadData;
animaPanelVisible = false;
isSkeJsonLoading = false;
isTexJsonLoading = false;
isTexPngLoading = false;
constructor(private appRef: ApplicationRef, private nzMessageService: NzMessageService) { constructor(private appRef: ApplicationRef, private nzMessageService: NzMessageService) {
......
...@@ -91,12 +91,27 @@ ...@@ -91,12 +91,27 @@
<div style="margin-bottom: 10px;">
<h1>整体设置:</h1>
<app-form-group
[group_arr]="item.global_setting || []"
(uploadDirector)="uploadDirectorFinishGlobal($event)"
(save)="saveFormGroupGlobal($event)"
>
</app-form-group>
</div>
<div style="margin-top: 50px;">
<h1>内容数据:</h1>
<app-form-group <app-form-group
[group_arr]="item.group_arr || []" [group_arr]="item.group_arr || []"
(uploadDirector)="uploadDirectorFinish($event)" (uploadDirector)="uploadDirectorFinish($event)"
(save)="saveFormGroup($event)" (save)="saveFormGroup($event)"
> >
</app-form-group> </app-form-group>
</div>
<!-- <div style="margin-top: 30px;"> <!-- <div style="margin-top: 30px;">
<button nz-button nzType="dashed" (click)="addGroupBtnClick()" <button nz-button nzType="dashed" (click)="addGroupBtnClick()"
......
...@@ -36,21 +36,33 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni ...@@ -36,21 +36,33 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
uploadData = {}; uploadData = {};
bytes = 1024; bytes = 1024;
root_group_arr = [];
myContent = ` myContent = `
注释: 注释:
(最多可添加两个大组) 整体设置:
文本-1: 第一组大标题 (只添加一个大组)
图片-1: 第一组大图 文本-1: 结束按钮文本
音频-1: 开始引导音频
音频-2: 结束引导音频
内容数据:
(有几道题添加几个大组)
组-1:第一题
文本-1: 第一组中间泡泡的文字
图片-1: 第一组中间泡泡的图片
子项组-1: 所有的小泡泡集合 子项组-1: 左右瓶子的图片和文字 (可能只有一个瓶子)
-> 文本-1: 第一个小泡泡文本 -> 文本-1: 左边瓶子文本
-> 图片-1: 第一个小泡泡图片 -> 图片-1: 左边瓶子图片
-> 文本-2: 第二个小泡泡文本 -> 文本-2: 右边瓶子文本
-> 图片-2: 第二个小泡泡图片 -> 图片-2: 右边瓶子图片
... (以此类推) ... (以此类推)
` `
constructor(private appRef: ApplicationRef, private changeDetectorRef: ChangeDetectorRef) { constructor(private appRef: ApplicationRef, private changeDetectorRef: ChangeDetectorRef) {
...@@ -109,6 +121,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni ...@@ -109,6 +121,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
this.item.group_arr = []; this.item.group_arr = [];
} }
if (!this.item.global_setting) {
this.item.global_setting = [];
}
} }
...@@ -165,6 +180,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni ...@@ -165,6 +180,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
} }
async uploadDirectorFinish(e) { async uploadDirectorFinish(e) {
console.log("in uploadDirectorFinish data: ", e); console.log("in uploadDirectorFinish data: ", e);
const textArr = this.getTextArr(e, '1'); const textArr = this.getTextArr(e, '1');
...@@ -384,6 +402,27 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni ...@@ -384,6 +402,27 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
} }
saveFormGroupGlobal(e) {
console.log("root e: ", e);
this.item.global_setting = e;
this.save();
}
async uploadDirectorFinishGlobal(e) {
console.log("in uploadDirectorFinishRoot data: ", e);
}
/** /**
* 储存数据 * 储存数据
*/ */
......
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