From 9161156e9929898163de8997ae8dccefcda58611 Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Wed, 13 Apr 2022 20:25:17 +0800 Subject: [PATCH] edit --- src/app/core/startup/startup.service.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/app/core/startup/startup.service.ts b/src/app/core/startup/startup.service.ts index 4b746335..5a8be33e 100644 --- a/src/app/core/startup/startup.service.ts +++ b/src/app/core/startup/startup.service.ts @@ -4,10 +4,13 @@ import { cacheConf } from '@conf/cache.conf'; import { sysConf } from '@conf/sys.conf'; import { ACLService } from '@delon/acl'; import { MenuService, SettingsService, TitleService, _HttpClient } from '@delon/theme'; +import { AlainConfigService } from '@delon/util'; import { environment } from '@env/environment'; import { AmapService, EACacheService, EAUserService } from '@shared'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; import { NzIconService } from 'ng-zorro-antd/icon'; +import { NzImageService } from 'ng-zorro-antd/image'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; import { Observable, zip } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; @@ -31,10 +34,22 @@ export class StartupService { private userSrv: EAUserService, private amapService: AmapService, public cacheSrv: EACacheService, - private coreSrv: CoreService + private coreSrv: CoreService, + private nzImageService: NzImageService, + private alainConfigService: AlainConfigService ) { iconSrv.addIcon(...ICONS_AUTO, ...ICONS); this.settingService.setLayout('fixSiderbar', true); + // 全局修改sf图片预览方式 + alainConfigService.set('sf', { + ui: { + preview: (file: NzUploadFile) => { + if (file.url) { + this.nzImageService.preview([{ src: file.url }]); + } + } + } + }); } // TODO: 退出登录时需要清理用户信息