Commit 66b75a82 authored by van.chen's avatar van.chen

提交一下

parent 7fab40f1
<p>
module-detail works!
</p>
<div class="searchBar" @fade>
<app-search-date [label]="'topicModuleName' | translate" [(value)]="req.startTime" showTime="true"></app-search-date>
<div class="btnLine">
<button nz-button [nzType]="'primary'" [nzLoading]="isLoading" (click)="onSearch()"><span>{{'search' | translate}}</span></button>
<button nz-button class="btnAll" [nzLoading]="isLoading" (click)="onGetAll()"><span>{{'allData' | translate}}</span></button>
</div>
</div>
<div class="tableBar" @fade>
<nz-table #nzTable
[nzData]="data"
[nzSize]="'middle'"
nzShowSizeChanger
[nzShowPagination]="true"
[nzLoading]="isLoading"
[nzFrontPagination]="false"
[nzTotal]="total"
[(nzPageIndex)]="page"
[(nzPageSize)]="rows"
(nzPageIndexChange)="searchData()"
(nzPageSizeChange)="searchData()">
<thead nz-thead>
<tr>
<th nz-th><span>{{'num' | translate}}</span></th>
<th nz-th><span>{{'topicModuleName' | translate}}</span></th>
<th nz-th><span>{{'front' | translate}}</span></th>
<th nz-th><span>{{'belongCompany' | translate}}</span></th>
<th nz-th><span>{{'createTime' | translate}}</span></th>
<th nz-th><span>{{'remark' | translate}}</span></th>
<th nz-th><span>{{'oper' | translate}}</span></th>
</tr>
</thead>
<tbody nz-tbody>
<tr *ngFor="let one of nzTable.data, let i = index">
<td nz-td>{{i + 1}}</td>
<td nz-td class="canClick" (click)="toDetail()">{{one.userName}}</td>
<td nz-td>{{one.realName}}</td>
<td nz-td>{{one.loginTime}}</td>
<td nz-td>{{'webPlatform' | translate}}</td>
<td nz-td>{{one.ipAddress}}</td>
<td nz-td>{{one.ipAddress}}</td>
</tr>
</tbody>
</nz-table>
</div>
import { Component, OnInit } from '@angular/core';
import {ApiService} from '../../service/api';
import {NzMessageService} from 'ng-zorro-antd';
import {TranslateService} from '@ngx-translate/core';
import {fadeIn} from '../../animation/fade-in';
import {Router} from '@angular/router';
@Component({
selector: 'app-module-detail',
templateUrl: './module-detail.component.html',
styles: []
styles: [],
animations: [fadeIn]
})
export class ModuleDetailComponent implements OnInit {
constructor() { }
req: any = {};
data = [];
isLoading = false;
page: any = 1;
rows: any = 10;
total: any;
constructor(private api: ApiService, private message: NzMessageService,
private translate: TranslateService, private router: Router) {
}
ngOnInit() {
this.getData();
}
getData() {
this.isLoading = true;
this.api.loginlog.getAll(this.page, this.rows, ['', this.next]);
}
onSearch() {
this.page = 1;
this.query();
}
query() {
this.isLoading = true;
const req = {
startTime: this.req.startTime ? new Date(this.req.startTime).getTime() : '',
endTime: this.req.endTime ? new Date(this.req.endTime).getTime() : ''
};
this.api.loginlog.getByTime(this.page, this.rows, [req, this.next]);
}
onGetAll() {
this.page = 1;
this.req = {};
this.getData();
}
next = (data) => {
if ( data && data.rows && data.rows.constructor === Array) {
this.data = data.rows;
this.total = data.total;
} else {
this.message.error(data.message || this.translate.instant('wrongToGetData'));
}
this.isLoading = false;
}
searchData() {
if (this.req.startTime || this.req.endTime) {
this.query();
} else {
this.getData();
}
}
toDetail() {
this.router.navigate(['/app/deviceCenter/moduleMgr/moduleDetail']);
}
}
<div class="searchBar" @fade>
<app-search-date [label]="'moduleName' | translate" [(value)]="req.startTime" showTime="true"></app-search-date>
<app-search-date [label]="'topicModuleName' | translate" [(value)]="req.startTime" showTime="true"></app-search-date>
<div class="btnLine">
<button nz-button [nzType]="'primary'" [nzLoading]="isLoading" (click)="onSearch()"><span>{{'search' | translate}}</span></button>
<button nz-button class="btnAll" [nzLoading]="isLoading" (click)="onGetAll()"><span>{{'allData' | translate}}</span></button>
......@@ -21,8 +21,10 @@
<thead nz-thead>
<tr>
<th nz-th><span>{{'num' | translate}}</span></th>
<th nz-th><span>{{'moduleName' | translate}}</span></th>
<th nz-th><span>{{'wayNum' | translate}}</span></th>
<th nz-th><span>{{'topicModuleName' | translate}}</span></th>
<th nz-th><span>{{'front' | translate}}</span></th>
<th nz-th><span>{{'belongCompany' | translate}}</span></th>
<th nz-th><span>{{'createTime' | translate}}</span></th>
<th nz-th><span>{{'remark' | translate}}</span></th>
<th nz-th><span>{{'oper' | translate}}</span></th>
</tr>
......@@ -30,9 +32,11 @@
<tbody nz-tbody>
<tr *ngFor="let one of nzTable.data, let i = index">
<td nz-td>{{i + 1}}</td>
<td nz-td>{{one.userName}}</td>
<td nz-td class="canClick" (click)="toDetail()">{{one.userName}}</td>
<td nz-td>{{one.realName}}</td>
<td nz-td>{{one.loginTime}}</td>
<td nz-td>{{'webPlatform' | translate}}</td>
<td nz-td>{{one.ipAddress}}</td>
<td nz-td>{{one.ipAddress}}</td>
</tr>
</tbody>
......
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {ApiService} from '../../service/api';
import {NzMessageService} from 'ng-zorro-antd';
import {TranslateService} from '@ngx-translate/core';
import {fadeIn} from '../../animation/fade-in';
import {Router} from '@angular/router';
@Component({
selector: 'app-module-mgr',
......@@ -19,7 +20,8 @@ export class ModuleMgrComponent implements OnInit {
rows: any = 10;
total: any;
constructor(private api: ApiService, private message: NzMessageService, private translate: TranslateService) {
constructor(private api: ApiService, private message: NzMessageService,
private translate: TranslateService, private router: Router) {
}
ngOnInit() {
......@@ -52,14 +54,14 @@ export class ModuleMgrComponent implements OnInit {
}
next = (data) => {
if ( data && data.rows && data.rows.constructor === Array) {
if (data && data.rows && data.rows.constructor === Array) {
this.data = data.rows;
this.total = data.total;
} else {
this.message.error(data.message || this.translate.instant('wrongToGetData'));
}
this.isLoading = false;
}
};
searchData() {
if (this.req.startTime || this.req.endTime) {
......@@ -68,4 +70,8 @@ export class ModuleMgrComponent implements OnInit {
this.getData();
}
}
toDetail() {
this.router.navigate(['/app/deviceCenter/moduleMgr/moduleDetail']);
}
}
<p>
topic-module-detail works!
</p>
<div class="searchBar" @fade>
<app-search-date [label]="'topicModuleName' | translate" [(value)]="req.startTime" showTime="true"></app-search-date>
<div class="btnLine">
<button nz-button [nzType]="'primary'" [nzLoading]="isLoading" (click)="onSearch()"><span>{{'search' | translate}}</span></button>
<button nz-button class="btnAll" [nzLoading]="isLoading" (click)="onGetAll()"><span>{{'allData' | translate}}</span></button>
</div>
</div>
<div class="tableBar" @fade>
<nz-table #nzTable
[nzData]="data"
[nzSize]="'middle'"
nzShowSizeChanger
[nzShowPagination]="true"
[nzLoading]="isLoading"
[nzFrontPagination]="false"
[nzTotal]="total"
[(nzPageIndex)]="page"
[(nzPageSize)]="rows"
(nzPageIndexChange)="searchData()"
(nzPageSizeChange)="searchData()">
<thead nz-thead>
<tr>
<th nz-th><span>{{'num' | translate}}</span></th>
<th nz-th><span>{{'topicModuleName' | translate}}</span></th>
<th nz-th><span>{{'front' | translate}}</span></th>
<th nz-th><span>{{'belongCompany' | translate}}</span></th>
<th nz-th><span>{{'createTime' | translate}}</span></th>
<th nz-th><span>{{'remark' | translate}}</span></th>
<th nz-th><span>{{'oper' | translate}}</span></th>
</tr>
</thead>
<tbody nz-tbody>
<tr *ngFor="let one of nzTable.data, let i = index">
<td nz-td>{{i + 1}}</td>
<td nz-td>{{one.userName}}</td>
<td nz-td>{{one.realName}}</td>
<td nz-td>{{one.loginTime}}</td>
<td nz-td>{{'webPlatform' | translate}}</td>
<td nz-td>{{one.ipAddress}}</td>
<td nz-td>{{one.ipAddress}}</td>
</tr>
</tbody>
</nz-table>
</div>
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {ApiService} from '../../service/api';
import {NzMessageService} from 'ng-zorro-antd';
import {TranslateService} from '@ngx-translate/core';
import {fadeIn} from '../../animation/fade-in';
import {Router} from '@angular/router';
@Component({
selector: 'app-topic-module-detail',
templateUrl: './topic-module-detail.component.html',
styles: []
styles: [],
animations: [fadeIn]
})
export class TopicModuleDetailComponent implements OnInit {
constructor() { }
req: any = {};
data = [];
isLoading = false;
page: any = 1;
rows: any = 10;
total: any;
constructor(private api: ApiService, private message: NzMessageService,
private translate: TranslateService, private router: Router) {
}
ngOnInit() {
this.getData();
}
getData() {
this.isLoading = true;
this.api.loginlog.getAll(this.page, this.rows, ['', this.next]);
}
onSearch() {
this.page = 1;
this.query();
}
query() {
this.isLoading = true;
const req = {
startTime: this.req.startTime ? new Date(this.req.startTime).getTime() : '',
endTime: this.req.endTime ? new Date(this.req.endTime).getTime() : ''
};
this.api.loginlog.getByTime(this.page, this.rows, [req, this.next]);
}
onGetAll() {
this.page = 1;
this.req = {};
this.getData();
}
next = (data) => {
if (data && data.rows && data.rows.constructor === Array) {
this.data = data.rows;
this.total = data.total;
} else {
this.message.error(data.message || this.translate.instant('wrongToGetData'));
}
this.isLoading = false;
};
searchData() {
if (this.req.startTime || this.req.endTime) {
this.query();
} else {
this.getData();
}
}
}
......@@ -32,7 +32,7 @@
<tbody nz-tbody>
<tr *ngFor="let one of nzTable.data, let i = index">
<td nz-td>{{i + 1}}</td>
<td nz-td>{{one.userName}}</td>
<td nz-td class="canClick" (click)="toDetail()">{{one.userName}}</td>
<td nz-td>{{one.realName}}</td>
<td nz-td>{{one.loginTime}}</td>
<td nz-td>{{'webPlatform' | translate}}</td>
......
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {ApiService} from '../../service/api';
import {NzMessageService} from 'ng-zorro-antd';
import {TranslateService} from '@ngx-translate/core';
import {fadeIn} from '../../animation/fade-in';
import {Router} from '@angular/router';
@Component({
selector: 'app-topic-module-mgr',
......@@ -19,7 +20,8 @@ export class TopicModuleMgrComponent implements OnInit {
rows: any = 10;
total: any;
constructor(private api: ApiService, private message: NzMessageService, private translate: TranslateService) {
constructor(private api: ApiService, private message: NzMessageService,
private translate: TranslateService, private router: Router) {
}
ngOnInit() {
......@@ -52,14 +54,14 @@ export class TopicModuleMgrComponent implements OnInit {
}
next = (data) => {
if ( data && data.rows && data.rows.constructor === Array) {
if (data && data.rows && data.rows.constructor === Array) {
this.data = data.rows;
this.total = data.total;
} else {
this.message.error(data.message || this.translate.instant('wrongToGetData'));
}
this.isLoading = false;
}
};
searchData() {
if (this.req.startTime || this.req.endTime) {
......@@ -68,4 +70,8 @@ export class TopicModuleMgrComponent implements OnInit {
this.getData();
}
}
toDetail() {
this.router.navigate(['/app/deviceCenter/topicModuleMgr/topicModuleDetail']);
}
}
......@@ -113,5 +113,7 @@
"addSensor": "新增传感器",
"selectTime": "选择时间",
"moduleName": "通道模板名称",
"topicModuleName": "主题配置模板名称"
"topicModuleName": "主题配置模板名称",
"moduleDetail": "通道模板详情",
"topicModuleDetail": "主题配置模板详情"
}
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