Commit ee51b6ca authored by limingzhe's avatar limingzhe

fix: debug

parent 8de8c5be
...@@ -102,6 +102,16 @@ ...@@ -102,6 +102,16 @@
<div style="border: 2px #ccc solid; border-radius: 15px; width: 1000px; margin: 30px"> <div style="border: 2px #ccc solid; border-radius: 15px; width: 1000px; margin: 30px">
<div style="margin: 30px; display: flex; align-items: center;">
<h2 style="margin: 10px">
干扰项类型:
</h2>
<nz-radio-group [ngModel]="item.wrongType" (ngModelChange)="radioChange($event, item, 'wrongType')" style="display: flex; align-items: center; justify-content: center; flex-wrap: wrap;">
<label nz-radio nzValue="text">文本</label>
<label nz-radio nzValue="pic">图片</label>
</nz-radio-group>
</div>
<div *ngFor="let wrongData of item.wrongArr; let i = index" <div *ngFor="let wrongData of item.wrongArr; let i = index"
style="border: 1px #ccc solid; border-radius: 15px; width: 950px; padding: 30px; margin: 30px;"> style="border: 1px #ccc solid; border-radius: 15px; width: 950px; padding: 30px; margin: 30px;">
...@@ -113,17 +123,21 @@ ...@@ -113,17 +123,21 @@
</div> </div>
<div style="border: 1px #ccc solid; border-radius: 15px; padding: 15px; background-color: rgb(255, 250, 243);"> <div *ngIf="item.wrongType == 'pic'" style="width: 300px;">
<app-upload-image-with-preview [picUrl]="wrongData.pic_url"
(imageUploaded)="onItemImgUploadSuccess($event, wrongData, 'pic_url')">
</app-upload-image-with-preview>
</div>
<div *ngIf="item.wrongType == 'text'" style="border: 1px #ccc solid; border-radius: 15px; padding: 15px; background-color: rgb(255, 250, 243);">
<div> <div>
<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>
<input type="text" nz-input [(ngModel)]="wrongData.text" (blur)="save()" style=" width: 300px;"> <input type="text" nz-input [(ngModel)]="wrongData.text" (blur)="save()" style=" width: 300px;">
</div> </div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -532,10 +532,16 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -532,10 +532,16 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
// this.item.partArr = []; // this.item.partArr = [];
// } // }
if (!this.item.wrongType) {
this.item.wrongType = 'text';
}
} }
templateTypeChange(e) { templateTypeChange(e) {
console.log("in templateTypeChange e: ", e); console.log("in templateTypeChange e: ", e);
this.item.templateType = e; this.item.templateType = e;
...@@ -806,7 +812,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -806,7 +812,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.item.wrongArr = []; this.item.wrongArr = [];
} }
this.item.wrongArr.push( this.item.wrongArr.push(
{} {text: '',
pir_url: ''
}
); );
this.save(); this.save();
......
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