Commit d4e36e95 authored by 李维's avatar 李维

Bug fix

parent 42ac3b55
......@@ -172,11 +172,18 @@
<div style="float: left; margin-left: 10px;">
<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, -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>
<!-- <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 style="float: left; margin-left: 10px;">
......
......@@ -228,9 +228,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
// item.text = ""
item.type = "Image"
} 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"
console.log(this.canvasWidth, this.canvasHeight)
item.x = this.canvasWidth / 2 - 35;
item.y = this.canvasHeight / 2 - 20;
}, () => this.autoSave());
......@@ -358,7 +357,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
addQustion() {
this.bgItem.questions.push({
number: 2,
combin: [0,0]
combin: [0, 0],
_combin: [0, 0]
})
this.autoSave()
}
......@@ -575,8 +575,10 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.curItem.showLineDash();
}
handlePartChange(e, item, index) {
item.combin[index] = Number(e)
handlePartChange(e, QI, index) {
let a = JSON.parse(JSON.stringify(this.bgItem.questions[QI].combin))
a[index] = Number(e)
this.bgItem.questions[QI].combin = a
this.autoSave()
}
......
export const defaultData = {
"version": "1.1",
"version": "1.2",
"dataKey": "DataKey_YM4-11",
"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