+
-
+
+
+
\ No newline at end of file
diff --git a/projects/admin/src/app/components/app-page/app-page.component.less b/projects/admin/src/app/components/app-page/app-page.component.less
index 66797ff..1dce684 100644
--- a/projects/admin/src/app/components/app-page/app-page.component.less
+++ b/projects/admin/src/app/components/app-page/app-page.component.less
@@ -1,7 +1,8 @@
:host {
display: flex;
flex-direction: column;
- min-height: 100%;
+ height: 100%;
+ overflow: auto;
}
.app-page {
diff --git a/projects/admin/src/app/components/app-page/app-page.component.ts b/projects/admin/src/app/components/app-page/app-page.component.ts
index b2695eb..56dc17e 100644
--- a/projects/admin/src/app/components/app-page/app-page.component.ts
+++ b/projects/admin/src/app/components/app-page/app-page.component.ts
@@ -1,16 +1,58 @@
-import { Component, Input, TemplateRef } from "@angular/core";
+import { Component, Input, OnDestroy, TemplateRef } from "@angular/core";
+import { ActivatedRoute, NavigationEnd, Router, Scroll } from "@angular/router";
+import { Subject, filter, startWith, take, takeUntil } from "rxjs";
+
+interface BreadcrumbInterface {
+ label: string;
+ href?: string;
+}
@Component({
selector: "app-page",
templateUrl: "./app-page.component.html",
styleUrls: ["./app-page.component.less"],
})
-export class AppPageComponent {
- constructor() {}
+export class AppPageComponent implements OnDestroy {
+ constructor(private route: ActivatedRoute, private router: Router) {
+ // this.router.events
+ // .pipe(
+ // takeUntil(this.unSubscribe$),
+ // filter((e) => e instanceof NavigationEnd || e instanceof Scroll)
+ // )
+ // .subscribe(() => {
+ // this.genBreadcrumb();
+ // });
+ }
@Input() pageTitle?: TemplateRef<{}> | string;
@Input() full: boolean = false;
+ @Input() scroll: boolean = true;
+
@Input() pageExtra?: TemplateRef<{}> | string;
+
+ unSubscribe$ = new Subject
();
+
+ breadcrumb: BreadcrumbInterface[] = [];
+
+ ngOnDestroy(): void {
+ this.unSubscribe$.next();
+ this.unSubscribe$.complete();
+ }
+
+ genBreadcrumb() {
+ let route: ActivatedRoute | null = this.route;
+ this.breadcrumb = [];
+ while (route) {
+ if (route.routeConfig?.title) {
+ this.breadcrumb.unshift({
+ label: route.routeConfig!.title as string,
+ href: route.routeConfig.path,
+ });
+ }
+ route = route?.parent ?? null;
+ }
+ console.log("this.route", this.breadcrumb);
+ }
}
diff --git a/projects/admin/src/app/components/index.ts b/projects/admin/src/app/components/index.ts
index 16c60bf..7396790 100644
--- a/projects/admin/src/app/components/index.ts
+++ b/projects/admin/src/app/components/index.ts
@@ -5,3 +5,6 @@ export * from "./food-form/food-form.component";
export * from "./dish-form/dish-form.component";
export * from "./ingredient-form-basic/ingredient-form-basic.component";
+
+export * from "./user-list/user-list.component";
+export * from "./role-permission/role-permission.component";
diff --git a/projects/admin/src/app/components/role-permission/role-permission.component.html b/projects/admin/src/app/components/role-permission/role-permission.component.html
new file mode 100644
index 0000000..26725c4
--- /dev/null
+++ b/projects/admin/src/app/components/role-permission/role-permission.component.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/projects/admin/src/app/components/role-permission/role-permission.component.less b/projects/admin/src/app/components/role-permission/role-permission.component.less
new file mode 100644
index 0000000..e69de29
diff --git a/projects/admin/src/app/components/role-permission/role-permission.component.ts b/projects/admin/src/app/components/role-permission/role-permission.component.ts
new file mode 100644
index 0000000..364e846
--- /dev/null
+++ b/projects/admin/src/app/components/role-permission/role-permission.component.ts
@@ -0,0 +1,72 @@
+import { ApiService } from "@admin/app/services";
+import { Component } from "@angular/core";
+import { ActivatedRoute } from "@angular/router";
+
+@Component({
+ selector: "app-role-permission",
+ templateUrl: "./role-permission.component.html",
+ styleUrls: ["./role-permission.component.less"],
+})
+export class RolePermissionComponent {
+ constructor(private api: ApiService, private route: ActivatedRoute) {}
+
+ roleId: string | null = null;
+
+ permissions = {
+ 食材管理: [
+ { label: "食材列表-查看", value: "1-1" },
+ { label: "食材-新增/编辑/删除", value: "1-2" },
+ ],
+ 菜品管理: [
+ { label: "菜品列表-查看", value: "2-1" },
+ { label: "菜品-新增/编辑/删除", value: "2-2" },
+ ],
+ 食谱管理: [
+ { label: "食谱列表-查看", value: "3-1" },
+ { label: "食谱-新增/编辑/删除", value: "3-2" },
+ { label: "食谱审核列表-查看", value: "3-3" },
+ { label: "食谱审核列表-通过/驳回", value: "3-4" },
+ { label: "食谱发布计划-查看", value: "3-5" },
+ { label: "食谱发布计划-发布/取消发布", value: "3-6" },
+ ],
+ 人群营养标准管理: [
+ { label: "模型列表-查看", value: "4-1" },
+ { label: "营养标准模型-新增/编辑/删除", value: "4-2" },
+ ],
+ 单位管理: [
+ { label: "单位列表-查看", value: "5-1" },
+ { label: "单位-新增/编辑/启用/禁用/删除", value: "5-2" },
+ ],
+ 系统设置: [
+ { label: "用户列表-查看", value: "6-1" },
+ { label: "角色权限-新增/编辑/删除", value: "6-2" },
+ { label: "用户-新增/编辑/删除", value: "6-3" },
+ ],
+ };
+
+ hasPermissions = new Set();
+
+ ngOnInit(): void {
+ this.route.queryParamMap.subscribe((r) => {
+ this.roleId = r.get("roleId");
+ if (this.roleId) {
+ }
+ });
+ }
+
+ returenZero() {
+ return 0;
+ }
+
+ onPermissionChange(checked: boolean, key: string) {
+ if (!checked && this.hasPermissions.has(key)) {
+ this.hasPermissions.delete(key);
+ } else {
+ this.hasPermissions.add(key);
+ }
+ }
+
+ onSubmit() {
+ console.log("this.hasPermissions", this.hasPermissions);
+ }
+}
diff --git a/projects/admin/src/app/components/user-list/user-list.component.html b/projects/admin/src/app/components/user-list/user-list.component.html
new file mode 100644
index 0000000..b23f5c9
--- /dev/null
+++ b/projects/admin/src/app/components/user-list/user-list.component.html
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/projects/admin/src/app/components/user-list/user-list.component.less b/projects/admin/src/app/components/user-list/user-list.component.less
new file mode 100644
index 0000000..e69de29
diff --git a/projects/admin/src/app/components/user-list/user-list.component.ts b/projects/admin/src/app/components/user-list/user-list.component.ts
new file mode 100644
index 0000000..856bd18
--- /dev/null
+++ b/projects/admin/src/app/components/user-list/user-list.component.ts
@@ -0,0 +1,73 @@
+import { ApiService } from "@admin/app/services";
+import { Component, OnInit, TemplateRef, ViewChild } from "@angular/core";
+import { FormControl, FormGroup } from "@angular/forms";
+import { ActivatedRoute } from "@angular/router";
+import { AnyObject, TableListOption } from "@cdk/public-api";
+import { NzModalService } from "ng-zorro-antd/modal";
+
+@Component({
+ selector: "app-user-list",
+ templateUrl: "./user-list.component.html",
+ styleUrls: ["./user-list.component.less"],
+})
+export class UserListComponent {
+ constructor(private api: ApiService, private route: ActivatedRoute, private modal: NzModalService) {}
+
+ @ViewChild("userFormTpl") public userFormTpl!: TemplateRef;
+
+ public tableList = new TableListOption(this.fetchData.bind(this), {
+ manual: true,
+ });
+
+ public queryForm = new FormGroup({
+ name: new FormControl(""),
+ });
+
+ roleId: string | null = null;
+
+ ngOnInit(): void {
+ this.route.queryParamMap.subscribe((r) => {
+ this.roleId = r.get("roleId");
+ if (this.roleId) {
+ this.tableList.reset();
+ }
+ });
+ this.initTableList();
+ }
+
+ initTableList() {
+ this.tableList.scroll = { x: null };
+ this.tableList = this.tableList.setColumns([
+ { key: "name", title: "账号" },
+ { key: "name", title: "姓名" },
+ { key: "name", title: "角色" },
+ { key: "name", title: "添加时间" },
+ ]);
+
+ this.tableList = this.tableList.setOptions([
+ {
+ title: "编辑",
+ premissions: [],
+ onClick: this.openForm.bind(this),
+ },
+ {
+ title: "删除",
+ premissions: [],
+ onClick: this.deleteItem.bind(this),
+ },
+ ]);
+ }
+
+ fetchData(query: AnyObject, pager: AnyObject) {
+ return this.api.page(pager, query);
+ }
+
+ deleteItem() {}
+
+ openForm(item?: any) {
+ this.modal.create({
+ nzTitle: item ? "编辑用户" : "新增用户",
+ nzContent: this.userFormTpl,
+ });
+ }
+}
diff --git a/projects/admin/src/app/pages/food/food.component.html b/projects/admin/src/app/pages/food/food.component.html
index 00b9689..f64687b 100644
--- a/projects/admin/src/app/pages/food/food.component.html
+++ b/projects/admin/src/app/pages/food/food.component.html
@@ -1,4 +1,4 @@
-
+
@@ -36,22 +36,25 @@
-
+
diff --git a/projects/admin/src/app/pages/index.ts b/projects/admin/src/app/pages/index.ts
index 13f9110..9be1707 100644
--- a/projects/admin/src/app/pages/index.ts
+++ b/projects/admin/src/app/pages/index.ts
@@ -9,3 +9,12 @@ export * from "./ingredients/ingredient-list/ingredient-list.component";
export * from "./ingredients/ingredient-review/ingredient-review.component";
export * from "./ingredients/ingredient-release/ingredient-release.component";
export * from "./ingredients/ingredient-form/ingredient-form.component";
+
+export * from "./organization/organization-list/organization-list.component";
+export * from "./organization/organization-form/organization-form.component";
+
+export * from "./system/user-manage/user-manage.component";
+
+export * from "./standard/standard-list/standard-list.component";
+export * from "./standard/standard-form/standard-form.component";
+export * from "./standard/standard-setting/standard-setting.component";
diff --git a/projects/admin/src/app/pages/organization/organization-form/organization-form.component.html b/projects/admin/src/app/pages/organization/organization-form/organization-form.component.html
new file mode 100644
index 0000000..2b14bb9
--- /dev/null
+++ b/projects/admin/src/app/pages/organization/organization-form/organization-form.component.html
@@ -0,0 +1,104 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/projects/admin/src/app/pages/organization/organization-form/organization-form.component.less b/projects/admin/src/app/pages/organization/organization-form/organization-form.component.less
new file mode 100644
index 0000000..e69de29
diff --git a/projects/admin/src/app/pages/organization/organization-form/organization-form.component.ts b/projects/admin/src/app/pages/organization/organization-form/organization-form.component.ts
new file mode 100644
index 0000000..64ce340
--- /dev/null
+++ b/projects/admin/src/app/pages/organization/organization-form/organization-form.component.ts
@@ -0,0 +1,54 @@
+import { Component } from "@angular/core";
+import { FormBuilder, FormGroup } from "@angular/forms";
+import { FormValidators } from "@cdk/validators";
+
+@Component({
+ selector: "app-organization-form",
+ templateUrl: "./organization-form.component.html",
+ styleUrls: ["./organization-form.component.less"],
+})
+export class OrganizationFormComponent {
+ constructor(private fb: FormBuilder) {}
+
+ formGroup!: FormGroup;
+
+ uploadLoading = false;
+
+ ngOnInit(): void {
+ this.formGroup = this.fb.group({
+ id: this.fb.control("", [FormValidators.required()]),
+ name: this.fb.control("", [FormValidators.required()]),
+ unit: this.fb.control("", [FormValidators.required()]),
+ day: this.fb.control("1", [FormValidators.required()]),
+ logo: this.fb.control("", []),
+ month: this.fb.control([], []),
+ });
+ }
+ onSubmit() {}
+
+ onFileChange(e: Event) {
+ const target = e.target as HTMLInputElement;
+ const file = target.files![0];
+ target.value = "";
+ const formData = new FormData();
+ const fileReader = new FileReader();
+ fileReader.onload = () => {
+ const base64 = fileReader.result as string;
+
+ const v = base64.split("base64,")[1];
+ };
+ formData.append("file", file);
+ this.uploadLoading = true;
+ // this.api
+ // .uploadLogo(formData)
+ // .pipe(
+ // finalize(() => {
+ // this.uploadLoading = false;
+ // })
+ // )
+ // .subscribe((r) => {
+ // this.msg.success(r.desc);
+ // fileReader.readAsDataURL(file);
+ // });
+ }
+}
diff --git a/projects/admin/src/app/pages/organization/organization-list/organization-list.component.html b/projects/admin/src/app/pages/organization/organization-list/organization-list.component.html
new file mode 100644
index 0000000..469d132
--- /dev/null
+++ b/projects/admin/src/app/pages/organization/organization-list/organization-list.component.html
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/projects/admin/src/app/pages/organization/organization-list/organization-list.component.less b/projects/admin/src/app/pages/organization/organization-list/organization-list.component.less
new file mode 100644
index 0000000..e69de29
diff --git a/projects/admin/src/app/pages/organization/organization-list/organization-list.component.ts b/projects/admin/src/app/pages/organization/organization-list/organization-list.component.ts
new file mode 100644
index 0000000..ee6ec2c
--- /dev/null
+++ b/projects/admin/src/app/pages/organization/organization-list/organization-list.component.ts
@@ -0,0 +1,82 @@
+import { Component, OnInit, TemplateRef, ViewChild } from "@angular/core";
+import { FormControl, FormGroup } from "@angular/forms";
+import { NzDrawerRef, NzDrawerService } from "ng-zorro-antd/drawer";
+import { AnyObject, TableListOption } from "@cdk/public-api";
+import { DishFormComponent } from "@admin/app/components";
+import { ApiService } from "@admin/app/services";
+
+@Component({
+ selector: "app-organization-list",
+ templateUrl: "./organization-list.component.html",
+ styleUrls: ["./organization-list.component.less"],
+})
+export class OrganizationListComponent {
+ constructor(private drawer: NzDrawerService, private api: ApiService) {}
+
+ @ViewChild("formFooterTpl") formFooterTpl!: TemplateRef<{}>;
+
+ private drawerRef?: NzDrawerRef;
+
+ public tableList = new TableListOption(this.fetchData.bind(this), {
+ selectable: true,
+ });
+
+ public queryForm = new FormGroup({
+ name: new FormControl(""),
+ });
+
+ ngOnInit(): void {
+ this.initTableList();
+ }
+
+ initTableList() {
+ this.tableList.scroll = { x: null };
+ this.tableList = this.tableList.setColumns([
+ { key: "name", title: "账号" },
+ { key: "name", title: "单位名称" },
+ { key: "name", title: "单位类型" },
+ { key: "name", title: "地址", width: "30%" },
+ { key: "name", title: "联系人" },
+ { key: "name", title: "联系电话" },
+ { key: "name", title: "使用状态" },
+ { key: "name", title: "到期时间" },
+ ]);
+
+ this.tableList = this.tableList.setOptions([
+ {
+ title: "续费",
+ premissions: [],
+ onClick: this.showFoodForm.bind(this),
+ },
+ {
+ title: "编辑",
+ premissions: [],
+ onClick: this.showFoodForm.bind(this),
+ },
+ {
+ title: "删除",
+ premissions: [],
+ onClick: this.deleteItem.bind(this),
+ },
+ ]);
+ }
+
+ fetchData(query: AnyObject, pager: AnyObject) {
+ return this.api.page(pager, query);
+ }
+
+ showFoodForm(food?: any) {
+ this.drawerRef = this.drawer.create({
+ nzTitle: food ? "编辑菜品" : "新增菜品",
+ nzWidth: 700,
+ nzContent: DishFormComponent,
+ nzFooter: this.formFooterTpl,
+ });
+ }
+
+ cancelFoodForm() {
+ this.drawerRef?.close();
+ }
+
+ deleteItem() {}
+}
diff --git a/projects/admin/src/app/pages/standard/standard-form/standard-form.component.html b/projects/admin/src/app/pages/standard/standard-form/standard-form.component.html
new file mode 100644
index 0000000..14c7ac0
--- /dev/null
+++ b/projects/admin/src/app/pages/standard/standard-form/standard-form.component.html
@@ -0,0 +1,59 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/projects/admin/src/app/pages/standard/standard-form/standard-form.component.less b/projects/admin/src/app/pages/standard/standard-form/standard-form.component.less
new file mode 100644
index 0000000..e69de29
diff --git a/projects/admin/src/app/pages/standard/standard-form/standard-form.component.ts b/projects/admin/src/app/pages/standard/standard-form/standard-form.component.ts
new file mode 100644
index 0000000..df05c1b
--- /dev/null
+++ b/projects/admin/src/app/pages/standard/standard-form/standard-form.component.ts
@@ -0,0 +1,57 @@
+import { Component } from "@angular/core";
+import { FormBuilder, FormGroup } from "@angular/forms";
+import { Router } from "@angular/router";
+import { FormValidators } from "@cdk/validators";
+
+@Component({
+ selector: "app-standard-form",
+ templateUrl: "./standard-form.component.html",
+ styleUrls: ["./standard-form.component.less"],
+})
+export class StandardFormComponent {
+ constructor(private fb: FormBuilder, private router: Router) {}
+
+ formGroup!: FormGroup;
+
+ uploadLoading = false;
+
+ ngOnInit(): void {
+ this.formGroup = this.fb.group({
+ id: this.fb.control("", [FormValidators.required()]),
+ name: this.fb.control("", [FormValidators.required()]),
+ unit: this.fb.control("", [FormValidators.required()]),
+ day: this.fb.control("1", [FormValidators.required()]),
+ logo: this.fb.control("", []),
+ month: this.fb.control([], []),
+ });
+ }
+ onSubmit() {
+ this.router.navigate(["/", "standard", "setting", "45"]);
+ }
+
+ onFileChange(e: Event) {
+ const target = e.target as HTMLInputElement;
+ const file = target.files![0];
+ target.value = "";
+ const formData = new FormData();
+ const fileReader = new FileReader();
+ fileReader.onload = () => {
+ const base64 = fileReader.result as string;
+
+ const v = base64.split("base64,")[1];
+ };
+ formData.append("file", file);
+ this.uploadLoading = true;
+ // this.api
+ // .uploadLogo(formData)
+ // .pipe(
+ // finalize(() => {
+ // this.uploadLoading = false;
+ // })
+ // )
+ // .subscribe((r) => {
+ // this.msg.success(r.desc);
+ // fileReader.readAsDataURL(file);
+ // });
+ }
+}
diff --git a/projects/admin/src/app/pages/standard/standard-list/standard-list.component.html b/projects/admin/src/app/pages/standard/standard-list/standard-list.component.html
new file mode 100644
index 0000000..eeabe24
--- /dev/null
+++ b/projects/admin/src/app/pages/standard/standard-list/standard-list.component.html
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/projects/admin/src/app/pages/standard/standard-list/standard-list.component.less b/projects/admin/src/app/pages/standard/standard-list/standard-list.component.less
new file mode 100644
index 0000000..e69de29
diff --git a/projects/admin/src/app/pages/standard/standard-list/standard-list.component.ts b/projects/admin/src/app/pages/standard/standard-list/standard-list.component.ts
new file mode 100644
index 0000000..974c4b2
--- /dev/null
+++ b/projects/admin/src/app/pages/standard/standard-list/standard-list.component.ts
@@ -0,0 +1,76 @@
+import { Component, OnInit, TemplateRef, ViewChild } from "@angular/core";
+import { FormControl, FormGroup } from "@angular/forms";
+import { NzDrawerRef, NzDrawerService } from "ng-zorro-antd/drawer";
+import { AnyObject, TableListOption } from "@cdk/public-api";
+import { DishFormComponent } from "@admin/app/components";
+import { ApiService } from "@admin/app/services";
+
+@Component({
+ selector: "app-standard-list",
+ templateUrl: "./standard-list.component.html",
+ styleUrls: ["./standard-list.component.less"],
+})
+export class StandardListComponent {
+ constructor(private drawer: NzDrawerService, private api: ApiService) {}
+
+ @ViewChild("formFooterTpl") formFooterTpl!: TemplateRef<{}>;
+
+ private drawerRef?: NzDrawerRef;
+
+ public tableList = new TableListOption(this.fetchData.bind(this));
+
+ public queryForm = new FormGroup({
+ name: new FormControl(""),
+ });
+
+ ngOnInit(): void {
+ this.initTableList();
+ }
+
+ initTableList() {
+ this.tableList.scroll = { x: null };
+ this.tableList = this.tableList.setColumns([
+ { key: "name", title: "营养标准名称" },
+ { key: "name", title: "人群细分" },
+ { key: "name", title: "适用单位" },
+ { key: "name", title: "更新时间" },
+ ]);
+
+ this.tableList = this.tableList.setOptions([
+ {
+ title: "标准设置",
+ premissions: [],
+ onClick: this.showFoodForm.bind(this),
+ },
+ {
+ title: "编辑",
+ premissions: [],
+ onClick: this.showFoodForm.bind(this),
+ },
+ {
+ title: "删除",
+ premissions: [],
+ onClick: this.deleteItem.bind(this),
+ },
+ ]);
+ }
+
+ fetchData(query: AnyObject, pager: AnyObject) {
+ return this.api.page(pager, query);
+ }
+
+ showFoodForm(food?: any) {
+ this.drawerRef = this.drawer.create({
+ nzTitle: food ? "编辑菜品" : "新增菜品",
+ nzWidth: 700,
+ nzContent: DishFormComponent,
+ nzFooter: this.formFooterTpl,
+ });
+ }
+
+ cancelFoodForm() {
+ this.drawerRef?.close();
+ }
+
+ deleteItem() {}
+}
diff --git a/projects/admin/src/app/pages/standard/standard-setting/standard-setting.component.html b/projects/admin/src/app/pages/standard/standard-setting/standard-setting.component.html
new file mode 100644
index 0000000..9285c49
--- /dev/null
+++ b/projects/admin/src/app/pages/standard/standard-setting/standard-setting.component.html
@@ -0,0 +1,42 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/projects/admin/src/app/pages/standard/standard-setting/standard-setting.component.less b/projects/admin/src/app/pages/standard/standard-setting/standard-setting.component.less
new file mode 100644
index 0000000..e69de29
diff --git a/projects/admin/src/app/pages/standard/standard-setting/standard-setting.component.ts b/projects/admin/src/app/pages/standard/standard-setting/standard-setting.component.ts
new file mode 100644
index 0000000..48b3862
--- /dev/null
+++ b/projects/admin/src/app/pages/standard/standard-setting/standard-setting.component.ts
@@ -0,0 +1,57 @@
+import { Component } from "@angular/core";
+import { FormBuilder, FormGroup } from "@angular/forms";
+import { Router } from "@angular/router";
+import { FormValidators } from "@cdk/validators";
+
+@Component({
+ selector: "app-standard-setting",
+ templateUrl: "./standard-setting.component.html",
+ styleUrls: ["./standard-setting.component.less"],
+})
+export class StandardSettingComponent {
+ constructor(private fb: FormBuilder, private router: Router) {}
+
+ formGroup!: FormGroup;
+
+ uploadLoading = false;
+
+ ngOnInit(): void {
+ this.formGroup = this.fb.group({
+ id: this.fb.control("", [FormValidators.required()]),
+ name: this.fb.control("", [FormValidators.required()]),
+ unit: this.fb.control("", [FormValidators.required()]),
+ day: this.fb.control("1", [FormValidators.required()]),
+ logo: this.fb.control("", []),
+ month: this.fb.control([], []),
+ });
+ }
+ onSubmit() {
+ this.router.navigate(["/", "standard", "setting", "45"]);
+ }
+
+ onFileChange(e: Event) {
+ const target = e.target as HTMLInputElement;
+ const file = target.files![0];
+ target.value = "";
+ const formData = new FormData();
+ const fileReader = new FileReader();
+ fileReader.onload = () => {
+ const base64 = fileReader.result as string;
+
+ const v = base64.split("base64,")[1];
+ };
+ formData.append("file", file);
+ this.uploadLoading = true;
+ // this.api
+ // .uploadLogo(formData)
+ // .pipe(
+ // finalize(() => {
+ // this.uploadLoading = false;
+ // })
+ // )
+ // .subscribe((r) => {
+ // this.msg.success(r.desc);
+ // fileReader.readAsDataURL(file);
+ // });
+ }
+}
diff --git a/projects/admin/src/app/pages/system/user-manage/user-manage.component.html b/projects/admin/src/app/pages/system/user-manage/user-manage.component.html
new file mode 100644
index 0000000..39c2ce2
--- /dev/null
+++ b/projects/admin/src/app/pages/system/user-manage/user-manage.component.html
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/projects/admin/src/app/pages/system/user-manage/user-manage.component.less b/projects/admin/src/app/pages/system/user-manage/user-manage.component.less
new file mode 100644
index 0000000..30c68b8
--- /dev/null
+++ b/projects/admin/src/app/pages/system/user-manage/user-manage.component.less
@@ -0,0 +1,17 @@
+.user-type {
+ border-right: 1px solid #e8e8e8;
+
+ ::ng-deep {
+ .ant-menu-inline {
+ border-right: none;
+ }
+ }
+}
+
+.role-head {
+ ::ng-deep {
+ .ant-card-extra {
+ padding: 10px 0;
+ }
+ }
+}
\ No newline at end of file
diff --git a/projects/admin/src/app/pages/system/user-manage/user-manage.component.ts b/projects/admin/src/app/pages/system/user-manage/user-manage.component.ts
new file mode 100644
index 0000000..4b61656
--- /dev/null
+++ b/projects/admin/src/app/pages/system/user-manage/user-manage.component.ts
@@ -0,0 +1,68 @@
+import { FoodFormComponent } from "@admin/app/components";
+import { ApiService } from "@admin/app/services";
+import { Component, OnInit, TemplateRef, ViewChild } from "@angular/core";
+import { FormControl, FormGroup } from "@angular/forms";
+import { ActivatedRoute, Router } from "@angular/router";
+import { AnyObject, TableListOption } from "@cdk/public-api";
+import { NzDrawerRef, NzDrawerService } from "ng-zorro-antd/drawer";
+import { NzModalService } from "ng-zorro-antd/modal";
+
+@Component({
+ selector: "app-user-manage",
+ templateUrl: "./user-manage.component.html",
+ styleUrls: ["./user-manage.component.less"],
+})
+export class UserManageComponent {
+ constructor(
+ private route: ActivatedRoute,
+ private api: ApiService,
+ private router: Router,
+ private modal: NzModalService
+ ) {}
+
+ public tab = 0;
+
+ public roleId: string | null = null;
+
+ ngOnInit(): void {
+ this.roleId = this.route.snapshot.queryParamMap.get("roleId");
+ this.tab = Number(this.route.snapshot.queryParamMap.get("tab")) || 0;
+ }
+
+ onRoleChange(roleId: string) {
+ this.roleId = roleId;
+ this.router.navigate(["/system/user"], {
+ queryParams: {
+ roleId,
+ },
+ queryParamsHandling: "merge",
+ });
+ }
+
+ onTabChange(index: number) {
+ this.tab = index;
+ this.router.navigate(["/system/user"], {
+ queryParams: {
+ tab: index,
+ },
+ queryParamsHandling: "merge",
+ });
+ }
+
+ openForm(nzContent: TemplateRef<{}>, event: MouseEvent, roleId?: string) {
+ event.preventDefault();
+ this.modal.create({
+ nzTitle: roleId ? "编辑角色" : "新增角色",
+ nzContent,
+ });
+ }
+
+ deleteItem(event: MouseEvent, id: string) {
+ event.preventDefault();
+ this.modal.confirm({
+ nzTitle: "警告",
+ nzContent: "是否要删除该角色?",
+ nzOkDanger: true,
+ });
+ }
+}
diff --git a/projects/admin/src/styles.less b/projects/admin/src/styles.less
index 31eded4..a18a81e 100644
--- a/projects/admin/src/styles.less
+++ b/projects/admin/src/styles.less
@@ -36,4 +36,24 @@ li {
font-size: 0;
cursor: pointer;
}
+}
+
+.fixed-footter {
+ box-shadow: 0 0 10px -2px rgba(0, 0, 0, .25)
+}
+
+.scroll-card-body {
+ height: 100%;
+
+ &>.ant-card-body {
+ overflow: auto;
+ height: calc(100% - 60px);
+ padding: 0
+ }
+
+ &>.ant-card-head {
+ position: relative;
+ z-index: 10;
+ }
+
}
\ No newline at end of file