From 3d80145be27ef58bac0cee5e912ebdfc2fbb1dcd Mon Sep 17 00:00:00 2001 From: cipchk Date: Sun, 12 Nov 2023 23:19:51 +0800 Subject: [PATCH 01/16] feat: configure app using provide --- src/app/app.component.ts | 6 +- src/app/app.config.ts | 65 +++++++++++ src/app/app.module.ts | 107 ------------------ src/app/core/core.module.ts | 12 -- src/app/core/index.ts | 1 - src/app/core/module-import-guard.ts | 6 - src/app/core/net/default.interceptor.ts | 15 ++- src/app/core/startup/startup.service.ts | 22 ++-- src/app/global-config.module.ts | 77 ------------- src/app/layout/basic/basic.component.ts | 48 +++++++- .../basic/widgets/clear-storage.component.ts | 6 +- .../basic/widgets/fullscreen.component.ts | 6 +- .../layout/basic/widgets/i18n.component.ts | 20 +++- .../layout/basic/widgets/icon.component.ts | 9 +- .../layout/basic/widgets/notify.component.ts | 6 +- src/app/layout/basic/widgets/rtl.component.ts | 6 +- .../layout/basic/widgets/search.component.ts | 18 ++- .../layout/basic/widgets/task.component.ts | 19 +++- .../layout/basic/widgets/user.component.ts | 10 +- src/app/layout/blank/blank.component.ts | 5 +- src/app/layout/index.ts | 3 + src/app/layout/layout.module.ts | 80 ------------- .../layout/passport/passport.component.html | 2 +- src/app/layout/passport/passport.component.ts | 10 +- .../analysis/analysis.component.html | 63 +++++++---- .../dashboard/analysis/analysis.component.ts | 28 ++++- src/app/routes/dashboard/dashboard.module.ts | 55 --------- .../dashboard/monitor/monitor.component.html | 8 +- .../dashboard/monitor/monitor.component.ts | 12 +- ...{dashboard-routing.module.ts => routes.ts} | 11 +- src/app/routes/dashboard/v1/v1.component.html | 35 ++++-- src/app/routes/dashboard/v1/v1.component.ts | 11 +- .../workplace/workplace.component.html | 24 +++- .../workplace/workplace.component.ts | 7 +- .../routes/exception/exception.component.ts | 6 +- src/app/routes/exception/exception.module.ts | 15 --- ...{exception-routing.module.ts => routes.ts} | 11 +- src/app/routes/exception/trigger.component.ts | 10 +- src/app/routes/extras/extras.module.ts | 3 +- src/app/routes/passport/callback.component.ts | 3 +- .../routes/passport/lock/lock.component.ts | 5 +- .../passport/login/login.component.html | 15 +-- .../routes/passport/login/login.component.ts | 5 +- src/app/routes/passport/passport.module.ts | 17 --- .../register-result.component.ts | 6 +- .../passport/register/register.component.html | 34 ++++-- .../passport/register/register.component.ts | 5 +- .../{passport-routing.module.ts => routes.ts} | 13 +-- src/app/routes/pro/pro.module.ts | 6 +- src/app/routes/routes-routing.module.ts | 62 ---------- src/app/routes/routes.module.ts | 12 -- src/app/routes/routes.ts | 40 +++++++ src/app/routes/widgets/routes.ts | 5 + .../routes/widgets/widgets-routing.module.ts | 12 -- src/app/routes/widgets/widgets.module.ts | 16 --- .../widgets/widgets/widgets.component.html | 15 ++- .../widgets/widgets/widgets.component.ts | 9 +- src/app/shared/index.ts | 4 +- src/app/shared/json-schema/index.ts | 3 + .../shared/json-schema/json-schema.module.ts | 18 --- .../shared/json-schema/test/test.widget.ts | 6 +- src/app/shared/shared-delon.module.ts | 3 +- src/app/shared/shared-zorro.module.ts | 4 +- src/app/shared/shared.ts | 20 ++++ src/app/shared/st-widget/index.ts | 1 + src/app/shared/st-widget/st-widget.module.ts | 17 --- src/main.ts | 13 +-- 67 files changed, 554 insertions(+), 673 deletions(-) create mode 100644 src/app/app.config.ts delete mode 100644 src/app/app.module.ts delete mode 100644 src/app/core/core.module.ts delete mode 100644 src/app/core/module-import-guard.ts delete mode 100644 src/app/global-config.module.ts create mode 100644 src/app/layout/index.ts delete mode 100644 src/app/layout/layout.module.ts delete mode 100644 src/app/routes/dashboard/dashboard.module.ts rename src/app/routes/dashboard/{dashboard-routing.module.ts => routes.ts} (70%) delete mode 100644 src/app/routes/exception/exception.module.ts rename src/app/routes/exception/{exception-routing.module.ts => routes.ts} (61%) delete mode 100644 src/app/routes/passport/passport.module.ts rename src/app/routes/passport/{passport-routing.module.ts => routes.ts} (77%) delete mode 100644 src/app/routes/routes-routing.module.ts delete mode 100644 src/app/routes/routes.module.ts create mode 100644 src/app/routes/routes.ts create mode 100644 src/app/routes/widgets/routes.ts delete mode 100644 src/app/routes/widgets/widgets-routing.module.ts delete mode 100644 src/app/routes/widgets/widgets.module.ts create mode 100644 src/app/shared/json-schema/index.ts delete mode 100644 src/app/shared/json-schema/json-schema.module.ts create mode 100644 src/app/shared/shared.ts create mode 100644 src/app/shared/st-widget/index.ts delete mode 100644 src/app/shared/st-widget/st-widget.module.ts diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 7c992da04..b795e2067 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,5 +1,5 @@ import { Component, ElementRef, OnInit, Renderer2 } from '@angular/core'; -import { NavigationEnd, NavigationError, RouteConfigLoadStart, Router } from '@angular/router'; +import { NavigationEnd, NavigationError, RouteConfigLoadStart, Router, RouterOutlet } from '@angular/router'; import { TitleService, VERSION as VERSION_ALAIN, stepPreloader } from '@delon/theme'; import { environment } from '@env/environment'; import { NzModalService } from 'ng-zorro-antd/modal'; @@ -7,7 +7,9 @@ import { VERSION as VERSION_ZORRO } from 'ng-zorro-antd/version'; @Component({ selector: 'app-root', - template: ` ` + template: ` `, + standalone: true, + imports: [RouterOutlet] }) export class AppComponent implements OnInit { private donePreloader = stepPreloader(); diff --git a/src/app/app.config.ts b/src/app/app.config.ts new file mode 100644 index 000000000..1cbd31fa1 --- /dev/null +++ b/src/app/app.config.ts @@ -0,0 +1,65 @@ +import { provideHttpClient } from '@angular/common/http'; +import { default as ngLang } from '@angular/common/locales/zh'; +import { ApplicationConfig } from '@angular/core'; +import { provideAnimations } from '@angular/platform-browser/animations'; +import { provideRouter, withComponentInputBinding, withInMemoryScrolling, withHashLocation, RouterFeatures } from '@angular/router'; +import { I18NService, provideDefaultInterceptor, provideStartup } from '@core'; +import { provideCellWidgets } from '@delon/abc/cell'; +import { provideSTWidgets } from '@delon/abc/st'; +import { provideAuth, withSimple } from '@delon/auth'; +import { provideSFConfig } from '@delon/form'; +import { AlainProvideLang, provideAlain, zh_CN as delonLang } from '@delon/theme'; +import { AlainConfig } from '@delon/util/config'; +import { environment } from '@env/environment'; +import { CELL_WIDGETS, ST_WIDGETS } from '@shared'; +import { zhCN as dateLang } from 'date-fns/locale'; +import { NzConfig, provideNzConfig } from 'ng-zorro-antd/core/config'; +import { zh_CN as zorroLang } from 'ng-zorro-antd/i18n'; +import { ICONS } from 'src/style-icons'; +import { ICONS_AUTO } from 'src/style-icons-auto'; + +import { routes } from './routes/routes'; + +const defaultLang: AlainProvideLang = { + abbr: 'zh-CN', + ng: ngLang, + zorro: zorroLang, + date: dateLang, + delon: delonLang +}; + +const alainConfig: AlainConfig = { + st: { modal: { size: 'lg' } }, + pageHeader: { homeI18n: 'home' }, + lodop: { + license: `A59B099A586B3851E0F0D7FDBF37B603`, + licenseA: `C94CEE276DB2187AE6B65D56B3FC2848` + }, + auth: { login_url: '/passport/login' } +}; + +const ngZorroConfig: NzConfig = {}; + +const routerFeatures: RouterFeatures[] = [withComponentInputBinding(), withInMemoryScrolling({ scrollPositionRestoration: 'top' })]; +if (environment.useHash) routerFeatures.push(withHashLocation()); + +export const appConfig: ApplicationConfig = { + providers: [ + provideHttpClient(), + provideAnimations(), + provideRouter(routes, ...routerFeatures), + provideAlain({ config: alainConfig, defaultLang, i18nClass: I18NService, icons: [...ICONS_AUTO, ...ICONS] }), + provideNzConfig(ngZorroConfig), + provideAuth(withSimple()), + provideCellWidgets(...CELL_WIDGETS), + provideSTWidgets(...ST_WIDGETS), + provideSFConfig({ + widgets: [ + // withUploadWidget() + ] + }), + provideStartup(), + provideDefaultInterceptor(), + ...(environment.providers || []) + ] +}; diff --git a/src/app/app.module.ts b/src/app/app.module.ts deleted file mode 100644 index 56d518951..000000000 --- a/src/app/app.module.ts +++ /dev/null @@ -1,107 +0,0 @@ -/* eslint-disable import/order */ -/* eslint-disable import/no-duplicates */ -import { default as ngLang } from '@angular/common/locales/zh'; -import { APP_INITIALIZER, LOCALE_ID, NgModule, Type } from '@angular/core'; -import { BrowserModule } from '@angular/platform-browser'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { SimpleInterceptor } from '@delon/auth'; -import { DELON_LOCALE, zh_CN as delonLang, ALAIN_I18N_TOKEN } from '@delon/theme'; -import { NZ_DATE_LOCALE, provideNzI18n, zh_CN as zorroLang } from 'ng-zorro-antd/i18n'; -import { NzNotificationModule } from 'ng-zorro-antd/notification'; - -// #region default language -// 参考:https://ng-alain.com/docs/i18n -import { I18NService } from '@core'; -import { zhCN as dateLang } from 'date-fns/locale'; - -const LANG = { - abbr: 'zh', - ng: ngLang, - zorro: zorroLang, - date: dateLang, - delon: delonLang -}; -// register angular -import { registerLocaleData } from '@angular/common'; -registerLocaleData(LANG.ng, LANG.abbr); -const LANG_PROVIDES = [ - { provide: LOCALE_ID, useValue: LANG.abbr }, - provideNzI18n(LANG.zorro), - { provide: NZ_DATE_LOCALE, useValue: LANG.date }, - { provide: DELON_LOCALE, useValue: LANG.delon } -]; -// #endregion - -// #region i18n services - -const I18NSERVICE_PROVIDES = [{ provide: ALAIN_I18N_TOKEN, useClass: I18NService, multi: false }]; - -// #endregion - -// #region global third module - -import { BidiModule } from '@angular/cdk/bidi'; -const GLOBAL_THIRD_MODULES: Array> = [BidiModule]; - -// #endregion - -// #region JSON Schema form (using @delon/form) -import { JsonSchemaModule } from '@shared'; -const FORM_MODULES = [JsonSchemaModule]; -// #endregion - -// #region Http Interceptors -import { HTTP_INTERCEPTORS } from '@angular/common/http'; - -import { DefaultInterceptor } from '@core'; - -const INTERCEPTOR_PROVIDES = [ - { provide: HTTP_INTERCEPTORS, useClass: SimpleInterceptor, multi: true }, - { provide: HTTP_INTERCEPTORS, useClass: DefaultInterceptor, multi: true } -]; -// #endregion - -// #region Startup Service -import { StartupService } from '@core'; -export function StartupServiceFactory(startupService: StartupService): () => Observable { - return () => startupService.load(); -} -const APPINIT_PROVIDES = [ - StartupService, - { - provide: APP_INITIALIZER, - useFactory: StartupServiceFactory, - deps: [StartupService], - multi: true - } -]; -// #endregion - -import { AppComponent } from './app.component'; -import { CoreModule } from './core/core.module'; -import { GlobalConfigModule } from './global-config.module'; -import { LayoutModule } from './layout/layout.module'; -import { RoutesModule } from './routes/routes.module'; -import { SharedModule } from './shared/shared.module'; -import { STWidgetModule } from './shared/st-widget/st-widget.module'; -import { Observable } from 'rxjs'; - -@NgModule({ - declarations: [AppComponent], - imports: [ - BrowserModule, - BrowserAnimationsModule, - GlobalConfigModule.forRoot(), - CoreModule, - SharedModule, - LayoutModule, - RoutesModule, - STWidgetModule, - NzNotificationModule, - ...GLOBAL_THIRD_MODULES, - ...FORM_MODULES - ], - providers: [...LANG_PROVIDES, ...INTERCEPTOR_PROVIDES, ...I18NSERVICE_PROVIDES, ...APPINIT_PROVIDES], - bootstrap: [AppComponent] -}) -export class AppModule {} diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts deleted file mode 100644 index 58522fc1b..000000000 --- a/src/app/core/core.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { NgModule, Optional, SkipSelf } from '@angular/core'; - -import { throwIfAlreadyLoaded } from './module-import-guard'; - -@NgModule({ - providers: [] -}) -export class CoreModule { - constructor(@Optional() @SkipSelf() parentModule: CoreModule) { - throwIfAlreadyLoaded(parentModule, 'CoreModule'); - } -} diff --git a/src/app/core/index.ts b/src/app/core/index.ts index 31b2d1167..ceb573789 100644 --- a/src/app/core/index.ts +++ b/src/app/core/index.ts @@ -1,5 +1,4 @@ export * from './i18n/i18n.service'; -export * from './module-import-guard'; export * from './net/default.interceptor'; export * from './startup/startup.service'; export * from './start-page.guard'; diff --git a/src/app/core/module-import-guard.ts b/src/app/core/module-import-guard.ts deleted file mode 100644 index ad3d795ac..000000000 --- a/src/app/core/module-import-guard.ts +++ /dev/null @@ -1,6 +0,0 @@ -// https://angular.io/guide/styleguide#style-04-12 -export function throwIfAlreadyLoaded(parentModule: any, moduleName: string): void { - if (parentModule) { - throw new Error(`${moduleName} has already been loaded. Import Core modules in the AppModule only.`); - } -} diff --git a/src/app/core/net/default.interceptor.ts b/src/app/core/net/default.interceptor.ts index 4ee7d44f3..e0b33325b 100644 --- a/src/app/core/net/default.interceptor.ts +++ b/src/app/core/net/default.interceptor.ts @@ -1,4 +1,5 @@ import { + HTTP_INTERCEPTORS, HttpErrorResponse, HttpEvent, HttpHandler, @@ -7,7 +8,7 @@ import { HttpRequest, HttpResponseBase } from '@angular/common/http'; -import { Injectable, Injector } from '@angular/core'; +import { Injectable, Injector, Provider } from '@angular/core'; import { Router } from '@angular/router'; import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth'; import { ALAIN_I18N_TOKEN, IGNORE_BASE_URL, _HttpClient, CUSTOM_ERROR, RAW_BODY } from '@delon/theme'; @@ -15,6 +16,16 @@ import { environment } from '@env/environment'; import { NzNotificationService } from 'ng-zorro-antd/notification'; import { BehaviorSubject, Observable, of, throwError, catchError, filter, mergeMap, switchMap, take } from 'rxjs'; +export function provideDefaultInterceptor(): Provider[] { + return [ + { + provide: HTTP_INTERCEPTORS, + useClass: DefaultInterceptor, + multi: true + } + ]; +} + const CODEMESSAGE: { [key: number]: string } = { 200: '服务器成功返回请求的数据。', 201: '新建或修改数据成功。', @@ -37,7 +48,7 @@ const CODEMESSAGE: { [key: number]: string } = { * 默认HTTP拦截器,其注册细节见 `app.module.ts` */ @Injectable() -export class DefaultInterceptor implements HttpInterceptor { +class DefaultInterceptor implements HttpInterceptor { private refreshTokenEnabled = environment.api.refreshTokenEnabled; private refreshTokenType: 're-request' | 'auth-refresh' = environment.api.refreshTokenType; private refreshToking = false; diff --git a/src/app/core/startup/startup.service.ts b/src/app/core/startup/startup.service.ts index c7e439c83..4e8686ab6 100644 --- a/src/app/core/startup/startup.service.ts +++ b/src/app/core/startup/startup.service.ts @@ -1,16 +1,25 @@ import { HttpClient } from '@angular/common/http'; -import { Inject, Injectable } from '@angular/core'; +import { APP_INITIALIZER, Inject, Injectable, Provider } from '@angular/core'; import { Router } from '@angular/router'; import { ACLService } from '@delon/acl'; import { ALAIN_I18N_TOKEN, MenuService, SettingsService, TitleService } from '@delon/theme'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; -import { NzIconService } from 'ng-zorro-antd/icon'; import { Observable, zip, catchError, map } from 'rxjs'; -import { ICONS } from '../../../style-icons'; -import { ICONS_AUTO } from '../../../style-icons-auto'; import { I18NService } from '../i18n/i18n.service'; +export function provideStartup(): Provider[] { + return [ + StartupService, + { + provide: APP_INITIALIZER, + useFactory: (startupService: StartupService) => () => startupService.load(), + deps: [StartupService], + multi: true + } + ]; +} + /** * Used for application startup * Generally used to get the basic data of the application, like: Menu Data, User Data, etc. @@ -18,7 +27,6 @@ import { I18NService } from '../i18n/i18n.service'; @Injectable() export class StartupService { constructor( - iconSrv: NzIconService, private menuService: MenuService, @Inject(ALAIN_I18N_TOKEN) private i18n: I18NService, private settingService: SettingsService, @@ -26,9 +34,7 @@ export class StartupService { private titleService: TitleService, private httpClient: HttpClient, private router: Router - ) { - iconSrv.addIcon(...ICONS_AUTO, ...ICONS); - } + ) {} load(): Observable { const defaultLang = this.i18n.defaultLang; diff --git a/src/app/global-config.module.ts b/src/app/global-config.module.ts deleted file mode 100644 index 9b48929bb..000000000 --- a/src/app/global-config.module.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* eslint-disable import/order */ -import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core'; -import { AlainConfig } from '@delon/util/config'; - -import { throwIfAlreadyLoaded } from '@core'; - -import { environment } from '@env/environment'; - -// Please refer to: https://ng-alain.com/docs/global-config -// #region NG-ALAIN Config - -const alainConfig: AlainConfig = { - st: { modal: { size: 'lg' } }, - pageHeader: { homeI18n: 'home' }, - lodop: { - license: `A59B099A586B3851E0F0D7FDBF37B603`, - licenseA: `C94CEE276DB2187AE6B65D56B3FC2848` - }, - auth: { login_url: '/passport/login' } -}; - -const alainModules: any[] = []; -const alainProvides = [provideAlain({ config: alainConfig })]; - -// #region reuse-tab -/** - * 若需要[路由复用](https://ng-alain.com/components/reuse-tab)需要: - * 1、在 `shared-delon.module.ts` 导入 `ReuseTabModule` 模块 - * 2、注册 `RouteReuseStrategy` - * 3、在 `src/app/layout/default/default.component.html` 修改: - * ```html - *
- * - * - *
- * ``` - */ -// import { RouteReuseStrategy } from '@angular/router'; -// import { ReuseTabService, ReuseTabStrategy } from '@delon/abc/reuse-tab'; -// alainProvides.push({ -// provide: RouteReuseStrategy, -// useClass: ReuseTabStrategy, -// deps: [ReuseTabService], -// } as any); - -// #endregion - -// #endregion - -// Please refer to: https://ng.ant.design/docs/global-config/en#how-to-use -// #region NG-ZORRO Config - -import { NzConfig, provideNzConfig } from 'ng-zorro-antd/core/config'; -import { provideAlain } from '@delon/theme'; -import { provideHttpClient, withInterceptors } from '@angular/common/http'; - -const ngZorroConfig: NzConfig = {}; - -const zorroProvides = [provideNzConfig(ngZorroConfig)]; - -// #endregion - -@NgModule({ - imports: [...alainModules, ...(environment.modules || [])] -}) -export class GlobalConfigModule { - constructor(@Optional() @SkipSelf() parentModule: GlobalConfigModule) { - throwIfAlreadyLoaded(parentModule, 'GlobalConfigModule'); - } - - static forRoot(): ModuleWithProviders { - return { - ngModule: GlobalConfigModule, - providers: [...alainProvides, ...zorroProvides, ...(environment.providers || []), provideHttpClient()] - }; - } -} diff --git a/src/app/layout/basic/basic.component.ts b/src/app/layout/basic/basic.component.ts index 1b184f6ce..28f6230b8 100644 --- a/src/app/layout/basic/basic.component.ts +++ b/src/app/layout/basic/basic.component.ts @@ -1,7 +1,24 @@ import { Component } from '@angular/core'; -import { SettingsService, User } from '@delon/theme'; -import { LayoutDefaultOptions } from '@delon/theme/layout-default'; +import { RouterLink, RouterOutlet } from '@angular/router'; +import { I18nPipe, SettingsService, User } from '@delon/theme'; +import { LayoutDefaultModule, LayoutDefaultOptions } from '@delon/theme/layout-default'; +import { SettingDrawerModule } from '@delon/theme/setting-drawer'; +import { ThemeBtnComponent } from '@delon/theme/theme-btn'; import { environment } from '@env/environment'; +import { NzAvatarModule } from 'ng-zorro-antd/avatar'; +import { NzDropDownModule } from 'ng-zorro-antd/dropdown'; +import { NzIconModule } from 'ng-zorro-antd/icon'; +import { NzMenuModule } from 'ng-zorro-antd/menu'; + +import { HeaderClearStorageComponent } from './widgets/clear-storage.component'; +import { HeaderFullScreenComponent } from './widgets/fullscreen.component'; +import { HeaderI18nComponent } from './widgets/i18n.component'; +import { HeaderIconComponent } from './widgets/icon.component'; +import { HeaderNotifyComponent } from './widgets/notify.component'; +import { HeaderRTLComponent } from './widgets/rtl.component'; +import { HeaderSearchComponent } from './widgets/search.component'; +import { HeaderTaskComponent } from './widgets/task.component'; +import { HeaderUserComponent } from './widgets/user.component'; @Component({ selector: 'layout-basic', @@ -77,10 +94,31 @@ import { environment } from '@env/environment'; - - + @if (showSettingDrawer) { } - ` + `, + standalone: true, + imports: [ + RouterOutlet, + RouterLink, + I18nPipe, + LayoutDefaultModule, + NzIconModule, + NzMenuModule, + NzDropDownModule, + NzAvatarModule, + SettingDrawerModule, + ThemeBtnComponent, + HeaderSearchComponent, + HeaderNotifyComponent, + HeaderTaskComponent, + HeaderIconComponent, + HeaderRTLComponent, + HeaderI18nComponent, + HeaderClearStorageComponent, + HeaderFullScreenComponent, + HeaderUserComponent + ] }) export class LayoutBasicComponent { options: LayoutDefaultOptions = { diff --git a/src/app/layout/basic/widgets/clear-storage.component.ts b/src/app/layout/basic/widgets/clear-storage.component.ts index 491824a2b..536464897 100644 --- a/src/app/layout/basic/widgets/clear-storage.component.ts +++ b/src/app/layout/basic/widgets/clear-storage.component.ts @@ -1,4 +1,6 @@ import { ChangeDetectionStrategy, Component, HostListener } from '@angular/core'; +import { I18nPipe } from '@delon/theme'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzMessageService } from 'ng-zorro-antd/message'; import { NzModalService } from 'ng-zorro-antd/modal'; @@ -11,7 +13,9 @@ import { NzModalService } from 'ng-zorro-antd/modal'; host: { '[class.flex-1]': 'true' }, - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NzIconModule, I18nPipe] }) export class HeaderClearStorageComponent { constructor( diff --git a/src/app/layout/basic/widgets/fullscreen.component.ts b/src/app/layout/basic/widgets/fullscreen.component.ts index e6c8c00be..0f24c12ec 100644 --- a/src/app/layout/basic/widgets/fullscreen.component.ts +++ b/src/app/layout/basic/widgets/fullscreen.component.ts @@ -1,4 +1,6 @@ import { ChangeDetectionStrategy, Component, HostListener } from '@angular/core'; +import { I18nPipe } from '@delon/theme'; +import { NzIconModule } from 'ng-zorro-antd/icon'; import screenfull from 'screenfull'; @Component({ @@ -10,7 +12,9 @@ import screenfull from 'screenfull'; host: { '[class.flex-1]': 'true' }, - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NzIconModule, I18nPipe] }) export class HeaderFullScreenComponent { status = false; diff --git a/src/app/layout/basic/widgets/i18n.component.ts b/src/app/layout/basic/widgets/i18n.component.ts index eaf5de20f..ca3df8cc5 100644 --- a/src/app/layout/basic/widgets/i18n.component.ts +++ b/src/app/layout/basic/widgets/i18n.component.ts @@ -1,31 +1,41 @@ import { DOCUMENT } from '@angular/common'; import { ChangeDetectionStrategy, Component, Inject, Input } from '@angular/core'; import { I18NService } from '@core'; -import { ALAIN_I18N_TOKEN, SettingsService } from '@delon/theme'; +import { ALAIN_I18N_TOKEN, I18nPipe, SettingsService } from '@delon/theme'; import { BooleanInput, InputBoolean } from '@delon/util/decorator'; +import { NzDropDownModule } from 'ng-zorro-antd/dropdown'; +import { NzIconModule } from 'ng-zorro-antd/icon'; +import { NzMenuModule } from 'ng-zorro-antd/menu'; @Component({ selector: 'header-i18n', template: ` -
+ @if (showLangText) { +
{{ 'menu.lang' | i18n }}
- + } @else { + + }
    -
  • + @for (item of langs; track $index) { +
  • {{ item.abbr }} {{ item.text }}
  • + }
`, host: { '[class.flex-1]': 'true' }, - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [I18nPipe, NzDropDownModule, NzIconModule, NzMenuModule] }) export class HeaderI18nComponent { static ngAcceptInputType_showLangText: BooleanInput; diff --git a/src/app/layout/basic/widgets/icon.component.ts b/src/app/layout/basic/widgets/icon.component.ts index 6526c8ea7..0ca35b786 100644 --- a/src/app/layout/basic/widgets/icon.component.ts +++ b/src/app/layout/basic/widgets/icon.component.ts @@ -1,4 +1,9 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component } from '@angular/core'; +import { NzDropDownModule } from 'ng-zorro-antd/dropdown'; +import { NzGridModule } from 'ng-zorro-antd/grid'; +import { NzIconModule } from 'ng-zorro-antd/icon'; +import { NzMenuModule } from 'ng-zorro-antd/menu'; +import { NzSpinModule } from 'ng-zorro-antd/spin'; @Component({ selector: 'header-icon', @@ -54,7 +59,9 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component } from '@angular/
`, - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NzDropDownModule, NzIconModule, NzMenuModule, NzGridModule, NzSpinModule] }) export class HeaderIconComponent { loading = true; diff --git a/src/app/layout/basic/widgets/notify.component.ts b/src/app/layout/basic/widgets/notify.component.ts index 2765fe65a..7aea641ed 100644 --- a/src/app/layout/basic/widgets/notify.component.ts +++ b/src/app/layout/basic/widgets/notify.component.ts @@ -1,5 +1,5 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component } from '@angular/core'; -import { NoticeIconList, NoticeIconSelect, NoticeItem } from '@delon/abc/notice-icon'; +import { NoticeIconList, NoticeIconModule, NoticeIconSelect, NoticeItem } from '@delon/abc/notice-icon'; import { add, formatDistanceToNow, parse } from 'date-fns'; import { NzI18nService } from 'ng-zorro-antd/i18n'; import { NzMessageService } from 'ng-zorro-antd/message'; @@ -18,7 +18,9 @@ import { NzMessageService } from 'ng-zorro-antd/message'; (popoverVisibleChange)="loadData()" /> `, - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NoticeIconModule] }) export class HeaderNotifyComponent { data: NoticeItem[] = [ diff --git a/src/app/layout/basic/widgets/rtl.component.ts b/src/app/layout/basic/widgets/rtl.component.ts index 04cdee635..719155831 100644 --- a/src/app/layout/basic/widgets/rtl.component.ts +++ b/src/app/layout/basic/widgets/rtl.component.ts @@ -1,5 +1,7 @@ +import { UpperCasePipe } from '@angular/common'; import { ChangeDetectionStrategy, Component, HostListener } from '@angular/core'; import { RTLService } from '@delon/theme'; +import { NzIconModule } from 'ng-zorro-antd/icon'; @Component({ selector: 'header-rtl', @@ -10,7 +12,9 @@ import { RTLService } from '@delon/theme'; host: { '[class.flex-1]': 'true' }, - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NzIconModule, UpperCasePipe] }) export class HeaderRTLComponent { constructor(public rtl: RTLService) {} diff --git a/src/app/layout/basic/widgets/search.component.ts b/src/app/layout/basic/widgets/search.component.ts index ba28843d2..1d4294daa 100644 --- a/src/app/layout/basic/widgets/search.component.ts +++ b/src/app/layout/basic/widgets/search.component.ts @@ -1,3 +1,4 @@ +import { NgTemplateOutlet } from '@angular/common'; import { AfterViewInit, ChangeDetectionStrategy, @@ -10,6 +11,11 @@ import { OnDestroy, Output } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { I18nPipe } from '@delon/theme'; +import { NzAutocompleteModule } from 'ng-zorro-antd/auto-complete'; +import { NzIconModule } from 'ng-zorro-antd/icon'; +import { NzInputModule } from 'ng-zorro-antd/input'; import { BehaviorSubject, debounceTime, distinctUntilChanged, tap } from 'rxjs'; @Component({ @@ -20,7 +26,9 @@ import { BehaviorSubject, debounceTime, distinctUntilChanged, tap } from 'rxjs'; - + @if (loading) { + + } - {{ i }} + @for (i of options; track $index) { + {{ i }} + } `, - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [FormsModule, I18nPipe, NgTemplateOutlet, NzInputModule, NzIconModule, NzAutocompleteModule] }) export class HeaderSearchComponent implements AfterViewInit, OnDestroy { q = ''; diff --git a/src/app/layout/basic/widgets/task.component.ts b/src/app/layout/basic/widgets/task.component.ts index 230f9ec0b..7cfc91677 100644 --- a/src/app/layout/basic/widgets/task.component.ts +++ b/src/app/layout/basic/widgets/task.component.ts @@ -1,4 +1,12 @@ +import { NgTemplateOutlet } from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, Component } from '@angular/core'; +import { NzAvatarModule } from 'ng-zorro-antd/avatar'; +import { NzBadgeModule } from 'ng-zorro-antd/badge'; +import { NzCardModule } from 'ng-zorro-antd/card'; +import { NzDropDownModule } from 'ng-zorro-antd/dropdown'; +import { NzGridModule } from 'ng-zorro-antd/grid'; +import { NzIconModule } from 'ng-zorro-antd/icon'; +import { NzSpinModule } from 'ng-zorro-antd/spin'; @Component({ selector: 'header-task', @@ -17,8 +25,10 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component } from '@angular/
-
- + @if (loading) { +
+ } @else { +
@@ -69,10 +79,13 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component } from '@angular/
See All
+ }
`, - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NgTemplateOutlet, NzDropDownModule, NzBadgeModule, NzIconModule, NzSpinModule, NzGridModule, NzAvatarModule, NzCardModule] }) export class HeaderTaskComponent { loading = true; diff --git a/src/app/layout/basic/widgets/user.component.ts b/src/app/layout/basic/widgets/user.component.ts index 3acdc2e31..1014a19b6 100644 --- a/src/app/layout/basic/widgets/user.component.ts +++ b/src/app/layout/basic/widgets/user.component.ts @@ -1,7 +1,11 @@ import { ChangeDetectionStrategy, Component, Inject } from '@angular/core'; import { Router } from '@angular/router'; import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth'; -import { SettingsService, User } from '@delon/theme'; +import { I18nPipe, SettingsService, User } from '@delon/theme'; +import { NzAvatarModule } from 'ng-zorro-antd/avatar'; +import { NzDropDownModule } from 'ng-zorro-antd/dropdown'; +import { NzIconModule } from 'ng-zorro-antd/icon'; +import { NzMenuModule } from 'ng-zorro-antd/menu'; @Component({ selector: 'header-user', @@ -32,7 +36,9 @@ import { SettingsService, User } from '@delon/theme';
`, - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NzDropDownModule, NzMenuModule, NzIconModule, I18nPipe, NzAvatarModule] }) export class HeaderUserComponent { get user(): User { diff --git a/src/app/layout/blank/blank.component.ts b/src/app/layout/blank/blank.component.ts index caabd9c0d..c8543c20c 100644 --- a/src/app/layout/blank/blank.component.ts +++ b/src/app/layout/blank/blank.component.ts @@ -1,10 +1,13 @@ import { Component } from '@angular/core'; +import { RouterOutlet } from '@angular/router'; @Component({ selector: 'layout-blank', template: ``, host: { '[class.alain-blank]': 'true' - } + }, + standalone: true, + imports: [RouterOutlet] }) export class LayoutBlankComponent {} diff --git a/src/app/layout/index.ts b/src/app/layout/index.ts new file mode 100644 index 000000000..47ab77c4b --- /dev/null +++ b/src/app/layout/index.ts @@ -0,0 +1,3 @@ +export * from './basic/basic.component'; +export * from './blank/blank.component'; +export * from './passport/passport.component'; diff --git a/src/app/layout/layout.module.ts b/src/app/layout/layout.module.ts deleted file mode 100644 index 1c9f6523a..000000000 --- a/src/app/layout/layout.module.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { RouterModule } from '@angular/router'; -import { GlobalFooterModule } from '@delon/abc/global-footer'; -import { HotkeyModule } from '@delon/abc/hotkey'; -import { NoticeIconModule } from '@delon/abc/notice-icon'; -import { AlainThemeModule } from '@delon/theme'; -import { LayoutDefaultModule } from '@delon/theme/layout-default'; -import { SettingDrawerModule } from '@delon/theme/setting-drawer'; -import { ThemeBtnModule } from '@delon/theme/theme-btn'; -import { NzAutocompleteModule } from 'ng-zorro-antd/auto-complete'; -import { NzAvatarModule } from 'ng-zorro-antd/avatar'; -import { NzBadgeModule } from 'ng-zorro-antd/badge'; -import { NzCardModule } from 'ng-zorro-antd/card'; -import { NzDropDownModule } from 'ng-zorro-antd/dropdown'; -import { NzFormModule } from 'ng-zorro-antd/form'; -import { NzGridModule } from 'ng-zorro-antd/grid'; -import { NzIconModule } from 'ng-zorro-antd/icon'; -import { NzInputModule } from 'ng-zorro-antd/input'; -import { NzSpinModule } from 'ng-zorro-antd/spin'; - -import { LayoutBasicComponent } from './basic/basic.component'; -import { HeaderClearStorageComponent } from './basic/widgets/clear-storage.component'; -import { HeaderFullScreenComponent } from './basic/widgets/fullscreen.component'; -import { HeaderI18nComponent } from './basic/widgets/i18n.component'; -import { HeaderIconComponent } from './basic/widgets/icon.component'; -import { HeaderNotifyComponent } from './basic/widgets/notify.component'; -import { HeaderRTLComponent } from './basic/widgets/rtl.component'; -import { HeaderSearchComponent } from './basic/widgets/search.component'; -import { HeaderTaskComponent } from './basic/widgets/task.component'; -import { HeaderUserComponent } from './basic/widgets/user.component'; -// eslint-disable-next-line import/order -import { LayoutBlankComponent } from './blank/blank.component'; - -const COMPONENTS = [LayoutBasicComponent, LayoutBlankComponent]; - -const HEADERCOMPONENTS = [ - HeaderSearchComponent, - HeaderNotifyComponent, - HeaderTaskComponent, - HeaderIconComponent, - HeaderFullScreenComponent, - HeaderI18nComponent, - HeaderClearStorageComponent, - HeaderUserComponent, - HeaderRTLComponent -]; - -// passport -import { LayoutPassportComponent } from './passport/passport.component'; -const PASSPORT = [LayoutPassportComponent]; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - RouterModule, - AlainThemeModule, - ThemeBtnModule, - SettingDrawerModule, - LayoutDefaultModule, - NoticeIconModule, - HotkeyModule, - GlobalFooterModule, - NzDropDownModule, - NzInputModule, - NzAutocompleteModule, - NzGridModule, - NzFormModule, - NzSpinModule, - NzBadgeModule, - NzAvatarModule, - NzIconModule, - NzCardModule - ], - declarations: [...COMPONENTS, ...HEADERCOMPONENTS, ...PASSPORT], - exports: [...COMPONENTS, ...PASSPORT] -}) -export class LayoutModule {} diff --git a/src/app/layout/passport/passport.component.html b/src/app/layout/passport/passport.component.html index dae227a6f..679bec735 100644 --- a/src/app/layout/passport/passport.component.html +++ b/src/app/layout/passport/passport.component.html @@ -11,7 +11,7 @@ Copyright - 2021 卡色出品 + 2023 卡色出品 diff --git a/src/app/layout/passport/passport.component.ts b/src/app/layout/passport/passport.component.ts index c48bb161b..847682ddb 100644 --- a/src/app/layout/passport/passport.component.ts +++ b/src/app/layout/passport/passport.component.ts @@ -1,10 +1,18 @@ import { Component, Inject, OnInit } from '@angular/core'; +import { RouterOutlet } from '@angular/router'; +import { GlobalFooterModule } from '@delon/abc/global-footer'; import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth'; +import { ThemeBtnComponent } from '@delon/theme/theme-btn'; +import { NzIconModule } from 'ng-zorro-antd/icon'; + +import { HeaderI18nComponent } from '../basic/widgets/i18n.component'; @Component({ selector: 'layout-passport', templateUrl: './passport.component.html', - styleUrls: ['./passport.component.less'] + styleUrls: ['./passport.component.less'], + standalone: true, + imports: [RouterOutlet, HeaderI18nComponent, GlobalFooterModule, NzIconModule, ThemeBtnComponent] }) export class LayoutPassportComponent implements OnInit { links = [ diff --git a/src/app/routes/dashboard/analysis/analysis.component.html b/src/app/routes/dashboard/analysis/analysis.component.html index d1e6f5b47..974b98308 100644 --- a/src/app/routes/dashboard/analysis/analysis.component.html +++ b/src/app/routes/dashboard/analysis/analysis.component.html @@ -25,7 +25,9 @@ - + @if (data.visitData) { + + }

{{ 'app.analysis.day-visits' | i18n }} @@ -39,7 +41,9 @@ - + @if (data.visitData) { + + }

{{ 'app.analysis.conversion-rate' | i18n }} @@ -70,45 +74,49 @@ - - + @if (data.salesData) { + + @for (tab of saleTabs; track $index) { +

- + @if (tab.show) { + + }

{{ 'app.analysis.' + tab.key + '-ranking' | i18n }}

    -
  • - {{ idx + 1 }} + @for (i of rankingListData; track $index) { +
  • + {{ $index + 1 }} {{ i.title }} {{ i.total | number: '3.0' }}
  • + }
+ }
- + @for (t of dateRangeTypes; track $index) { + {{ 'app.analysis.all-' + t | i18n }} + }
+ }
@@ -136,11 +144,15 @@

{{ 'app.analysis.' + tab.key + '-ranking' | i18n }} - + @if (data.visitData2) { + + }

- + @if (data.visitData2) { + + }
@@ -183,8 +195,8 @@

{{ 'app.analysis.' + tab.key + '-ranking' | i18n }}

{{ 'app.analysis.sales' | i18n }}

+ @if (salesPieData) { {{ 'app.analysis.sales' | i18n }} [total]="salesTotal" [valueFormat]="handlePieValueFormat" /> + } - - + @if (data.offlineData) { + + @for (tab of data.offlineData; track $index) { +
{{ 'app.analysis.sales' | i18n }} [subTitle]="'app.analysis.conversion-rate' | i18n" gap="2" [total]="tab.cvr * 100 + '%'" - [theme]="i !== offlineIdx ? 'light' : 'default'" + [theme]="$index !== offlineIdx ? 'light' : 'default'" class="mr-md" /> {{ 'app.analysis.sales' | i18n }}
- + @if (tab.show) { + + }
+ }
+ }
diff --git a/src/app/routes/dashboard/analysis/analysis.component.ts b/src/app/routes/dashboard/analysis/analysis.component.ts index 69a7692bb..504675fc3 100644 --- a/src/app/routes/dashboard/analysis/analysis.component.ts +++ b/src/app/routes/dashboard/analysis/analysis.component.ts @@ -1,10 +1,20 @@ +import { DecimalPipe } from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, OnInit } from '@angular/core'; import { I18NService } from '@core'; import { STColumn } from '@delon/abc/st'; +import { G2BarModule } from '@delon/chart/bar'; +import { G2CardModule } from '@delon/chart/card'; +import { G2MiniAreaModule } from '@delon/chart/mini-area'; +import { G2MiniBarModule } from '@delon/chart/mini-bar'; +import { G2MiniProgressModule } from '@delon/chart/mini-progress'; +import { NumberInfoModule } from '@delon/chart/number-info'; +import { G2PieModule } from '@delon/chart/pie'; +import { G2TimelineModule } from '@delon/chart/timeline'; +import { TrendModule } from '@delon/chart/trend'; import { ALAIN_I18N_TOKEN, _HttpClient } from '@delon/theme'; import { getTimeDistance } from '@delon/util/date-time'; import { deepCopy } from '@delon/util/other'; -import { yuan } from '@shared'; +import { SHARED, yuan } from '@shared'; import type { NzSafeAny } from 'ng-zorro-antd/core/types'; import { NzMessageService } from 'ng-zorro-antd/message'; @@ -12,7 +22,21 @@ import { NzMessageService } from 'ng-zorro-antd/message'; selector: 'app-dashboard-analysis', templateUrl: './analysis.component.html', styleUrls: ['./analysis.component.less'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + ...SHARED, + G2TimelineModule, + G2PieModule, + NumberInfoModule, + TrendModule, + G2MiniAreaModule, + DecimalPipe, + G2BarModule, + G2MiniProgressModule, + G2CardModule, + G2MiniBarModule + ] }) export class DashboardAnalysisComponent implements OnInit { constructor( diff --git a/src/app/routes/dashboard/dashboard.module.ts b/src/app/routes/dashboard/dashboard.module.ts deleted file mode 100644 index 8fa249409..000000000 --- a/src/app/routes/dashboard/dashboard.module.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CountDownModule } from '@delon/abc/count-down'; -import { OnboardingModule } from '@delon/abc/onboarding'; -import { QuickMenuModule } from '@delon/abc/quick-menu'; -import { G2BarModule } from '@delon/chart/bar'; -import { G2CardModule } from '@delon/chart/card'; -import { G2GaugeModule } from '@delon/chart/gauge'; -import { G2MiniAreaModule } from '@delon/chart/mini-area'; -import { G2MiniBarModule } from '@delon/chart/mini-bar'; -import { G2MiniProgressModule } from '@delon/chart/mini-progress'; -import { NumberInfoModule } from '@delon/chart/number-info'; -import { G2PieModule } from '@delon/chart/pie'; -import { G2RadarModule } from '@delon/chart/radar'; -import { G2SingleBarModule } from '@delon/chart/single-bar'; -import { G2TagCloudModule } from '@delon/chart/tag-cloud'; -import { G2TimelineModule } from '@delon/chart/timeline'; -import { TrendModule } from '@delon/chart/trend'; -import { G2WaterWaveModule } from '@delon/chart/water-wave'; -import { SharedModule } from '@shared'; -import { CountdownModule } from 'ngx-countdown'; - -import { DashboardAnalysisComponent } from './analysis/analysis.component'; -import { DashboardRoutingModule } from './dashboard-routing.module'; -import { DashboardMonitorComponent } from './monitor/monitor.component'; -import { DashboardV1Component } from './v1/v1.component'; -import { DashboardWorkplaceComponent } from './workplace/workplace.component'; - -const COMPONENTS = [DashboardV1Component, DashboardAnalysisComponent, DashboardMonitorComponent, DashboardWorkplaceComponent]; - -@NgModule({ - imports: [ - SharedModule, - DashboardRoutingModule, - CountDownModule, - CountdownModule, - G2BarModule, - G2CardModule, - G2GaugeModule, - G2MiniAreaModule, - G2MiniBarModule, - G2MiniProgressModule, - G2PieModule, - G2RadarModule, - G2SingleBarModule, - G2TagCloudModule, - G2TimelineModule, - G2WaterWaveModule, - NumberInfoModule, - TrendModule, - QuickMenuModule, - OnboardingModule - ], - declarations: [...COMPONENTS] -}) -export class DashboardModule {} diff --git a/src/app/routes/dashboard/monitor/monitor.component.html b/src/app/routes/dashboard/monitor/monitor.component.html index 1d3dd8558..327b0d781 100644 --- a/src/app/routes/dashboard/monitor/monitor.component.html +++ b/src/app/routes/dashboard/monitor/monitor.component.html @@ -32,7 +32,8 @@
-
+ @if (activeData) { +
@@ -45,9 +46,12 @@ {{ activeStat.t2 }}
+ } - + @if (percent) { + + }
diff --git a/src/app/routes/dashboard/monitor/monitor.component.ts b/src/app/routes/dashboard/monitor/monitor.component.ts index ab0ccc2a6..d7cd0debf 100644 --- a/src/app/routes/dashboard/monitor/monitor.component.ts +++ b/src/app/routes/dashboard/monitor/monitor.component.ts @@ -1,5 +1,13 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; +import { CountDownModule } from '@delon/abc/count-down'; +import { G2GaugeModule } from '@delon/chart/gauge'; +import { G2MiniAreaModule } from '@delon/chart/mini-area'; +import { NumberInfoModule } from '@delon/chart/number-info'; +import { G2PieModule } from '@delon/chart/pie'; +import { G2TagCloudModule } from '@delon/chart/tag-cloud'; +import { G2WaterWaveModule } from '@delon/chart/water-wave'; import { _HttpClient } from '@delon/theme'; +import { SHARED } from '@shared'; import { NzMessageService } from 'ng-zorro-antd/message'; import type { CountdownConfig } from 'ngx-countdown'; import { zip } from 'rxjs'; @@ -8,7 +16,9 @@ import { zip } from 'rxjs'; selector: 'app-dashboard-monitor', templateUrl: './monitor.component.html', styleUrls: ['./monitor.component.less'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [...SHARED, G2WaterWaveModule, G2TagCloudModule, G2PieModule, G2GaugeModule, G2MiniAreaModule, NumberInfoModule, CountDownModule] }) export class DashboardMonitorComponent implements OnInit, OnDestroy { constructor( diff --git a/src/app/routes/dashboard/dashboard-routing.module.ts b/src/app/routes/dashboard/routes.ts similarity index 70% rename from src/app/routes/dashboard/dashboard-routing.module.ts rename to src/app/routes/dashboard/routes.ts index 7900c4c80..b1d0f184e 100644 --- a/src/app/routes/dashboard/dashboard-routing.module.ts +++ b/src/app/routes/dashboard/routes.ts @@ -1,21 +1,14 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; +import { Routes } from '@angular/router'; import { DashboardAnalysisComponent } from './analysis/analysis.component'; import { DashboardMonitorComponent } from './monitor/monitor.component'; import { DashboardV1Component } from './v1/v1.component'; import { DashboardWorkplaceComponent } from './workplace/workplace.component'; -const routes: Routes = [ +export const routes: Routes = [ { path: '', redirectTo: 'v1', pathMatch: 'full' }, { path: 'v1', component: DashboardV1Component }, { path: 'analysis', component: DashboardAnalysisComponent }, { path: 'monitor', component: DashboardMonitorComponent }, { path: 'workplace', component: DashboardWorkplaceComponent } ]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class DashboardRoutingModule {} diff --git a/src/app/routes/dashboard/v1/v1.component.html b/src/app/routes/dashboard/v1/v1.component.html index 8ed4db68f..8297009a8 100644 --- a/src/app/routes/dashboard/v1/v1.component.html +++ b/src/app/routes/dashboard/v1/v1.component.html @@ -31,8 +31,8 @@

Website Traffics

+ @if (webSite) { tooltipType="mini" (ready)="fixDark($event)" /> + }
@@ -51,8 +52,8 @@

Website Impressions

+ @if (webSite) { tooltipType="mini" (ready)="fixDark($event)" /> + }
@@ -71,8 +73,8 @@

Total Sales

+ @if (webSite) { tooltipType="mini" (ready)="fixDark($event)" /> + }
@@ -91,8 +94,8 @@

Support Tickets

+ @if (webSite) { tooltipType="mini" (ready)="fixDark($event)" /> + }
@@ -112,7 +116,9 @@

Sales Statistics Business Expectations & Retail Sales Statistics - + @if (salesData) { + + }
@@ -121,7 +127,9 @@

Growth Rate Business Expectations & Retail Sales Statistics - + @if (offlineChartData) { + + }

@@ -149,7 +157,8 @@

ANT DESIGN

Recent Posts Venenatis portauam Inceptos ameteiam -
+ @for (item of todoData; track $index) { +
@@ -158,11 +167,13 @@

ANT DESIGN

{{ item.content }}

+ }
-
+ @for (item of todoData; track $index) { +
@@ -174,13 +185,17 @@

ANT DESIGN

    -
  • Active
  • -
  • Completed
  • + @if (item.completed) { +
  • Active
  • + } @else { +
  • Completed
  • + }
  • Delted
+ }
diff --git a/src/app/routes/dashboard/v1/v1.component.ts b/src/app/routes/dashboard/v1/v1.component.ts index 3000d288f..55b2edb73 100644 --- a/src/app/routes/dashboard/v1/v1.component.ts +++ b/src/app/routes/dashboard/v1/v1.component.ts @@ -2,14 +2,21 @@ import { Platform } from '@angular/cdk/platform'; import { DOCUMENT } from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, OnInit, Renderer2 } from '@angular/core'; import type { Chart } from '@antv/g2'; -import { OnboardingService } from '@delon/abc/onboarding'; +import { OnboardingModule, OnboardingService } from '@delon/abc/onboarding'; +import { QuickMenuModule } from '@delon/abc/quick-menu'; +import { G2BarModule } from '@delon/chart/bar'; +import { G2MiniBarModule } from '@delon/chart/mini-bar'; +import { G2TimelineModule } from '@delon/chart/timeline'; import { _HttpClient } from '@delon/theme'; +import { SHARED } from '@shared'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; @Component({ selector: 'app-dashboard-v1', templateUrl: './v1.component.html', - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [...SHARED, G2TimelineModule, G2BarModule, G2MiniBarModule, QuickMenuModule, OnboardingModule] }) export class DashboardV1Component implements OnInit { todoData = [ diff --git a/src/app/routes/dashboard/workplace/workplace.component.html b/src/app/routes/dashboard/workplace/workplace.component.html index 994f363fd..49241ca24 100644 --- a/src/app/routes/dashboard/workplace/workplace.component.html +++ b/src/app/routes/dashboard/workplace/workplace.component.html @@ -53,7 +53,8 @@ 全部项目 -
+ @for (item of notice; track $index) { +
@@ -65,16 +66,20 @@
{{ item.member }} - + @if (item.updatedAt) { + {{ item.updatedAt | _date: 'fn' }} + }
+ } - + @for (item of activities; track $index) { + {{ item.user.name }} @@ -86,13 +91,16 @@ + }
- + @if (radarData) { + + }
-
+ @for (i of members; track $index) { + + }
diff --git a/src/app/routes/dashboard/workplace/workplace.component.ts b/src/app/routes/dashboard/workplace/workplace.component.ts index 45a7aefa2..8440c2979 100644 --- a/src/app/routes/dashboard/workplace/workplace.component.ts +++ b/src/app/routes/dashboard/workplace/workplace.component.ts @@ -1,5 +1,8 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core'; +import { G2RadarModule } from '@delon/chart/radar'; import { _HttpClient } from '@delon/theme'; +import { SHARED } from '@shared'; +import { NzAvatarModule } from 'ng-zorro-antd/avatar'; import { NzMessageService } from 'ng-zorro-antd/message'; import { zip } from 'rxjs'; @@ -7,7 +10,9 @@ import { zip } from 'rxjs'; selector: 'app-dashboard-workplace', templateUrl: './workplace.component.html', styleUrls: ['./workplace.component.less'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [...SHARED, NzAvatarModule, G2RadarModule] }) export class DashboardWorkplaceComponent implements OnInit { notice: any[] = []; diff --git a/src/app/routes/exception/exception.component.ts b/src/app/routes/exception/exception.component.ts index ae2e574c1..e5b19eda0 100644 --- a/src/app/routes/exception/exception.component.ts +++ b/src/app/routes/exception/exception.component.ts @@ -1,11 +1,13 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { ExceptionType } from '@delon/abc/exception'; +import { ExceptionModule, ExceptionType } from '@delon/abc/exception'; @Component({ selector: 'app-exception', template: ` `, - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ExceptionModule] }) export class ExceptionComponent { get type(): ExceptionType { diff --git a/src/app/routes/exception/exception.module.ts b/src/app/routes/exception/exception.module.ts deleted file mode 100644 index 2981fae5a..000000000 --- a/src/app/routes/exception/exception.module.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ExceptionModule as DelonExceptionModule } from '@delon/abc/exception'; -import { NzButtonModule } from 'ng-zorro-antd/button'; -import { NzCardModule } from 'ng-zorro-antd/card'; - -import { ExceptionRoutingModule } from './exception-routing.module'; -import { ExceptionComponent } from './exception.component'; -import { ExceptionTriggerComponent } from './trigger.component'; - -@NgModule({ - imports: [CommonModule, DelonExceptionModule, NzButtonModule, NzCardModule, ExceptionRoutingModule], - declarations: [ExceptionComponent, ExceptionTriggerComponent] -}) -export class ExceptionModule {} diff --git a/src/app/routes/exception/exception-routing.module.ts b/src/app/routes/exception/routes.ts similarity index 61% rename from src/app/routes/exception/exception-routing.module.ts rename to src/app/routes/exception/routes.ts index 47e8cc737..99528ec94 100644 --- a/src/app/routes/exception/exception-routing.module.ts +++ b/src/app/routes/exception/routes.ts @@ -1,18 +1,11 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; +import { Routes } from '@angular/router'; import { ExceptionComponent } from './exception.component'; import { ExceptionTriggerComponent } from './trigger.component'; -const routes: Routes = [ +export const routes: Routes = [ { path: '403', component: ExceptionComponent, data: { type: 403 } }, { path: '404', component: ExceptionComponent, data: { type: 404 } }, { path: '500', component: ExceptionComponent, data: { type: 500 } }, { path: 'trigger', component: ExceptionTriggerComponent } ]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class ExceptionRoutingModule {} diff --git a/src/app/routes/exception/trigger.component.ts b/src/app/routes/exception/trigger.component.ts index c19f1b2a6..8689d8c10 100644 --- a/src/app/routes/exception/trigger.component.ts +++ b/src/app/routes/exception/trigger.component.ts @@ -1,17 +1,23 @@ import { Component, Inject } from '@angular/core'; import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth'; import { _HttpClient } from '@delon/theme'; +import { NzButtonModule } from 'ng-zorro-antd/button'; +import { NzCardModule } from 'ng-zorro-antd/card'; @Component({ selector: 'exception-trigger', template: `
- + @for (t of types; track $index) { + + }
- ` + `, + standalone: true, + imports: [NzCardModule, NzButtonModule] }) export class ExceptionTriggerComponent { types = [401, 403, 404, 500]; diff --git a/src/app/routes/extras/extras.module.ts b/src/app/routes/extras/extras.module.ts index 76b07a1b7..8ade1654e 100644 --- a/src/app/routes/extras/extras.module.ts +++ b/src/app/routes/extras/extras.module.ts @@ -1,5 +1,6 @@ import { NgModule } from '@angular/core'; import { SharedModule } from '@shared'; +import { NzUploadModule } from 'ng-zorro-antd/upload'; import { ExtrasRoutingModule } from './extras-routing.module'; import { HelpCenterComponent } from './helpcenter/helpcenter.component'; @@ -10,7 +11,7 @@ import { ExtrasSettingsComponent } from './settings/settings.component'; const COMPONENTS = [HelpCenterComponent, ExtrasSettingsComponent, ExtrasPoiComponent, ExtrasPoiEditComponent]; @NgModule({ - imports: [SharedModule, ExtrasRoutingModule], + imports: [SharedModule, ExtrasRoutingModule, NzUploadModule], declarations: [...COMPONENTS] }) export class ExtrasModule {} diff --git a/src/app/routes/passport/callback.component.ts b/src/app/routes/passport/callback.component.ts index 31fd290cf..df364df11 100644 --- a/src/app/routes/passport/callback.component.ts +++ b/src/app/routes/passport/callback.component.ts @@ -5,7 +5,8 @@ import { SettingsService } from '@delon/theme'; @Component({ selector: 'app-callback', template: ``, - providers: [SocialService] + providers: [SocialService], + standalone: true }) export class CallbackComponent implements OnInit { @Input() type = ''; diff --git a/src/app/routes/passport/lock/lock.component.ts b/src/app/routes/passport/lock/lock.component.ts index 5071b19ca..5e652097c 100644 --- a/src/app/routes/passport/lock/lock.component.ts +++ b/src/app/routes/passport/lock/lock.component.ts @@ -3,11 +3,14 @@ import { FormControl, FormGroup, Validators } from '@angular/forms'; import { Router } from '@angular/router'; import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth'; import { SettingsService, User } from '@delon/theme'; +import { SHARED } from '@shared'; @Component({ selector: 'passport-lock', templateUrl: './lock.component.html', - styleUrls: ['./lock.component.less'] + styleUrls: ['./lock.component.less'], + standalone: true, + imports: [...SHARED] }) export class UserLockComponent { f = new FormGroup({ diff --git a/src/app/routes/passport/login/login.component.html b/src/app/routes/passport/login/login.component.html index ee8094d4e..a42f1591f 100644 --- a/src/app/routes/passport/login/login.component.html +++ b/src/app/routes/passport/login/login.component.html @@ -1,7 +1,9 @@
- + @if (error) { + + } @@ -24,12 +26,11 @@ - - {{ 'validation.phone-number.required' | i18n }} - - - {{ 'validation.phone-number.wrong-format' | i18n }} - + @if (i.errors.required) { + {{ 'validation.phone-number.required' | i18n }} + } @if (i.errors.pattern) { + {{ 'validation.phone-number.wrong-format' | i18n }} + } diff --git a/src/app/routes/passport/login/login.component.ts b/src/app/routes/passport/login/login.component.ts index f13fcc8e0..95b925345 100644 --- a/src/app/routes/passport/login/login.component.ts +++ b/src/app/routes/passport/login/login.component.ts @@ -7,6 +7,7 @@ import { ReuseTabService } from '@delon/abc/reuse-tab'; import { ALLOW_ANONYMOUS, DA_SERVICE_TOKEN, ITokenService, SocialOpenType, SocialService } from '@delon/auth'; import { SettingsService, _HttpClient } from '@delon/theme'; import { environment } from '@env/environment'; +import { SHARED } from '@shared'; import { NzTabChangeEvent } from 'ng-zorro-antd/tabs'; import { finalize } from 'rxjs'; @@ -15,7 +16,9 @@ import { finalize } from 'rxjs'; templateUrl: './login.component.html', styleUrls: ['./login.component.less'], providers: [SocialService], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [...SHARED] }) export class UserLoginComponent implements OnDestroy { constructor( diff --git a/src/app/routes/passport/passport.module.ts b/src/app/routes/passport/passport.module.ts deleted file mode 100644 index a84eae334..000000000 --- a/src/app/routes/passport/passport.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; -import { SharedModule } from '@shared'; - -import { CallbackComponent } from './callback.component'; -import { UserLockComponent } from './lock/lock.component'; -import { UserLoginComponent } from './login/login.component'; -import { PassportRoutingModule } from './passport-routing.module'; -import { UserRegisterComponent } from './register/register.component'; -import { UserRegisterResultComponent } from './register-result/register-result.component'; - -const COMPONENTS = [UserLoginComponent, UserRegisterResultComponent, UserRegisterComponent, UserLockComponent, CallbackComponent]; - -@NgModule({ - imports: [SharedModule, PassportRoutingModule], - declarations: [...COMPONENTS] -}) -export class PassportModule {} diff --git a/src/app/routes/passport/register-result/register-result.component.ts b/src/app/routes/passport/register-result/register-result.component.ts index 5b273cbe3..47d2dfe3f 100644 --- a/src/app/routes/passport/register-result/register-result.component.ts +++ b/src/app/routes/passport/register-result/register-result.component.ts @@ -1,10 +1,14 @@ import { Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { ResultModule } from '@delon/abc/result'; +import { SHARED } from '@shared'; import { NzMessageService } from 'ng-zorro-antd/message'; @Component({ selector: 'passport-register-result', - templateUrl: './register-result.component.html' + templateUrl: './register-result.component.html', + standalone: true, + imports: [...SHARED, ResultModule] }) export class UserRegisterResultComponent { params = { email: '' }; diff --git a/src/app/routes/passport/register/register.component.html b/src/app/routes/passport/register/register.component.html index 3aeb0fa60..aa070ac07 100644 --- a/src/app/routes/passport/register/register.component.html +++ b/src/app/routes/passport/register/register.component.html @@ -1,14 +1,19 @@

{{ 'app.register.register' | i18n }}

- + @if (error) { + + } - {{ 'validation.email.required' | i18n }} - {{ 'validation.email.wrong-format' | i18n }} + @if (i.errors?.required) { + {{ 'validation.email.required' | i18n }} + } @if (i.errors?.email) { + {{ 'validation.email.wrong-format' | i18n }} + } @@ -29,11 +34,13 @@

{{ 'app.register.register' | i18n }}

- -
{{ 'validation.password.strength.strong' | i18n }}
-
{{ 'validation.password.strength.medium' | i18n }}
-
{{ 'validation.password.strength.short' | i18n }}
-
+ @switch (status) { @case ('ok') { +
{{ 'validation.password.strength.strong' | i18n }}
+ } @case ('pass') { +
{{ 'validation.password.strength.medium' | i18n }}
+ } @default { +
{{ 'validation.password.strength.short' | i18n }}
+ } }
@@ -48,8 +55,11 @@

{{ 'app.register.register' | i18n }}

- {{ 'validation.confirm-password.required' | i18n }} - {{ 'validation.password.twice' | i18n }} + @if (i.errors?.required) { + {{ 'validation.confirm-password.required' | i18n }} + } @if (i.errors?.matchControl) { + {{ 'validation.password.twice' | i18n }} + } @@ -65,8 +75,8 @@

{{ 'app.register.register' | i18n }}

- {{ 'validation.phone-number.required' | i18n }} - {{ 'validation.phone-number.wrong-format' | i18n }} + @if (i.errors?.required) { {{ 'validation.phone-number.required' | i18n }} } @if (i.errors?.pattern) { + {{ 'validation.phone-number.wrong-format' | i18n }} } diff --git a/src/app/routes/passport/register/register.component.ts b/src/app/routes/passport/register/register.component.ts index 89c2b6d5e..98e3a0d3d 100644 --- a/src/app/routes/passport/register/register.component.ts +++ b/src/app/routes/passport/register/register.component.ts @@ -5,6 +5,7 @@ import { Router } from '@angular/router'; import { ALLOW_ANONYMOUS } from '@delon/auth'; import { _HttpClient } from '@delon/theme'; import { MatchControl } from '@delon/util/form'; +import { SHARED } from '@shared'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; import { finalize } from 'rxjs'; @@ -12,7 +13,9 @@ import { finalize } from 'rxjs'; selector: 'passport-register', templateUrl: './register.component.html', styleUrls: ['./register.component.less'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [...SHARED] }) export class UserRegisterComponent implements OnDestroy { constructor( diff --git a/src/app/routes/passport/passport-routing.module.ts b/src/app/routes/passport/routes.ts similarity index 77% rename from src/app/routes/passport/passport-routing.module.ts rename to src/app/routes/passport/routes.ts index 9344489ca..c2634ce93 100644 --- a/src/app/routes/passport/passport-routing.module.ts +++ b/src/app/routes/passport/routes.ts @@ -1,14 +1,13 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; +import { Routes } from '@angular/router'; import { CallbackComponent } from './callback.component'; import { UserLockComponent } from './lock/lock.component'; import { UserLoginComponent } from './login/login.component'; import { UserRegisterComponent } from './register/register.component'; import { UserRegisterResultComponent } from './register-result/register-result.component'; -import { LayoutPassportComponent } from '../../layout/passport/passport.component'; +import { LayoutPassportComponent } from '../../layout'; -const routes: Routes = [ +export const routes: Routes = [ // passport { path: 'passport', @@ -39,9 +38,3 @@ const routes: Routes = [ // 单页不包裹Layout { path: 'passport/callback/:type', component: CallbackComponent } ]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class PassportRoutingModule {} diff --git a/src/app/routes/pro/pro.module.ts b/src/app/routes/pro/pro.module.ts index bb44f1d08..997fec732 100644 --- a/src/app/routes/pro/pro.module.ts +++ b/src/app/routes/pro/pro.module.ts @@ -2,11 +2,13 @@ import { NgModule } from '@angular/core'; import { AvatarListModule } from '@delon/abc/avatar-list'; import { EllipsisModule } from '@delon/abc/ellipsis'; import { FooterToolbarModule } from '@delon/abc/footer-toolbar'; +import { ResultModule } from '@delon/abc/result'; import { TagSelectModule } from '@delon/abc/tag-select'; import { CurrencyPipeModule } from '@delon/util/pipes/currency'; import { SharedModule } from '@shared'; import { NzPaginationModule } from 'ng-zorro-antd/pagination'; import { NzStepsModule } from 'ng-zorro-antd/steps'; +import { NzUploadModule } from 'ng-zorro-antd/upload'; import { ProAccountCenterApplicationsComponent } from './account/center/applications/applications.component'; import { ProAccountCenterArticlesComponent } from './account/center/articles/articles.component'; @@ -77,7 +79,9 @@ const COMPONENTS = [ FooterToolbarModule, NzPaginationModule, NzStepsModule, - CurrencyPipeModule + CurrencyPipeModule, + ResultModule, + NzUploadModule ], declarations: COMPONENTS }) diff --git a/src/app/routes/routes-routing.module.ts b/src/app/routes/routes-routing.module.ts deleted file mode 100644 index 1754f83fb..000000000 --- a/src/app/routes/routes-routing.module.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { startPageGuard } from '@core'; -import { authSimpleCanActivate, authSimpleCanActivateChild } from '@delon/auth'; -import { PreloadOptionalModules } from '@delon/theme'; -import { environment } from '@env/environment'; - -// layout -import { LayoutBasicComponent } from '../layout/basic/basic.component'; -import { LayoutBlankComponent } from '../layout/blank/blank.component'; - -const routes: Routes = [ - { - path: '', - component: LayoutBasicComponent, - canActivate: [startPageGuard, authSimpleCanActivate], - canActivateChild: [authSimpleCanActivateChild], - data: {}, - children: [ - { path: '', redirectTo: 'dashboard', pathMatch: 'full' }, - { - path: 'dashboard', - loadChildren: () => import('./dashboard/dashboard.module').then(m => m.DashboardModule), - data: { preload: true } - }, - { - path: 'widgets', - loadChildren: () => import('./widgets/widgets.module').then(m => m.WidgetsModule) - }, - { path: 'style', loadChildren: () => import('./style/style.module').then(m => m.StyleModule) }, - { path: 'delon', loadChildren: () => import('./delon/delon.module').then(m => m.DelonModule) }, - { path: 'extras', loadChildren: () => import('./extras/extras.module').then(m => m.ExtrasModule) }, - { path: 'pro', loadChildren: () => import('./pro/pro.module').then(m => m.ProModule) } - ] - }, - // Blak Layout 空白布局 - { - path: 'data-v', - component: LayoutBlankComponent, - children: [{ path: '', loadChildren: () => import('./data-v/data-v.module').then(m => m.DataVModule) }] - }, - // passport - { path: '', loadChildren: () => import('./passport/passport.module').then(m => m.PassportModule), data: { preload: true } }, - { path: 'exception', loadChildren: () => import('./exception/exception.module').then(m => m.ExceptionModule) }, - { path: '**', redirectTo: 'exception/404' } -]; - -@NgModule({ - providers: [PreloadOptionalModules], - imports: [ - RouterModule.forRoot(routes, { - useHash: environment.useHash, - // NOTICE: If you use `reuse-tab` component and turn on keepingScroll you can set to `disabled` - // Pls refer to https://ng-alain.com/components/reuse-tab - scrollPositionRestoration: 'top', - preloadingStrategy: PreloadOptionalModules, - bindToComponentInputs: true - }) - ], - exports: [RouterModule] -}) -export class RouteRoutingModule {} diff --git a/src/app/routes/routes.module.ts b/src/app/routes/routes.module.ts deleted file mode 100644 index c4074f4a3..000000000 --- a/src/app/routes/routes.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { NgModule, Type } from '@angular/core'; -import { SharedModule } from '@shared'; - -import { RouteRoutingModule } from './routes-routing.module'; - -const COMPONENTS: Array> = []; - -@NgModule({ - imports: [SharedModule, RouteRoutingModule], - declarations: [...COMPONENTS] -}) -export class RoutesModule {} diff --git a/src/app/routes/routes.ts b/src/app/routes/routes.ts new file mode 100644 index 000000000..daf3e5dd9 --- /dev/null +++ b/src/app/routes/routes.ts @@ -0,0 +1,40 @@ +import { Routes } from '@angular/router'; +import { startPageGuard } from '@core'; +import { authSimpleCanActivate, authSimpleCanActivateChild } from '@delon/auth'; + +import { LayoutBasicComponent, LayoutBlankComponent } from '../layout'; + +export const routes: Routes = [ + { + path: '', + component: LayoutBasicComponent, + canActivate: [startPageGuard, authSimpleCanActivate], + canActivateChild: [authSimpleCanActivateChild], + data: {}, + children: [ + { path: '', redirectTo: 'dashboard', pathMatch: 'full' }, + { + path: 'dashboard', + loadChildren: () => import('./dashboard/routes').then(m => m.routes) + }, + { + path: 'widgets', + loadChildren: () => import('./widgets/routes').then(m => m.routes) + }, + { path: 'style', loadChildren: () => import('./style/style.module').then(m => m.StyleModule) }, + { path: 'delon', loadChildren: () => import('./delon/delon.module').then(m => m.DelonModule) }, + { path: 'extras', loadChildren: () => import('./extras/extras.module').then(m => m.ExtrasModule) }, + { path: 'pro', loadChildren: () => import('./pro/pro.module').then(m => m.ProModule) } + ] + }, + // Blak Layout 空白布局 + { + path: 'data-v', + component: LayoutBlankComponent, + children: [{ path: '', loadChildren: () => import('./data-v/data-v.module').then(m => m.DataVModule) }] + }, + // passport + { path: '', loadChildren: () => import('./passport/routes').then(m => m.routes) }, + { path: 'exception', loadChildren: () => import('./exception/routes').then(m => m.routes) }, + { path: '**', redirectTo: 'exception/404' } +]; diff --git a/src/app/routes/widgets/routes.ts b/src/app/routes/widgets/routes.ts new file mode 100644 index 000000000..183dd0c8d --- /dev/null +++ b/src/app/routes/widgets/routes.ts @@ -0,0 +1,5 @@ +import { Routes } from '@angular/router'; + +import { WidgetsComponent } from './widgets/widgets.component'; + +export const routes: Routes = [{ path: '', component: WidgetsComponent }]; diff --git a/src/app/routes/widgets/widgets-routing.module.ts b/src/app/routes/widgets/widgets-routing.module.ts deleted file mode 100644 index 12263fdc7..000000000 --- a/src/app/routes/widgets/widgets-routing.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; - -import { WidgetsComponent } from './widgets/widgets.component'; - -const routes: Routes = [{ path: '', component: WidgetsComponent }]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class WidgetsRoutingModule {} diff --git a/src/app/routes/widgets/widgets.module.ts b/src/app/routes/widgets/widgets.module.ts deleted file mode 100644 index 498b2fc37..000000000 --- a/src/app/routes/widgets/widgets.module.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { NgModule, Type } from '@angular/core'; -import { G2MiniAreaModule } from '@delon/chart/mini-area'; -import { G2MiniBarModule } from '@delon/chart/mini-bar'; -import { SharedModule } from '@shared'; -import { NzCarouselModule } from 'ng-zorro-antd/carousel'; - -import { WidgetsComponent } from './widgets/widgets.component'; -import { WidgetsRoutingModule } from './widgets-routing.module'; - -const COMPONENTS: Array> = [WidgetsComponent]; - -@NgModule({ - imports: [SharedModule, WidgetsRoutingModule, NzCarouselModule, G2MiniBarModule, G2MiniAreaModule], - declarations: COMPONENTS -}) -export class WidgetsModule {} diff --git a/src/app/routes/widgets/widgets/widgets.component.html b/src/app/routes/widgets/widgets/widgets.component.html index b000ab03e..856ba91a2 100644 --- a/src/app/routes/widgets/widgets/widgets.component.html +++ b/src/app/routes/widgets/widgets/widgets.component.html @@ -764,7 +764,8 @@

ANT DESIGN

Recent Posts Venenatis portauam Inceptos ameteiam -
+ @for (item of todoData; track $index) { +
@@ -773,11 +774,13 @@

ANT DESIGN

{{ item.content }}
+ }
-
+ @for (item of todoData; track $index) { +
@@ -789,13 +792,17 @@

ANT DESIGN

    -
  • Active
  • -
  • Completed
  • + @if (item.completed) { +
  • Active
  • + } @else { +
  • Completed
  • + }
  • Delted
+ }
diff --git a/src/app/routes/widgets/widgets/widgets.component.ts b/src/app/routes/widgets/widgets/widgets.component.ts index 2c1f0985f..188a1c96a 100644 --- a/src/app/routes/widgets/widgets/widgets.component.ts +++ b/src/app/routes/widgets/widgets/widgets.component.ts @@ -1,13 +1,18 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core'; -import { G2MiniBarData } from '@delon/chart/mini-bar'; +import { G2MiniAreaModule } from '@delon/chart/mini-area'; +import { G2MiniBarData, G2MiniBarModule } from '@delon/chart/mini-bar'; import { _HttpClient } from '@delon/theme'; +import { SHARED } from '@shared'; +import { NzCarouselModule } from 'ng-zorro-antd/carousel'; import { NzMessageService } from 'ng-zorro-antd/message'; @Component({ selector: 'app-widgets', templateUrl: './widgets.component.html', styleUrls: ['./widgets.component.less'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [...SHARED, NzCarouselModule, G2MiniBarModule, G2MiniAreaModule] }) export class WidgetsComponent implements OnInit { data: G2MiniBarData[] = []; diff --git a/src/app/shared/index.ts b/src/app/shared/index.ts index 61f370732..4003d633a 100644 --- a/src/app/shared/index.ts +++ b/src/app/shared/index.ts @@ -4,5 +4,7 @@ export * from './utils/yuan'; // Module +export * from './shared'; export * from './shared.module'; -export * from './json-schema/json-schema.module'; +export * from './json-schema/index'; +export * from './st-widget/index'; diff --git a/src/app/shared/json-schema/index.ts b/src/app/shared/json-schema/index.ts new file mode 100644 index 000000000..c0e75ecbe --- /dev/null +++ b/src/app/shared/json-schema/index.ts @@ -0,0 +1,3 @@ +import { TestWidget } from './test/test.widget'; + +export const CELL_WIDGETS = [{ KEY: TestWidget.KEY, type: TestWidget }]; diff --git a/src/app/shared/json-schema/json-schema.module.ts b/src/app/shared/json-schema/json-schema.module.ts deleted file mode 100644 index 63d7340b1..000000000 --- a/src/app/shared/json-schema/json-schema.module.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { NgModule } from '@angular/core'; -import { DelonFormModule, WidgetRegistry } from '@delon/form'; - -import { TestWidget } from './test/test.widget'; -import { SharedModule } from '../shared.module'; - -export const SCHEMA_THIRDS_COMPONENTS = [TestWidget]; - -@NgModule({ - declarations: SCHEMA_THIRDS_COMPONENTS, - imports: [SharedModule, DelonFormModule.forRoot()], - exports: SCHEMA_THIRDS_COMPONENTS -}) -export class JsonSchemaModule { - constructor(widgetRegistry: WidgetRegistry) { - widgetRegistry.register(TestWidget.KEY, TestWidget); - } -} diff --git a/src/app/shared/json-schema/test/test.widget.ts b/src/app/shared/json-schema/test/test.widget.ts index ba8178eb1..79dbf9bd0 100644 --- a/src/app/shared/json-schema/test/test.widget.ts +++ b/src/app/shared/json-schema/test/test.widget.ts @@ -1,5 +1,5 @@ import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; -import { ControlWidget } from '@delon/form'; +import { ControlWidget, DelonFormModule } from '@delon/form'; @Component({ selector: 'test', @@ -9,7 +9,9 @@ import { ControlWidget } from '@delon/form'; `, preserveWhitespaces: false, - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [DelonFormModule] }) export class TestWidget extends ControlWidget implements OnInit { static readonly KEY = 'test'; diff --git a/src/app/shared/shared-delon.module.ts b/src/app/shared/shared-delon.module.ts index 367f63709..136df4679 100644 --- a/src/app/shared/shared-delon.module.ts +++ b/src/app/shared/shared-delon.module.ts @@ -1,7 +1,6 @@ import { PageHeaderModule } from '@delon/abc/page-header'; -import { ResultModule } from '@delon/abc/result'; import { SEModule } from '@delon/abc/se'; import { STModule } from '@delon/abc/st'; import { SVModule } from '@delon/abc/sv'; -export const SHARED_DELON_MODULES = [STModule, SVModule, SEModule, PageHeaderModule, ResultModule]; +export const SHARED_DELON_MODULES = [STModule, SVModule, SEModule, PageHeaderModule]; diff --git a/src/app/shared/shared-zorro.module.ts b/src/app/shared/shared-zorro.module.ts index b71a8714a..713df812d 100644 --- a/src/app/shared/shared-zorro.module.ts +++ b/src/app/shared/shared-zorro.module.ts @@ -29,7 +29,6 @@ import { NzTabsModule } from 'ng-zorro-antd/tabs'; import { NzTagModule } from 'ng-zorro-antd/tag'; import { NzTimePickerModule } from 'ng-zorro-antd/time-picker'; import { NzToolTipModule } from 'ng-zorro-antd/tooltip'; -import { NzUploadModule } from 'ng-zorro-antd/upload'; export const SHARED_ZORRO_MODULES = [ NzButtonModule, @@ -62,6 +61,5 @@ export const SHARED_ZORRO_MODULES = [ NzCardModule, NzDividerModule, NzProgressModule, - NzPopconfirmModule, - NzUploadModule + NzPopconfirmModule ]; diff --git a/src/app/shared/shared.ts b/src/app/shared/shared.ts new file mode 100644 index 000000000..3d9656ee2 --- /dev/null +++ b/src/app/shared/shared.ts @@ -0,0 +1,20 @@ +import { NgClass, NgStyle, NgTemplateOutlet } from '@angular/common'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { RouterLink } from '@angular/router'; +import { DatePipe, I18nPipe } from '@delon/theme'; + +import { SHARED_DELON_MODULES } from './shared-delon.module'; +import { SHARED_ZORRO_MODULES } from './shared-zorro.module'; + +export const SHARED = [ + FormsModule, + ReactiveFormsModule, + RouterLink, + NgTemplateOutlet, + NgClass, + NgStyle, + I18nPipe, + DatePipe, + ...SHARED_DELON_MODULES, + ...SHARED_ZORRO_MODULES +]; diff --git a/src/app/shared/st-widget/index.ts b/src/app/shared/st-widget/index.ts new file mode 100644 index 000000000..a6a6b7358 --- /dev/null +++ b/src/app/shared/st-widget/index.ts @@ -0,0 +1 @@ +export const ST_WIDGETS = []; diff --git a/src/app/shared/st-widget/st-widget.module.ts b/src/app/shared/st-widget/st-widget.module.ts deleted file mode 100644 index c006e747b..000000000 --- a/src/app/shared/st-widget/st-widget.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; - -// import { STWidgetRegistry } from '@delon/abc/st'; -import { SharedModule } from '../shared.module'; - -export const STWIDGET_COMPONENTS = []; - -@NgModule({ - declarations: STWIDGET_COMPONENTS, - imports: [SharedModule], - exports: [...STWIDGET_COMPONENTS] -}) -export class STWidgetModule { - // constructor(widgetRegistry: STWidgetRegistry) { - // widgetRegistry.register(STImgWidget.KEY, STImgWidget); - // } -} diff --git a/src/main.ts b/src/main.ts index 783241285..15883c553 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,11 +1,6 @@ -import { ViewEncapsulation } from '@angular/core'; -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import { bootstrapApplication } from '@angular/platform-browser'; -import { AppModule } from './app/app.module'; +import { AppComponent } from './app/app.component'; +import { appConfig } from './app/app.config'; -platformBrowserDynamic() - .bootstrapModule(AppModule, { - defaultEncapsulation: ViewEncapsulation.Emulated, - preserveWhitespaces: false - }) - .catch(err => console.error(err)); +bootstrapApplication(AppComponent, appConfig).catch(err => console.error(err)); From ec0b440ddeec3d734705ec6c002034b5eaad48f8 Mon Sep 17 00:00:00 2001 From: cipchk Date: Mon, 13 Nov 2023 11:31:11 +0800 Subject: [PATCH 02/16] style(*): bump prettier to `3.1.0` --- package.json | 2 +- src/app/layout/basic/basic.component.ts | 4 +- .../layout/basic/widgets/i18n.component.ts | 20 +-- .../layout/basic/widgets/search.component.ts | 4 +- .../layout/basic/widgets/task.component.ts | 92 +++++----- .../analysis/analysis.component.html | 168 +++++++++--------- .../dashboard/analysis/analysis.component.ts | 4 +- .../dashboard/monitor/monitor.component.html | 26 +-- src/app/routes/dashboard/v1/v1.component.html | 134 +++++++------- .../workplace/workplace.component.html | 80 ++++----- src/app/routes/exception/trigger.component.ts | 2 +- .../passport/login/login.component.html | 9 +- .../passport/register/register.component.html | 42 +++-- .../widgets/widgets/widgets.component.html | 58 +++--- 14 files changed, 329 insertions(+), 316 deletions(-) diff --git a/package.json b/package.json index 587d90ec5..403d625f3 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "eslint-plugin-deprecation": "~2.0.0", "@angular/language-service": "^17.0.0", "source-map-explorer": "^2.5.3", - "prettier": "^3.0.3", + "prettier": "^3.1.0", "stylelint": "^15.11.0", "stylelint-config-standard": "^34.0.0", "stylelint-declaration-block-no-ignored-properties": "^2.7.0", diff --git a/src/app/layout/basic/basic.component.ts b/src/app/layout/basic/basic.component.ts index 28f6230b8..b6be78665 100644 --- a/src/app/layout/basic/basic.component.ts +++ b/src/app/layout/basic/basic.component.ts @@ -94,7 +94,9 @@ import { HeaderUserComponent } from './widgets/user.component'; - @if (showSettingDrawer) { } + @if (showSettingDrawer) { + + } `, standalone: true, diff --git a/src/app/layout/basic/widgets/i18n.component.ts b/src/app/layout/basic/widgets/i18n.component.ts index ca3df8cc5..25866527e 100644 --- a/src/app/layout/basic/widgets/i18n.component.ts +++ b/src/app/layout/basic/widgets/i18n.component.ts @@ -11,21 +11,21 @@ import { NzMenuModule } from 'ng-zorro-antd/menu'; selector: 'header-i18n', template: ` @if (showLangText) { -
- - {{ 'menu.lang' | i18n }} - -
+
+ + {{ 'menu.lang' | i18n }} + +
} @else { - + }
    @for (item of langs; track $index) { -
  • - {{ item.abbr }} - {{ item.text }} -
  • +
  • + {{ item.abbr }} + {{ item.text }} +
  • }
diff --git a/src/app/layout/basic/widgets/search.component.ts b/src/app/layout/basic/widgets/search.component.ts index 1d4294daa..807557ee8 100644 --- a/src/app/layout/basic/widgets/search.component.ts +++ b/src/app/layout/basic/widgets/search.component.ts @@ -27,7 +27,7 @@ import { BehaviorSubject, debounceTime, distinctUntilChanged, tap } from 'rxjs'; @if (loading) { - + } @for (i of options; track $index) { - {{ i }} + {{ i }} } `, diff --git a/src/app/layout/basic/widgets/task.component.ts b/src/app/layout/basic/widgets/task.component.ts index 7cfc91677..845fe5d6c 100644 --- a/src/app/layout/basic/widgets/task.component.ts +++ b/src/app/layout/basic/widgets/task.component.ts @@ -26,59 +26,59 @@ import { NzSpinModule } from 'ng-zorro-antd/spin';
@if (loading) { -
+
} @else { - - -
-
- + + +
+
+ +
+
+ cipchk +

Please tell me what happened in a few words, don't go into details.

+
-
- cipchk -

Please tell me what happened in a few words, don't go into details.

+
+
+ +
+
+ はなさき +

ハルカソラトキヘダツヒカリ

+
-
-
-
- +
+
+ +
+
+ 苏先生 +

请告诉我,我应该说点什么好?

+
-
- はなさき -

ハルカソラトキヘダツヒカリ

+
+
+ +
+
+ Kent +

Please tell me what happened in a few words, don't go into details.

+
-
-
-
- +
+
+ +
+
+ Jefferson +

Please tell me what happened in a few words, don't go into details.

+
-
- 苏先生 -

请告诉我,我应该说点什么好?

+
+
See All
-
-
-
- -
-
- Kent -

Please tell me what happened in a few words, don't go into details.

-
-
-
-
- -
-
- Jefferson -

Please tell me what happened in a few words, don't go into details.

-
-
-
-
See All
-
- + }
diff --git a/src/app/routes/dashboard/analysis/analysis.component.html b/src/app/routes/dashboard/analysis/analysis.component.html index 974b98308..e0acbb7e7 100644 --- a/src/app/routes/dashboard/analysis/analysis.component.html +++ b/src/app/routes/dashboard/analysis/analysis.component.html @@ -26,7 +26,7 @@ @if (data.visitData) { - + }

@@ -42,7 +42,7 @@ @if (data.visitData) { - + }

@@ -75,47 +75,47 @@

@if (data.salesData) { - - @for (tab of saleTabs; track $index) { - -
-
-
- @if (tab.show) { - - } + + @for (tab of saleTabs; track $index) { + +
+
+
+ @if (tab.show) { + + } +
+
+
+
+

{{ 'app.analysis.' + tab.key + '-ranking' | i18n }}

+
    + @for (i of rankingListData; track $index) { +
  • + {{ $index + 1 }} + {{ i.title }} + {{ i.total | number: '3.0' }} +
  • + } +
+
+
-
-
-
-

{{ 'app.analysis.' + tab.key + '-ranking' | i18n }}

-
    - @for (i of rankingListData; track $index) { -
  • - {{ $index + 1 }} - {{ i.title }} - {{ i.total | number: '3.0' }} -
  • - } -
+ + } + +
+
+ @for (t of dateRangeTypes; track $index) { + + {{ 'app.analysis.all-' + t | i18n }} + + }
+
-
- - } - -
-
- @for (t of dateRangeTypes; track $index) { - - {{ 'app.analysis.all-' + t | i18n }} - - } -
- -
-
- + + }
@@ -145,13 +145,13 @@

{{ 'app.analysis.' + tab.key + '-ranking' | i18n }} @if (data.visitData2) { - + }

@if (data.visitData2) { - + }
@@ -196,53 +196,53 @@

{{ 'app.analysis.' + tab.key + '-ranking' | i18n }}

{{ 'app.analysis.sales' | i18n }}

@if (salesPieData) { - + }
@if (data.offlineData) { - - @for (tab of data.offlineData; track $index) { - - -
- - -
-
-
- @if (tab.show) { - - } -
-
- } -
+ + @for (tab of data.offlineData; track $index) { + + +
+ + +
+
+
+ @if (tab.show) { + + } +
+
+ } +
}
diff --git a/src/app/routes/dashboard/analysis/analysis.component.ts b/src/app/routes/dashboard/analysis/analysis.component.ts index 504675fc3..40016727e 100644 --- a/src/app/routes/dashboard/analysis/analysis.component.ts +++ b/src/app/routes/dashboard/analysis/analysis.component.ts @@ -118,8 +118,8 @@ export class DashboardAnalysisComponent implements OnInit { this.salesType === 'all' ? this.data.salesTypeData : this.salesType === 'online' - ? this.data.salesTypeDataOnline - : this.data.salesTypeDataOffline; + ? this.data.salesTypeDataOnline + : this.data.salesTypeDataOffline; if (this.salesPieData) { this.salesTotal = this.salesPieData.reduce((pre: number, now: { y: number }) => now.y + pre, 0); } diff --git a/src/app/routes/dashboard/monitor/monitor.component.html b/src/app/routes/dashboard/monitor/monitor.component.html index 327b0d781..5a3327a03 100644 --- a/src/app/routes/dashboard/monitor/monitor.component.html +++ b/src/app/routes/dashboard/monitor/monitor.component.html @@ -33,24 +33,24 @@
@if (activeData) { -
- - -
-

{{ activeStat.max }} 亿元

-

{{ activeStat.min }} 亿元

+
+ + +
+

{{ activeStat.max }} 亿元

+

{{ activeStat.min }} 亿元

+
+
+ 00:00 + {{ activeStat.t1 }} + {{ activeStat.t2 }} +
-
- 00:00 - {{ activeStat.t1 }} - {{ activeStat.t2 }} -
-
} @if (percent) { - + }
diff --git a/src/app/routes/dashboard/v1/v1.component.html b/src/app/routes/dashboard/v1/v1.component.html index 8297009a8..52ddea077 100644 --- a/src/app/routes/dashboard/v1/v1.component.html +++ b/src/app/routes/dashboard/v1/v1.component.html @@ -32,15 +32,15 @@

@if (webSite) { - + }
@@ -53,15 +53,15 @@

@if (webSite) { - + }
@@ -74,15 +74,15 @@

@if (webSite) { - + }
@@ -95,15 +95,15 @@

@if (webSite) { - + }
@@ -117,7 +117,7 @@

Business Expectations & Retail Sales Statistics @if (salesData) { - + } @@ -128,7 +128,7 @@

Business Expectations & Retail Sales Statistics @if (offlineChartData) { - + } @@ -158,43 +158,43 @@

ANT DESIGN

Venenatis portauam Inceptos ameteiam @for (item of todoData; track $index) { -
-
- +
+
+ +
+
+ {{ item.name }} +

{{ item.content }}

+
-
- {{ item.name }} -

{{ item.content }}

-
-
}
@for (item of todoData; track $index) { -
-
- -
-
- {{ item.name }} -

{{ item.content }}

+
+
+ +
+
+ {{ item.name }} +

{{ item.content }}

+
+
+ + +
    + @if (item.completed) { +
  • Active
  • + } @else { +
  • Completed
  • + } +
  • Delted
  • +
+
+
-
- - -
    - @if (item.completed) { -
  • Active
  • - } @else { -
  • Completed
  • - } -
  • Delted
  • -
-
-
-
}
diff --git a/src/app/routes/dashboard/workplace/workplace.component.html b/src/app/routes/dashboard/workplace/workplace.component.html index 49241ca24..c5527ff2b 100644 --- a/src/app/routes/dashboard/workplace/workplace.component.html +++ b/src/app/routes/dashboard/workplace/workplace.component.html @@ -54,43 +54,43 @@ 全部项目 @for (item of notice; track $index) { -
- - - - - - -
- {{ item.member }} - @if (item.updatedAt) { - - {{ item.updatedAt | _date: 'fn' }} - - } -
-
-
+
+ + + + + + +
+ {{ item.member }} + @if (item.updatedAt) { + + {{ item.updatedAt | _date: 'fn' }} + + } +
+
+
}
@for (item of activities; track $index) { - - - - {{ item.user.name }} -   - - - - {{ item.updatedAt | _date: 'fn' }} - - - + + + + {{ item.user.name }} +   + + + + {{ item.updatedAt | _date: 'fn' }} + + + } @@ -99,7 +99,7 @@ - + @for (i of fileTypes; track $index) { + + } diff --git a/src/app/routes/delon/print/print.component.html b/src/app/routes/delon/print/print.component.html index bf79494f9..470c62d24 100644 --- a/src/app/routes/delon/print/print.component.html +++ b/src/app/routes/delon/print/print.component.html @@ -8,62 +8,66 @@

- - - 请先下载 - Lodop插件。 - - -
- - 打印服务器 - - -
- -
-
- -
-
-
-
- - 打印机 - - - - - - - - 纸张类型 - - - - - - - - 打印内容 - - -
仅限HTML,更多类型支持请参考官网
-
-
- - - - - - -
+ @if (error) { + + + 请先下载 + Lodop插件。 + + + } + @if (!error) { +
+ + 打印服务器 + + +
+ +
+
+ +
+
+
+
+ + 打印机 + + + + + + + + 纸张类型 + + + + + + + + 打印内容 + + +
仅限HTML,更多类型支持请参考官网
+
+
+ + + + + + +
+ }
diff --git a/src/app/routes/delon/zip/zip.component.html b/src/app/routes/delon/zip/zip.component.html index 7f8a9e4de..962c44330 100644 --- a/src/app/routes/delon/zip/zip.component.html +++ b/src/app/routes/delon/zip/zip.component.html @@ -4,36 +4,40 @@

Document

- - - -
    -
  1. {{ i | json }}
  2. -
-
- - - - - - - - path - - - url - - - - - - - - - - - - - - - +@if (instance) { + + + +
    +
  1. {{ i | json }}
  2. +
+
+} +@if (instance) { + + + + + + + + path + + + url + + + + + + + + + + + + + + + +} diff --git a/src/app/routes/extras/settings/settings.component.html b/src/app/routes/extras/settings/settings.component.html index 43b16a496..41b9ef314 100644 --- a/src/app/routes/extras/settings/settings.component.html +++ b/src/app/routes/extras/settings/settings.component.html @@ -14,194 +14,212 @@ - - - -
- - name - - - - - - email - - - - - - - You can manage verified email addresses in your - email settings. - - - - - Bio - - - You can @mention other users and organizations to link to them. - - - - URL - - - - - - Company - - - - - - Location - - - - - - - - - -
-
- -

Profile picture

- - - - -
-
-
- - - -
- - Old password - - - - - - New password - - - - - - Confirm new password - - - - - - - - I forgot my password - - -
-
-
-

Change username

-

Changing your username can have unintended side effects.

- -
- - - - cipchk@qq.com - Primary - Public - - - - - -

Add email address

- - -

Primary email address

-

- cipchk@qq.com will be used for account-related notifications and for web-based GitHub operations (e.g. edits and merges). -

- - - - -
- -

Choose how you receive notifications. These notification settings apply to the repositories you’re watching.

- - -

Automatically watch repositories

-

When you’re given push access to a repository, automatically receive notifications for it.

- -
- -

Participating

-

Notifications for the conversations you are participating in, or if someone cites you with an @mention.

- - -
- -

Watching

-

Notifications for all repositories or conversations you’re watching.

- - -
-
-
- -
-

No OAuth applications

-

OAuth applications are used to access the GitHub API. Read the docs to find out more.

- -
-
- - - - - -

Tokens you have generated that can be used to access the GitHub API.

- - - octotree — repo - - Last used within the last day - - - - - - - -
+ @switch (active) { + @case (1) { + + + +
+ + name + + + + + + email + + + + + + + You can manage verified email addresses in your + email settings. + + + + + Bio + + + + You can @mention other users and organizations to link to them. + + + + + URL + + + + + + Company + + + + + + Location + + + + + + + + + +
+
+ +

Profile picture

+ + + + +
+
+
+ } + @case (2) { + + + +
+ + Old password + + + + + + New password + + + + + + Confirm new password + + + + + + + + I forgot my password + + +
+
+
+

Change username

+

Changing your username can have unintended side effects.

+ +
+ } + @case (3) { + + + + cipchk@qq.com + Primary + Public + + + + + +

Add email address

+ + +

Primary email address

+

+ cipchk@qq.com will be used for account-related notifications and for web-based GitHub operations (e.g. edits and merges). +

+ + + + +
+ } + @case (4) { + +

Choose how you receive notifications. These notification settings apply to the repositories you’re watching.

+ + +

Automatically watch repositories

+

When you’re given push access to a repository, automatically receive notifications for it.

+ +
+ +

Participating

+

Notifications for the conversations you are participating in, or if someone cites you with an @mention.

+ + +
+ +

Watching

+

Notifications for all repositories or conversations you’re watching.

+ + +
+
+
+ } + @case (5) { + +
+

No OAuth applications

+

OAuth applications are used to access the GitHub API. Read the docs to find out more.

+ +
+
+ } + @case (6) { + + + + + +

Tokens you have generated that can be used to access the GitHub API.

+ + + octotree — repo + + Last used within the last day + + + + + + + +
+ } + }
diff --git a/src/app/routes/style/colors/colors.component.html b/src/app/routes/style/colors/colors.component.html index a302536d3..db52feb47 100644 --- a/src/app/routes/style/colors/colors.component.html +++ b/src/app/routes/style/colors/colors.component.html @@ -7,52 +7,56 @@

-
-
-
-

.bg-{{ c }}-light

-

.text-{{ c }}-light

+ @for (c of brands; track $index) { +
+
+
+

.bg-{{ c }}-light

+

.text-{{ c }}-light

+
-
-
-
-

.bg-{{ c }}

-

.text-{{ c }}

+
+
+

.bg-{{ c }}

+

.text-{{ c }}

+
-
-
-
-

.bg-{{ c }}-dark

-

.text-{{ c }}-dark

+
+
+

.bg-{{ c }}-dark

+

.text-{{ c }}-dark

+
-
+ }
-
-
-
-

.bg-{{ c }}-light

-

.text-{{ c }}-light

+ @for (c of names; track $index) { +
+
+
+

.bg-{{ c }}-light

+

.text-{{ c }}-light

+
-
-
-
-

.bg-{{ c }}

-

.text-{{ c }}

+
+
+

.bg-{{ c }}

+

.text-{{ c }}

+
-
-
-
-

.bg-{{ c }}-dark

-

.text-{{ c }}-dark

+
+
+

.bg-{{ c }}-dark

+

.text-{{ c }}-dark

+
-
+ }
@@ -92,13 +96,17 @@

-
-
-

.bg-{{ c }}-{{ i }}

-

.bg-{{ c }}-{{ i }}-h

-

.text-{{ c }}-{{ i }}

+ @for (c of names; track $index) { +
+ @for (i of nums; track $index) { +
+

.bg-{{ c }}-{{ i }}

+

.bg-{{ c }}-{{ i }}-h

+

.text-{{ c }}-{{ i }}

+
+ }
-
+ }
diff --git a/src/app/routes/style/typography/typography.component.html b/src/app/routes/style/typography/typography.component.html index 57e0d4443..583eccdc9 100644 --- a/src/app/routes/style/typography/typography.component.html +++ b/src/app/routes/style/typography/typography.component.html @@ -49,7 +49,9 @@

Alignment & Sizing Helpers

-

class="text-{{ color }} bg-{{ color }}"

+ @for (color of names; track $index) { +

class="text-{{ color }} bg-{{ color }}"

+ }