Commit d124eef9 authored by liujiangnan's avatar liujiangnan

feat: 表单

parent 81531605
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
export const defaultData = { export const defaultData = {
"title": "Hello Apples", "title": "Hello Apples",
"endImgAni": { "tipSwitch": 1,
"audio": "",
"imgAni": {
"ske": { "ske": {
"url": "https://teach.cdn.ireadabc.com/8a5825bc51a32f13ddb55d3065d713a9.json", "url": "https://teach.cdn.ireadabc.com/8a5825bc51a32f13ddb55d3065d713a9.json",
"name": "动画用图川阅阅奖励_ske.json" "name": "动画用图川阅阅奖励_ske.json"
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
.model-content { .model-content {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.radioPaire { .radioPaire {
......
<div class="model-content"> <div class="model-content">
<br>
<span style="font-size: 20px; padding-left: 20px;">标题: </span>
<input type="text" style="width: 300px;" nz-input [(ngModel)]="item.title" (blur)="save()">
<div> <br>
<span style="font-size: 20px;">标题: </span><input type="text" nz-input [(ngModel)]="item.title" (blur)="save()"> <br>
<span style="padding-left: 20px;font-size: 20px;">提示开关: </span>
<span style="font-size: 20px;">提示动画: </span> <nz-radio-group [ngModel]="item.tipSwitch" (ngModelChange)="customRadioChange($event, item,'tipSwitch')"
<app-upload-dragon-bone style="width: 100%" (save)="onDragonBoneSave($event,item)" style="font-size: 20px; display: inline-block;">
[skeJsonData]="item.endImgAni.ske" [texJsonData]="item.endImgAni.tex" [texPngData]="item.endImgAni.png"> <label nz-radio nzValue="1"></label>
<label nz-radio nzValue="0"></label>
</nz-radio-group>
<br>
<br>
<div *ngIf="item.tipSwitch == 1">
<div>
<span style="font-size: 20px; padding-left: 20px;">提示音频: </span>
<app-audio-recorder [audioUrl]="item.audio" style="display: inline-block;"
(audioUploaded)="onAudioUploadSuccess($event, 'audio', item)">
</app-audio-recorder>
</div>
<br>
<span style="font-size: 20px; padding-left: 20px;">提示动画: </span>
<app-upload-dragon-bone style="width: 100%" (save)="onDragonBoneSave($event,item)" style="display: inline-block;"
[skeJsonData]="item.imgAni.ske" [texJsonData]="item.imgAni.tex" [texPngData]="item.imgAni.png">
</app-upload-dragon-bone> </app-upload-dragon-bone>
</div> </div>
......
...@@ -17,7 +17,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O ...@@ -17,7 +17,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
item = { item = {
title: "", title: "",
endImgAni: { tipSwitch: 1,
audio: "",
imgAni: {
ske: {}, ske: {},
tex: {}, tex: {},
png: {} png: {}
...@@ -46,4 +48,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O ...@@ -46,4 +48,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
this.save(); this.save();
} }
customRadioChange(e, item, key) {
item[key] = e;
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