chore: fix bug

This commit is contained in:
禾几海
2021-03-12 17:55:00 +08:00
parent 03cf88868e
commit 754193d6ab
4 changed files with 8 additions and 8 deletions

View File

@@ -72,7 +72,7 @@ export class CommonTableComponent<T> implements OnInit, OnChanges {
// count: countValue
// }
this.pageInfo.emit({page: pageValue, pageSize: countValue});
return this.httpService.Service<PageList<T>>(this.request).subscribe({
return this.httpService.service<PageList<T>>(this.request).subscribe({
next: resp => {
this.dataList = resp.result;
setTimeout(() => this.loading = false, 10);

View File

@@ -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;
}

View File

@@ -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://'],

View File

@@ -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({