style: eslint of member-ordering
This commit is contained in:
@@ -14,9 +14,9 @@ import {Router} from '@angular/router';
|
||||
})
|
||||
export class AdminArticleComponent implements OnInit {
|
||||
|
||||
@ViewChild('commonTableComponent') private commonTableComponent: CommonTableComponent<Article>;
|
||||
request: RequestObj;
|
||||
headData: Data<Article>[];
|
||||
@ViewChild('commonTableComponent') private commonTableComponent: CommonTableComponent<Article>;
|
||||
|
||||
constructor(private apiService: ApiService, private nzMessage: NzMessageService, private title: Title,
|
||||
private router: Router) {
|
||||
|
||||
@@ -15,6 +15,8 @@ import {CommonTableComponent} from '../components/common-table/common-table.comp
|
||||
})
|
||||
export class AdminCommentComponent implements OnInit {
|
||||
|
||||
@ViewChild('editableTagComponent') editableTagComponent: EditableTagComponent;
|
||||
@ViewChild('commonTableComponent') commonTableComponent: CommonTableComponent<Comment>;
|
||||
request: RequestObj;
|
||||
editInfo = {
|
||||
id: null,
|
||||
@@ -25,8 +27,6 @@ export class AdminCommentComponent implements OnInit {
|
||||
visible: false,
|
||||
comment: null
|
||||
};
|
||||
@ViewChild('editableTagComponent') editableTagComponent: EditableTagComponent;
|
||||
@ViewChild('commonTableComponent') commonTableComponent: CommonTableComponent<Comment>;
|
||||
|
||||
constructor(private apiService: ApiService, private messageService: NzMessageService, private userService: GlobalUserService,
|
||||
private title: Title) {
|
||||
|
||||
@@ -15,11 +15,11 @@ import {Data} from '../components/common-table/data';
|
||||
})
|
||||
export class AdminLinkComponent implements OnInit {
|
||||
|
||||
@ViewChild('commonTableComponent') commonTableComponent: CommonTableComponent<Link>;
|
||||
modalVisible: boolean = false;
|
||||
modalTitle: string = '';
|
||||
formGroup: FormGroup;
|
||||
request: RequestObj;
|
||||
@ViewChild('commonTableComponent') commonTableComponent: CommonTableComponent<Link>;
|
||||
headData: Data<Link>[];
|
||||
|
||||
constructor(private apiService: ApiService, private messageService: NzMessageService, private title: Title) {
|
||||
|
||||
@@ -15,6 +15,10 @@ import {EditableTagComponent} from '../components/editable-tag/editable-tag.comp
|
||||
})
|
||||
export class AdminTagComponent implements OnInit {
|
||||
|
||||
@ViewChild('categoryCTComponent', {static: true}) categoryCTComponent: CommonTableComponent<Category>;
|
||||
@ViewChild('tagCTComponent', {static: true}) tagCTComponent: CommonTableComponent<Tag>;
|
||||
@ViewChild('editableTagComponent') editableTagComponent: EditableTagComponent;
|
||||
|
||||
categoryCTData: { headData: Data<Category>[]; commonTable: CommonTableComponent<Category>; request: RequestObj } = {
|
||||
headData: null,
|
||||
commonTable: null,
|
||||
@@ -25,9 +29,6 @@ export class AdminTagComponent implements OnInit {
|
||||
commonTable: null,
|
||||
request: null
|
||||
};
|
||||
@ViewChild('categoryCTComponent', {static: true}) categoryCTComponent: CommonTableComponent<Category>;
|
||||
@ViewChild('tagCTComponent', {static: true}) tagCTComponent: CommonTableComponent<Tag>;
|
||||
@ViewChild('editableTagComponent') editableTagComponent: EditableTagComponent;
|
||||
getData: any;
|
||||
private updateData: any;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import {CdkDragDrop, moveItemInArray} from '@angular/cdk/drag-drop';
|
||||
})
|
||||
export class CommonTableComponent<T> implements OnInit, OnChanges {
|
||||
|
||||
@Input() request: RequestObj;
|
||||
@Output() pageInfo = new EventEmitter<{ page: number; pageSize: number }>();
|
||||
@Input() cardTitle: string | null;
|
||||
@Input() template: {
|
||||
[fieldValue: string]: {
|
||||
@@ -19,14 +19,14 @@ export class CommonTableComponent<T> implements OnInit, OnChanges {
|
||||
param?: { [key: string]: string };
|
||||
};
|
||||
};
|
||||
@Output() pageInfo = new EventEmitter<{ page: number; pageSize: number }>();
|
||||
@Input() request: RequestObj;
|
||||
@Input() private headData: Data<T>[];
|
||||
loading: boolean = true;
|
||||
dataList: PageList<T> = new PageList<T>();
|
||||
settingModalVisible: boolean = false;
|
||||
filedData: Data<T>[];
|
||||
changed: boolean = false;
|
||||
visibleFieldLength: number = 0;
|
||||
@Input() private headData: Data<T>[];
|
||||
|
||||
constructor(private httpService: HttpService) {
|
||||
|
||||
@@ -41,16 +41,22 @@ export class CommonTableComponent<T> implements OnInit, OnChanges {
|
||||
}
|
||||
this.calculateVisibleFieldLength();
|
||||
|
||||
if (!this.template) {this.template = {};}
|
||||
if (!this.template) {
|
||||
this.template = {};
|
||||
}
|
||||
this.headData.forEach(dat => {
|
||||
if (!dat.action) {return;}
|
||||
if (!dat.action) {
|
||||
return;
|
||||
}
|
||||
dat.action.forEach(act => {
|
||||
if (!act.hover) {
|
||||
act.hover = () => null;
|
||||
}
|
||||
});
|
||||
});
|
||||
if (!this.request || !this.request.path) {return;}
|
||||
if (!this.request || !this.request.path) {
|
||||
return;
|
||||
}
|
||||
this.getData();
|
||||
}
|
||||
|
||||
@@ -87,7 +93,9 @@ export class CommonTableComponent<T> implements OnInit, OnChanges {
|
||||
getValue(index: number, fieldValue: string): string {
|
||||
let value = this.dataList.list[index];
|
||||
try {
|
||||
for (const key of fieldValue.split('.')) {value = value[key];}
|
||||
for (const key of fieldValue.split('.')) {
|
||||
value = value[key];
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
@@ -30,8 +30,6 @@ import {NzModalRef, NzModalService} from 'ng-zorro-antd/modal';
|
||||
export class EditableTagComponent implements OnInit, OnChanges {
|
||||
|
||||
private static instanceArray: EditableTagComponent[] = [];
|
||||
inputVisible = false;
|
||||
inputValue = '';
|
||||
@ViewChild('inputElement', {static: false}) inputElement?: ElementRef;
|
||||
@Output() valueChange = new EventEmitter<{ value: string; originalValue: string; changed: boolean }>();
|
||||
@Input() color: string;
|
||||
@@ -46,6 +44,8 @@ export class EditableTagComponent implements OnInit, OnChanges {
|
||||
@Output() inEditStatus = new EventEmitter<void>();
|
||||
@Output() modalOK = new EventEmitter<{ value: string; originalValue: string; changed: boolean }>();
|
||||
@Output() modalCancel = new EventEmitter<{ value: string; originalValue: string; changed: boolean }>();
|
||||
inputVisible = false;
|
||||
inputValue = '';
|
||||
confirmModal?: NzModalRef;
|
||||
private tmpKey: any;
|
||||
private doubleClickInfo = {
|
||||
|
||||
@@ -18,6 +18,7 @@ declare let $;
|
||||
})
|
||||
export class ArticleComponent implements OnInit {
|
||||
|
||||
@ViewChild('divElement') divElement: ElementRef;
|
||||
articleId: number;
|
||||
article: Article;
|
||||
copyRightUrl: string;
|
||||
@@ -30,7 +31,6 @@ export class ArticleComponent implements OnInit {
|
||||
avatarImgUrl: string;
|
||||
pid: number;
|
||||
content: string;
|
||||
@ViewChild('divElement') divElement: ElementRef;
|
||||
|
||||
constructor(private activatedRoute: ActivatedRoute,
|
||||
private apiService: ApiService,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import {NzMessageService} from 'ng-zorro-antd/message';
|
||||
import {LoginReq} from '../../../../class/User';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {LoginRegistrationService} from '../../service/login-registration.service';
|
||||
@@ -13,6 +13,14 @@ import {GlobalUserService} from '../../../../services/global-user.service';
|
||||
})
|
||||
export class LoginComponent implements OnInit {
|
||||
|
||||
@Output() loginStatus = new EventEmitter<boolean>();
|
||||
@Input() showSendEmail: boolean = true;
|
||||
|
||||
submitting: boolean = false;
|
||||
loginReq: LoginReq = new LoginReq(null, true, null);
|
||||
|
||||
private url: string;
|
||||
|
||||
constructor(private nzMessageService: NzMessageService,
|
||||
private userService: GlobalUserService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
@@ -22,14 +30,6 @@ export class LoginComponent implements OnInit {
|
||||
this.title.setTitle('小海博客 | 登录 ');
|
||||
}
|
||||
|
||||
submitting: boolean = false;
|
||||
|
||||
loginReq: LoginReq = new LoginReq(null, true, null);
|
||||
@Output() loginStatus = new EventEmitter<boolean>();
|
||||
@Input() showSendEmail: boolean = true;
|
||||
|
||||
private url: string;
|
||||
|
||||
ngOnInit() {
|
||||
this.url = this.activatedRoute.snapshot.queryParamMap.get('url');
|
||||
this.loginReq.email = localStorage.getItem('e');
|
||||
|
||||
@@ -15,6 +15,17 @@ import {Title} from '@angular/platform-browser';
|
||||
})
|
||||
export class RegistrationComponent implements OnInit {
|
||||
|
||||
@Output() regStatus = new EventEmitter<boolean>();
|
||||
@Output() regAccount = new EventEmitter<LoginReq>();
|
||||
|
||||
imgCodeUrl: string;
|
||||
|
||||
imgCode: string;
|
||||
email: string;
|
||||
|
||||
pwd: string;
|
||||
submitting: boolean;
|
||||
|
||||
constructor(private apiService: ApiService,
|
||||
private nzMessageService: NzMessageService,
|
||||
private router: Router,
|
||||
@@ -22,17 +33,6 @@ export class RegistrationComponent implements OnInit {
|
||||
this.title.setTitle('小海博客 | 注册');
|
||||
}
|
||||
|
||||
imgCodeUrl: string;
|
||||
|
||||
imgCode: string;
|
||||
|
||||
email: string;
|
||||
pwd: string;
|
||||
|
||||
submitting: boolean;
|
||||
@Output() regStatus = new EventEmitter<boolean>();
|
||||
@Output() regAccount = new EventEmitter<LoginReq>();
|
||||
|
||||
ngOnInit() {
|
||||
this.imgCodeUrl = environment.host + '/imgCode';
|
||||
this.submitting = false;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {ApiService} from '../../api/api.service';
|
||||
import {LoginRegistrationService} from './service/login-registration.service';
|
||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import {NzMessageService} from 'ng-zorro-antd/message';
|
||||
|
||||
@Component({
|
||||
selector: 'view-login-registration',
|
||||
@@ -10,14 +10,15 @@ import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
})
|
||||
export class LoginRegistrationComponent implements OnInit {
|
||||
|
||||
picUrl: string = '';
|
||||
email: string;
|
||||
submitting: boolean = false;
|
||||
|
||||
constructor(private apiService: ApiService,
|
||||
public loginRegistrationService: LoginRegistrationService,
|
||||
private nzMessageService: NzMessageService) {
|
||||
}
|
||||
|
||||
picUrl: string = '';
|
||||
email: string;
|
||||
submitting: boolean = false;
|
||||
|
||||
ngOnInit() {
|
||||
this.apiService.bingPic().subscribe(data => {
|
||||
|
||||
Reference in New Issue
Block a user