Commit 4a57f417 authored by Chen Jiping's avatar Chen Jiping

修复bug

parent e7037bdb
......@@ -43,17 +43,6 @@
<input type="text" nz-input placeholder="字母(组合)" [(ngModel)]="it.title_val" (blur)="saveItem()">
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="it.title_color">颜色</nz-form-label>
<nz-form-control [nzSpan]="6">
<nz-select [(ngModel)]="it.title_color" nzAllowClear nzPlaceHolder="Please select the color" (ngModelChange)="saveItem()">
<nz-option nzValue="C01" nzLabel="绿色"></nz-option>
<nz-option nzValue="C02" nzLabel="红色"></nz-option>
<nz-option nzValue="C03" nzLabel="巧克力色"></nz-option>
<nz-option nzValue="C04" nzLabel="黑色"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="it.title_audio_url">发音</nz-form-label>
<nz-form-control [nzSpan]="6">
......@@ -83,7 +72,7 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-control [nzSpan]="12" nzOffset="3">
<nz-form-control [nzSpan]="15" nzOffset="3">
<div *ngFor="let it of wordArr; let i = index" class="card-item" style="padding: 0.5vw;">
<div class="border">
<h5 style="width: 100%; line-height: 40px; text-align: center;"> 单词-{{i+1}}</h5>
......@@ -103,6 +92,12 @@
</app-audio-recorder>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="word_font_size">字体大小</nz-form-label>
<nz-form-control [nzSpan]="6">
<nz-input-number [(ngModel)]="it.word_font_size" [nzMin]="1" [nzStep]="1" (blur)="saveItem()"></nz-input-number>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="it.word_audio_url">单词字组(组合)</nz-form-label>
<nz-form-control [nzSpan]="6">
......@@ -120,6 +115,7 @@
<th>序号</th>
<th>字母(组合)</th>
<th>发音</th>
<th>颜色</th>
<th>操作</th>
</tr>
</thead>
......@@ -133,6 +129,14 @@
(audioUploaded)="onAudioUploadSuccessByItem($event, data, 'letter_audio_url')">
</app-audio-recorder>
</td>
<td>
<nz-select [(ngModel)]="data.letter_color" nzAllowClear nzPlaceHolder="Please select the color" (ngModelChange)="saveItem()">
<nz-option nzValue="C01" nzLabel="绿色"></nz-option>
<nz-option nzValue="C02" nzLabel="红色"></nz-option>
<nz-option nzValue="C03" nzLabel="巧克力色"></nz-option>
<nz-option nzValue="C04" nzLabel="黑色"></nz-option>
</nz-select>
</td>
<td>
<a (click)="deleteLetterItem(it.letters, j)">delete</a>
</td>
......
......@@ -149,6 +149,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
return {
word_val: "",
word_audio_url: "",
word_font_size:110,
letters:[]
};
}
......@@ -156,7 +157,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
letterData(){
return {
letter_val:"",
letter_audio_url:""
letter_audio_url:"",
letter_color:"C04"
};
}
......@@ -186,8 +188,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
titleItem(){
return {
title_val:"",
title_audio_url:"",
title_color:"C04"
title_audio_url:""
}
}
......
......@@ -864,6 +864,84 @@ export class ShapeRect extends MySprite {
}
}
export class ShapeRectNew extends MySprite {
radius = 0;
fillColor = '#ffffff';
strokeColor = '#000000';
fill = true;
stroke = false;
lineWidth = 1;
setSize(w, h, r) {
this.width = w;
this.height = h;
this.radius = r;
}
setOutLine(color, lineWidth) {
this.stroke = true;
this.strokeColor = color;
this.lineWidth = lineWidth;
}
drawShape() {
const ctx = this.ctx;
const width = this.width;
const height = this.height;
const radius = this.radius;
ctx.save();
ctx.beginPath(0);
// 从右下角顺时针绘制,弧度从0到1/2PI
ctx.arc(width - radius, height - radius, radius, 0, Math.PI / 2);
// 矩形下边线
ctx.lineTo(radius, height);
// 左下角圆弧,弧度从1/2PI到PI
ctx.arc(radius, height - radius, radius, Math.PI / 2, Math.PI);
// 矩形左边线
ctx.lineTo(0, radius);
// 左上角圆弧,弧度从PI到3/2PI
ctx.arc(radius, radius, radius, Math.PI, Math.PI * 3 / 2);
// 上边线
ctx.lineTo(width - radius, 0);
// 右上角圆弧
ctx.arc(width - radius, radius, radius, Math.PI * 3 / 2, Math.PI * 2);
// 右边线
ctx.lineTo(width, height - radius);
ctx.closePath();
if (this.fill) {
ctx.fillStyle = this.fillColor;
ctx.fill();
}
if (this.stroke) {
ctx.lineWidth = this.lineWidth;
ctx.strokeStyle = this.strokeColor;
ctx.stroke();
}
ctx.restore();
}
drawSelf() {
super.drawSelf();
this.drawShape();
}
}
export class ShapeCircle extends MySprite {
......
This diff is collapsed.
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