import { RhProjectConfigDto, RhLoginedUserDto, RhAppConfigDto, DataResultT, EmployeeInfoQueryDto, FullEmployeeInfoDto, UserAccountQueryDto, UserAccountInfo, myEmployeeInfoQueryDto, WithNil } from 'rh-base/model'; import { RhStorageService, RhAppConfigService, RhApiUrlsService } from 'rh-base/core'; import { Injectable } from '@angular/core'; import { Observable, Subject } from 'rxjs'; /** 程序根服务,用于存取整个程序中通用的一些数据 */ @Injectable({ providedIn: 'root' }) export class AppService { // 调试组件订阅方法 private debugSubject = new Subject(); get debugSubject$() { return this.debugSubject.asObservable(); } debugSubjectTrigger(status: boolean) { this.debugSubject.next(status); } constructor( private storage: RhStorageService, private appConfigSer: RhAppConfigService, private appconfigSer: RhAppConfigService, private apiUrls: RhApiUrlsService ) { } get appconfig(): RhAppConfigDto { return this.appConfigSer.appConfig; } get projectConfig(): RhProjectConfigDto { return this.appconfigSer.projectConfig; } getUser(): RhLoginedUserDto { return this.storage.getUserSession()?.User!; } getDebug() { return this.storage.getDebug(); } setLoginStatus(status: boolean) { this.storage.setLoginStatus(status); } getUserSession(ignore = false) { return this.storage.getUserSession(ignore); } //#region 后端接口区域开始 /** * 查询员工基本信息 */ GetEmployeeInfoDatas(queryDto: EmployeeInfoQueryDto): Observable> { return this.apiUrls.PostMdp('EmployeeWebApi', 'GetEmployeeInfoDatas', queryDto); } /** * 获取用户账户信息 */ GetUserAccounts(queryDto: UserAccountQueryDto): Observable> { return this.apiUrls.PostPp('YGAacApi', 'GetUserAccounts', queryDto); } //#endregion 后端接口区域结束 }