Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
biaogebusy committed Jan 18, 2025
2 parents 2de8eae + 853d5c0 commit 969940f
Show file tree
Hide file tree
Showing 30 changed files with 292 additions and 185 deletions.
5 changes: 5 additions & 0 deletions src/app/core/interface/widgets/IIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ export interface IIcon {
svg?: string;
inline?: boolean;
style?: any;
badge?: {
value: string | number;
position?: 'above' | 'below' | 'before' | 'after';
size?: 'small' | 'medium' | 'large';
};
}
5 changes: 4 additions & 1 deletion src/app/core/interface/widgets/IViewList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ export interface IViewList {
spacer?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'none';
params: Params;
header: Header[];
form: FormlyFieldConfig[];
form: {
type: string;
fields: FormlyFieldConfig[];
};
tableClasses?: string;
tableParams?: any;
fullWidth?: boolean;
Expand Down
12 changes: 0 additions & 12 deletions src/app/core/service/utilities.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,6 @@ export class UtilitiesService {
toggleActions: `${trigger?.onEnter || 'restart'} ${
trigger?.onLeave || 'pause'
} ${trigger?.onEnterBack || 'none'} ${trigger?.onLeaveBack || 'reverse'}`,
onEnter: () => {
console.log('onEnter');
},
onLeave: () => {
console.log('onLeave');
},
onEnterBack: () => {
console.log('onEnterBack');
},
onLeaveBack: () => {
console.log('onLeaveBack');
},
},
});
if (from) {
Expand Down
8 changes: 3 additions & 5 deletions src/app/modules/builder/builder.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
[ngClass]="{ dark: (builder.themeMode | async) === 'dark' }"
>
<mat-drawer-container class="w-full">
@if (isBuilderMode$ | async) {
<mat-drawer #drawer class="sidebar-drawer" [(opened)]="sidebarDrawerOpened" mode="side">
<app-builder-sidebar [sidebarDrawer]="drawer" [drawerContentRef]="drawerContent" />
</mat-drawer>
}
<mat-drawer #drawer class="sidebar-drawer" [(opened)]="sidebarDrawerOpened" mode="side">
<app-builder-sidebar [sidebarDrawer]="drawer" [drawerContentRef]="drawerContent" />
</mat-drawer>
<mat-drawer-content #drawerContent class="drawer-content">
<div
class="builder flex-1 overflow-auto h-full"
Expand Down
12 changes: 2 additions & 10 deletions src/app/modules/builder/builder.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
AfterViewInit,
} from '@angular/core';
import { BuilderState } from '@core/state/BuilderState';
import { BUILDER_FULL_SCREEN, IS_BUILDER_MODE } from '@core/token/token-providers';
import { BUILDER_FULL_SCREEN } from '@core/token/token-providers';
import { MatDrawer } from '@angular/material/sidenav';
import { Observable } from 'rxjs';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
Expand All @@ -24,17 +24,9 @@ export class BuilderComponent implements OnInit, AfterViewInit {
builderRightDrawer: MatDrawer;
sidebarDrawerOpened = false;
builder = inject(BuilderState);
isBuilderMode: boolean;
private destroyRef = inject(DestroyRef);

constructor(
@Inject(IS_BUILDER_MODE) public isBuilderMode$: Observable<boolean>,
@Inject(BUILDER_FULL_SCREEN) public builderFullScreen$: Observable<boolean>
) {
this.isBuilderMode$.pipe(takeUntilDestroyed()).subscribe(state => {
this.isBuilderMode = state;
});
}
constructor(@Inject(BUILDER_FULL_SCREEN) public builderFullScreen$: Observable<boolean>) {}

ngOnInit(): void {
this.builder.rightContent$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(content => {
Expand Down
12 changes: 12 additions & 0 deletions src/app/modules/builder/data/components-for-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1827,6 +1827,7 @@ export const components: any[] = [
alt: '',
},
carousel: {
type: 'swiper',
params: {
slidesPerView: 1,
navigation: false,
Expand Down Expand Up @@ -1877,6 +1878,7 @@ export const components: any[] = [
alt: '',
},
carousel: {
type: 'swiper',
params: {
slidesPerView: 1,
navigation: false,
Expand Down Expand Up @@ -1914,6 +1916,7 @@ export const components: any[] = [
alt: '',
},
carousel: {
type: 'swiper',
params: {
slidesPerView: 1,
navigation: false,
Expand Down Expand Up @@ -1951,6 +1954,7 @@ export const components: any[] = [
alt: '',
},
carousel: {
type: 'swiper',
params: {
slidesPerView: 1,
navigation: false,
Expand Down Expand Up @@ -1988,6 +1992,7 @@ export const components: any[] = [
alt: '',
},
carousel: {
type: 'swiper',
params: {
slidesPerView: 1,
navigation: false,
Expand Down Expand Up @@ -2025,6 +2030,7 @@ export const components: any[] = [
alt: '',
},
carousel: {
type: 'swiper',
params: {
slidesPerView: 1,
navigation: false,
Expand Down Expand Up @@ -2062,6 +2068,7 @@ export const components: any[] = [
alt: '',
},
carousel: {
type: 'swiper',
params: {
slidesPerView: 1,
navigation: false,
Expand Down Expand Up @@ -2099,6 +2106,7 @@ export const components: any[] = [
alt: '',
},
carousel: {
type: 'swiper',
params: {
slidesPerView: 1,
navigation: false,
Expand Down Expand Up @@ -2260,6 +2268,7 @@ export const components: any[] = [
elements: [
{
carousel: {
type: 'swiper',
params: {
slidesPerView: 1,
navigation: false,
Expand Down Expand Up @@ -2303,6 +2312,7 @@ export const components: any[] = [
},
{
carousel: {
type: 'swiper',
params: {
slidesPerView: 1,
navigation: false,
Expand Down Expand Up @@ -2334,6 +2344,7 @@ export const components: any[] = [
},
{
carousel: {
type: 'swiper',
params: {
slidesPerView: 1,
navigation: false,
Expand Down Expand Up @@ -2365,6 +2376,7 @@ export const components: any[] = [
},
{
carousel: {
type: 'swiper',
params: {
slidesPerView: 1,
navigation: false,
Expand Down
17 changes: 17 additions & 0 deletions src/app/modules/builder/data/system-for-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ export const system: any[] = [
type: 'dashboard',
elements: [
{
type: 'dashboard-box',
title: {
label: '内容发布量',
},
Expand Down Expand Up @@ -336,6 +337,7 @@ export const system: any[] = [
},
{
row: 3,
type: 'dashboard-box',
widget: {
type: 'chart-box',
label: '文章数',
Expand Down Expand Up @@ -400,6 +402,7 @@ export const system: any[] = [
},
{
row: 3,
type: 'dashboard-box',
widget: {
type: 'chart-box',
label: '审核数',
Expand Down Expand Up @@ -464,6 +467,7 @@ export const system: any[] = [
},
{
row: 3,
type: 'dashboard-box',
widget: {
type: 'chart-box',
label: '用户数',
Expand Down Expand Up @@ -528,6 +532,7 @@ export const system: any[] = [
},
{
row: 3,
type: 'dashboard-box',
widget: {
type: 'chart-box',
label: '评论数',
Expand Down Expand Up @@ -591,6 +596,7 @@ export const system: any[] = [
},
},
{
type: 'dashboard-box',
title: {
label: '最新文章',
},
Expand Down Expand Up @@ -662,6 +668,7 @@ export const system: any[] = [
},
},
{
type: 'dashboard-box',
title: {
label: '最新审批',
},
Expand Down Expand Up @@ -733,6 +740,7 @@ export const system: any[] = [
},
},
{
type: 'dashboard-box',
title: {
label: '工作日历',
},
Expand Down Expand Up @@ -890,6 +898,7 @@ export const system: any[] = [
type: 'dashboard',
elements: [
{
type: 'dashboard-box',
title: {
label: '消费者注册数据',
},
Expand Down Expand Up @@ -978,6 +987,7 @@ export const system: any[] = [
},
{
row: 3,
type: 'dashboard-box',
widget: {
type: 'chart-box',
label: '广告发布量',
Expand Down Expand Up @@ -1041,6 +1051,7 @@ export const system: any[] = [
},
},
{
type: 'dashboard-box',
row: 3,
widget: {
type: 'chart-box',
Expand Down Expand Up @@ -1105,6 +1116,7 @@ export const system: any[] = [
},
},
{
type: 'dashboard-box',
row: 3,
widget: {
type: 'chart-box',
Expand Down Expand Up @@ -1169,6 +1181,7 @@ export const system: any[] = [
},
},
{
type: 'dashboard-box',
row: 3,
widget: {
type: 'chart-box',
Expand Down Expand Up @@ -1233,6 +1246,7 @@ export const system: any[] = [
},
},
{
type: 'dashboard-box',
title: {
label: '抽奖数据',
},
Expand Down Expand Up @@ -1299,6 +1313,7 @@ export const system: any[] = [
},
},
{
type: 'dashboard-box',
title: {
label: '最新广告',
},
Expand Down Expand Up @@ -1363,6 +1378,7 @@ export const system: any[] = [
},
},
{
type: 'dashboard-box',
title: {
label: '最新评论',
},
Expand Down Expand Up @@ -1419,6 +1435,7 @@ export const system: any[] = [
},
},
{
type: 'dashboard-box',
title: {
label: '活动日历',
},
Expand Down
4 changes: 2 additions & 2 deletions src/app/modules/builder/factory/getCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ export function getCard(widget: any): FormlyFieldConfig {
updateLabel: '更新图片',
addLabel: '设置图片',
deleteLabel: '删除',
fileName: widget.feature.img.src.split('/').pop(),
alt: widget.alt ?? '',
fileName: widget?.feature?.img?.src.split('/').pop(),
alt: widget?.feature?.img?.alt ?? '',
},
},
],
Expand Down
Loading

0 comments on commit 969940f

Please sign in to comment.