1 files added
4 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'); |
| | | } |
| | | } |
| | |
| | | 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'); |
| | | } |
| | | } |