Commit cbb605d2 authored by limingzhe's avatar limingzhe

fix: debug

parent 2bd1138a
...@@ -13,6 +13,15 @@ ...@@ -13,6 +13,15 @@
<input type="text" nz-input [(ngModel)]="item.title" (blur)="save()" style=" width: 500px;"> <input type="text" nz-input [(ngModel)]="item.title" (blur)="save()" style=" width: 500px;">
</div> </div>
<div style="margin: 30px; display: flex; align-items: center;">
<h3 style="margin-right: 20px;">类型:</h3>
<nz-radio-group [(ngModel)]="item.type" (ngModelChange)="save()">
<label nz-radio nzValue="pic">图片</label>
<label nz-radio nzValue="text">文本</label>
<label nz-radio nzValue="picAndText">图片+文本</label>
</nz-radio-group>
</div>
<div *ngIf="item && item.quesArr"> <div *ngIf="item && item.quesArr">
<div *ngFor="let ques of item.quesArr; let i = index" <div *ngFor="let ques of item.quesArr; let i = index"
style="border: 2px #ccc solid; border-radius: 15px; width: 1000px; padding: 30px; margin: 30px;"> style="border: 2px #ccc solid; border-radius: 15px; width: 1000px; padding: 30px; margin: 30px;">
...@@ -142,7 +151,7 @@ ...@@ -142,7 +151,7 @@
</div> </div>
<div *ngIf="ques.optionTypeText"> <div *ngIf="item.type == 'text' || item.type == 'picAndText'">
<div style="margin-top: 5px; display: flex; align-items: center; "> <div style="margin-top: 5px; display: flex; align-items: center; ">
<span style="">文本:</span> <span style="">文本:</span>
...@@ -154,7 +163,7 @@ ...@@ -154,7 +163,7 @@
</div> --> </div> -->
</div> </div>
<div *ngIf="ques.optionTypePic" style="margin-top: 10px; display: flex; "> <div *ngIf="item.type == 'pic' || item.type == 'picAndText'" style="margin-top: 10px; display: flex; ">
<span style="">图片:</span> <span style="">图片:</span>
<div style="width: 300px;"> <div style="width: 300px;">
<app-upload-image-with-preview [picUrl]="option.pic_url" <app-upload-image-with-preview [picUrl]="option.pic_url"
......
...@@ -85,7 +85,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -85,7 +85,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
} }
initItem() { initItem() {
// 如果type未设置,设置默认值为"picture"
if (!this.item.type) {
this.item.type = 'pic';
}
} }
init() { init() {
......
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