Merge branch 'develop' of http://blit.7drlb.com:8888/r/screen-frontend into develop
4 files added
7 files modified
| | |
| | | import { AppComponent } from './app.component'; |
| | | import { RoutesModule } from './routes/routes.module'; |
| | | import { LayoutModule } from './layout/layout.module'; |
| | | import { DateService } from './core/services/date.service'; |
| | | import { StartupService } from './core/services/startup.service'; |
| | | import { DefaultInterceptor } from '@core/net/default.interceptor'; |
| | | import { AlainAuthModule, SimpleInterceptor } from '@delon/auth'; |
| | |
| | | { provide: HTTP_INTERCEPTORS, useClass: SimpleInterceptor, multi: true}, |
| | | { provide: HTTP_INTERCEPTORS, useClass: DefaultInterceptor, multi: true}, |
| | | { provide: ALAIN_I18N_TOKEN, useClass: I18NService, multi: false }, |
| | | DateService, |
| | | StartupService, |
| | | { |
| | | provide: APP_INITIALIZER, |
New file |
| | |
| | | import {Injectable} from '@angular/core'; |
| | | |
| | | import * as moment from 'moment'; |
| | | |
| | | @Injectable() |
| | | export class DateService { |
| | | |
| | | date_format(date: string, format: string) { |
| | | return moment(date).format('YYYY-MM-DD'); |
| | | } |
| | | } |
| | |
| | | { path: 'users', loadChildren: './users/users.module#UsersModule' }, |
| | | { path: 'devices', loadChildren: './devices/devices.module#DevicesModule' }, |
| | | { path: 'sensors', loadChildren: './sensors/sensors.module#SensorsModule' }, |
| | | { path: 'systems', loadChildren: './systems/systems.module#SystemsModule' }, |
| | | |
| | | { path: 'dashboard/v1', component: DashboardV1Component, data: { translate: 'dashboard_v1' } }, |
| | | { path: 'dashboard/analysis', component: DashboardAnalysisComponent, data: { translate: 'dashboard_analysis' } }, |
New file |
| | |
| | | <p> |
| | | account works! |
| | | </p> |
New file |
| | |
| | | import { Component, OnInit } from '@angular/core'; |
| | | import { NzMessageService } from 'ng-zorro-antd'; |
| | | import { ModalHelper } from '@delon/theme'; |
| | | import { HttpClient } from '@angular/common/http'; |
| | | import * as moment from 'moment'; |
| | | |
| | | @Component({ |
| | | selector: 'app-account', |
| | | templateUrl: './account.component.html', |
| | | styles: [] |
| | | }) |
| | | export class AccountComponent implements OnInit { |
| | | |
| | | constructor( |
| | | public http: HttpClient, |
| | | public msgSrv: NzMessageService, |
| | | private modalHelper: ModalHelper) { |
| | | |
| | | } |
| | | |
| | | ngOnInit() { |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | import { Component, OnInit } from '@angular/core'; |
| | | import { NgModule } from '@angular/core'; |
| | | import { CommonModule } from '@angular/common'; |
| | | import { RouterModule, Routes } from '@angular/router'; |
| | | import { SharedModule } from '@shared/shared.module'; |
| | | |
| | | import { AccountComponent } from './account/account.component'; |
| | | |
| | | const routes: Routes = [ |
| | | { |
| | | path: '', |
| | | children: [ |
| | | { path: 'account', component: AccountComponent } |
| | | ] |
| | | } |
| | | ]; |
| | | |
| | | const COMPONENTS_NOROUNT = [ ]; |
| | | |
| | | @NgModule({ |
| | | imports: [ |
| | | CommonModule, |
| | | SharedModule, |
| | | RouterModule.forChild(routes) |
| | | ], |
| | | declarations: [ |
| | | ...COMPONENTS_NOROUNT, |
| | | AccountComponent |
| | | ], |
| | | entryComponents: COMPONENTS_NOROUNT |
| | | }) |
| | | export class SystemsModule { } |
| | |
| | | import { ModalHelper } from '@delon/theme'; |
| | | import { HttpClient } from '@angular/common/http'; |
| | | import { environment } from '../../../../../environments/environment'; |
| | | import { DateService } from '../../../../core/services/date.service'; |
| | | |
| | | @Component({ |
| | | selector: 'app-edit', |
| | |
| | | constructor( |
| | | private modalHelper: ModalHelper, |
| | | private subject: NzModalSubject, |
| | | public dateSrv: DateService, |
| | | public msgSrv: NzMessageService, |
| | | public http: HttpClient) { } |
| | | |
| | | ngOnInit() { |
| | | if (this.user.id > 0) { |
| | | this.http.get(environment.SERVER_BASH_URL + '/user/operate_user/' + this.user.id).subscribe((res: any) => this.user = res.data ); |
| | | this.http.get(environment.SERVER_BASH_URL + '/user/operate_user/' + this.user.id).subscribe((res: any) => { |
| | | this.user = res; |
| | | this.user.createTime = this.dateSrv.date_format(this.user.createTime, 'YYYY-MM-DD'); |
| | | this.user.expireTime = this.dateSrv.date_format(this.user.expireTime, 'YYYY-MM-DD'); |
| | | }); |
| | | } |
| | | } |
| | | |
| | |
| | | <td nz-td>{{i.weixin}}</td> |
| | | <td nz-td>{{i.password}}</td> |
| | | <td nz-td>{{i.organizationId}}</td> |
| | | <td nz-td>{{i.createTime | _date}}</td> |
| | | <td nz-td>{{i.expireTime | _date}}</td> |
| | | <td nz-td>{{format_date(i.createTime)}}</td> |
| | | <td nz-td>{{format_date(i.expireTime)}}</td> |
| | | <td nz-td> |
| | | <a (click)="edit(i)">编辑</a> |
| | | <span nz-table-divider></span> |
| | |
| | | import { NzMessageService } from 'ng-zorro-antd'; |
| | | import { ModalHelper } from '@delon/theme'; |
| | | import { HttpClient } from '@angular/common/http'; |
| | | import * as moment from 'moment'; |
| | | import { UserInstallerEditComponent } from './edit/edit.component'; |
| | | import { environment } from '../../../../environments/environment'; |
| | | import { DateService } from '../../../core/services/date.service'; |
| | | |
| | | @Component({ |
| | | selector: 'app-installer', |
| | |
| | | |
| | | constructor( |
| | | public http: HttpClient, |
| | | public dateSrv: DateService, |
| | | public msgSrv: NzMessageService, |
| | | private modalHelper: ModalHelper) {} |
| | | |
| | |
| | | for (const item of ls) item.value = false; |
| | | this.load(true); |
| | | } |
| | | |
| | | format_date(date) { |
| | | return this.dateSrv.date_format(date, 'YYYY-MM-DD'); |
| | | } |
| | | } |
| | |
| | | "link": "/sensors/basic", |
| | | "translate": "device_management_info" |
| | | }] |
| | | }, { |
| | | "text": "系统管理", |
| | | "translate": "system_management", |
| | | "link": "/", |
| | | "icon": "icon-note", |
| | | "children": [{ |
| | | "text": "账户管理", |
| | | "link": "/systems/account", |
| | | "translate": "system_management_account" |
| | | }] |
| | | }] |
| | | }] |
| | | } |
| | |
| | | "sensor_management": "传感器管理", |
| | | "sensor_management_info": "基本信息", |
| | | |
| | | "system_management":"系统管理", |
| | | "system_management_account":"账户管理", |
| | | |
| | | "settings": "设置", |
| | | "profile": "个人资料", |
| | | "login": "登录", |