fengxiang
2017-12-20 124766132b01645c9942f4cadd7cb88953bfc728
Merge branch 'develop' of http://blit.7drlb.com:8888/r/screen-frontend into develop
4 files added
7 files modified
106 ■■■■■ changed files
src/app/app.module.ts 2 ●●●●● patch | view | raw | blame | history
src/app/core/services/date.service.ts 11 ●●●●● patch | view | raw | blame | history
src/app/routes/routes.ts 1 ●●●● patch | view | raw | blame | history
src/app/routes/systems/account/account.component.html 3 ●●●●● patch | view | raw | blame | history
src/app/routes/systems/account/account.component.ts 25 ●●●●● patch | view | raw | blame | history
src/app/routes/systems/systems.module.ts 32 ●●●●● patch | view | raw | blame | history
src/app/routes/users/installer/edit/edit.component.ts 8 ●●●● patch | view | raw | blame | history
src/app/routes/users/installer/installer.component.html 4 ●●●● patch | view | raw | blame | history
src/app/routes/users/installer/installer.component.ts 7 ●●●● patch | view | raw | blame | history
src/assets/app-data.json 10 ●●●●● patch | view | raw | blame | history
src/assets/i18n/zh-CN.json 3 ●●●●● patch | view | raw | blame | history
src/app/app.module.ts
@@ -10,6 +10,7 @@
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';
@@ -60,6 +61,7 @@
        { 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,
src/app/core/services/date.service.ts
New file
@@ -0,0 +1,11 @@
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');
  }
}
src/app/routes/routes.ts
@@ -16,6 +16,7 @@
            { 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' } },
src/app/routes/systems/account/account.component.html
New file
@@ -0,0 +1,3 @@
<p>
  account works!
</p>
src/app/routes/systems/account/account.component.ts
New file
@@ -0,0 +1,25 @@
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() {
  }
}
src/app/routes/systems/systems.module.ts
New file
@@ -0,0 +1,32 @@
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 { }
src/app/routes/users/installer/edit/edit.component.ts
@@ -3,6 +3,7 @@
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',
@@ -16,12 +17,17 @@
  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');
      });
    }
  }
src/app/routes/users/installer/installer.component.html
@@ -79,8 +79,8 @@
      <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>
src/app/routes/users/installer/installer.component.ts
@@ -2,9 +2,9 @@
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',
@@ -31,6 +31,7 @@
  constructor(
    public http: HttpClient,
    public dateSrv: DateService,
    public msgSrv: NzMessageService,
    private modalHelper: ModalHelper) {}
@@ -136,4 +137,8 @@
    for (const item of ls) item.value = false;
    this.load(true);
  }
  format_date(date) {
    return this.dateSrv.date_format(date, 'YYYY-MM-DD');
  }
}
src/assets/app-data.json
@@ -59,6 +59,16 @@
      "link": "/sensors/basic",
      "translate": "device_management_info"
    }]
  }, {
    "text": "系统管理",
    "translate": "system_management",
    "link": "/",
    "icon": "icon-note",
    "children": [{
      "text": "账户管理",
      "link": "/systems/account",
      "translate": "system_management_account"
    }]
  }]
}]
}
src/assets/i18n/zh-CN.json
@@ -11,6 +11,9 @@
    "sensor_management": "传感器管理",
    "sensor_management_info": "基本信息",
    "system_management":"系统管理",
    "system_management_account":"账户管理",
    "settings": "设置",
    "profile": "个人资料",
    "login": "登录",