From ac3b2c2a220b3ea60a077d49859284381f1dbc65 Mon Sep 17 00:00:00 2001 From: kkerwin Date: Tue, 7 May 2024 00:47:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8E=E6=88=91=E7=9B=B8=E5=85=B3=E7=9A=84?= =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web-admin-app/src/app/app.routes.ts | 6 + .../contact-group-form.component.html | 12 - .../contact-group-form.component.ts | 38 --- .../contact-group.component.html | 31 --- .../contact-group.component.less | 0 .../contact-group/contact-group.component.ts | 83 ------- .../contact-list/contact-list.component.html | 97 -------- .../contact-list/contact-list.component.less | 3 - .../contact-list/contact-list.component.ts | 223 ------------------ .../pages copy/contacts/contact.service.ts | 59 ----- .../role-form/role-form.component.html | 83 ------- .../role-form/role-form.component.less | 11 - .../contacts/role-form/role-form.component.ts | 146 ------------ .../role-list/role-list.component.html | 27 --- .../role-list/role-list.component.less | 0 .../contacts/role-list/role-list.component.ts | 72 ------ .../dashboard/dashboard.component.html | 63 ----- .../dashboard/dashboard.component.less | 0 .../dashboard/dashboard.component.ts | 195 --------------- .../entity-detail.component.html | 101 -------- .../entity-detail.component.less | 0 .../entity-detail/entity-detail.component.ts | 105 --------- .../entity-list/entity-list.component.html | 83 ------- .../entity-list/entity-list.component.less | 0 .../entity-list/entity-list.component.ts | 132 ----------- .../forbidden/forbidden.component.html | 5 - .../forbidden/forbidden.component.less | 0 .../forbidden/forbidden.component.ts | 11 - .../src/app/pages copy/log/log.component.html | 82 ------- .../src/app/pages copy/log/log.component.less | 0 .../src/app/pages copy/log/log.component.ts | 87 ------- .../app/pages copy/login/login.component.html | 54 ----- .../app/pages copy/login/login.component.less | 20 -- .../app/pages copy/login/login.component.ts | 54 ----- .../notfound/notfound.component.html | 5 - .../notfound/notfound.component.less | 0 .../pages copy/notfound/notfound.component.ts | 11 - .../product-detail.component.html | 43 ---- .../product-detail.component.less | 0 .../product-detail.component.ts | 84 ------- .../product-list/product-list.component.html | 80 ------- .../product-list/product-list.component.less | 0 .../product-list/product-list.component.ts | 104 -------- .../profile-account.component.html | 28 --- .../profile-account.component.less | 0 .../profile-account.component.ts | 46 ---- .../profile-basic.component.html | 54 ----- .../profile-basic.component.less | 0 .../profile-basic/profile-basic.component.ts | 52 ---- .../pages copy/profile/profile.component.html | 36 --- .../pages copy/profile/profile.component.less | 18 -- .../pages copy/profile/profile.component.ts | 22 -- .../flow-layout/flow-layout.component.html | 1 + .../flow/flow-main/flow-main.component.html | 21 +- .../flow/flow-main/flow-main.component.less | 10 + .../flow-my-apply.component.html | 32 ++- .../flow-my-apply/flow-my-apply.component.ts | 91 ++++++- .../flow-my-finished.component.html | 31 +++ .../flow-my-finished.component.less} | 0 .../flow-my-finished.component.ts | 91 +++++++ .../flow-my-todo/flow-my-todo.component.html | 32 ++- .../flow-my-todo/flow-my-todo.component.ts | 91 ++++++- .../flow/flow-form/flow-form.component.html | 3 + .../flow/flow-form/flow-form.component.ts | 8 +- web-admin-app/src/app/services/api.service.ts | 9 + 65 files changed, 407 insertions(+), 2479 deletions(-) delete mode 100644 web-admin-app/src/app/pages copy/contacts/contact-group-form/contact-group-form.component.html delete mode 100644 web-admin-app/src/app/pages copy/contacts/contact-group-form/contact-group-form.component.ts delete mode 100644 web-admin-app/src/app/pages copy/contacts/contact-group/contact-group.component.html delete mode 100644 web-admin-app/src/app/pages copy/contacts/contact-group/contact-group.component.less delete mode 100644 web-admin-app/src/app/pages copy/contacts/contact-group/contact-group.component.ts delete mode 100644 web-admin-app/src/app/pages copy/contacts/contact-list/contact-list.component.html delete mode 100644 web-admin-app/src/app/pages copy/contacts/contact-list/contact-list.component.less delete mode 100644 web-admin-app/src/app/pages copy/contacts/contact-list/contact-list.component.ts delete mode 100644 web-admin-app/src/app/pages copy/contacts/contact.service.ts delete mode 100644 web-admin-app/src/app/pages copy/contacts/role-form/role-form.component.html delete mode 100644 web-admin-app/src/app/pages copy/contacts/role-form/role-form.component.less delete mode 100644 web-admin-app/src/app/pages copy/contacts/role-form/role-form.component.ts delete mode 100644 web-admin-app/src/app/pages copy/contacts/role-list/role-list.component.html delete mode 100644 web-admin-app/src/app/pages copy/contacts/role-list/role-list.component.less delete mode 100644 web-admin-app/src/app/pages copy/contacts/role-list/role-list.component.ts delete mode 100644 web-admin-app/src/app/pages copy/dashboard/dashboard.component.html delete mode 100644 web-admin-app/src/app/pages copy/dashboard/dashboard.component.less delete mode 100644 web-admin-app/src/app/pages copy/dashboard/dashboard.component.ts delete mode 100644 web-admin-app/src/app/pages copy/entity-detail/entity-detail.component.html delete mode 100644 web-admin-app/src/app/pages copy/entity-detail/entity-detail.component.less delete mode 100644 web-admin-app/src/app/pages copy/entity-detail/entity-detail.component.ts delete mode 100644 web-admin-app/src/app/pages copy/entity-list/entity-list.component.html delete mode 100644 web-admin-app/src/app/pages copy/entity-list/entity-list.component.less delete mode 100644 web-admin-app/src/app/pages copy/entity-list/entity-list.component.ts delete mode 100644 web-admin-app/src/app/pages copy/forbidden/forbidden.component.html delete mode 100644 web-admin-app/src/app/pages copy/forbidden/forbidden.component.less delete mode 100644 web-admin-app/src/app/pages copy/forbidden/forbidden.component.ts delete mode 100644 web-admin-app/src/app/pages copy/log/log.component.html delete mode 100644 web-admin-app/src/app/pages copy/log/log.component.less delete mode 100644 web-admin-app/src/app/pages copy/log/log.component.ts delete mode 100644 web-admin-app/src/app/pages copy/login/login.component.html delete mode 100644 web-admin-app/src/app/pages copy/login/login.component.less delete mode 100644 web-admin-app/src/app/pages copy/login/login.component.ts delete mode 100644 web-admin-app/src/app/pages copy/notfound/notfound.component.html delete mode 100644 web-admin-app/src/app/pages copy/notfound/notfound.component.less delete mode 100644 web-admin-app/src/app/pages copy/notfound/notfound.component.ts delete mode 100644 web-admin-app/src/app/pages copy/product-detail/product-detail.component.html delete mode 100644 web-admin-app/src/app/pages copy/product-detail/product-detail.component.less delete mode 100644 web-admin-app/src/app/pages copy/product-detail/product-detail.component.ts delete mode 100644 web-admin-app/src/app/pages copy/product-list/product-list.component.html delete mode 100644 web-admin-app/src/app/pages copy/product-list/product-list.component.less delete mode 100644 web-admin-app/src/app/pages copy/product-list/product-list.component.ts delete mode 100644 web-admin-app/src/app/pages copy/profile-account/profile-account.component.html delete mode 100644 web-admin-app/src/app/pages copy/profile-account/profile-account.component.less delete mode 100644 web-admin-app/src/app/pages copy/profile-account/profile-account.component.ts delete mode 100644 web-admin-app/src/app/pages copy/profile-basic/profile-basic.component.html delete mode 100644 web-admin-app/src/app/pages copy/profile-basic/profile-basic.component.less delete mode 100644 web-admin-app/src/app/pages copy/profile-basic/profile-basic.component.ts delete mode 100644 web-admin-app/src/app/pages copy/profile/profile.component.html delete mode 100644 web-admin-app/src/app/pages copy/profile/profile.component.less delete mode 100644 web-admin-app/src/app/pages copy/profile/profile.component.ts create mode 100644 web-admin-app/src/app/pages/flow/flow-my-finished/flow-my-finished.component.html rename web-admin-app/src/app/{pages copy/contacts/contact-group-form/contact-group-form.component.less => pages/flow/flow-my-finished/flow-my-finished.component.less} (100%) create mode 100644 web-admin-app/src/app/pages/flow/flow-my-finished/flow-my-finished.component.ts diff --git a/web-admin-app/src/app/app.routes.ts b/web-admin-app/src/app/app.routes.ts index 277bfca..e68e9fa 100644 --- a/web-admin-app/src/app/app.routes.ts +++ b/web-admin-app/src/app/app.routes.ts @@ -57,6 +57,7 @@ import { FlowMainComponent } from './pages/flow/flow-main/flow-main.component' import { FlowMyApplyComponent } from './pages/flow/flow-my-apply/flow-my-apply.component' import { FlowMyTodoComponent } from './pages/flow/flow-my-todo/flow-my-todo.component' import { FlowLayoutComponent } from './pages/flow/flow-layout/flow-layout.component' +import { FlowMyFinishedComponent } from './pages/flow/flow-my-finished/flow-my-finished.component' export const routes: Routes = [ { @@ -469,6 +470,11 @@ export const routes: Routes = [ title: '待我处理', component: FlowMyTodoComponent, }, + { + path: 'my-finished', + title: '我已处理', + component: FlowMyFinishedComponent, + }, ], }, ], diff --git a/web-admin-app/src/app/pages copy/contacts/contact-group-form/contact-group-form.component.html b/web-admin-app/src/app/pages copy/contacts/contact-group-form/contact-group-form.component.html deleted file mode 100644 index bd03920..0000000 --- a/web-admin-app/src/app/pages copy/contacts/contact-group-form/contact-group-form.component.html +++ /dev/null @@ -1,12 +0,0 @@ -
- - 部门名称 - - - - -
- - - - diff --git a/web-admin-app/src/app/pages copy/contacts/contact-group-form/contact-group-form.component.ts b/web-admin-app/src/app/pages copy/contacts/contact-group-form/contact-group-form.component.ts deleted file mode 100644 index 70bc9c9..0000000 --- a/web-admin-app/src/app/pages copy/contacts/contact-group-form/contact-group-form.component.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Component, OnInit, inject } from '@angular/core' -import { FormControl, FormGroup } from '@angular/forms' -import { SharedModule } from 'app/shared/shared.module' -import { FormValidators } from 'app/utils' -import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal' - -@Component({ - selector: 'app-contact-group-form', - standalone: true, - imports: [SharedModule], - templateUrl: './contact-group-form.component.html', - styleUrl: './contact-group-form.component.less', -}) -export class ContactGroupFormComponent implements OnInit { - constructor() {} - - data = inject(NZ_MODAL_DATA) - - formGroup = new FormGroup({ - id: new FormControl(), - name: new FormControl('', [FormValidators.required('请输入部门名称'), FormValidators.maxLength(30)]), - parentId: new FormControl(), - }) - - ngOnInit(): void { - if (this.data) { - this.formGroup.patchValue(this.data) - } - } - - public getValues() { - let values = null - if (FormValidators.validateFormGroup(this.formGroup)) { - values = this.formGroup.value - } - return values - } -} diff --git a/web-admin-app/src/app/pages copy/contacts/contact-group/contact-group.component.html b/web-admin-app/src/app/pages copy/contacts/contact-group/contact-group.component.html deleted file mode 100644 index f4ae55e..0000000 --- a/web-admin-app/src/app/pages copy/contacts/contact-group/contact-group.component.html +++ /dev/null @@ -1,31 +0,0 @@ -
- - -
- - -
- {{ node.title }} - - @if (origin.id !== '1') { - - } - -
    - -
  • 编辑
  • -
  • 删除
  • -
-
-
-
diff --git a/web-admin-app/src/app/pages copy/contacts/contact-group/contact-group.component.less b/web-admin-app/src/app/pages copy/contacts/contact-group/contact-group.component.less deleted file mode 100644 index e69de29..0000000 diff --git a/web-admin-app/src/app/pages copy/contacts/contact-group/contact-group.component.ts b/web-admin-app/src/app/pages copy/contacts/contact-group/contact-group.component.ts deleted file mode 100644 index ed02f4e..0000000 --- a/web-admin-app/src/app/pages copy/contacts/contact-group/contact-group.component.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { Component, EventEmitter, Input, Output, OnChanges, OnInit, SimpleChanges } from '@angular/core' - -import { NzContextMenuService, NzDropdownMenuComponent } from 'ng-zorro-antd/dropdown' -import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree' -import { SharedModule } from 'app/shared/shared.module' -import { Persist } from 'app/utils' -import { ContactService } from '../contact.service' - -@Component({ - selector: 'app-contact-group', - standalone: true, - imports: [SharedModule], - providers: [ContactService], - templateUrl: './contact-group.component.html', - styleUrl: './contact-group.component.less', -}) -export class ContactGroupComponent implements OnInit, OnChanges { - constructor( - private nzContextMenuService: NzContextMenuService, - public contact: ContactService, - ) {} - - @Input() nodes: NzTreeNodeOptions[] = [] - - @Input() active!: Persist - - @Output() onSelect = new EventEmitter() - - @Output() onCreate = new EventEmitter() - - @Output() onEdit = new EventEmitter() - - @Output() onDelete = new EventEmitter() - - ngOnInit(): void {} - - ngOnChanges(changes: SimpleChanges) {} - - openFolder(data: NzTreeNode | NzFormatEmitEvent): void { - if (data instanceof NzTreeNode) { - data.isExpanded = !data.isExpanded - } else { - const node = data.node - if (node) { - node.isExpanded = !node.isExpanded - } - } - } - - activeNode(data: NzFormatEmitEvent): void { - this.contact.contactGroup.update((state) => { - return { - ...state, - selecedKeys: [data.node!.key], - } - }) - this.onSelect.emit() - } - - handleExpandedKeysChange(expanded: NzFormatEmitEvent) { - this.contact.contactGroup.update((state) => { - return { - ...state, - expandedKeys: expanded?.keys ?? [], - } - }) - } - - contextMenu($event: MouseEvent, menu: NzDropdownMenuComponent): void { - this.nzContextMenuService.create($event, menu) - } - - createGroup(node: NzTreeNode): void { - this.onCreate.emit(node.origin) - } - - editGroup(node: NzTreeNode): void { - this.onEdit.emit(node.origin) - } - deleteGroup(node: NzTreeNode): void { - this.onDelete.emit(node.origin.key) - } -} diff --git a/web-admin-app/src/app/pages copy/contacts/contact-list/contact-list.component.html b/web-admin-app/src/app/pages copy/contacts/contact-list/contact-list.component.html deleted file mode 100644 index 85e0db6..0000000 --- a/web-admin-app/src/app/pages copy/contacts/contact-list/contact-list.component.html +++ /dev/null @@ -1,97 +0,0 @@ - -
-
-
-

- 部门 - -

-
- -
- - -
-
-
- -
-
- - 用户名 - - - - -
-
- - 姓名 - - - - -
-
- - 状态 - - - - - - - -
-
- - 创建时间 - - - - - -
-
-
- - - -
- - @switch (key) { - @case ('enable') { - @if (data) { - - } @else { - - } - } - @case ('roleName') { - @if (data) { - {{ data }} - } @else { - - - } - } - @default { - {{ data }} - } - } - -
-
-
-
diff --git a/web-admin-app/src/app/pages copy/contacts/contact-list/contact-list.component.less b/web-admin-app/src/app/pages copy/contacts/contact-list/contact-list.component.less deleted file mode 100644 index 5af3248..0000000 --- a/web-admin-app/src/app/pages copy/contacts/contact-list/contact-list.component.less +++ /dev/null @@ -1,3 +0,0 @@ -.group { - border-right: 1px solid var(--border-color); -} \ No newline at end of file diff --git a/web-admin-app/src/app/pages copy/contacts/contact-list/contact-list.component.ts b/web-admin-app/src/app/pages copy/contacts/contact-list/contact-list.component.ts deleted file mode 100644 index 2a4466c..0000000 --- a/web-admin-app/src/app/pages copy/contacts/contact-list/contact-list.component.ts +++ /dev/null @@ -1,223 +0,0 @@ -import { Component, HostListener, OnInit, OnDestroy } from '@angular/core' -import { lastValueFrom } from 'rxjs' -import { NzTreeNodeOptions } from 'ng-zorro-antd/tree' -import { NzModalService } from 'ng-zorro-antd/modal' -import { FormControl, FormGroup } from '@angular/forms' -import { NzMessageService } from 'ng-zorro-antd/message' -import { format } from 'date-fns' -import { ApiService, UserGroupTreeItem } from 'app/services' -import { SharedModule } from 'app/shared/shared.module' -import { ContactGroupComponent } from '../contact-group/contact-group.component' -import { ContactGroupFormComponent } from '../contact-group-form/contact-group-form.component' -import { AnyObject, TableOption } from 'app/components/server-paginated-table' -import { UserFormComponent } from 'app/components/user-form/user-form.component' -import { RoleListDTO, UserDTO } from 'app/services/api.dto' -import { ContactService } from '../contact.service' - -@Component({ - selector: 'app-contact-list', - standalone: true, - imports: [SharedModule, ContactGroupComponent, ContactGroupFormComponent], - templateUrl: './contact-list.component.html', - styleUrl: './contact-list.component.less', - providers: [ContactService], -}) -export class ContactListComponent implements OnInit, OnDestroy { - constructor( - private api: ApiService, - private modal: NzModalService, - private msg: NzMessageService, - private contact: ContactService, - ) {} - - height = 'auto' - - groups: NzTreeNodeOptions[] = [] - - tableOption = new TableOption(this.fetchData.bind(this), { - manual: true, - }) - - queryForm = new FormGroup({ - userName: new FormControl(), - enable: new FormControl(), - name: new FormControl(), - createTime: new FormControl(), - }) - - roleList: RoleListDTO[] = [] - - ngOnInit(): void { - this.initTableOption() - this.onResize() - this.getUserGroupTree() - this.getRoleList() - } - - ngOnDestroy(): void {} - - initTableOption() { - this.tableOption - .setColumn([ - { key: 'username', title: '用户名' }, - { key: 'name', title: '姓名' }, - { key: 'enable', title: '状态' }, - { key: 'roleName', title: '角色' }, - { key: 'remark', title: '说明' }, - { key: 'createTime', title: '创建时间' }, - ]) - .setRowOperate([ - { title: '启用', onClick: this.updateStatus.bind(this), visible: (v) => v.id !== '1' && !v.enable }, - { title: '禁用', onClick: this.updateStatus.bind(this), visible: (v) => v.id !== '1' && v.enable }, - { - title: '重置密码', - onClick: this.resetPassword.bind(this), - premissions: [], - visible: (v) => v.id !== '1', - }, - { - title: '编辑', - onClick: this.handleCreateUser.bind(this), - premissions: [], - visible: (v) => v.id !== '1', - }, - { - title: '删除', - onClick: this.deleteUser.bind(this), - premissions: [], - visible: (v) => v.id !== '1', - }, - ]) - } - - @HostListener('window:resize') - onResize() { - this.height = innerHeight - 100 + 'px' - } - - fetchData(p: {}, q: AnyObject) { - let query = Object.create(null) - const activeGroup = this.contact.contactGroup.value - if (Array.isArray(q['createTime'])) { - const createTimeStart = q['createTime']?.[0] - const createTimeEnd = q['createTime']?.[1] - - q['createTimeStart'] = createTimeStart ? format(new Date(createTimeStart), 'yyyy-MM-dd HH:mm:ss') : '' - q['createTimeEnd'] = createTimeEnd ? format(new Date(createTimeEnd), 'yyyy-MM-dd HH:mm:ss') : '' - } - query = { ...q, groupId: activeGroup?.selecedKeys[0] } - return this.api.getUserPage(p, query) - } - - handleGroupSelect() { - this.tableOption.ref?.search() - } - - updateStatus(v: UserDTO) { - this.modal.confirm({ - nzTitle: '警告', - nzContent: `是否要${v.enable ? '禁用' : '启用'}该用户?`, - nzOnOk: async () => { - await lastValueFrom(this.api.updateUserStatus(v.id)) - this.msg.success('操作成功') - this.tableOption.ref.reload() - }, - }) - } - - getUserGroupTree() { - this.api.getUserGroupTree().subscribe((res) => { - this.groups = res - this.contact.initState(res) - if (res.length > 0) { - this.tableOption.ref?.reload() - } - }) - } - - getRoleList() { - this.api.getAllRole().subscribe((res) => { - this.roleList = res.data - }) - } - - showGroupForm(group?: UserGroupTreeItem, edit = false) { - this.modal.create({ - nzTitle: edit ? '编辑部门' : '新增部门', - nzContent: ContactGroupFormComponent, - nzData: edit ? group : { parentId: group?.id }, - nzOnOk: async (e) => { - const vals = e.getValues() - if (vals) { - await lastValueFrom(this.api.saveUserGroup(vals as UserGroupTreeItem)) - this.msg.success('保存成功') - this.getUserGroupTree() - return true - } - return false - }, - }) - } - - deleteUserGroup(id: string) { - this.modal.confirm({ - nzTitle: '警告', - nzContent: '是否要删除该分组?', - nzOkDanger: true, - nzOnOk: async () => { - await lastValueFrom(this.api.deleteUserGroup(id)) - this.msg.success('删除成功') - this.getUserGroupTree() - }, - }) - } - - deleteUser(v: UserDTO) { - this.modal.confirm({ - nzTitle: '警告', - nzContent: '是否要删除该用户?', - nzOkDanger: true, - nzOnOk: async () => { - await lastValueFrom(this.api.deleteUser(v.id)) - this.msg.success('删除成功') - this.getUserGroupTree() - }, - }) - } - - resetPassword(v: UserDTO) { - this.modal.confirm({ - nzTitle: '警告', - nzContent: '是否要将该用户的密码重置为jwkj?', - nzOnOk: async () => { - await lastValueFrom(this.api.changeUserPassword(v.id, 'jwkj')) - this.msg.success('重置成功') - }, - }) - } - - handleCreateUser(user?: UserDTO) { - this.modal.create({ - nzTitle: user ? '编辑用户' : '添加用户', - nzContent: UserFormComponent, - nzWidth: 720, - nzData: { - roleList: this.roleList, - value: user, - }, - nzOnOk: async (e) => { - const vals = e.getValues() - if (vals) { - const activeGroup = this.contact.contactGroup.value - await lastValueFrom( - this.api.saveUser({ ...(user ?? {}), ...vals, groupId: activeGroup.selecedKeys[0] }), - ) - this.tableOption.ref?.reload() - this.msg.success('保存成功') - return true - } - return false - }, - }) - } -} diff --git a/web-admin-app/src/app/pages copy/contacts/contact.service.ts b/web-admin-app/src/app/pages copy/contacts/contact.service.ts deleted file mode 100644 index b2d9db0..0000000 --- a/web-admin-app/src/app/pages copy/contacts/contact.service.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { Injectable, OnDestroy } from '@angular/core' -import { Persist, Utils } from 'app/utils' -import { NzTreeNodeOptions } from 'ng-zorro-antd/tree' - -@Injectable() -export class ContactService implements OnDestroy { - constructor() {} - - ngOnDestroy(): void { - this.contactGroup.clear() - } - - contactGroup = new Persist<{ selecedKeys: string[]; expandedKeys: string[] }>(sessionStorage, 'contactGroup', { - selecedKeys: [], - expandedKeys: [], - }) - - public get selecedKeys(): string[] { - return this.contactGroup.value.selecedKeys - } - - public get expandedKeys(): string[] { - return this.contactGroup.value.expandedKeys - } - - initState(treeData: NzTreeNodeOptions[]) { - if (treeData.length === 0) { - return - } - let selecedKeys = this.selecedKeys - let expandedKeys = this.expandedKeys - const flatData: NzTreeNodeOptions[] = Utils.treeToFlatList(treeData) - if (!flatData.some((s) => selecedKeys.includes(s.key))) { - selecedKeys = [] - } - if (selecedKeys.length === 0) { - selecedKeys = [treeData[0].key] as string[] - } else { - expandedKeys = this.setExpandedKeysBySelecedKeys(treeData, selecedKeys) - } - this.contactGroup.update(() => { - return { - expandedKeys: [...new Set(expandedKeys)], - selecedKeys, - } - }) - } - - setExpandedKeysBySelecedKeys(flatData: NzTreeNodeOptions[], selecedKeys: string[]) { - const res: string[] = [] - - let parentId = flatData.find((f) => selecedKeys.includes(f.key))?.['parentId'] - while (parentId) { - res.push(parentId) - parentId = flatData.find((f) => f.key === parentId)?.['parentId'] - } - return this.expandedKeys.concat(res) - } -} diff --git a/web-admin-app/src/app/pages copy/contacts/role-form/role-form.component.html b/web-admin-app/src/app/pages copy/contacts/role-form/role-form.component.html deleted file mode 100644 index 3f00225..0000000 --- a/web-admin-app/src/app/pages copy/contacts/role-form/role-form.component.html +++ /dev/null @@ -1,83 +0,0 @@ - -
- - 角色名称 - - - - - - - 权限 - - -
-
    - @for (p of permissions; track $index) { -
  • -
    - {{ p.name }} -
    -
  • - } -
- -
-
-
-
- - 说明 - - - - - - - - - - - - -
-
diff --git a/web-admin-app/src/app/pages copy/contacts/role-form/role-form.component.less b/web-admin-app/src/app/pages copy/contacts/role-form/role-form.component.less deleted file mode 100644 index dc7f8f8..0000000 --- a/web-admin-app/src/app/pages copy/contacts/role-form/role-form.component.less +++ /dev/null @@ -1,11 +0,0 @@ -.permissions { - li { - display: flex; - padding: 8px 24px; - - &:not(:last-child) { - - border-bottom: 1px solid var(--border-color); - } - } -} \ No newline at end of file diff --git a/web-admin-app/src/app/pages copy/contacts/role-form/role-form.component.ts b/web-admin-app/src/app/pages copy/contacts/role-form/role-form.component.ts deleted file mode 100644 index 3502f17..0000000 --- a/web-admin-app/src/app/pages copy/contacts/role-form/role-form.component.ts +++ /dev/null @@ -1,146 +0,0 @@ -import { finalize } from 'rxjs' -import { Component, OnInit } from '@angular/core' -import { FormControl, FormGroup } from '@angular/forms' -import { ActivatedRoute, Router } from '@angular/router' -import { ApiService } from 'app/services' -import { PermissionDTO } from 'app/services/api.dto' -import { SharedModule } from 'app/shared/shared.module' -import { FormValidators } from 'app/utils' -import { NzMessageService } from 'ng-zorro-antd/message' - -@Component({ - selector: 'app-role-form', - standalone: true, - imports: [SharedModule], - templateUrl: './role-form.component.html', - styleUrl: './role-form.component.less', -}) -export class RoleFormComponent implements OnInit { - constructor( - private api: ApiService, - private msg: NzMessageService, - private route: ActivatedRoute, - private router: Router, - // private modal: NzModalService, - ) {} - - id: string | null = null - - permissions: PermissionDTO[] = [] - - formGroup = new FormGroup({ - roleName: new FormControl('', [FormValidators.required('请输入角色名称'), FormValidators.maxLength(30)]), - remark: new FormControl('', [FormValidators.maxLength(30)]), - }) - - checkedAll = new Map() - - checked = new Set() - - permissionsLoading = false - - ngOnInit(): void { - this.getPermissions() - const id = this.route.snapshot.paramMap.get('id') - if (id && id !== 'create') { - this.id = id - this.getRoleInfo() - } - } - - getPermissions() { - this.permissionsLoading = true - this.api - .getAllPermission() - .pipe( - finalize(() => { - this.permissionsLoading = false - }), - ) - .subscribe((res) => { - this.permissions = res.data - this.updateCheckedAll() - }) - } - - getRoleInfo() { - this.api.getRoleById(this.id!).subscribe((res) => { - this.formGroup.patchValue(res.data) - this.checked = new Set(res.data.authorityId) - this.updateCheckedAll() - }) - } - - /** - * 权限之间的联动 - */ - roleLinkage = new Map([ - // ['2', ['2', '9', '15']], - // ['9', ['2', '9', '15']], - // ['15', ['2', '9', '15']], - // ['20', ['20', '25']], - // ['25', ['20', '25']], - ]) - - onPermissionChange(checked: boolean, id: string) { - const checkedIds = this.roleLinkage.get(id) ?? [id] - checkedIds.forEach((i) => { - if (checked) { - this.checked.add(i) - } else { - this.checked.delete(i) - } - }) - this.updateCheckedAll() - } - - checkAllChange(checked: boolean, p: PermissionDTO) { - p.children?.forEach((permission) => { - if (checked) { - this.checked.add(permission.id) - } else { - this.checked.delete(permission.id) - } - }) - this.updateCheckedAll() - } - - updateCheckedAll() { - this.permissions.forEach((g) => { - let nzChecked = true - let nzIndeterminate = false - g.children?.forEach((permission) => { - if (this.checked.has(permission.id)) { - nzIndeterminate = true - } else { - nzChecked = false - } - }) - this.checkedAll.set(g.id, { - nzChecked, - nzIndeterminate: nzChecked ? false : nzIndeterminate, - }) - }) - } - - onSubmit() { - if (FormValidators.validateFormGroup(this.formGroup)) { - if (this.checked.size === 0) { - this.msg.error('请选择权限') - return - } - const { value } = this.formGroup - this.api - .saveRole({ - id: this.id, - roleName: value.roleName!, - remark: value.remark as string, - authorityId: Array.from(this.checked), - }) - .subscribe(() => { - this.msg.success('保存成功') - this.router.navigate(['/role/list']) - }) - } - } -} diff --git a/web-admin-app/src/app/pages copy/contacts/role-list/role-list.component.html b/web-admin-app/src/app/pages copy/contacts/role-list/role-list.component.html deleted file mode 100644 index 3c0ef87..0000000 --- a/web-admin-app/src/app/pages copy/contacts/role-list/role-list.component.html +++ /dev/null @@ -1,27 +0,0 @@ - - -
-
- - - -
- -
-
-
diff --git a/web-admin-app/src/app/pages copy/contacts/role-list/role-list.component.less b/web-admin-app/src/app/pages copy/contacts/role-list/role-list.component.less deleted file mode 100644 index e69de29..0000000 diff --git a/web-admin-app/src/app/pages copy/contacts/role-list/role-list.component.ts b/web-admin-app/src/app/pages copy/contacts/role-list/role-list.component.ts deleted file mode 100644 index 1cd54b1..0000000 --- a/web-admin-app/src/app/pages copy/contacts/role-list/role-list.component.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { lastValueFrom } from 'rxjs' -import { Component, OnInit } from '@angular/core' -import { FormControl, FormGroup } from '@angular/forms' -import { Router } from '@angular/router' -import { TableOption } from 'app/components/server-paginated-table' -import { ApiService } from 'app/services' -import { RoleListDTO } from 'app/services/api.dto' -import { SharedModule } from 'app/shared/shared.module' -import { NzModalService } from 'ng-zorro-antd/modal' -import { NzMessageService } from 'ng-zorro-antd/message' - -@Component({ - selector: 'app-role-list', - standalone: true, - imports: [SharedModule], - templateUrl: './role-list.component.html', - styleUrl: './role-list.component.less', -}) -export class RoleListComponent implements OnInit { - constructor( - private api: ApiService, - private modal: NzModalService, - private router: Router, - private msg: NzMessageService, - ) {} - - tableOption = new TableOption(this.fetchData.bind(this)) - - queryForm = new FormGroup({ - roleName: new FormControl(), - }) - - permissions = [] - - ngOnInit(): void { - this.initTable() - } - - initTable() { - this.tableOption - .setColumn([ - { key: 'roleName', title: '角色名称' }, - { key: 'remark', title: '说明' }, - { key: 'createTime', title: '创建时间' }, - ]) - .setRowOperate([ - { title: '编辑', onClick: this.edit.bind(this), visible: (v) => v.id !== '1' }, - { title: '删除', onClick: this.deleteItem.bind(this), visible: (v) => v.id !== '1' }, - ]) - } - - fetchData(p: {}, q: {}) { - return this.api.getRolePage(p, q) - } - - edit(role: RoleListDTO) { - this.router.navigate(['/', 'role', 'form', role.id]) - } - - deleteItem(role: RoleListDTO) { - this.modal.confirm({ - nzTitle: '警告', - nzContent: '是否要删除该角色?', - nzOkDanger: true, - nzOnOk: async () => { - await lastValueFrom(this.api.deleteRole(role.id)) - this.msg.success('删除成功') - this.tableOption.ref?.reload() - }, - }) - } -} diff --git a/web-admin-app/src/app/pages copy/dashboard/dashboard.component.html b/web-admin-app/src/app/pages copy/dashboard/dashboard.component.html deleted file mode 100644 index ae2f26e..0000000 --- a/web-admin-app/src/app/pages copy/dashboard/dashboard.component.html +++ /dev/null @@ -1,63 +0,0 @@ -
-
- -
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
-
-
-
- -
- -
-
-
- -
- - - - - 实体 - 产品 - - 到期时间 - - - - @for (p of expiringSoon; track $index) { - - {{ p.clientName }} - {{ p.productName }} - - - {{ p.endTime * 1000 | date: 'yyyy-MM-dd HH:mm:ss' }} - - - } @empty { - - - - - - } - - - -
diff --git a/web-admin-app/src/app/pages copy/dashboard/dashboard.component.less b/web-admin-app/src/app/pages copy/dashboard/dashboard.component.less deleted file mode 100644 index e69de29..0000000 diff --git a/web-admin-app/src/app/pages copy/dashboard/dashboard.component.ts b/web-admin-app/src/app/pages copy/dashboard/dashboard.component.ts deleted file mode 100644 index 2b417ee..0000000 --- a/web-admin-app/src/app/pages copy/dashboard/dashboard.component.ts +++ /dev/null @@ -1,195 +0,0 @@ -import { AfterViewInit, Component, ElementRef, HostListener, OnInit, ViewChild } from '@angular/core' -import { init, EChartsType } from 'echarts' -import { SharedModule } from '../../shared/shared.module' -import { ApiService } from 'app/services' -import { ConsoleClientTopDTO, ConsoleCountDTO, ConsoleExpireDTO } from 'app/services/api.dto' - -const antvColor = [ - '#5B8FF9', - '#61DDAA', - '#65789B', - '#F6BD16', - '#7262FD', - '#78D3F8', - '#9661BC', - '#F6903D', - '#008685', - '#F08BB4', -] - -@Component({ - standalone: true, - imports: [SharedModule], - selector: 'app-dashboard', - templateUrl: './dashboard.component.html', - styleUrls: ['./dashboard.component.less'], -}) -export class DashboardComponent implements OnInit, AfterViewInit { - constructor(private api: ApiService) {} - - @ViewChild('chart1Tpl') chart1!: ElementRef - - @ViewChild('chart2Tpl') chart2!: ElementRef - - echartRef1?: EChartsType - - echartRef2?: EChartsType - - counter: ConsoleCountDTO = { totalClient: 0, totalLicense: 0, totalProduct: 0 } - - expiringSoon: ConsoleExpireDTO[] = [] - - clientTopTen: ConsoleClientTopDTO[] = [] - - @HostListener('window:resize') - onResize() { - // this.echartRef1?.resize(); - this.echartRef2?.resize() - } - - ngOnInit(): void { - // this.api.getDashboardCounter().subscribe((res) => { - // this.counter = res.data - // }) - // this.api.getDashboardExpire().subscribe((res) => { - // this.expiringSoon = res.data - // }) - // this.api.getDashboardClientTop().subscribe((res) => { - // this.clientTopTen = res.data - // this.initChart2() - // }) - } - - ngAfterViewInit(): void { - // this.initChart1(); - } - - initChart1() { - const el = this.chart1.nativeElement - if (el) { - this.echartRef1 = init(el) - this.echartRef1.setOption({ - color: antvColor, - tooltip: { - trigger: 'axis', - axisPointer: { - type: 'cross', - label: { - backgroundColor: '#6a7985', - }, - }, - }, - legend: { - data: ['晶未智慧安全平台', 'NG-WAF', 'DLP', 'API'], - }, - - grid: { - left: '10px', - right: '10px', - bottom: '3%', - containLabel: true, - }, - xAxis: [ - { - type: 'category', - boundaryGap: false, - data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], - }, - ], - yAxis: [ - { - type: 'value', - }, - ], - series: [ - { - name: '晶未智慧安全平台', - type: 'line', - smooth: true, - areaStyle: { - opacity: 0.2, - }, - emphasis: { - focus: 'series', - }, - data: [620, 332, 401, 534, 190, 330, 410], - }, - { - name: 'NG-WAF', - type: 'line', - smooth: true, - areaStyle: { - opacity: 0.2, - }, - emphasis: { - focus: 'series', - }, - data: [220, 182, 191, 234, 290, 330, 310], - }, - { - name: 'API', - type: 'line', - smooth: true, - areaStyle: { - opacity: 0.2, - }, - emphasis: { - focus: 'series', - }, - data: [55, 612, 491, 34, 90, 200, 411], - }, - { - name: 'DLP', - type: 'line', - smooth: true, - areaStyle: { - opacity: 0.2, - }, - emphasis: { - focus: 'series', - }, - data: [20, 162, 291, 134, 390, 300, 10], - }, - ], - }) - } - } - initChart2() { - const el = this.chart2.nativeElement - if (el) { - this.echartRef2 = init(el) - this.echartRef2.setOption({ - color: antvColor, - tooltip: { - trigger: 'axis', - axisPointer: { - type: 'cross', - label: { - backgroundColor: '#6a7985', - }, - }, - }, - - grid: { - left: '10px', - right: '10px', - bottom: '3%', - containLabel: true, - }, - xAxis: { - type: 'category', - data: this.clientTopTen.map((i) => i.clientName), - }, - yAxis: { - type: 'value', - }, - series: [ - { - data: this.clientTopTen.map((i) => i.count), - type: 'bar', - }, - ], - }) - } - } -} diff --git a/web-admin-app/src/app/pages copy/entity-detail/entity-detail.component.html b/web-admin-app/src/app/pages copy/entity-detail/entity-detail.component.html deleted file mode 100644 index 4b61d7d..0000000 --- a/web-admin-app/src/app/pages copy/entity-detail/entity-detail.component.html +++ /dev/null @@ -1,101 +0,0 @@ -@if (entity) { -
- - - - - - - - - - {{ entity.name }} - - - {{ entity.contact ?? '-' }} - - - {{ entity.remark || '-' }} - - -
-} - -
- - - - - - -
-
- -
状态:
-
- - - - - -
-
-
- - - - 授权产品 - 操作人 - 生效时间 - 失效时间 - 状态 - 创建时间 - 操作 - - - - @for (item of table.data; track $index) { - - - {{ item.productName }} - - - {{ item.username }} - - - {{ item.startTime * 1000 | date: 'yyyy-MM-dd HH:mm:ss' }} - - - {{ item.endTime ? (item.endTime * 1000 | date: 'yyyy-MM-dd HH:mm:ss') : '永久' }} - - - @if (item.status) { - - } @else { - - } - - - {{ item.createTime }} - - - - - - - - } - - -
-
-
diff --git a/web-admin-app/src/app/pages copy/entity-detail/entity-detail.component.less b/web-admin-app/src/app/pages copy/entity-detail/entity-detail.component.less deleted file mode 100644 index e69de29..0000000 diff --git a/web-admin-app/src/app/pages copy/entity-detail/entity-detail.component.ts b/web-admin-app/src/app/pages copy/entity-detail/entity-detail.component.ts deleted file mode 100644 index 54f6b36..0000000 --- a/web-admin-app/src/app/pages copy/entity-detail/entity-detail.component.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { Component, OnInit } from '@angular/core' -import { ActivatedRoute } from '@angular/router' -import { ApiService } from 'app/services' -import { AuthorizeItemDTO, EntityDTO, EntityDetailDTO } from 'app/services/api.dto' -import { SharedModule } from 'app/shared/shared.module' -import { Clipboard } from '@angular/cdk/clipboard' -import { NzMessageService } from 'ng-zorro-antd/message' -import { NzModalService } from 'ng-zorro-antd/modal' -import { AuthorizeComponent } from 'app/components/authorize/authorize.component' - -@Component({ - selector: 'app-entity-detail', - standalone: true, - imports: [SharedModule], - templateUrl: './entity-detail.component.html', - styleUrl: './entity-detail.component.less', -}) -export class EntityDetailComponent implements OnInit { - constructor( - private api: ApiService, - private route: ActivatedRoute, - private clipboard: Clipboard, - private msg: NzMessageService, - private modal: NzModalService, - ) {} - - entity?: EntityDetailDTO - - authorizeData: AuthorizeItemDTO[] = [] - - visibleList: AuthorizeItemDTO[] = [] - - product: { id: string; name: string }[] = [] - - id: string = '' - - status = -1 - - ngOnInit(): void { - const id = this.route.snapshot.paramMap.get('id') - if (id) { - this.id = id - this.api.getEntityDetail(id).subscribe((res) => { - this.entity = res.data - }) - this.getEntityAuthorizeList() - } - this.api.getAllProduct().subscribe((res) => { - this.product = res.data - }) - } - - getEntityAuthorizeList() { - this.api.getEntityAuthorizeList(this.id).subscribe((res) => { - this.authorizeData = res.data.map((i) => ({ - ...i, - status: this.between(i.startTime, i.endTime) ? 1 : 0, - })) - this.onStatusChange() - }) - } - - onStatusChange() { - this.visibleList = this.authorizeData.filter((f) => (this.status === -1 ? true : f.status === this.status)) - } - - copy(license: string) { - const pending = this.clipboard.beginCopy(license) - let remainingAttempts = 3 - const attempt = () => { - const result = pending.copy() - if (!result && --remainingAttempts) { - setTimeout(attempt) - } else { - this.msg.success('复制成功') - pending.destroy() - } - } - attempt() - } - - between(start: number, end: number): boolean { - if (end === 0) { - return true - } - const now = Date.now() - return start * 1000 <= now && now <= end * 1000 - } - - authorize() { - const ref = this.modal.create({ - nzTitle: '添加授权', - nzContent: AuthorizeComponent, - nzWidth: 800, - nzData: { - product: this.product, - entity: this.entity, - }, - nzFooter: null, - }) - ref.afterClose.subscribe(() => { - this.getEntityAuthorizeList() - }) - } -} diff --git a/web-admin-app/src/app/pages copy/entity-list/entity-list.component.html b/web-admin-app/src/app/pages copy/entity-list/entity-list.component.html deleted file mode 100644 index 5327058..0000000 --- a/web-admin-app/src/app/pages copy/entity-list/entity-list.component.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - @switch (key) { - @case ('name') { - {{ data }} - } - @default { - {{ data }} - } - } - - -
-
- - 实体名称 - - - - -
-
- - 创建时间 - - - - - -
-
-
-
- - - -
-
- - -
-
- - -
- - 实体名称 - - - - - - - 联系方式 - - - - - - - 说明 - - - - -
-
- - - - diff --git a/web-admin-app/src/app/pages copy/entity-list/entity-list.component.less b/web-admin-app/src/app/pages copy/entity-list/entity-list.component.less deleted file mode 100644 index e69de29..0000000 diff --git a/web-admin-app/src/app/pages copy/entity-list/entity-list.component.ts b/web-admin-app/src/app/pages copy/entity-list/entity-list.component.ts deleted file mode 100644 index 25f52ae..0000000 --- a/web-admin-app/src/app/pages copy/entity-list/entity-list.component.ts +++ /dev/null @@ -1,132 +0,0 @@ -import { Component, ElementRef, OnInit, TemplateRef, ViewChild } from '@angular/core' -import { FormControl, FormGroup } from '@angular/forms' -import { NzModalService } from 'ng-zorro-antd/modal' -import { ApiService } from 'app/services' -import { AnyObject, ServerPaginatedTableComponent, TableOption } from 'app/components/server-paginated-table' -import { SharedModule } from 'app/shared/shared.module' -import { FormValidators } from 'app/utils' -import { lastValueFrom } from 'rxjs' -import { EntityDTO, ProductDTO } from 'app/services/api.dto' -import { NzMessageService } from 'ng-zorro-antd/message' -import { format } from 'date-fns' -import { AuthorizeComponent } from 'app/components/authorize/authorize.component' - -@Component({ - standalone: true, - imports: [SharedModule], - selector: 'app-entity-list', - templateUrl: './entity-list.component.html', - styleUrls: ['./entity-list.component.less'], -}) -export class EntityListComponent implements OnInit { - constructor( - private api: ApiService, - private modal: NzModalService, - private msg: NzMessageService, - ) {} - - @ViewChild('entityFormTpl') entityFormTpl!: TemplateRef<{}> - - table = new TableOption(this.fetchData.bind(this), [{ key: 'name', title: '实体名称' }], [], { - cacheUrls: ['/dashboard'], - }) - - queryForm = new FormGroup({ - name: new FormControl(''), - createTime: new FormControl(), - }) - - createForm = new FormGroup({ - name: new FormControl('', [FormValidators.required('请输入实体名称'), FormValidators.maxLength(30)]), - // secretKey: new FormControl('', [FormValidators.required('请输入序列号')]), - contact: new FormControl('', FormValidators.maxLength(30)), - // address: new FormControl('', FormValidators.maxLength(200)), - remark: new FormControl('', FormValidators.maxLength(200)), - }) - - product: { id: string; name: string }[] = [] - - ngOnInit(): void { - this.table - .setColumn([ - { key: 'name', title: '实体名称' }, - { key: 'contact', title: '联系方式' }, - // { key: 'address', title: '地址' }, - { key: 'remark', title: '说明' }, - { key: 'createTime', title: '创建时间' }, - ]) - .setRowOperate([ - { title: '添加授权', premissions: [], onClick: this.authorize.bind(this) }, - { title: '编辑', onClick: this.create.bind(this) }, - { title: '删除', onClick: this.deleteItem.bind(this) }, - ]) - this.api.getAllProduct().subscribe((res) => { - this.product = res.data - }) - } - - fetchData(p: {}, q: AnyObject) { - if (Array.isArray(q['createTime'])) { - const createTimeStart = q['createTime']?.[0] - const createTimeEnd = q['createTime']?.[1] - - q['createTimeStart'] = createTimeStart ? format(new Date(createTimeStart), 'yyyy-MM-dd HH:mm:ss') : '' - q['createTimeEnd'] = createTimeEnd ? format(new Date(createTimeEnd), 'yyyy-MM-dd HH:mm:ss') : '' - } - return this.api.getEntityPage(p, q) - } - - onSearch() {} - - authorize(v: EntityDTO) { - this.modal.create({ - nzTitle: '添加授权', - nzContent: AuthorizeComponent, - nzWidth: 800, - nzData: { - product: this.product, - entity: v, - }, - nzFooter: null, - }) - } - - create(entity?: EntityDTO) { - if (entity) { - this.createForm.patchValue(entity) - this.createForm.get('secretKey')?.disable() - } else { - this.createForm.get('secretKey')?.enable() - } - this.modal.create({ - nzTitle: entity ? '编辑实体' : '添加实体', - nzContent: this.entityFormTpl, - nzOnOk: async () => { - if (FormValidators.validateFormGroup(this.createForm)) { - await lastValueFrom(this.api.saveEntity({ ...(entity ?? {}), ...this.createForm.value })) - this.msg.success('保存成功') - this.table.ref?.reload() - this.createForm.reset() - return true - } - return false - }, - nzOnCancel: () => { - this.createForm.reset() - }, - }) - } - - deleteItem(entity: EntityDTO) { - this.modal.confirm({ - nzTitle: '警告', - nzContent: '是否要删除该实体?', - nzOkDanger: true, - nzOnOk: async () => { - await lastValueFrom(this.api.deleteEntity(entity.id)) - this.msg.success('删除成功') - this.table.ref?.reload() - }, - }) - } -} diff --git a/web-admin-app/src/app/pages copy/forbidden/forbidden.component.html b/web-admin-app/src/app/pages copy/forbidden/forbidden.component.html deleted file mode 100644 index 4bf1ea7..0000000 --- a/web-admin-app/src/app/pages copy/forbidden/forbidden.component.html +++ /dev/null @@ -1,5 +0,0 @@ - -
- -
-
diff --git a/web-admin-app/src/app/pages copy/forbidden/forbidden.component.less b/web-admin-app/src/app/pages copy/forbidden/forbidden.component.less deleted file mode 100644 index e69de29..0000000 diff --git a/web-admin-app/src/app/pages copy/forbidden/forbidden.component.ts b/web-admin-app/src/app/pages copy/forbidden/forbidden.component.ts deleted file mode 100644 index 14fc792..0000000 --- a/web-admin-app/src/app/pages copy/forbidden/forbidden.component.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Component } from '@angular/core' -import { SharedModule } from 'app/shared/shared.module' - -@Component({ - selector: 'app-forbidden', - standalone: true, - imports: [SharedModule], - templateUrl: './forbidden.component.html', - styleUrl: './forbidden.component.less', -}) -export class ForbiddenComponent {} diff --git a/web-admin-app/src/app/pages copy/log/log.component.html b/web-admin-app/src/app/pages copy/log/log.component.html deleted file mode 100644 index 2d73f2f..0000000 --- a/web-admin-app/src/app/pages copy/log/log.component.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - @switch (key) { - @case ('content') { - - @switch (row.operation) { - @case ('insert') { - 新增 - } - @case ('update') { - 编辑 - } - @case ('delete') { - 删除 - } - @case ('login') { - 登录 - } - } - - {{ data }} - } - - @default { - {{ data }} - } - } - -
-
- - 操作人 - - - - -
- -
- - 操作类型 - - - - - - - - - -
- -
- - 操作内容 - - - - -
- -
- - 创建时间 - - - - - -
-
-
-
- - diff --git a/web-admin-app/src/app/pages copy/log/log.component.less b/web-admin-app/src/app/pages copy/log/log.component.less deleted file mode 100644 index e69de29..0000000 diff --git a/web-admin-app/src/app/pages copy/log/log.component.ts b/web-admin-app/src/app/pages copy/log/log.component.ts deleted file mode 100644 index e88f556..0000000 --- a/web-admin-app/src/app/pages copy/log/log.component.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { AfterViewInit, Component, ElementRef, OnInit, TemplateRef, ViewChild } from '@angular/core' -import { FormControl, FormGroup } from '@angular/forms' -import { ApiService } from 'app/services/api.service' -import { - AnyObject, - ServerPaginatedTableComponent, - ServerPaginatedTableService, - TableOption, -} from 'app/components/server-paginated-table' -import { SharedModule } from 'app/shared/shared.module' -import { NzModalService } from 'ng-zorro-antd/modal' -import { format } from 'date-fns' - -@Component({ - standalone: true, - imports: [SharedModule], - selector: 'app-log', - templateUrl: './log.component.html', - styleUrls: ['./log.component.less'], -}) -export class LogComponent implements OnInit, AfterViewInit { - constructor( - private api: ApiService, - private modal: NzModalService, - private table: ServerPaginatedTableService, - ) {} - - @ViewChild('shadowLineTpl') shadowLineRef!: ElementRef - - tableOption = new TableOption(this.fetchData.bind(this)) - - queryForm = new FormGroup({ - operation: new FormControl(), - username: new FormControl(), - content: new FormControl(), - - createTime: new FormControl(), - }) - - ngOnInit(): void { - // this.table.run(); - this.tableOption.setConfig({ - cacheUrls: ['/dashboard'], - }) - this.tableOption.setColumn([ - { - key: 'username', - title: '操作人', - }, - { - key: 'content', - title: '操作内容', - }, - - { - key: 'createTime', - title: '创建时间', - }, - ]) - } - - ngAfterViewInit(): void {} - - fetchData(p: {}, q: AnyObject) { - if (Array.isArray(q['createTime'])) { - const createTimeStart = q['createTime']?.[0] - const createTimeEnd = q['createTime']?.[1] - - q['createTimeStart'] = createTimeStart ? format(new Date(createTimeStart), 'yyyy-MM-dd HH:mm:ss') : '' - q['createTimeEnd'] = createTimeEnd ? format(new Date(createTimeEnd), 'yyyy-MM-dd HH:mm:ss') : '' - } - return this.api.getSysLog(p, q) - } - - create(nzContent: TemplateRef<{}>) { - this.modal.create({ - nzTitle: '添加授权', - nzContent, - nzWidth: 720, - nzOnOk: async () => { - this.tableOption.ref?.reload() - }, - }) - } - - onSearch() {} -} diff --git a/web-admin-app/src/app/pages copy/login/login.component.html b/web-admin-app/src/app/pages copy/login/login.component.html deleted file mode 100644 index 7e04f66..0000000 --- a/web-admin-app/src/app/pages copy/login/login.component.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - diff --git a/web-admin-app/src/app/pages copy/login/login.component.less b/web-admin-app/src/app/pages copy/login/login.component.less deleted file mode 100644 index 454d57d..0000000 --- a/web-admin-app/src/app/pages copy/login/login.component.less +++ /dev/null @@ -1,20 +0,0 @@ -.login-page { - - - .bg { - background-image: url(/assets/images/login-bg.jpg); - background-repeat: no-repeat; - background-size: cover; - filter: blur(1px); - } - - - - .login-form { - - background-color: #fff; - background-color: rgba(255, 255, 255, .7); - -webkit-backdrop-filter: blur(10px); - backdrop-filter: blur(10px); - } -} \ No newline at end of file diff --git a/web-admin-app/src/app/pages copy/login/login.component.ts b/web-admin-app/src/app/pages copy/login/login.component.ts deleted file mode 100644 index 168c519..0000000 --- a/web-admin-app/src/app/pages copy/login/login.component.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { Component } from '@angular/core' -import { FormControl, FormGroup } from '@angular/forms' -import { SharedModule } from '../../shared/shared.module' -import { FormValidators } from 'app/utils' -import { ApiService, LocalHttpInterceptorService } from 'app/services' -import { NzMessageService } from 'ng-zorro-antd/message' -import { Router } from '@angular/router' -import { finalize } from 'rxjs' - -@Component({ - standalone: true, - imports: [SharedModule], - selector: 'app-login', - templateUrl: './login.component.html', - styleUrls: ['./login.component.less'], -}) -export class LoginComponent { - constructor( - private api: ApiService, - private msg: NzMessageService, - private local: LocalHttpInterceptorService, - private router: Router, - ) {} - - loading = false - - loginForm = new FormGroup({ - username: new FormControl('', [FormValidators.required('请输入用户名')]), - password: new FormControl('', [FormValidators.required('请输入密码')]), - }) - - onLogin() { - if (FormValidators.validateFormGroup(this.loginForm)) { - this.loading = true - this.router.navigate(['/']) - return - this.api - .login(this.loginForm.value) - .pipe( - finalize(() => { - this.loading = false - }), - ) - .subscribe((res) => { - this.msg.success('登录成功') - this.local.setAccess({ - access_token: res.data, - }) - localStorage.setItem('add', res.data) - this.router.navigate(['/']) - }) - } - } -} diff --git a/web-admin-app/src/app/pages copy/notfound/notfound.component.html b/web-admin-app/src/app/pages copy/notfound/notfound.component.html deleted file mode 100644 index a725744..0000000 --- a/web-admin-app/src/app/pages copy/notfound/notfound.component.html +++ /dev/null @@ -1,5 +0,0 @@ - -
- -
-
diff --git a/web-admin-app/src/app/pages copy/notfound/notfound.component.less b/web-admin-app/src/app/pages copy/notfound/notfound.component.less deleted file mode 100644 index e69de29..0000000 diff --git a/web-admin-app/src/app/pages copy/notfound/notfound.component.ts b/web-admin-app/src/app/pages copy/notfound/notfound.component.ts deleted file mode 100644 index c198d16..0000000 --- a/web-admin-app/src/app/pages copy/notfound/notfound.component.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Component } from '@angular/core' -import { SharedModule } from 'app/shared/shared.module' - -@Component({ - selector: 'app-notfound', - standalone: true, - imports: [SharedModule], - templateUrl: './notfound.component.html', - styleUrl: './notfound.component.less', -}) -export class NotfoundComponent {} diff --git a/web-admin-app/src/app/pages copy/product-detail/product-detail.component.html b/web-admin-app/src/app/pages copy/product-detail/product-detail.component.html deleted file mode 100644 index 89db895..0000000 --- a/web-admin-app/src/app/pages copy/product-detail/product-detail.component.html +++ /dev/null @@ -1,43 +0,0 @@ -
- - - - - - - - @if (detail(); as info) { - - - {{ info.productId }} - - - {{ info.name }} - - - {{ info.remark || '-' }} - - } - -
- - - -
- - 版本号 - - - - -
-
diff --git a/web-admin-app/src/app/pages copy/product-detail/product-detail.component.less b/web-admin-app/src/app/pages copy/product-detail/product-detail.component.less deleted file mode 100644 index e69de29..0000000 diff --git a/web-admin-app/src/app/pages copy/product-detail/product-detail.component.ts b/web-admin-app/src/app/pages copy/product-detail/product-detail.component.ts deleted file mode 100644 index 1c9209f..0000000 --- a/web-admin-app/src/app/pages copy/product-detail/product-detail.component.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { TemplateRef } from '@angular/core' -import { ViewChild } from '@angular/core' -import { Component, OnInit, signal, computed, effect } from '@angular/core' -import { FormControl, FormGroup } from '@angular/forms' -import { ActivatedRoute, Router } from '@angular/router' -import { TableOption } from 'app/components/server-paginated-table' -import { ApiService } from 'app/services' -import { VersionDTO } from 'app/services/api.dto' -import { SharedModule } from 'app/shared/shared.module' -import { FormValidators } from 'app/utils' -import { NzMessageService } from 'ng-zorro-antd/message' -import { NzModalService } from 'ng-zorro-antd/modal' -import { lastValueFrom } from 'rxjs' - -@Component({ - selector: 'app-product-detail', - standalone: true, - imports: [SharedModule], - templateUrl: './product-detail.component.html', - styleUrl: './product-detail.component.less', -}) -export class ProductDetailComponent implements OnInit { - constructor( - private api: ApiService, - private router: Router, - private route: ActivatedRoute, - private modal: NzModalService, - private msg: NzMessageService, - ) {} - - @ViewChild('versionFormTpl') versionFormTpl!: TemplateRef<{}> - - tableOption = new TableOption(this.fetchData.bind(this)) - - formGroup = new FormGroup({ - name: new FormControl('', [FormValidators.required('请输入产品版本号')]), - }) - - detail = signal({ - productId: '', - name: '', - remark: '', - }) - - id!: string - - ngOnInit(): void { - this.id = this.route.snapshot.paramMap.get('id')! - this.api.getProductDetail(this.id).subscribe((res) => { - this.detail.set(res.data) - }) - } - - fetchData(p: {}, q: {}) { - return this.api.getProductVersionPage(p, { ...q, productId: this.id }) - } - - createVersion(version?: VersionDTO) { - this.modal.create({ - nzTitle: '添加版本', - nzContent: this.versionFormTpl, - nzOnOk: async () => { - if (FormValidators.validateFormGroup(this.formGroup)) { - await lastValueFrom(this.api.saveVersion({ ...(version ?? {}), ...this.formGroup.value })) - this.msg.success('保存成功') - this.tableOption.ref?.reload() - } - }, - }) - } - - deleteItem(v: VersionDTO) { - this.modal.confirm({ - nzTitle: '警告', - nzContent: '是否要删除该版本?', - nzOkDanger: true, - nzOnOk: async () => { - await lastValueFrom(this.api.deleteVersion(v.id, this.id)) - this.msg.success('删除成功') - this.tableOption.ref?.reload() - }, - }) - } -} diff --git a/web-admin-app/src/app/pages copy/product-list/product-list.component.html b/web-admin-app/src/app/pages copy/product-list/product-list.component.html deleted file mode 100644 index 9b977a4..0000000 --- a/web-admin-app/src/app/pages copy/product-list/product-list.component.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - @switch (key) { - @case ('name') { - - {{ data }} - - } - @default { - {{ data }} - } - } - - -
-
- - 产品名称 - - - - -
-
- - 创建时间 - - - - - -
-
-
-
- - - -
-
- - -
-
- - -
- - 产品名称 - - - - - - - 产品ID - - - - - - - 产品说明 - - - - -
-
- - - - diff --git a/web-admin-app/src/app/pages copy/product-list/product-list.component.less b/web-admin-app/src/app/pages copy/product-list/product-list.component.less deleted file mode 100644 index e69de29..0000000 diff --git a/web-admin-app/src/app/pages copy/product-list/product-list.component.ts b/web-admin-app/src/app/pages copy/product-list/product-list.component.ts deleted file mode 100644 index b827f2b..0000000 --- a/web-admin-app/src/app/pages copy/product-list/product-list.component.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { Component, ElementRef, OnInit, TemplateRef, ViewChild } from '@angular/core' -import { FormControl, FormGroup } from '@angular/forms' -import { NzModalService } from 'ng-zorro-antd/modal' -import { ApiService } from 'app/services' -import { AnyObject, ServerPaginatedTableComponent, TableOption } from 'app/components/server-paginated-table' -import { SharedModule } from 'app/shared/shared.module' -import { FormValidators } from 'app/utils' -import { lastValueFrom } from 'rxjs' -import { ProductDTO } from 'app/services/api.dto' -import { NzMessageService } from 'ng-zorro-antd/message' -import { format } from 'date-fns' - -@Component({ - selector: 'app-product-list', - standalone: true, - imports: [SharedModule], - templateUrl: './product-list.component.html', - styleUrl: './product-list.component.less', -}) -export class ProductListComponent { - constructor( - private api: ApiService, - private modal: NzModalService, - private msg: NzMessageService, - ) {} - - @ViewChild('productFormTpl') productFormTpl!: TemplateRef<{}> - - table = new TableOption( - this.fetchData.bind(this), - [ - { key: 'name', title: '产品名称' }, - { key: 'productId', title: '产品ID' }, - { key: 'remark', title: '产品说明', width: '500px' }, - { key: 'createTime', title: '创建时间' }, - ], - [], - ) - - queryForm = new FormGroup({ - name: new FormControl(''), - createTime: new FormControl(), - }) - - createForm = new FormGroup({ - name: new FormControl('', [FormValidators.required('请输入产品名称'), FormValidators.maxLength(30)]), - productId: new FormControl('', [FormValidators.required('请输入产品ID'), FormValidators.maxLength(30)]), - remark: new FormControl('', [FormValidators.maxLength(200)]), - }) - - ngOnInit(): void { - this.table.setRowOperate([ - { title: '编辑', onClick: this.create.bind(this) }, - { title: '删除', onClick: this.deleteItem.bind(this) }, - ]) - } - - fetchData(p: {}, q: AnyObject) { - if (Array.isArray(q['createTime'])) { - const createTimeStart = q['createTime']?.[0] - const createTimeEnd = q['createTime']?.[1] - - q['createTimeStart'] = createTimeStart ? format(new Date(createTimeStart), 'yyyy-MM-dd HH:mm:ss') : '' - q['createTimeEnd'] = createTimeEnd ? format(new Date(createTimeEnd), 'yyyy-MM-dd HH:mm:ss') : '' - } - return this.api.getProductPage(p, q) - } - - onSearch() {} - - create(product?: ProductDTO) { - if (product) { - this.createForm.patchValue(product) - } - this.modal.create({ - nzTitle: product ? '编辑产品' : '添加产品', - nzContent: this.productFormTpl, - nzOnOk: async () => { - if (FormValidators.validateFormGroup(this.createForm)) { - await lastValueFrom(this.api.saveProduct({ ...(product ?? {}), ...this.createForm.value })) - this.msg.success('保存成功') - this.table.ref?.reload() - this.createForm.reset() - } - }, - nzOnCancel: () => { - this.createForm.reset() - }, - }) - } - - deleteItem(product: ProductDTO) { - this.modal.confirm({ - nzTitle: '警告', - nzContent: '是否要删除该产品?', - nzOkDanger: true, - nzOnOk: async () => { - await lastValueFrom(this.api.deleteProduct(product.id)) - this.msg.success('删除成功') - this.table.ref?.reload() - }, - }) - } -} diff --git a/web-admin-app/src/app/pages copy/profile-account/profile-account.component.html b/web-admin-app/src/app/pages copy/profile-account/profile-account.component.html deleted file mode 100644 index d4a1e6a..0000000 --- a/web-admin-app/src/app/pages copy/profile-account/profile-account.component.html +++ /dev/null @@ -1,28 +0,0 @@ -
-
- - 用户名 - - - - - - 新密码 - - - - - - 确认密码 - - - - - - - - - - -
-
diff --git a/web-admin-app/src/app/pages copy/profile-account/profile-account.component.less b/web-admin-app/src/app/pages copy/profile-account/profile-account.component.less deleted file mode 100644 index e69de29..0000000 diff --git a/web-admin-app/src/app/pages copy/profile-account/profile-account.component.ts b/web-admin-app/src/app/pages copy/profile-account/profile-account.component.ts deleted file mode 100644 index 599bf3b..0000000 --- a/web-admin-app/src/app/pages copy/profile-account/profile-account.component.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { Component } from '@angular/core' -import { SharedModule } from '../../shared/shared.module' -import { FormControl, FormGroup } from '@angular/forms' -import { FormValidators } from 'app/utils' -import { ApiService, LocalHttpInterceptorService } from 'app/services' -import { NzMessageService } from 'ng-zorro-antd/message' - -@Component({ - standalone: true, - imports: [SharedModule], - selector: 'app-profile-account', - templateUrl: './profile-account.component.html', - styleUrls: ['./profile-account.component.less'], -}) -export class ProfileAccountComponent { - constructor( - private local: LocalHttpInterceptorService, - private api: ApiService, - private msg: NzMessageService, - ) {} - - formGroup = new FormGroup({ - id: new FormControl(this.api.authInfo.id), - username: new FormControl({ value: this.api.authInfo.username, disabled: true }, [ - FormValidators.required('请输入用户名'), - ]), - password: new FormControl('', [FormValidators.required('请输入密码')]), - confirmPassword: new FormControl('', [FormValidators.required('请再次输入密码')]), - }) - - onSubmit() { - if (FormValidators.validateFormGroup(this.formGroup)) { - if (this.formGroup.value.confirmPassword !== this.formGroup.value.password) { - this.msg.error('两次输入密码不一致') - return - } - const v = this.formGroup.getRawValue() - this.api.changePassword(v).subscribe(() => { - this.msg.success('修改成功,请重新登录').onClose.subscribe(() => { - this.local.removeAccess() - window.location.href = '/login' - }) - }) - } - } -} diff --git a/web-admin-app/src/app/pages copy/profile-basic/profile-basic.component.html b/web-admin-app/src/app/pages copy/profile-basic/profile-basic.component.html deleted file mode 100644 index 17b43ad..0000000 --- a/web-admin-app/src/app/pages copy/profile-basic/profile-basic.component.html +++ /dev/null @@ -1,54 +0,0 @@ -
-
- - 姓名 - - - - - - - 备注 - - - - - - - - - - -
- - - - -
diff --git a/web-admin-app/src/app/pages copy/profile-basic/profile-basic.component.less b/web-admin-app/src/app/pages copy/profile-basic/profile-basic.component.less deleted file mode 100644 index e69de29..0000000 diff --git a/web-admin-app/src/app/pages copy/profile-basic/profile-basic.component.ts b/web-admin-app/src/app/pages copy/profile-basic/profile-basic.component.ts deleted file mode 100644 index 216fd1a..0000000 --- a/web-admin-app/src/app/pages copy/profile-basic/profile-basic.component.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { Component, OnDestroy, OnInit } from '@angular/core' -import { SharedModule } from '../../shared/shared.module' -import { ApiService } from 'app/services' -import { UserFormComponent } from 'app/components/user-form/user-form.component' -import { FormBuilder, FormControl, FormGroup } from '@angular/forms' -import { FormValidators } from 'app/utils' -import { NzMessageService } from 'ng-zorro-antd/message' -import { Subscription } from 'rxjs' - -@Component({ - standalone: true, - imports: [SharedModule, UserFormComponent], - selector: 'app-profile-basic', - templateUrl: './profile-basic.component.html', - styleUrls: ['./profile-basic.component.less'], -}) -export class ProfileBasicComponent implements OnInit, OnDestroy { - constructor( - public api: ApiService, - private fb: FormBuilder, - private msg: NzMessageService, - ) {} - - formGroup!: FormGroup - - ngOnInit(): void { - this.formGroup = this.fb.group({ - name: new FormControl(this.api.authInfo.name, [FormValidators.required('请输入姓名')]), - remark: new FormControl(this.api.authInfo.remark), - }) - } - - ngOnDestroy(): void {} - - public getValues() { - let values = null - if (FormValidators.validateFormGroup(this.formGroup)) { - values = this.formGroup.value - } - return values - } - - onSubmit() { - const vals = this.getValues() - if (vals) { - this.api.saveUser({ ...this.api.authInfo, ...vals }).subscribe(() => { - this.msg.success('保存成功') - this.api.getAuthInfo(true).subscribe(() => {}) - }) - } - } -} diff --git a/web-admin-app/src/app/pages copy/profile/profile.component.html b/web-admin-app/src/app/pages copy/profile/profile.component.html deleted file mode 100644 index bc9b86b..0000000 --- a/web-admin-app/src/app/pages copy/profile/profile.component.html +++ /dev/null @@ -1,36 +0,0 @@ -
- - - - {{ api.authInfo.username }} - - - {{ api.authInfo.name }} - - - {{ api.authInfo.roleName }} - - - @if (api.authInfo.enable) { - - } @else { - - } - - {{ api.authInfo.remark || '-' }} - - -
-
- - -
- -
-
-
diff --git a/web-admin-app/src/app/pages copy/profile/profile.component.less b/web-admin-app/src/app/pages copy/profile/profile.component.less deleted file mode 100644 index 410d139..0000000 --- a/web-admin-app/src/app/pages copy/profile/profile.component.less +++ /dev/null @@ -1,18 +0,0 @@ -.nav-bar { - ul { - display: flex; - - li { - padding: 6px 24px; - margin-right: 12px; - font-size: 14px; - border-radius: 20px; - font-weight: bold; - - &.active { - background-color: #f2f3f5; - color: var(--primary); - } - } - } -} \ No newline at end of file diff --git a/web-admin-app/src/app/pages copy/profile/profile.component.ts b/web-admin-app/src/app/pages copy/profile/profile.component.ts deleted file mode 100644 index cd46449..0000000 --- a/web-admin-app/src/app/pages copy/profile/profile.component.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Component, OnDestroy, OnInit } from '@angular/core' -import { SharedModule } from '../../shared/shared.module' -import { ApiService } from 'app/services' -import { UserDTO } from 'app/services/api.dto' -import { Subscription } from 'rxjs' - -@Component({ - standalone: true, - imports: [SharedModule], - selector: 'app-profile', - templateUrl: './profile.component.html', - styleUrls: ['./profile.component.less'], -}) -export class ProfileComponent implements OnInit, OnDestroy { - constructor(public api: ApiService) {} - - ngOnInit(): void { - this.api.getUserInfo(this.api.authInfo.id).subscribe((res) => {}) - } - - ngOnDestroy(): void {} -} diff --git a/web-admin-app/src/app/pages/flow/flow-layout/flow-layout.component.html b/web-admin-app/src/app/pages/flow/flow-layout/flow-layout.component.html index d7e3333..5c2d329 100644 --- a/web-admin-app/src/app/pages/flow/flow-layout/flow-layout.component.html +++ b/web-admin-app/src/app/pages/flow/flow-layout/flow-layout.component.html @@ -5,6 +5,7 @@
  • 流程首页
  • 我的申请
  • 待我处理
  • +
  • 我已处理
  • diff --git a/web-admin-app/src/app/pages/flow/flow-main/flow-main.component.html b/web-admin-app/src/app/pages/flow/flow-main/flow-main.component.html index 5a27719..3621114 100644 --- a/web-admin-app/src/app/pages/flow/flow-main/flow-main.component.html +++ b/web-admin-app/src/app/pages/flow/flow-main/flow-main.component.html @@ -4,9 +4,24 @@ @for (item of assetFlows; track $index) {
    -
    -
    - {{ item.name }} +
    +
    +
    + +
    +
    +
    +

    + {{ item.name }} +

    +
    + {{ item.formKey }} +
    + @if (item._assignee) { +
    + 审批人:{{ item._assignee.userName }} +
    + }
    发起流程 diff --git a/web-admin-app/src/app/pages/flow/flow-main/flow-main.component.less b/web-admin-app/src/app/pages/flow/flow-main/flow-main.component.less index e69de29..8bf95c1 100644 --- a/web-admin-app/src/app/pages/flow/flow-main/flow-main.component.less +++ b/web-admin-app/src/app/pages/flow/flow-main/flow-main.component.less @@ -0,0 +1,10 @@ +.icon { + width: 48px; + height: 48px; + border-radius: 8px; + overflow: hidden; + background-image: linear-gradient(135deg, #77abf4, #2f7deb); + font-size: 32px; + color: #fff; + +} \ No newline at end of file diff --git a/web-admin-app/src/app/pages/flow/flow-my-apply/flow-my-apply.component.html b/web-admin-app/src/app/pages/flow/flow-my-apply/flow-my-apply.component.html index f3dc55c..c194807 100644 --- a/web-admin-app/src/app/pages/flow/flow-my-apply/flow-my-apply.component.html +++ b/web-admin-app/src/app/pages/flow/flow-my-apply/flow-my-apply.component.html @@ -1 +1,31 @@ -

    flow-my-apply works!

    + +
    + + + @switch (key) { + @case ('_assignee') { + {{ data.userName }} + } + @default { + {{ data }} + } + } + + +
    +
    + + +
    + + 审批人 + + + + +
    +
    + + + + diff --git a/web-admin-app/src/app/pages/flow/flow-my-apply/flow-my-apply.component.ts b/web-admin-app/src/app/pages/flow/flow-my-apply/flow-my-apply.component.ts index ad9b62e..8e7ebeb 100644 --- a/web-admin-app/src/app/pages/flow/flow-my-apply/flow-my-apply.component.ts +++ b/web-admin-app/src/app/pages/flow/flow-my-apply/flow-my-apply.component.ts @@ -1,12 +1,91 @@ -import { Component } from '@angular/core'; +import { Component, TemplateRef, ViewChild } from '@angular/core' +import { FormControl, FormGroup } from '@angular/forms' + +import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' +import { ApiService } from 'app/services' +import { SharedModule } from 'app/shared/shared.module' + +import { lastValueFrom, map, of } from 'rxjs' +import { NzSafeAny } from 'ng-zorro-antd/core/types' +import { NzModalService } from 'ng-zorro-antd/modal' +import { NzMessageService } from 'ng-zorro-antd/message' +import { FormValidators } from 'app/utils' @Component({ - selector: 'app-flow-my-apply', - standalone: true, - imports: [], - templateUrl: './flow-my-apply.component.html', - styleUrl: './flow-my-apply.component.less' + selector: 'app-flow-my-apply', + standalone: true, + imports: [SharedModule], + templateUrl: './flow-my-apply.component.html', + styleUrl: './flow-my-apply.component.less', }) export class FlowMyApplyComponent { + constructor( + private api: ApiService, + private modal: NzModalService, + private msg: NzMessageService, + ) {} + + @ViewChild('createFormTpl') createFormTpl!: TemplateRef<{}> + + createForm = new FormGroup({ + formId: new FormControl(''), + userId: new FormControl([], [FormValidators.required('请选择')]), + }) + + table = new TableOption(this.fetchData.bind(this)) + + ngOnInit(): void { + this.table + // .setConfig({ + // selectable: true, + // rowKey: 'id', + // }) + .setColumn([ + { key: 'taskName', title: '标识', visible: true }, + { key: 'name', title: '名称', visible: true }, + { key: 'status', title: '审批状态', visible: true }, + { key: 'category', title: '流程类型', visible: true }, + { key: 'assigneeName', title: '审批人', visible: true }, + { key: 'createTime', title: '提交时间', visible: true }, + // { key: 'createTime', title: '作废时间', visible: true }, + // { key: 'createTime', title: '完成时间', visible: true }, + ]) + .setRowOperate([{ title: '详情' }, { title: '作废' }]) + } + + fetchData(p: {}, q: AnyObject) { + return this.api.getMyApplyAssetFlow({ ...p, ...q }) + } + onSetApprover(data?: NzSafeAny) { + if (data) { + console.log('data._assignee.userId', data._assignee.userId) + this.createForm.patchValue({ + userId: data._assignee.userId ? [data._assignee.userId] : [], + }) + } + this.modal.create({ + nzTitle: '设置审批人', + nzContent: this.createFormTpl, + nzOnOk: async () => { + if (FormValidators.validateFormGroup(this.createForm)) { + const vals = this.createForm.value + const res = await lastValueFrom( + this.api.setFlowFormsAssignee({ + ...vals, + userId: vals.userId?.[0], + }), + ) + this.msg.success(res.desc) + this.table.ref.reload() + this.createForm.reset() + return true + } + return false + }, + nzOnCancel: () => { + this.createForm.reset() + }, + }) + } } diff --git a/web-admin-app/src/app/pages/flow/flow-my-finished/flow-my-finished.component.html b/web-admin-app/src/app/pages/flow/flow-my-finished/flow-my-finished.component.html new file mode 100644 index 0000000..c194807 --- /dev/null +++ b/web-admin-app/src/app/pages/flow/flow-my-finished/flow-my-finished.component.html @@ -0,0 +1,31 @@ + +
    + + + @switch (key) { + @case ('_assignee') { + {{ data.userName }} + } + @default { + {{ data }} + } + } + + +
    +
    + + +
    + + 审批人 + + + + +
    +
    + + + + diff --git a/web-admin-app/src/app/pages copy/contacts/contact-group-form/contact-group-form.component.less b/web-admin-app/src/app/pages/flow/flow-my-finished/flow-my-finished.component.less similarity index 100% rename from web-admin-app/src/app/pages copy/contacts/contact-group-form/contact-group-form.component.less rename to web-admin-app/src/app/pages/flow/flow-my-finished/flow-my-finished.component.less diff --git a/web-admin-app/src/app/pages/flow/flow-my-finished/flow-my-finished.component.ts b/web-admin-app/src/app/pages/flow/flow-my-finished/flow-my-finished.component.ts new file mode 100644 index 0000000..05427f6 --- /dev/null +++ b/web-admin-app/src/app/pages/flow/flow-my-finished/flow-my-finished.component.ts @@ -0,0 +1,91 @@ +import { Component, TemplateRef, ViewChild } from '@angular/core' +import { FormControl, FormGroup } from '@angular/forms' + +import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' +import { ApiService } from 'app/services' +import { SharedModule } from 'app/shared/shared.module' + +import { lastValueFrom, map, of } from 'rxjs' +import { NzSafeAny } from 'ng-zorro-antd/core/types' +import { NzModalService } from 'ng-zorro-antd/modal' +import { NzMessageService } from 'ng-zorro-antd/message' +import { FormValidators } from 'app/utils' + +@Component({ + selector: 'app-flow-my-finished', + standalone: true, + imports: [SharedModule], + templateUrl: './flow-my-finished.component.html', + styleUrl: './flow-my-finished.component.less', +}) +export class FlowMyFinishedComponent { + constructor( + private api: ApiService, + private modal: NzModalService, + private msg: NzMessageService, + ) {} + + @ViewChild('createFormTpl') createFormTpl!: TemplateRef<{}> + + createForm = new FormGroup({ + formId: new FormControl(''), + userId: new FormControl([], [FormValidators.required('请选择')]), + }) + + table = new TableOption(this.fetchData.bind(this)) + + ngOnInit(): void { + this.table + // .setConfig({ + // selectable: true, + // rowKey: 'id', + // }) + .setColumn([ + { key: 'taskName', title: '标识', visible: true }, + { key: 'name', title: '名称', visible: true }, + { key: 'status', title: '审批状态', visible: true }, + { key: 'category', title: '流程类型', visible: true }, + { key: 'assigneeName', title: '审批人', visible: true }, + { key: 'createTime', title: '提交时间', visible: true }, + // { key: 'createTime', title: '作废时间', visible: true }, + // { key: 'createTime', title: '完成时间', visible: true }, + ]) + .setRowOperate([{ title: '详情' }, { title: '作废' }]) + } + + fetchData(p: {}, q: AnyObject) { + return this.api.getMyFinishedAssetFlow({ ...p, ...q }) + } + + onSetApprover(data?: NzSafeAny) { + if (data) { + console.log('data._assignee.userId', data._assignee.userId) + this.createForm.patchValue({ + userId: data._assignee.userId ? [data._assignee.userId] : [], + }) + } + this.modal.create({ + nzTitle: '设置审批人', + nzContent: this.createFormTpl, + nzOnOk: async () => { + if (FormValidators.validateFormGroup(this.createForm)) { + const vals = this.createForm.value + const res = await lastValueFrom( + this.api.setFlowFormsAssignee({ + ...vals, + userId: vals.userId?.[0], + }), + ) + this.msg.success(res.desc) + this.table.ref.reload() + this.createForm.reset() + return true + } + return false + }, + nzOnCancel: () => { + this.createForm.reset() + }, + }) + } +} diff --git a/web-admin-app/src/app/pages/flow/flow-my-todo/flow-my-todo.component.html b/web-admin-app/src/app/pages/flow/flow-my-todo/flow-my-todo.component.html index 5c0e2c5..c194807 100644 --- a/web-admin-app/src/app/pages/flow/flow-my-todo/flow-my-todo.component.html +++ b/web-admin-app/src/app/pages/flow/flow-my-todo/flow-my-todo.component.html @@ -1 +1,31 @@ -

    flow-my-todo works!

    + +
    + + + @switch (key) { + @case ('_assignee') { + {{ data.userName }} + } + @default { + {{ data }} + } + } + + +
    +
    + + +
    + + 审批人 + + + + +
    +
    + + + + diff --git a/web-admin-app/src/app/pages/flow/flow-my-todo/flow-my-todo.component.ts b/web-admin-app/src/app/pages/flow/flow-my-todo/flow-my-todo.component.ts index fd6dce1..1413264 100644 --- a/web-admin-app/src/app/pages/flow/flow-my-todo/flow-my-todo.component.ts +++ b/web-admin-app/src/app/pages/flow/flow-my-todo/flow-my-todo.component.ts @@ -1,12 +1,91 @@ -import { Component } from '@angular/core'; +import { Component, TemplateRef, ViewChild } from '@angular/core' +import { FormControl, FormGroup } from '@angular/forms' + +import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' +import { ApiService } from 'app/services' +import { SharedModule } from 'app/shared/shared.module' + +import { lastValueFrom, map, of } from 'rxjs' +import { NzSafeAny } from 'ng-zorro-antd/core/types' +import { NzModalService } from 'ng-zorro-antd/modal' +import { NzMessageService } from 'ng-zorro-antd/message' +import { FormValidators } from 'app/utils' @Component({ - selector: 'app-flow-my-todo', - standalone: true, - imports: [], - templateUrl: './flow-my-todo.component.html', - styleUrl: './flow-my-todo.component.less' + selector: 'app-flow-my-todo', + standalone: true, + imports: [SharedModule], + templateUrl: './flow-my-todo.component.html', + styleUrl: './flow-my-todo.component.less', }) export class FlowMyTodoComponent { + constructor( + private api: ApiService, + private modal: NzModalService, + private msg: NzMessageService, + ) {} + + @ViewChild('createFormTpl') createFormTpl!: TemplateRef<{}> + + createForm = new FormGroup({ + formId: new FormControl(''), + userId: new FormControl([], [FormValidators.required('请选择')]), + }) + + table = new TableOption(this.fetchData.bind(this)) + + ngOnInit(): void { + this.table + // .setConfig({ + // selectable: true, + // rowKey: 'id', + // }) + .setColumn([ + { key: 'taskName', title: '标识', visible: true }, + { key: 'name', title: '名称', visible: true }, + { key: 'status', title: '审批状态', visible: true }, + { key: 'category', title: '流程类型', visible: true }, + { key: 'assigneeName', title: '审批人', visible: true }, + { key: 'createTime', title: '提交时间', visible: true }, + // { key: 'createTime', title: '作废时间', visible: true }, + // { key: 'createTime', title: '完成时间', visible: true }, + ]) + .setRowOperate([{ title: '详情' }, { title: '作废' }]) + } + + fetchData(p: {}, q: AnyObject) { + return this.api.getMyTodoAssetFlow({ ...p, ...q }) + } + onSetApprover(data?: NzSafeAny) { + if (data) { + console.log('data._assignee.userId', data._assignee.userId) + this.createForm.patchValue({ + userId: data._assignee.userId ? [data._assignee.userId] : [], + }) + } + this.modal.create({ + nzTitle: '设置审批人', + nzContent: this.createFormTpl, + nzOnOk: async () => { + if (FormValidators.validateFormGroup(this.createForm)) { + const vals = this.createForm.value + const res = await lastValueFrom( + this.api.setFlowFormsAssignee({ + ...vals, + userId: vals.userId?.[0], + }), + ) + this.msg.success(res.desc) + this.table.ref.reload() + this.createForm.reset() + return true + } + return false + }, + nzOnCancel: () => { + this.createForm.reset() + }, + }) + } } diff --git a/web-admin-app/src/app/pages/system/flow/flow-form/flow-form.component.html b/web-admin-app/src/app/pages/system/flow/flow-form/flow-form.component.html index 7d5cfa3..c194807 100644 --- a/web-admin-app/src/app/pages/system/flow/flow-form/flow-form.component.html +++ b/web-admin-app/src/app/pages/system/flow/flow-form/flow-form.component.html @@ -3,6 +3,9 @@ @switch (key) { + @case ('_assignee') { + {{ data.userName }} + } @default { {{ data }} } diff --git a/web-admin-app/src/app/pages/system/flow/flow-form/flow-form.component.ts b/web-admin-app/src/app/pages/system/flow/flow-form/flow-form.component.ts index b6e1d0c..7bc2e0f 100644 --- a/web-admin-app/src/app/pages/system/flow/flow-form/flow-form.component.ts +++ b/web-admin-app/src/app/pages/system/flow/flow-form/flow-form.component.ts @@ -30,7 +30,7 @@ export class FlowFormComponent { createForm = new FormGroup({ formId: new FormControl(''), - userId: new FormControl('', [FormValidators.required('请选择')]), + userId: new FormControl([], [FormValidators.required('请选择')]), }) table = new TableOption(this.fetchData.bind(this)) @@ -46,6 +46,7 @@ export class FlowFormComponent { { key: 'formKey', title: '标识', visible: true }, { key: 'name', title: '名称', visible: true }, { key: 'deployId', title: '流程ID', visible: true }, + { key: '_assignee', title: '审批人', visible: true }, // { key: 'createTime', title: '创建时间', visible: true }, ]) .setRowOperate([{ title: '设置审批人', onClick: this.onSetApprover.bind(this) }]) @@ -66,7 +67,10 @@ export class FlowFormComponent { onSetApprover(data?: NzSafeAny) { if (data) { - this.createForm.patchValue(data) + console.log('data._assignee.userId', data._assignee.userId) + this.createForm.patchValue({ + userId: data._assignee.userId ? [data._assignee.userId] : [], + }) } this.modal.create({ nzTitle: '设置审批人', diff --git a/web-admin-app/src/app/services/api.service.ts b/web-admin-app/src/app/services/api.service.ts index aa637fa..11e43aa 100644 --- a/web-admin-app/src/app/services/api.service.ts +++ b/web-admin-app/src/app/services/api.service.ts @@ -480,4 +480,13 @@ export class ApiService { params: data, }) } + getMyApplyAssetFlow(data: {}) { + return this.http.post(`/api/flowable/task/myProcess`, data) + } + getMyTodoAssetFlow(data: {}) { + return this.http.post(`/api/flowable/task/todoList`, data) + } + getMyFinishedAssetFlow(data: {}) { + return this.http.post(`/api/flowable/task/finishedList`, data) + } }