From 200ce2cb0ddc728156badd8365d0f4da9e20e656 Mon Sep 17 00:00:00 2001 From: MaxKey Date: Sat, 4 Jun 2022 18:36:46 +0800 Subject: [PATCH] dept tree select --- .../main/java/org/maxkey/entity/Groups.java | 1 - .../java/org/maxkey/entity/Institutions.java | 15 +- .../java/org/maxkey/entity/Resources.java | 12 +- .../main/java/org/maxkey/entity/Roles.java | 22 +- .../repository/InstitutionsRepository.java | 6 +- .../src/app/entity/Institutions.ts | 8 +- .../src/app/entity/Resources.ts | 8 +- .../group-editer/group-editer.component.html | 61 +- .../group-editer/group-editer.component.ts | 23 + .../accounts-strategy-editer.component.html | 81 +- .../accounts-strategy-editer.component.ts | 22 + .../adapter-editer.component.html | 45 +- .../config/adapters/adapters.component.ts | 2 + .../institutions/institutions.component.html | 76 +- .../ldap-context/ldap-context.component.html | 4 +- .../synchronizer-editer.component.html | 8 +- .../resource-editer.component.html | 97 +- .../role-editer/role-editer.component.html | 63 +- .../role-editer/role-editer.component.ts | 22 + .../src/app/shared/shared.module.ts | 10 +- .../src/assets/i18n/en-US.json | 4 +- .../src/assets/i18n/zh-CN.json | 6 +- .../src/assets/i18n/zh-TW.json | 6 +- sql/MaxKey单点登录认证系统v2.9.0GA.chnr.json | 12180 ---------------- 24 files changed, 332 insertions(+), 12450 deletions(-) delete mode 100644 sql/MaxKey单点登录认证系统v2.9.0GA.chnr.json diff --git a/maxkey-core/src/main/java/org/maxkey/entity/Groups.java b/maxkey-core/src/main/java/org/maxkey/entity/Groups.java index 5f11875ef..7752d47d3 100644 --- a/maxkey-core/src/main/java/org/maxkey/entity/Groups.java +++ b/maxkey-core/src/main/java/org/maxkey/entity/Groups.java @@ -50,7 +50,6 @@ public class Groups extends JpaBaseEntity implements Serializable { String orgIdsList; @Column String resumeTime; - @Column String suspendTime; diff --git a/maxkey-core/src/main/java/org/maxkey/entity/Institutions.java b/maxkey-core/src/main/java/org/maxkey/entity/Institutions.java index ae1e6ad40..d8b1e76b2 100644 --- a/maxkey-core/src/main/java/org/maxkey/entity/Institutions.java +++ b/maxkey-core/src/main/java/org/maxkey/entity/Institutions.java @@ -69,11 +69,14 @@ public class Institutions extends JpaBaseEntity implements Serializable { @Column private String logo; @Column + private String domain; + @Column private String frontTitle; @Column - private String consoleTitle; + private String consoleDomain; @Column - private String domain; + private String consoleTitle; + @Column private String captchaType; @Column @@ -135,6 +138,14 @@ public class Institutions extends JpaBaseEntity implements Serializable { this.captchaType = captchaType; } + public String getConsoleDomain() { + return consoleDomain; + } + + public void setConsoleDomain(String consoleDomain) { + this.consoleDomain = consoleDomain; + } + public String getConsoleTitle() { return consoleTitle; } diff --git a/maxkey-core/src/main/java/org/maxkey/entity/Resources.java b/maxkey-core/src/main/java/org/maxkey/entity/Resources.java index 838aecb06..f6deb405a 100644 --- a/maxkey-core/src/main/java/org/maxkey/entity/Resources.java +++ b/maxkey-core/src/main/java/org/maxkey/entity/Resources.java @@ -37,6 +37,8 @@ public class Resources extends JpaBaseEntity implements Serializable { @Column String name; @Column + String permission; + @Column int sortIndex; @Column String appId; @@ -108,7 +110,15 @@ public class Resources extends JpaBaseEntity implements Serializable { this.appName = appName; } - public String getParentId() { + public String getPermission() { + return permission; + } + + public void setPermission(String permission) { + this.permission = permission; + } + + public String getParentId() { return parentId; } diff --git a/maxkey-core/src/main/java/org/maxkey/entity/Roles.java b/maxkey-core/src/main/java/org/maxkey/entity/Roles.java index e27331e0b..7644a046f 100644 --- a/maxkey-core/src/main/java/org/maxkey/entity/Roles.java +++ b/maxkey-core/src/main/java/org/maxkey/entity/Roles.java @@ -46,6 +46,10 @@ public class Roles extends JpaBaseEntity implements Serializable { @Column String orgIdsList; @Column + String resumeTime; + @Column + String suspendTime; + @Column String status; @Column String description; @@ -154,7 +158,23 @@ public class Roles extends JpaBaseEntity implements Serializable { this.orgIdsList = orgIdsList; } - public String getInstId() { + public String getResumeTime() { + return resumeTime; + } + + public void setResumeTime(String resumeTime) { + this.resumeTime = resumeTime; + } + + public String getSuspendTime() { + return suspendTime; + } + + public void setSuspendTime(String suspendTime) { + this.suspendTime = suspendTime; + } + + public String getInstId() { return instId; } diff --git a/maxkey-core/src/main/java/org/maxkey/persistence/repository/InstitutionsRepository.java b/maxkey-core/src/main/java/org/maxkey/persistence/repository/InstitutionsRepository.java index 5e56bf576..ec0228886 100644 --- a/maxkey-core/src/main/java/org/maxkey/persistence/repository/InstitutionsRepository.java +++ b/maxkey-core/src/main/java/org/maxkey/persistence/repository/InstitutionsRepository.java @@ -36,7 +36,7 @@ public class InstitutionsRepository { private static Logger _logger = LoggerFactory.getLogger(InstitutionsRepository.class); private static final String SELECT_STATEMENT = - "select * from mxk_institutions where id = ? or domain = ? " ; + "select * from mxk_institutions where id = ? or domain = ? or consoledomain = ?" ; private static final String DEFAULT_INSTID = "1"; @@ -69,13 +69,14 @@ public class InstitutionsRepository { Institutions inst = institutionsStore.getIfPresent(mapper.get(instIdOrDomain)==null ? DEFAULT_INSTID : mapper.get(instIdOrDomain) ); if(inst == null) { List institutions = - jdbcTemplate.query(SELECT_STATEMENT,new InstitutionsRowMapper(),instIdOrDomain,instIdOrDomain); + jdbcTemplate.query(SELECT_STATEMENT,new InstitutionsRowMapper(),instIdOrDomain,instIdOrDomain,instIdOrDomain); if (institutions != null && institutions.size() > 0) { inst = institutions.get(0); } if(inst != null ) { institutionsStore.put(inst.getDomain(), inst); + institutionsStore.put(inst.getConsoleDomain(), inst); mapper.put(inst.getId(), inst.getDomain()); } } @@ -93,6 +94,7 @@ public class InstitutionsRepository { institution.setLogo(rs.getString("logo")); institution.setDomain(rs.getString("domain")); institution.setFrontTitle(rs.getString("fronttitle")); + institution.setConsoleDomain(rs.getString("consoledomain")); institution.setConsoleTitle(rs.getString("consoletitle")); institution.setCaptchaType(rs.getString("captchatype")); institution.setCaptchaSupport(rs.getString("captchasupport")); diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/Institutions.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/Institutions.ts index b35253675..c58466c12 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/Institutions.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/Institutions.ts @@ -1,19 +1,18 @@ /* * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - import { BaseEntity } from './BaseEntity'; @@ -27,6 +26,7 @@ export class Institutions extends BaseEntity { logo!: String; frontTitle!: String; consoleTitle!: String; + consoleDomain!: String; domain!: String; captchaType!: String; captchaSupport!: String; diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/Resources.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/Resources.ts index fedf00c80..afbb95675 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/Resources.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/Resources.ts @@ -1,24 +1,24 @@ /* * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - import { BaseEntity } from './BaseEntity'; export class Resources extends BaseEntity { name!: String; + permission!: String; appId!: String; appName!: String; parentId!: String; diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/groups/group-editer/group-editer.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/groups/group-editer/group-editer.component.html index ed8ae58c2..54c702df1 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/groups/group-editer/group-editer.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/groups/group-editer/group-editer.component.html @@ -4,7 +4,8 @@ {{ 'mxk.text.id' | i18n }} - + @@ -16,13 +17,8 @@ {{ 'mxk.groups.dynamic' | i18n }} - + @@ -30,59 +26,40 @@ {{ 'mxk.groups.resumeTime' | i18n }} - + {{ 'mxk.groups.suspendTime' | i18n }} - + {{ 'mxk.groups.orgIdsList' | i18n }} - + + + {{ 'mxk.groups.filters' | i18n }} - + {{ 'mxk.text.description' | i18n }} - + @@ -91,4 +68,4 @@
-
+ \ No newline at end of file diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/groups/group-editer/group-editer.component.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/groups/group-editer/group-editer.component.ts index 8c96e1c8f..c40921783 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/groups/group-editer/group-editer.component.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/groups/group-editer/group-editer.component.ts @@ -23,7 +23,9 @@ import { NzMessageService } from 'ng-zorro-antd/message'; import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; import { Groups } from '../../../../entity/Groups'; +import { TreeNodes } from '../../../../entity/TreeNodes'; import { GroupsService } from '../../../../service/groups.service'; +import { OrganizationsService } from '../../../../service/organizations.service'; @Component({ selector: 'app-group-editer', @@ -49,11 +51,17 @@ export class GroupEditerComponent implements OnInit { model: new Groups() }; + // TreeNodes + treeNodes = new TreeNodes(false); + + selectValues: string[] = []; + formGroup: FormGroup = new FormGroup({}); constructor( private modalRef: NzModalRef, private groupsService: GroupsService, + private orgsService: OrganizationsService, private fb: FormBuilder, private msg: NzMessageService, @Inject(ALAIN_I18N_TOKEN) private i18n: I18NService, @@ -61,14 +69,24 @@ export class GroupEditerComponent implements OnInit { ) { } ngOnInit(): void { + this.tree(); if (this.isEdit) { this.groupsService.get(`${this.id}`).subscribe(res => { this.form.model.init(res.data); + this.selectValues = this.form.model.orgIdsList.split(','); this.cdr.detectChanges(); }); } } + tree(): void { + this.orgsService.tree({}).subscribe(res => { + this.treeNodes.init(res.data); + this.treeNodes.nodes = this.treeNodes.build(); + this.cdr.detectChanges(); + }); + } + onClose(e: MouseEvent): void { e.preventDefault(); this.modalRef.destroy({ refresh: false }); @@ -78,6 +96,11 @@ export class GroupEditerComponent implements OnInit { e.preventDefault(); this.form.submitting = true; this.form.model.trans(); + this.form.model.orgIdsList = ''; + this.selectValues.forEach(value => { + this.form.model.orgIdsList = `${this.form.model.orgIdsList + value},`; + }); + (this.isEdit ? this.groupsService.update(this.form.model) : this.groupsService.add(this.form.model)).subscribe(res => { if (res.code == 0) { this.msg.success(this.i18n.fanyi(this.isEdit ? 'mxk.alert.update.success' : 'mxk.alert.add.success')); diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/accounts-strategy/accounts-strategy-editer/accounts-strategy-editer.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/accounts-strategy/accounts-strategy-editer/accounts-strategy-editer.component.html index 9b968fb13..35e8a69ed 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/accounts-strategy/accounts-strategy-editer/accounts-strategy-editer.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/accounts-strategy/accounts-strategy-editer/accounts-strategy-editer.component.html @@ -4,37 +4,35 @@ {{ 'mxk.text.id' | i18n }} - + - {{ 'mxk.accountsstrategy.name' | i18n }} + {{ 'mxk.accountsstrategy.name' | i18n }} + - {{ 'mxk.accountsstrategy.appName' | i18n }} + {{ 'mxk.accountsstrategy.appName' | i18n }} + - + - + - {{ 'mxk.accountsstrategy.mapping' | i18n }} + {{ 'mxk.accountsstrategy.mapping' | i18n }} + @@ -47,36 +45,39 @@ - {{ 'mxk.accountsstrategy.suffixes' | i18n }} + {{ 'mxk.accountsstrategy.suffixes' | i18n }} + - + - {{ 'mxk.accountsstrategy.orgIdsList' | i18n }} + {{ 'mxk.accountsstrategy.orgIdsList' | i18n }} + - + + + {{ 'mxk.accountsstrategy.filters' | i18n }} - + - {{ 'mxk.accountsstrategy.createType' | i18n }} + {{ 'mxk.accountsstrategy.createType' | i18n }} + - + @@ -85,27 +86,15 @@ {{ 'mxk.text.description' | i18n }} - + {{ 'mxk.text.status' | i18n }} - + @@ -116,4 +105,4 @@
-
+ \ No newline at end of file diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/accounts-strategy/accounts-strategy-editer/accounts-strategy-editer.component.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/accounts-strategy/accounts-strategy-editer/accounts-strategy-editer.component.ts index df732a65a..2bce7a9e0 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/accounts-strategy/accounts-strategy-editer/accounts-strategy-editer.component.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/accounts-strategy/accounts-strategy-editer/accounts-strategy-editer.component.ts @@ -23,7 +23,9 @@ import { NzMessageService } from 'ng-zorro-antd/message'; import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; import { AccountsStrategy } from '../../../../entity/AccountsStrategy'; +import { TreeNodes } from '../../../../entity/TreeNodes'; import { AccountsStrategyService } from '../../../../service/accounts-strategy.service'; +import { OrganizationsService } from '../../../../service/organizations.service'; import { SelectAppsComponent } from '../../../apps/select-apps/select-apps.component'; @Component({ @@ -51,10 +53,15 @@ export class AccountsStrategyEditerComponent implements OnInit { }; formGroup: FormGroup = new FormGroup({}); + // TreeNodes + treeNodes = new TreeNodes(false); + + selectValues: string[] = []; constructor( private modal: NzModalRef, private accountsStrategyService: AccountsStrategyService, + private orgsService: OrganizationsService, private fb: FormBuilder, private modalService: NzModalService, private viewContainerRef: ViewContainerRef, @@ -64,14 +71,24 @@ export class AccountsStrategyEditerComponent implements OnInit { ) { } ngOnInit(): void { + this.tree(); if (this.isEdit) { this.accountsStrategyService.get(`${this.id}`).subscribe(res => { this.form.model.init(res.data); + this.selectValues = this.form.model.orgIdsList.split(','); this.cdr.detectChanges(); }); } } + tree(): void { + this.orgsService.tree({}).subscribe(res => { + this.treeNodes.init(res.data); + this.treeNodes.nodes = this.treeNodes.build(); + this.cdr.detectChanges(); + }); + } + onSelect(e: MouseEvent): void { e.preventDefault(); const modal = this.modalService.create({ @@ -100,6 +117,11 @@ export class AccountsStrategyEditerComponent implements OnInit { e.preventDefault(); this.form.submitting = true; this.form.model.trans(); + this.form.model.orgIdsList = ''; + this.selectValues.forEach(value => { + this.form.model.orgIdsList = `${this.form.model.orgIdsList + value},`; + }); + (this.isEdit ? this.accountsStrategyService.update(this.form.model) : this.accountsStrategyService.add(this.form.model)).subscribe( res => { if (res.code == 0) { diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/adapters/adapter-editer/adapter-editer.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/adapters/adapter-editer/adapter-editer.component.html index 8a8c3a183..009dd647a 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/adapters/adapter-editer/adapter-editer.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/adapters/adapter-editer/adapter-editer.component.html @@ -2,43 +2,32 @@
- {{ 'mxk.text.id' | i18n }} - - + {{ 'mxk.text.id' | i18n }} + + - {{ 'mxk.adapters.name' | i18n }} - + {{ 'mxk.adapters.name' | i18n }} + + - {{ 'mxk.adapters.adapter' | i18n }} - - + {{ 'mxk.adapters.adapter' | i18n }} + + + - {{ 'mxk.text.description' | i18n }} - - + {{ 'mxk.text.description' | i18n }} + +
@@ -47,4 +36,4 @@
-
+
\ No newline at end of file diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/adapters/adapters.component.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/adapters/adapters.component.ts index f749c1939..3e8eafb4a 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/adapters/adapters.component.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/adapters/adapters.component.ts @@ -130,6 +130,7 @@ export class AdaptersComponent implements OnInit { isEdit: false, id: '' }, + nzWidth: 600, nzOnOk: () => new Promise(resolve => setTimeout(resolve, 1000)) }); // Return a result when closed @@ -150,6 +151,7 @@ export class AdaptersComponent implements OnInit { isEdit: true, id: editiId }, + nzWidth: 600, nzOnOk: () => new Promise(resolve => setTimeout(resolve, 1000)) }); // Return a result when closed diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/institutions/institutions.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/institutions/institutions.component.html index 2d206e5cb..a52f545b1 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/institutions/institutions.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/institutions/institutions.component.html @@ -4,7 +4,8 @@ {{ 'mxk.institutions.id' | i18n }} - + @@ -16,13 +17,8 @@ {{ 'mxk.institutions.fullName' | i18n }} - - - - - {{ 'mxk.institutions.domain' | i18n }} - - + @@ -32,27 +28,47 @@
- {{ 'mxk.institutions.frontTitle' | i18n }} - - + {{ 'mxk.institutions.defaultUri' | i18n }} + + - {{ 'mxk.institutions.consoleTitle' | i18n }} + {{ 'mxk.institutions.domain' | i18n }} + + + + + + {{ 'mxk.institutions.frontTitle' | i18n }} + + + + + + {{ 'mxk.institutions.consoleDomain' | i18n }} + + + + + + + {{ 'mxk.institutions.consoleTitle' | i18n }} + - + {{ 'mxk.institutions.captchaSupport' | i18n }} - + @@ -68,34 +84,32 @@ - - {{ 'mxk.institutions.defaultUri' | i18n }} - - - - {{ 'mxk.institutions.contact' | i18n }} - + {{ 'mxk.institutions.phone' | i18n }} - + {{ 'mxk.institutions.email' | i18n }} - + {{ 'mxk.institutions.address' | i18n }} - + @@ -104,4 +118,4 @@ - + \ No newline at end of file diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/ldap-context/ldap-context.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/ldap-context/ldap-context.component.html index 5816acc82..b43ac979b 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/ldap-context/ldap-context.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/ldap-context/ldap-context.component.html @@ -101,14 +101,14 @@
- + {{ 'mxk.ldapcontext.trustStore' | i18n }} - + {{ 'mxk.ldapcontext.trustStorePassword' | i18n }} diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/synchronizers/synchronizer-editer/synchronizer-editer.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/synchronizers/synchronizer-editer/synchronizer-editer.component.html index 096897e94..6adfb2440 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/synchronizers/synchronizer-editer/synchronizer-editer.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/synchronizers/synchronizer-editer/synchronizer-editer.component.html @@ -33,7 +33,7 @@ {{ 'mxk.synchronizers.scheduler' | i18n }} + placeholder="0 0 12 * * ?" id="scheduler" /> - + {{ 'mxk.synchronizers.trustStore' | i18n }} @@ -107,7 +108,8 @@ id="trustStore" /> - + {{ 'mxk.synchronizers.trustStorePassword' | i18n }} diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/resources/resource-editer/resource-editer.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/resources/resource-editer/resource-editer.component.html index 504c20999..a329015bf 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/resources/resource-editer/resource-editer.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/resources/resource-editer/resource-editer.component.html @@ -4,7 +4,8 @@ {{ 'mxk.resources.id' | i18n }} - + @@ -14,9 +15,12 @@ - {{ 'mxk.resources.resourceType' | i18n }} - - + {{ 'mxk.resources.resourceType' | i18n }} + + + @@ -29,83 +33,74 @@ - {{ 'mxk.resources.parentId' | i18n }} + {{ 'mxk.resources.parentId' | i18n }} + - + {{ 'mxk.resources.parentName' | i18n }} - + {{ 'mxk.resources.resourceUrl' | i18n }} - + - {{ 'mxk.resources.resourceAction' | i18n }} - - + {{ 'mxk.resources.permission' | i18n }} + + - {{ 'mxk.resources.resourceStyle' | i18n }} - - + {{ 'mxk.resources.resourceAction' | i18n }} + + + - {{ 'mxk.resources.resourceIcon' | i18n }} - - + {{ 'mxk.resources.resourceStyle' | i18n }} + + + + + + + {{ 'mxk.resources.resourceIcon' | i18n }} + + + {{ 'mxk.text.sortIndex' | i18n }} - + {{ 'mxk.text.status' | i18n }} - + @@ -116,4 +111,4 @@
-
+ \ No newline at end of file diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/roles/role-editer/role-editer.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/roles/role-editer/role-editer.component.html index 4a674992d..651f7d02c 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/roles/role-editer/role-editer.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/roles/role-editer/role-editer.component.html @@ -4,7 +4,8 @@ {{ 'mxk.text.id' | i18n }} - + @@ -16,13 +17,8 @@ {{ 'mxk.roles.dynamic' | i18n }} - + @@ -30,59 +26,40 @@ {{ 'mxk.roles.resumeTime' | i18n }} - + {{ 'mxk.roles.suspendTime' | i18n }} - + {{ 'mxk.roles.orgIdsList' | i18n }} - - + + + + {{ 'mxk.roles.filters' | i18n }} - + {{ 'mxk.text.description' | i18n }} - + @@ -91,4 +68,4 @@
-
+ \ No newline at end of file diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/roles/role-editer/role-editer.component.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/roles/role-editer/role-editer.component.ts index eebecde09..0ddcd2e42 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/roles/role-editer/role-editer.component.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/roles/role-editer/role-editer.component.ts @@ -23,7 +23,10 @@ import { NzMessageService } from 'ng-zorro-antd/message'; import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; import { Roles } from 'src/app/entity/Roles'; +import { TreeNodes } from '../../../../entity/TreeNodes'; +import { OrganizationsService } from '../../../../service/organizations.service'; import { RolesService } from '../../../../service/roles.service'; + @Component({ selector: 'app-role-editer', templateUrl: './role-editer.component.html', @@ -47,12 +50,17 @@ export class RoleEditerComponent implements OnInit { submitting: false, model: new Roles() }; + // TreeNodes + treeNodes = new TreeNodes(false); + + selectValues: string[] = []; formGroup: FormGroup = new FormGroup({}); constructor( private modalRef: NzModalRef, private rolesService: RolesService, + private orgsService: OrganizationsService, private fb: FormBuilder, private msg: NzMessageService, @Inject(ALAIN_I18N_TOKEN) private i18n: I18NService, @@ -60,14 +68,24 @@ export class RoleEditerComponent implements OnInit { ) { } ngOnInit(): void { + this.tree(); if (this.isEdit) { this.rolesService.get(`${this.id}`).subscribe(res => { this.form.model.init(res.data); + this.selectValues = this.form.model.orgIdsList.split(','); this.cdr.detectChanges(); }); } } + tree(): void { + this.orgsService.tree({}).subscribe(res => { + this.treeNodes.init(res.data); + this.treeNodes.nodes = this.treeNodes.build(); + this.cdr.detectChanges(); + }); + } + onClose(e: MouseEvent): void { e.preventDefault(); this.modalRef.destroy({ refresh: false }); @@ -77,6 +95,10 @@ export class RoleEditerComponent implements OnInit { e.preventDefault(); this.form.submitting = true; this.form.model.trans(); + this.form.model.orgIdsList = ''; + this.selectValues.forEach(value => { + this.form.model.orgIdsList = `${this.form.model.orgIdsList + value},`; + }); (this.isEdit ? this.rolesService.update(this.form.model) : this.rolesService.add(this.form.model)).subscribe(res => { if (res.code == 0) { this.msg.success(this.i18n.fanyi(this.isEdit ? 'mxk.alert.update.success' : 'mxk.alert.add.success')); diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/shared/shared.module.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/shared/shared.module.ts index a84e64081..41e268321 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/shared/shared.module.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/shared/shared.module.ts @@ -1,19 +1,18 @@ /* * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - import { CommonModule } from '@angular/common'; import { NgModule, Type } from '@angular/core'; @@ -24,6 +23,7 @@ import { DelonFormModule } from '@delon/form'; import { AlainThemeModule } from '@delon/theme'; import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzTreeModule } from 'ng-zorro-antd/tree'; +import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select'; import { SHARED_DELON_MODULES } from './shared-delon.module'; import { SHARED_ZORRO_MODULES } from './shared-zorro.module'; @@ -46,6 +46,7 @@ const DIRECTIVES: Array> = []; FormsModule, NzIconModule, NzTreeModule, + NzTreeSelectModule, RouterModule, ReactiveFormsModule, AlainThemeModule.forChild(), @@ -65,6 +66,7 @@ const DIRECTIVES: Array> = []; CommonModule, FormsModule, NzTreeModule, + NzTreeSelectModule, ReactiveFormsModule, RouterModule, AlainThemeModule, diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/en-US.json b/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/en-US.json index 67c536072..42215ff25 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/en-US.json +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/en-US.json @@ -479,6 +479,7 @@ "resources": { "id": "ID", "name": "Resource", + "permission": "Permission", "appId": "App Id", "appName": "App Name", "parentId": "Parent Id", @@ -512,9 +513,10 @@ "email": "email", "address": "address", "logo": "LOGO", + "domain": "Domain", "frontTitle": "Front Title", "consoleTitle": "Console Title", - "domain": "Domain", + "consoleDomain": "Console Domain", "captchaType": "Captcha Type", "captchaType.text": "Text", "captchaType.arithmetic": "Arithmetic", diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-CN.json b/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-CN.json index 73244fb49..3ff85fdaf 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-CN.json +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-CN.json @@ -478,6 +478,7 @@ "resources": { "id": "资源编码", "name": "资源名称", + "permission": "权限标识", "appId": "应用编码", "appName": "应用名称", "parentId": "父级编码", @@ -511,9 +512,10 @@ "email": "邮箱", "address": "地址", "logo": "LOGO", - "frontTitle": "系统名称", - "consoleTitle": "控制台名称", "domain": "域名", + "frontTitle": "系統名称", + "consoleDomain": "控制台域名", + "consoleTitle": "控制台名称", "captchaType": "验证码", "captchaType.text": "字符", "captchaType.arithmetic": "算术", diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-TW.json b/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-TW.json index 4489e2a8e..8ac7d21bf 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-TW.json +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-TW.json @@ -479,6 +479,7 @@ "resources": { "id": "資源編碼", "name": "資源名稱", + "permission": "許可權標識", "appId": "應用編碼", "appName": "應用名稱", "parentId": "父級編碼", @@ -512,9 +513,10 @@ "email": "郵箱", "address": "地址", "logo": "LOGO", - "frontTitle": "系統名稱", - "consoleTitle": "控制台名稱", "domain": "域名", + "frontTitle": "系統名稱", + "consoleDomain": "控制台域名", + "consoleTitle": "控制台名稱", "captchaType": "驗證碼", "captchaType.text": "字符", "captchaType.arithmetic": "算術", diff --git a/sql/MaxKey单点登录认证系统v2.9.0GA.chnr.json b/sql/MaxKey单点登录认证系统v2.9.0GA.chnr.json deleted file mode 100644 index 27d77d8e8..000000000 --- a/sql/MaxKey单点登录认证系统v2.9.0GA.chnr.json +++ /dev/null @@ -1,12180 +0,0 @@ -{ - "name": "MaxKey单点登录认证系统", - "describe": "MaxKey单点登录认证系统", - "avatar": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJTUUH5QgWCzowwHpiJwAAEGNJREFUaN7Fmnt0lNW1wH/nm0dm8pi8E0gmbyByIUCCoCgISmuoCyiVuxDB2kKVVXuplHZ1sYrF9tKl9bHsbW+vyxapSpfaKqxWASuXKhWhvC4iRQhJwJAHeZKEPGYm8/rOvn/MBLCimQCVvdZZk/nmy/n279vn7LP32UeJiHANxe/309jYyIkTxzl+/Di1tadobm6mp6cHr9eL1hqr1UpycjIZGRkUFhYyduwNjB9fxg033EBWVhZKqWulzgnrteglGAxw6tRp9u7dw65df+PDDz+ktbUVn8+H1nrI/7fZbCQnJ1NUVMQtt9zC7NmzmTJlCiNGjLh65WTYoqNNxOfzyV//ulOWL18mBQUFYhiGAFfd4uPjZerUqfL4449JTU3N8FW8KMevAFAkFArK7t27ZcmSJZKSknJNoD6rlZaWymOPPSaNjQ1f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7rTR0d/CF9QYxiKZKeVHJeNMdkJjMtxUZjmJOD18Lf3dvPcc8+xc+fOYc25QZk3bx6bNm26MDy5XPksFArJ2rVrr7iM5Xa7ZcWKFbJ9+zY529QkAf+AmFpLSIsMhLX4TS0hETG1KV5Pv9RUn5SXXnpR5s6de1XnANxut+zZsye2AmhbWyvLli1nx44dw36Lg5KQkEBhYSGlpaWMGlVCZmYWyckuwmGTnp4eWltbqa2tpaamhubm5iuy2KA4HA6efPJJvvvdlZF89KJ82oJaR04sfPDBYRk3btw1racbhiFKqWvap1JKVq5cKR6PZ3g1ehGRHTt2SEFBwXU/aPB5bdGiRdLe3jb8QwiDh+7+/Oc/SV5e3nUHuVxbsGCBNDY2fp6Nhj4IpLWW7du3SWlp6XUHunSoL126VJqaGodSP/azavv375dZM2dedziXyyVr1qyRrq6uWNSOFTDieBoaGuThhx++bse6xo4dKy+//PIlJw6vGeBF8fv9snnzZpk+fbpYLJYvBCw1NVVWrFghx48fH666V3YgVkSkpaVFfvWrX0p5eblYrdZ/CVhKSoosXLhQdu7cOdxzolcPOCiNjY2yYcMGueuuuyQzM/Oqoex2u5SWlspDDz0k77zzV/F4+q9GvctHMlciHo+HkyereP/9Pezbt4+amhra29vxeDyEQqFI1nDJo5RSF8oBKcnJ5OXnM3HiRGbOvI2pU2+ioCAfi+Wqz8yfuGaAl8rAwABtbW3U19fT0NBAc3MzXV2deL0+QqEQ8fHxJCUlkZWVRX5+PoWFheTn55GWlh5TUXM4gP8PXQbvxrosGrwAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjEtMDgtMjJUMTE6NTg6MzArMDA6MDDtH3m1AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIxLTA4LTIyVDExOjU4OjMwKzAwOjAwnELBCQAAAABJRU5ErkJggg==", - "version": "3.2.0", - "createdTime": "2021-8-22 20:00:01", - "updatedTime": "2021-8-22 20:30:15", - "dbConns": [], - "profile": { - "default": { - "db": "MYSQL", - "dbConn": "FA259A2D-3916-4D2E-98BC-18B848E2412F", - "entityInitFields": [ - { - "defKey": "TENANT_ID", - "defName": "租户号", - "comment": "", - "type": "", - "len": 32, - "scale": "", - "primaryKey": false, - "notNull": false, - "autoIncrement": false, - "defaultValue": "", - "hideInGraph": true, - "domain": "IdOrKey" - }, - { - "defKey": "REVISION", - "defName": "乐观锁", - "comment": "", - "domain": "IdOrKey", - "type": "", - "len": 32, - "scale": "", - "primaryKey": false, - "notNull": false, - "autoIncrement": false, - "defaultValue": "", - "hideInGraph": true - }, - { - "defKey": "CREATED_BY", - "defName": "创建人", - "comment": "", - "domain": "IdOrKey", - "type": "", - "len": 32, - "scale": "", - "primaryKey": false, - "notNull": false, - "autoIncrement": false, - "defaultValue": "", - "hideInGraph": true - }, - { - "defKey": "CREATED_TIME", - "defName": "创建时间", - "comment": "", - "domain": "DateTime", - "type": "", - "len": "", - "scale": "", - "primaryKey": false, - "notNull": false, - "autoIncrement": false, - "defaultValue": "", - "hideInGraph": true - }, - { - "defKey": "UPDATED_BY", - "defName": "更新人", - "comment": "", - "domain": "IdOrKey", - "type": "", - "len": 32, - "scale": "", - "primaryKey": false, - "notNull": false, - "autoIncrement": false, - "defaultValue": "", - "hideInGraph": true - }, - { - "defKey": "UPDATED_TIME", - "defName": "更新时间", - "comment": "", - "domain": "DateTime", - "type": "", - "len": "", - "scale": "", - "primaryKey": false, - "notNull": false, - "autoIncrement": false, - "defaultValue": "", - "hideInGraph": true - } - ], - "entityInitProperties": {} - }, - "javaHome": "", - "sql": { - "delimiter": "" - }, - "dataTypeSupports": [ - "MYSQL", - "ORACLE", - "SQLServer", - "PostgreSQL", - "DB2", - "DM", - "GaussDB", - "Kingbase", - "JAVA", - "C#" - ], - "codeTemplates": [ - { - "type": "dbDDL", - "isDefault": true, - "applyFor": "MYSQL", - "createTable": "DROP TABLE IF EXISTS {{=it.entity.defKey}};\nCREATE TABLE {{=it.entity.defKey}}(\n{{ pkList = [] ; }}\n{{~it.entity.fields:field:index}}\n {{? field.primaryKey }}{{ pkList.push(field.defKey) }}{{?}}\n {{=field.defKey}} {{=field.type}}{{?field.len>0}}{{='('}}{{=field.len}}{{?field.scale>0}}{{=','}}{{=field.scale}}{{?}}{{=')'}}{{?}} {{= field.notNull ? 'NOT NULL' : '' }} {{= field.autoIncrement ? 'AUTO_INCREMENT' : '' }} {{= field.defaultValue ? it.func.join('DEFAULT',field.defaultValue,' ') : '' }} COMMENT '{{=it.func.join(field.defName,field.comment,';')}}' {{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i0}}{{='('}}{{=field.len}}{{?field.scale>0}}{{=','}}{{=field.scale}}{{?}}{{=')'}}{{?}}{{= field.notNull ? ' NOT NULL' : '' }}{{= field.autoIncrement ? '' : '' }}{{= field.defaultValue ? it.func.join(' DEFAULT ',field.defaultValue,' ') : '' }}{{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i0}}{{='('}}{{=field.len}}{{?field.scale>0}}{{=','}}{{=field.scale}}{{?}}{{=')'}}{{?}}{{= field.notNull ? ' NOT NULL' : '' }}{{= field.autoIncrement ? ' IDENTITY(1,1)' : '' }}{{= field.defaultValue ? it.func.join(' DEFAULT ',field.defaultValue,' ') : '' }}{{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i0}}{{='('}}{{=field.len}}{{?field.scale>0}}{{=','}}{{=field.scale}}{{?}}{{=')'}}{{?}}{{= field.notNull ? ' NOT NULL' : '' }}{{= field.autoIncrement ? ' AUTO_INCREMENT' : '' }}{{= field.defaultValue ? it.func.join(' DEFAULT ',field.defaultValue,' ') : '' }}{{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i0}}{{='('}}{{=field.len}}{{?field.scale>0}}{{=','}}{{=field.scale}}{{?}}{{=')'}}{{?}}{{= field.notNull ? ' NOT NULL' : '' }}{{= field.autoIncrement ? '' : '' }}{{= field.defaultValue ? it.func.join(' DEFAULT ',field.defaultValue,' ') : '' }}{{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i0}}{{='('}}{{=field.len}}{{?field.scale>0}}{{=','}}{{=field.scale}}{{?}}{{=')'}}{{?}}{{= field.notNull ? ' NOT NULL' : '' }}{{= field.autoIncrement ? '' : '' }}{{= field.defaultValue ? it.func.join(' DEFAULT ','('+field.defaultValue+')',' ') : '' }}{{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i\n /// {{=it.func.join(field.defName,field.comment,';')}}\n /// \n public {{=field.type}} {{=it.func.camel(field.defKey,true)}} { get; set; }\n $blankline\n {{~}}\n \n }\n}" - }, - { - "type": "dbDDL", - "isDefault": true, - "applyFor": "GaussDB", - "createTable": "DROP TABLE IF EXISTS {{=it.entity.defKey}};\nCREATE TABLE {{=it.entity.defKey}}(\n{{ pkList = [] ; }}\n{{~it.entity.fields:field:index}}\n {{? field.primaryKey }}{{ pkList.push(field.defKey) }}{{?}}\n {{=field.defKey}} {{=field.type}}{{?field.len>0}}{{='('}}{{=field.len}}{{?field.scale>0}}{{=','}}{{=field.scale}}{{?}}{{=')'}}{{?}}{{= field.notNull ? ' NOT NULL' : '' }}{{= field.autoIncrement ? ' AUTO_INCREMENT' : '' }}{{= field.defaultValue ? it.func.join(' DEFAULT ',field.defaultValue,' ') : '' }}{{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i0}}{{='('}}{{=field.len}}{{?field.scale>0}}{{=','}}{{=field.scale}}{{?}}{{=')'}}{{?}}{{= field.notNull ? ' NOT NULL' : '' }}{{= field.autoIncrement ? ' AUTO_INCREMENT' : '' }}{{= field.defaultValue ? it.func.join(' DEFAULT ',field.defaultValue,' ') : '' }}{{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i