From f1612c729e3656820130643431f3d28c670fe38a Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Fri, 19 Apr 2024 18:14:23 +0800 Subject: [PATCH] 1 --- src/app/app.routes.ts | 9 +++ src/app/data/goods/goods.namespace.ts | 5 ++ src/app/model/goods.interface.ts | 10 ++++ .../sys-account/sys-account.component.spec.ts | 23 -------- .../sys-role/sys-role.component.spec.ts | 23 -------- .../goods-type/goods-type.component.html | 20 +++++++ .../goods-type/goods-type.component.less | 6 ++ .../goods/goods-type/goods-type.component.ts | 57 +++++++++++++++++++ src/app/pages/goods/goods.module.ts | 12 ++++ src/app/pages/goods/goods.routes.ts | 8 +++ src/app/pages/system/menu/menu.component.html | 8 ++- src/app/pages/system/menu/menu.component.ts | 7 ++- 12 files changed, 137 insertions(+), 51 deletions(-) create mode 100644 src/app/data/goods/goods.namespace.ts create mode 100644 src/app/model/goods.interface.ts delete mode 100644 src/app/pages/account/sys-account/sys-account.component.spec.ts delete mode 100644 src/app/pages/account/sys-role/sys-role.component.spec.ts create mode 100644 src/app/pages/goods/goods-type/goods-type.component.html create mode 100644 src/app/pages/goods/goods-type/goods-type.component.less create mode 100644 src/app/pages/goods/goods-type/goods-type.component.ts create mode 100644 src/app/pages/goods/goods.module.ts create mode 100644 src/app/pages/goods/goods.routes.ts diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index c571b81..7e0a3cf 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -7,6 +7,10 @@ export const routes: Routes = [ path: 'login', loadChildren: () => import('./pages/login/login.routes').then(m => m.LOGIN_ROUTES) }, + { + path: 'index', + loadChildren: () => import('./pages/login/login.routes').then(m => m.LOGIN_ROUTES) + }, { path: 'admin', component: IndexComponent, children: [ @@ -20,6 +24,11 @@ export const routes: Routes = [ loadChildren: () => import('./pages/account/account.routes').then(m => m.ACCOUNT_ROUTES), canActivate: [InitGuardService] }, + { + path: 'goods', + loadChildren: () => import('./pages/goods/goods.routes').then(m => m.GOODS_ROUTES), + canActivate: [InitGuardService] + }, { path: 'system', loadChildren: () => import('./pages/system/system.routes').then(m => m.SYSTEM_ROUTES), diff --git a/src/app/data/goods/goods.namespace.ts b/src/app/data/goods/goods.namespace.ts new file mode 100644 index 0000000..8b6e8c8 --- /dev/null +++ b/src/app/data/goods/goods.namespace.ts @@ -0,0 +1,5 @@ +export const goodsTypeSearch = [ + {title: "标题" , formControlName: "title"}, + {title: "业务类型" , formControlName: "businessType"} , +]; + diff --git a/src/app/model/goods.interface.ts b/src/app/model/goods.interface.ts new file mode 100644 index 0000000..88a3553 --- /dev/null +++ b/src/app/model/goods.interface.ts @@ -0,0 +1,10 @@ +export interface GoodsTypeData { + id: number; + parentId: number; + title: string; + businessType: number; + imgUrl: string; + createTime: string; + updateTime: string; + status: number; +} diff --git a/src/app/pages/account/sys-account/sys-account.component.spec.ts b/src/app/pages/account/sys-account/sys-account.component.spec.ts deleted file mode 100644 index 1202300..0000000 --- a/src/app/pages/account/sys-account/sys-account.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { SysAccountComponent } from './sys-account.component'; - -describe('SysAccountComponent', () => { - let component: SysAccountComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [SysAccountComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(SysAccountComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/pages/account/sys-role/sys-role.component.spec.ts b/src/app/pages/account/sys-role/sys-role.component.spec.ts deleted file mode 100644 index b92aa28..0000000 --- a/src/app/pages/account/sys-role/sys-role.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { SysRoleComponent } from './sys-role.component'; - -describe('SysRoleComponent', () => { - let component: SysRoleComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [SysRoleComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(SysRoleComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/pages/goods/goods-type/goods-type.component.html b/src/app/pages/goods/goods-type/goods-type.component.html new file mode 100644 index 0000000..9d22493 --- /dev/null +++ b/src/app/pages/goods/goods-type/goods-type.component.html @@ -0,0 +1,20 @@ +
+
+
+ + {{item.title}} + + + + +
+ +
+
+ + + +
+
+
+
diff --git a/src/app/pages/goods/goods-type/goods-type.component.less b/src/app/pages/goods/goods-type/goods-type.component.less new file mode 100644 index 0000000..5cbaf43 --- /dev/null +++ b/src/app/pages/goods/goods-type/goods-type.component.less @@ -0,0 +1,6 @@ +.search-area { + text-align: center; +} +button { + margin-left: 8px; +} diff --git a/src/app/pages/goods/goods-type/goods-type.component.ts b/src/app/pages/goods/goods-type/goods-type.component.ts new file mode 100644 index 0000000..fd060f0 --- /dev/null +++ b/src/app/pages/goods/goods-type/goods-type.component.ts @@ -0,0 +1,57 @@ +import { Component } from '@angular/core'; +import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms"; +import {NzButtonComponent} from "ng-zorro-antd/button"; +import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {RoleService} from "../../../servies/role/role.service"; +import {MenuService} from "../../../servies/menu/menu.service"; +import {NzMessageService} from "ng-zorro-antd/message"; +import {NzModalService} from "ng-zorro-antd/modal"; +import {NgForOf} from "@angular/common"; +import {goodsTypeSearch} from "../../../data/goods/goods.namespace"; + +@Component({ + selector: 'app-goods-type', + standalone: true, + imports: [ + FormsModule, + NzButtonComponent, + NzColDirective, + NzFormControlComponent, + NzFormDirective, + NzFormItemComponent, + NzFormLabelComponent, + NzInputDirective, + NzRowDirective, + ReactiveFormsModule, + NgForOf + ], + templateUrl: './goods-type.component.html', + styleUrl: './goods-type.component.less' +}) +export class GoodsTypeComponent { + // 搜索表单 + searchForm: FormGroup; + + constructor(private fb: NonNullableFormBuilder) { + // 初始化搜索框 + this.searchForm = this.fb.group({ + title: [''], + parentId: [''], + businessType: [''], + }); + + } + + // 搜索表单提交 + searchFormSubmit(): void { + } + + // 搜索表单重置 + searchFormReset(): void { + this.searchForm.reset(); + } + + protected readonly goodsTypeSearch = goodsTypeSearch; +} diff --git a/src/app/pages/goods/goods.module.ts b/src/app/pages/goods/goods.module.ts new file mode 100644 index 0000000..5abd5d7 --- /dev/null +++ b/src/app/pages/goods/goods.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + + + +@NgModule({ + declarations: [], + imports: [ + CommonModule + ] +}) +export class GoodsModule { } diff --git a/src/app/pages/goods/goods.routes.ts b/src/app/pages/goods/goods.routes.ts new file mode 100644 index 0000000..02f1bbb --- /dev/null +++ b/src/app/pages/goods/goods.routes.ts @@ -0,0 +1,8 @@ +import { Routes } from '@angular/router'; +import {GoodsTypeComponent} from "./goods-type/goods-type.component"; + + +export const GOODS_ROUTES: Routes = [ + { path: 'goods_type', component: GoodsTypeComponent}, + +]; diff --git a/src/app/pages/system/menu/menu.component.html b/src/app/pages/system/menu/menu.component.html index 3391b7e..8acaa3a 100644 --- a/src/app/pages/system/menu/menu.component.html +++ b/src/app/pages/system/menu/menu.component.html @@ -45,9 +45,11 @@ 父级菜单 - - - + diff --git a/src/app/pages/system/menu/menu.component.ts b/src/app/pages/system/menu/menu.component.ts index 162f652..978421a 100644 --- a/src/app/pages/system/menu/menu.component.ts +++ b/src/app/pages/system/menu/menu.component.ts @@ -24,6 +24,7 @@ import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; import {NzInputNumberComponent} from "ng-zorro-antd/input-number"; import {NzMessageService} from "ng-zorro-antd/message"; import {NzSpinComponent} from "ng-zorro-antd/spin"; +import {NzTreeSelectComponent} from "ng-zorro-antd/tree-select"; @Component({ selector: 'app-menu', @@ -56,7 +57,8 @@ import {NzSpinComponent} from "ng-zorro-antd/spin"; NzOptionComponent, NgForOf, NzInputNumberComponent, - NzSpinComponent + NzSpinComponent, + NzTreeSelectComponent ], templateUrl: './menu.component.html', styleUrl: './menu.component.less' @@ -88,7 +90,7 @@ export class MenuComponent { menuName: ['', [Validators.required]], menuType: ['1', [Validators.required]], menuUrl: ['', [Validators.required]], - menuPSid: [''], + menuPSid: [null], menuUrlImg: [''], menuSort: ['', [Validators.required]], menuDesc: [''], @@ -112,6 +114,7 @@ export class MenuComponent { queryMenuData() { this.menuService.queryMenuList((data: any) => { this.menuData = data['return_data']; + console.log("父类菜单数据" , this.menuData); }); }