chore: fix bug
This commit is contained in:
@@ -72,7 +72,7 @@ export class CommonTableComponent<T> implements OnInit, OnChanges {
|
|||||||
// count: countValue
|
// count: countValue
|
||||||
// }
|
// }
|
||||||
this.pageInfo.emit({page: pageValue, pageSize: 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 => {
|
next: resp => {
|
||||||
this.dataList = resp.result;
|
this.dataList = resp.result;
|
||||||
setTimeout(() => this.loading = false, 10);
|
setTimeout(() => this.loading = false, 10);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
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';
|
import {Router} from '@angular/router';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -20,8 +20,8 @@ export class TagTagComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
const randomNumber = Math.floor(ColorList.length * Math.random());
|
const randomNumber = Math.floor(COLOR_LIST.length * Math.random());
|
||||||
this.randColor = ColorList[randomNumber];
|
this.randColor = COLOR_LIST[randomNumber];
|
||||||
if (this.clickable == null) {
|
if (this.clickable == null) {
|
||||||
this.clickable = true;
|
this.clickable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {Title} from '@angular/platform-browser';
|
|||||||
import {ApiService} from '../../api/api.service';
|
import {ApiService} from '../../api/api.service';
|
||||||
import {ApplyLinkReq, Link} from '../../class/Link';
|
import {ApplyLinkReq, Link} from '../../class/Link';
|
||||||
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
|
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
|
||||||
import {Color, RandomColor} from '../../utils/color';
|
import {Color, randomColor} from '../../utils/color';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'view-link',
|
selector: 'view-link',
|
||||||
@@ -37,7 +37,7 @@ export class LinkComponent implements OnInit {
|
|||||||
this.apiService.links().subscribe({
|
this.apiService.links().subscribe({
|
||||||
next: data => this.linkList = data.result,
|
next: data => this.linkList = data.result,
|
||||||
error: err => this.message.error(err.msg),
|
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({
|
this.applyFormGroup = this.fb.group({
|
||||||
urlLinkProtocol: ['http://'],
|
urlLinkProtocol: ['http://'],
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';
|
import {Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';
|
||||||
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
|
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
|
||||||
import {Category} from '../../../../class/Tag';
|
import {Category} from '../../../../class/Tag';
|
||||||
import {ColorList} from '../../../../utils/color';
|
import {COLOR_LIST} from '../../../../utils/color';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'c-publish-form',
|
selector: 'c-publish-form',
|
||||||
@@ -32,7 +32,7 @@ export class PublishFormComponent implements OnInit {
|
|||||||
constructor(private fb: FormBuilder) {
|
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 {
|
ngOnInit(): void {
|
||||||
this.formGroup = this.fb.group({
|
this.formGroup = this.fb.group({
|
||||||
|
|||||||
Reference in New Issue
Block a user