Commit d4e36e95 authored by 李维's avatar 李维

Bug fix

parent 42ac3b55
...@@ -172,11 +172,18 @@ ...@@ -172,11 +172,18 @@
<div style="float: left; margin-left: 10px;"> <div style="float: left; margin-left: 10px;">
<div>组合</div> <div>组合</div>
<div> <div>
<nz-select *ngFor="let part of item.combin; let i = index" style="float: left; margin-right: 5px; width: 150px;" (ngModelChange)="handlePartChange($event, item, i)"> <nz-select *ngFor="let part of item.combin; let i = index" [attr.data-index]="i" [(ngModel)]="bgItem.questions[QI]._combin[i]" style="float: left; margin-right: 5px; width: 150px;" (ngModelChange)="handlePartChange($event, QI, i)">
<nz-option [nzDisabled]="checkDisabel(item.combin, -1, i)" [nzValue]="-1" [nzLabel]="'L-' + bgItem.wordLeft_text"></nz-option> <nz-option [nzDisabled]="checkDisabel(item.combin, -1, i)" [nzValue]="-1" [nzLabel]="'L-' + bgItem.wordLeft_text"></nz-option>
<nz-option [nzDisabled]="checkDisabel(item.combin, -2, i)" [nzValue]="-2" [nzLabel]="'R-' + bgItem.wordRight_text"></nz-option> <nz-option [nzDisabled]="checkDisabel(item.combin, -2, i)" [nzValue]="-2" [nzLabel]="'R-' + bgItem.wordRight_text"></nz-option>
<nz-option *ngFor="let hot of hotZoneArr; let j = index;" [nzValue]="j" [nzLabel]="(j + 1) + '-' + hot.text"></nz-option> <nz-option *ngFor="let hot of hotZoneArr; let j = index;" [attr.data-index]="j" [nzValue]="j" [nzLabel]="(j + 1) + '-' + hot.text"></nz-option>
</nz-select> </nz-select>
<!-- <select *ngFor="let part of item.combin; let i = index" style="float: left; margin-right: 5px; width: 150px;" (change)="handlePartChange($event, QI, i)">
<option *ngIf="checkDisabel(item.combin, -1, i)" [value]="-1">{{'L-' + bgItem.wordLeft_text}}</option >
<option *ngIf="checkDisabel(item.combin, -2, i)" [value]="-2">{{'R-' + bgItem.wordRight_text}}</option >
<option *ngFor="let hot of hotZoneArr; let j = index;" [value]="j">{{(j + 1) + '-' + hot.text}}</option >
</select> -->
</div> </div>
</div> </div>
<div style="float: left; margin-left: 10px;"> <div style="float: left; margin-left: 10px;">
......
...@@ -228,9 +228,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -228,9 +228,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
// item.text = "" // item.text = ""
item.type = "Image" item.type = "Image"
} else { } else {
item.init(`assets/play/bg_70_40_${this.hotZoneItemArr.length}.png`, null, "Image", () => { item.init(`assets/play/hotZooCard/bg_70_40_${this.hotZoneItemArr.length}.png`, null, "Image", () => {
// item.image_url = "assets/play/bg_70_40.png" // item.image_url = "assets/play/bg_70_40.png"
console.log(this.canvasWidth, this.canvasHeight)
item.x = this.canvasWidth / 2 - 35; item.x = this.canvasWidth / 2 - 35;
item.y = this.canvasHeight / 2 - 20; item.y = this.canvasHeight / 2 - 20;
}, () => this.autoSave()); }, () => this.autoSave());
...@@ -358,7 +357,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -358,7 +357,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
addQustion() { addQustion() {
this.bgItem.questions.push({ this.bgItem.questions.push({
number: 2, number: 2,
combin: [0,0] combin: [0, 0],
_combin: [0, 0]
}) })
this.autoSave() this.autoSave()
} }
...@@ -575,8 +575,10 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -575,8 +575,10 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.curItem.showLineDash(); this.curItem.showLineDash();
} }
handlePartChange(e, item, index) { handlePartChange(e, QI, index) {
item.combin[index] = Number(e) let a = JSON.parse(JSON.stringify(this.bgItem.questions[QI].combin))
a[index] = Number(e)
this.bgItem.questions[QI].combin = a
this.autoSave() this.autoSave()
} }
......
export const defaultData = { export const defaultData = {
"version": "1.1", "version": "1.2",
"dataKey": "DataKey_YM4-11", "dataKey": "DataKey_YM4-11",
"dataArray": [ "dataArray": [
......
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