Commit 7fab40f1 authored by van.chen's avatar van.chen

提交一下

parent 709335f3
......@@ -27,6 +27,8 @@ import {SetModuleMgrComponent} from '../main/set-module-mgr/set-module-mgr.compo
import {TopicModuleMgrComponent} from '../main/topic-module-mgr/topic-module-mgr.component';
import {SensorMgrComponent} from '../main/sensor-mgr/sensor-mgr.component';
import {SensorDetailComponent} from '../main/sensor-detail/sensor-detail.component';
import {ModuleDetailComponent} from '../main/module-detail/module-detail.component';
import {TopicModuleDetailComponent} from '../main/topic-module-detail/topic-module-detail.component';
// 通用组件
import {SearchDateComponent} from '../component/search-date/search-date.component';
import {SearchItemComponent} from '../component/search-item/search-item.component';
......@@ -80,7 +82,9 @@ import {BackComponent} from '../component/back/back.component';
SetModuleMgrComponent,
TopicModuleMgrComponent,
SensorMgrComponent,
SensorDetailComponent
SensorDetailComponent,
ModuleDetailComponent,
TopicModuleDetailComponent
]
})
export class LayoutModule {
......
......@@ -33,7 +33,7 @@ export class LeftmenuComponent implements OnInit, OnDestroy {
icon: 'io i-shebei',
type: 0,
child: [{name: 'gatewayMgr'}, {name: 'sensorMgr'}, {name: 'moduleMgr'},
{name: 'topicModuleMgr'}, {name: 'setModuleMgr'}, {name: 'mqttSetMgr'}]
{name: 'topicModuleMgr'}]
}, {
name: 'systemMgr',
icon: 'io i-shezhi',
......
......@@ -58,7 +58,7 @@ export class GatewayComponent implements OnInit {
next = (data) => {
if (data && data.rows && data.rows.constructor === Array) {
this.data = data.rows.filter(one => { one.isOn = Math.random() > 0.5 ? 1 : 0; return one; });
this.data = data.rows.filter(one => { one.isOn = Math.random() > 0.5; return one; });
this.total = data.total;
} else if (data.code === 1) {
this.message.success(data && data.message ? data.message : '操作成功');
......
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-module-detail',
templateUrl: './module-detail.component.html',
styles: []
})
export class ModuleDetailComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
<p>
module-mgr works!
</p>
<div class="searchBar" @fade>
<app-search-date [label]="'moduleName' | 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>{{'moduleName' | translate}}</span></th>
<th nz-th><span>{{'wayNum' | 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>{{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';
@Component({
selector: 'app-module-mgr',
templateUrl: './module-mgr.component.html',
styles: []
styles: [],
animations: [fadeIn]
})
export class ModuleMgrComponent 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) {
}
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();
}
}
}
......@@ -81,5 +81,98 @@
</tbody>
</nz-table>
</nz-tab>
<nz-tab nzTitle="运行状态">
<div class="cards">
<div class="card" *ngFor="let one of items">
<div class="title">
{{one.name}}
<div class="rightSpan canClick">查看数据</div>
</div>
<div class="middle">
<div class="left">{{one.data}}{{one.per}}</div>
<div class="right">
{{one.min}}{{one.per}} - {{one.max}}{{one.per}}
</div>
</div>
<div class="bottom">
{{one.time | date: 'yyyy-MM-dd HH:mm:ss'}}
</div>
</div>
</div>
<div class="charts">
<div style="width: calc(100% - 80px);display: inline-block;vertical-align: top;padding-left: 15px;">
<app-search-select inModal="true" [label]="'selectTime' | translate" [(value)]="selectTime"
optL="a" optV="b" [data]="[{a: '1小时', b: 1}, {a: '24小时', b: 24}, {a: '7天', b: 144}, {a: '自定义', b: 0}]"></app-search-select>
<app-search-date *ngIf="selectTime === 0" inModal="true" [label]="'startTime' | translate" [(value)]="req.startTime"
showTime="true"></app-search-date>
<app-search-date *ngIf="selectTime === 0" inModal="true" [label]="'endTime' | translate" [(value)]="req.endTime"
showTime="true"></app-search-date>
</div>
<button nz-button [nzType]="'primary'" [nzLoading]="isLoading" (click)="onSearch()">
<span>{{'search' | translate}}</span></button>
<nz-tabset style="border-top: 1px solid #cccccc">
<nz-tab nzTitle="表格">111</nz-tab>
<nz-tab nzTitle="图表">222</nz-tab>
</nz-tabset>
<div class="btnLine">
<button nz-button [nzType]="'default'" [nzLoading]="isLoading" (click)="close()">
<span>{{'close' | translate}}</span></button>
</div>
</div>
</nz-tab>
<nz-tab nzTitle="日志服务">
<div style="width: calc(100% - 80px);display: inline-block;vertical-align: top;">
<app-search-select [label]="'selectTime' | translate" [(value)]="selectTime2"
showTime="true" optL="a" optV="b"
[data]="[{a: '1小时', b: 1}, {a: '24小时', b: 24}, {a: '7天', b: 144}, {a: '自定义', b: 0}]"></app-search-select>
<app-search-date *ngIf="selectTime === 0" [label]="'startTime' | translate" [(value)]="req2.startTime"
showTime="true"></app-search-date>
<app-search-date *ngIf="selectTime === 0" [label]="'endTime' | translate" [(value)]="req2.endTime"
showTime="true"></app-search-date>
</div>
<button nz-button [nzType]="'primary'" [nzLoading]="isLoading" (click)="onSearch2()">
<span>{{'search' | translate}}</span></button>
<nz-table #nzTable3
[nzData]="data"
[nzSize]="'middle'"
nzShowSizeChanger
[nzShowPagination]="true"
[nzLoading]="isLoading">
<thead nz-thead>
<tr>
<th nz-th><span>{{'wayIndex' | translate}}</span></th>
<th nz-th><span>{{'wayName' | translate}}</span></th>
<th nz-th><span>{{'wayAlias' | translate}}</span></th>
<th nz-th><span>{{'per' | translate}}</span></th>
<th nz-th><span>{{'wayType' | translate}}</span></th>
<th nz-th><span>{{'max' | translate}}</span></th>
<th nz-th><span>{{'min' | translate}}</span></th>
<th nz-th><span>{{'alarmMax' | translate}}</span></th>
<th nz-th><span>{{'alarmMaxMax' | translate}}</span></th>
<th nz-th><span>{{'alarmMin' | translate}}</span></th>
<th nz-th><span>{{'alarmMinMin' | translate}}</span></th>
<th nz-th><span>{{'isbind' | translate}}</span></th>
</tr>
</thead>
<tbody nz-tbody>
<tr *ngFor="let one of nzTable3.data, let i = index">
<td nz-td>{{i + 1}}</td>
<td nz-td>{{one.userName}}</td>
<td nz-td>{{one.loginTime}}</td>
<td nz-td>{{'web'}}</td>
<td nz-td>{{one.userName}}</td>
<td nz-td>{{one.realName}}</td>
<td nz-td>{{one.loginTime}}</td>
<td nz-td>{{'web'}}</td>
<td nz-td>{{one.userName}}</td>
<td nz-td>{{one.realName}}</td>
<td nz-td>{{one.loginTime}}</td>
<td nz-td>
<span class="deleteFontColor">{{'delete' | translate}}</span>
</td>
</tr>
</tbody>
</nz-table>
</nz-tab>
</nz-tabset>
</div>
.cards, .charts {
width: 50%;
display: inline-block;
vertical-align: top;
}
.card {
width: calc(50% - 10px);
display: inline-block;
border: 1px solid #cccccc;
border-radius: 10px;
padding: 10px;
margin: 0 10px 15px 0;
}
.rightSpan.canClick {
float: right;
}
.right {
text-align: right;
}
.left, .right {
width: 50%;
display: inline-block;
line-height: 40px;
}
.bottom {
line-height: 20px;
letter-spacing: 0.4px;
}
.charts {
border: 1px solid #cccccc;
padding: 10px;
border-radius: 10px;
margin-bottom: 15px;
}
......@@ -7,13 +7,39 @@ import {fadeIn} from '../../animation/fade-in';
@Component({
selector: 'app-sensor-detail',
templateUrl: './sensor-detail.component.html',
styles: [],
styleUrls: ['./sensor-detail.component.scss'],
animations: [fadeIn]
})
export class SensorDetailComponent implements OnInit {
isLoading = false;
data = [];
selectTime = 24;
req = {};
selectTime2 = 24;
req2 = {};
items = [{
name: '液位',
data: '1',
per: '℃',
max: '2',
min: '0',
time: new Date().getTime()
}, {
name: '液位',
data: '1',
per: '℃',
max: '2',
min: '0',
time: new Date().getTime()
}, {
name: '液位',
data: '1',
per: '℃',
max: '2',
min: '0',
time: new Date().getTime()
}];
constructor(private api: ApiService, private message: NzMessageService, private router: Router) { }
ngOnInit() {
......@@ -43,4 +69,10 @@ export class SensorDetailComponent implements OnInit {
toDetail() {
this.router.navigate(['/app/deviceCenter/sensorMgr/sensorDetail']);
}
onSearch() {}
onSearch2() {}
close() {}
}
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-topic-module-detail',
templateUrl: './topic-module-detail.component.html',
styles: []
})
export class TopicModuleDetailComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
<p>
topic-module-mgr 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 {ApiService} from '../../service/api';
import {NzMessageService} from 'ng-zorro-antd';
import {TranslateService} from '@ngx-translate/core';
import {fadeIn} from '../../animation/fade-in';
@Component({
selector: 'app-topic-module-mgr',
templateUrl: './topic-module-mgr.component.html',
styles: []
styles: [],
animations: [fadeIn]
})
export class TopicModuleMgrComponent 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) {
}
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();
}
}
}
import { RouterModule, Routes } from '@angular/router';
import { LayoutComponent } from './layout/layout.component';
import { AuthService } from './service/auth';
import { HomeComponent } from './main/home/home.component';
import {RouterModule, Routes} from '@angular/router';
import {LayoutComponent} from './layout/layout.component';
import {AuthService} from './service/auth';
import {HomeComponent} from './main/home/home.component';
import {LogComponent} from './main/log/log.component';
import {RoleComponent} from './main/role/role.component';
import {UserComponent} from './main/user/user.component';
......@@ -18,6 +18,8 @@ import {SetModuleMgrComponent} from './main/set-module-mgr/set-module-mgr.compon
import {TopicModuleMgrComponent} from './main/topic-module-mgr/topic-module-mgr.component';
import {SensorMgrComponent} from './main/sensor-mgr/sensor-mgr.component';
import {SensorDetailComponent} from './main/sensor-detail/sensor-detail.component';
import {ModuleDetailComponent} from './main/module-detail/module-detail.component';
import {TopicModuleDetailComponent} from './main/topic-module-detail/topic-module-detail.component';
const AppRoutes: Routes = [
{path: '', redirectTo: '/extra/login', pathMatch: 'full'},
......@@ -40,7 +42,9 @@ const routes: Routes = [
{path: 'deviceCenter/sensorMgr', component: SensorMgrComponent},
{path: 'deviceCenter/sensorMgr/sensorDetail', component: SensorDetailComponent},
{path: 'deviceCenter/moduleMgr', component: ModuleMgrComponent},
{path: 'deviceCenter/moduleMgr/moduleDetail', component: ModuleDetailComponent},
{path: 'deviceCenter/topicModuleMgr', component: TopicModuleMgrComponent},
{path: 'deviceCenter/topicModuleMgr/topicModuleDetail', component: TopicModuleDetailComponent},
{path: 'deviceCenter/setModuleMgr', component: SetModuleMgrComponent},
{path: 'deviceCenter/mqttSetMgr', component: MqttSetMgrComponent},
{path: 'systemMgr/userCenter', component: UserComponent},
......
......@@ -4,7 +4,7 @@
"deviceCenter": "设备中心",
"gatewayMgr": "网关管理",
"sensorMgr": "传感器管理",
"moduleMgr": "模块管理",
"moduleMgr": "通道模板",
"topicModuleMgr": "主题模板管理",
"setModuleMgr": "配置模板管理",
"mqttSetMgr": "MQTT账户管理",
......@@ -40,6 +40,8 @@
"divide": "分配",
"unbind": "解绑",
"update": "修改",
"back": "返回",
"close": "关闭",
"-----------业务-----------": "-----------业务-----------",
"loginName": "登录名",
"userRealName": "用户姓名",
......@@ -65,6 +67,7 @@
"editRole": "编辑角色",
"addRole": "新增角色",
"confirmDeleteThisRecord": "确认删除这条记录吗",
"confirmDeleteSelectedRecord": "确认批量删除选中的这些记录吗",
"loginOutValidityTips": "登录凭证失效,请重新登录",
"noLoginTips": "您尚未登录,请登录",
"wrongServerWithCode": "服务器异常,错误代码: ",
......@@ -75,5 +78,40 @@
"simCardNum": "SIM卡号",
"off/on": "卸载/挂载",
"belongCompany": "所属公司",
"isbind": "是否绑定"
"isbind": "是否绑定",
"gatewaySee": "查看网关",
"gatewayDetail": "网关详情",
"sensorName": "传感器名称",
"wayNum": "通道数",
"createTime": "创建时间",
"wayIndex": "通道编号",
"sensorSN": "传感器序列号",
"wayName": "通道名称",
"wayAlias": "通道别名",
"per": "单位",
"wayType": "通道类型",
"max": "最大值",
"min": "最小值",
"alarmMax": "报警上限",
"alarmMaxMax": "报警上上限",
"alarmMin": "报警下限",
"alarmMinMin": "报警下下限",
"sensorDetail": "传感器详情",
"topicName": "主题名",
"topicType": "主题类型",
"dataType": "数据类型",
"inTime": "间隔时间/ms",
"dataSaveInTime": "数据存储间隔时间/ms",
"sensor": "传感器",
"wayDetail": "通道详情",
"detail": "详情",
"gateway": "网关",
"multiAdd": "批量新增",
"addGateway": "新增网关",
"front": "前缀",
"frontName": "前缀名",
"addSensor": "新增传感器",
"selectTime": "选择时间",
"moduleName": "通道模板名称",
"topicModuleName": "主题配置模板名称"
}
......@@ -4,7 +4,7 @@
"deviceCenter": "设备中心",
"gatewayMgr": "网关管理",
"sensorMgr": "传感器管理",
"moduleMgr": "模块管理",
"moduleMgr": "通道模板",
"topicModuleMgr": "主题模板管理",
"setModuleMgr": "配置模板管理",
"mqttSetMgr": "MQTT账户管理",
......@@ -40,6 +40,8 @@
"divide": "分配",
"unbind": "解绑",
"update": "修改",
"back": "返回",
"close": "关闭",
"-----------业务-----------": "-----------业务-----------",
"loginName": "登录名",
"userRealName": "用户姓名",
......@@ -65,6 +67,7 @@
"editRole": "编辑角色",
"addRole": "新增角色",
"confirmDeleteThisRecord": "确认删除这条记录吗",
"confirmDeleteSelectedRecord": "确认批量删除选中的这些记录吗",
"loginOutValidityTips": "登录凭证失效,请重新登录",
"noLoginTips": "您尚未登录,请登录",
"wrongServerWithCode": "服务器异常,错误代码: ",
......@@ -75,5 +78,40 @@
"simCardNum": "SIM卡号",
"off/on": "卸载/挂载",
"belongCompany": "所属公司",
"isbind": "是否绑定"
"isbind": "是否绑定",
"gatewaySee": "查看网关",
"gatewayDetail": "网关详情",
"sensorName": "传感器名称",
"wayNum": "通道数",
"createTime": "创建时间",
"wayIndex": "通道编号",
"sensorSN": "传感器序列号",
"wayName": "通道名称",
"wayAlias": "通道别名",
"per": "单位",
"wayType": "通道类型",
"max": "最大值",
"min": "最小值",
"alarmMax": "报警上限",
"alarmMaxMax": "报警上上限",
"alarmMin": "报警下限",
"alarmMinMin": "报警下下限",
"sensorDetail": "传感器详情",
"topicName": "主题名",
"topicType": "主题类型",
"dataType": "数据类型",
"inTime": "间隔时间/ms",
"dataSaveInTime": "数据存储间隔时间/ms",
"sensor": "传感器",
"wayDetail": "通道详情",
"detail": "详情",
"gateway": "网关",
"multiAdd": "批量新增",
"addGateway": "新增网关",
"front": "前缀",
"frontName": "前缀名",
"addSensor": "新增传感器",
"selectTime": "选择时间",
"moduleName": "通道模板名称",
"topicModuleName": "主题配置模板名称"
}
......@@ -4,7 +4,7 @@
"deviceCenter": "设备中心",
"gatewayMgr": "网关管理",
"sensorMgr": "传感器管理",
"moduleMgr": "模块管理",
"moduleMgr": "通道模板",
"topicModuleMgr": "主题模板管理",
"setModuleMgr": "配置模板管理",
"mqttSetMgr": "MQTT账户管理",
......@@ -41,6 +41,7 @@
"unbind": "解绑",
"update": "修改",
"back": "返回",
"close": "关闭",
"-----------业务-----------": "-----------业务-----------",
"loginName": "登录名",
"userRealName": "用户姓名",
......@@ -107,6 +108,10 @@
"gateway": "网关",
"multiAdd": "批量新增",
"addGateway": "新增网关",
"front": "前缀",
"frontName": "前缀名",
"addSensor": "新增传感器"
"addSensor": "新增传感器",
"selectTime": "选择时间",
"moduleName": "通道模板名称",
"topicModuleName": "主题配置模板名称"
}
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