diff --git a/src/app/view/admin/components/common-table/common-table.component.ts b/src/app/view/admin/components/common-table/common-table.component.ts index 4845bc6..02837ad 100644 --- a/src/app/view/admin/components/common-table/common-table.component.ts +++ b/src/app/view/admin/components/common-table/common-table.component.ts @@ -72,7 +72,7 @@ export class CommonTableComponent implements OnInit, OnChanges { // count: countValue // } this.pageInfo.emit({page: pageValue, pageSize: countValue}); - return this.httpService.Service>(this.request).subscribe({ + return this.httpService.service>(this.request).subscribe({ next: resp => { this.dataList = resp.result; setTimeout(() => this.loading = false, 10); diff --git a/src/app/view/index/components/tag-tag/tag-tag.component.ts b/src/app/view/index/components/tag-tag/tag-tag.component.ts index fe87d25..a14cac3 100644 --- a/src/app/view/index/components/tag-tag/tag-tag.component.ts +++ b/src/app/view/index/components/tag-tag/tag-tag.component.ts @@ -1,5 +1,5 @@ import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; -import {ColorList} from '../../../../utils/color'; +import {COLOR_LIST} from '../../../../utils/color'; import {Router} from '@angular/router'; @Component({ @@ -20,8 +20,8 @@ export class TagTagComponent implements OnInit { } ngOnInit() { - const randomNumber = Math.floor(ColorList.length * Math.random()); - this.randColor = ColorList[randomNumber]; + const randomNumber = Math.floor(COLOR_LIST.length * Math.random()); + this.randColor = COLOR_LIST[randomNumber]; if (this.clickable == null) { this.clickable = true; } diff --git a/src/app/view/link/link.component.ts b/src/app/view/link/link.component.ts index 30698e4..cccc21d 100644 --- a/src/app/view/link/link.component.ts +++ b/src/app/view/link/link.component.ts @@ -5,7 +5,7 @@ import {Title} from '@angular/platform-browser'; import {ApiService} from '../../api/api.service'; import {ApplyLinkReq, Link} from '../../class/Link'; import {FormBuilder, FormGroup, Validators} from '@angular/forms'; -import {Color, RandomColor} from '../../utils/color'; +import {Color, randomColor} from '../../utils/color'; @Component({ selector: 'view-link', @@ -37,7 +37,7 @@ export class LinkComponent implements OnInit { this.apiService.links().subscribe({ next: data => this.linkList = data.result, error: err => this.message.error(err.msg), - complete: () => this.colors = RandomColor(this.linkList.length) + complete: () => this.colors = randomColor(this.linkList.length) }); this.applyFormGroup = this.fb.group({ urlLinkProtocol: ['http://'], diff --git a/src/app/view/write/components/publish-form/publish-form.component.ts b/src/app/view/write/components/publish-form/publish-form.component.ts index 210f101..7d52343 100644 --- a/src/app/view/write/components/publish-form/publish-form.component.ts +++ b/src/app/view/write/components/publish-form/publish-form.component.ts @@ -1,7 +1,7 @@ import {Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core'; import {FormBuilder, FormGroup, Validators} from '@angular/forms'; import {Category} from '../../../../class/Tag'; -import {ColorList} from '../../../../utils/color'; +import {COLOR_LIST} from '../../../../utils/color'; @Component({ selector: 'c-publish-form', @@ -32,7 +32,7 @@ export class PublishFormComponent implements OnInit { constructor(private fb: FormBuilder) { } - randomColor = () => this.color = ColorList.map(c => c.bgColor).sort(() => Math.floor(Math.random() * 2)); + randomColor = () => this.color = COLOR_LIST.map(c => c.bgColor).sort(() => Math.floor(Math.random() * 2)); ngOnInit(): void { this.formGroup = this.fb.group({