Browse Source

Refactoring Api: OrganizationUnit

pull/112/head
cKey 5 years ago
parent
commit
14d5a65c17
  1. 20
      aspnet-core/database/ApiGateway-Init-SqlServer.sql
  2. 130
      aspnet-core/database/ApiGateway-Init.sql
  3. 12
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddRoleDto.cs
  4. 12
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddUserDto.cs
  5. 15
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitDtoAddOrRemoveRoleDto.cs
  6. 15
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitDtoAddOrRemoveUserDto.cs
  7. 14
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetRoleByPagedDto.cs
  8. 10
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedRoleByPagedDto.cs
  9. 9
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedUserByPagedDto.cs
  10. 14
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUserDto.cs
  11. 3
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentityRoleAppService.cs
  12. 5
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentityUserAppService.cs
  13. 14
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IOrganizationUnitAppService.cs
  14. 3
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IdentityPermissionDefinitionProvider.cs
  15. 12
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Localization/en.json
  16. 13
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Localization/zh-Hans.json
  17. 8
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityRoleAppService.cs
  18. 11
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityUserAppService.cs
  19. 106
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/OrganizationUnitAppService.cs
  20. 6
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityRoleRepository.cs
  21. 68
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityUserRepository.cs
  22. 1
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreModule.cs
  23. 11
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityRoleRepository.cs
  24. 173
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs
  25. 19
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentityRoleController.cs
  26. 23
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentityUserController.cs
  27. 49
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/OrganizationUnitController.cs
  28. BIN
      aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/event-bus-cap.db
  29. 169
      vueJs/src/api/organizationunit.ts
  30. 15
      vueJs/src/api/roles.ts
  31. 39
      vueJs/src/api/users.ts
  32. 60
      vueJs/src/components/OrganizationUnitTree/index.vue
  33. 1
      vueJs/src/components/PermissionForm/index.vue
  34. 4
      vueJs/src/mixins/DataListMiXin.ts
  35. 19
      vueJs/src/views/admin/claim-type/index.vue
  36. 146
      vueJs/src/views/admin/organization-unit/components/CreateOrUpdateOrganizationUnit.vue
  37. 211
      vueJs/src/views/admin/organization-unit/components/EditOrganizationUint.vue
  38. 305
      vueJs/src/views/admin/organization-unit/components/OrganizationUnitTree.vue
  39. 84
      vueJs/src/views/admin/organization-unit/components/RoleOrganizationUint.vue
  40. 218
      vueJs/src/views/admin/organization-unit/components/RoleReference.vue
  41. 93
      vueJs/src/views/admin/organization-unit/components/UserOrganizationUint.vue
  42. 261
      vueJs/src/views/admin/organization-unit/components/UserReference.vue
  43. 14
      vueJs/src/views/admin/organization-unit/index.vue
  44. 74
      vueJs/src/views/admin/roles/components/RoleEditForm.vue

20
aspnet-core/database/ApiGateway-Init-SqlServer.sql

File diff suppressed because one or more lines are too long

130
aspnet-core/database/ApiGateway-Init.sql

@ -11,7 +11,7 @@
Target Server Version : 80020
File Encoding : 65001
Date: 22/10/2020 17:33:42
Date: 23/10/2020 19:13:56
*/
SET NAMES utf8mb4;
@ -54,7 +54,7 @@ CREATE TABLE `appapigatewayaggregate` (
`Priority` int(0) NULL DEFAULT NULL,
`UpstreamHttpMethod` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of appapigatewayaggregate
@ -76,7 +76,7 @@ CREATE TABLE `appapigatewayaggregateconfig` (
PRIMARY KEY (`Id`) USING BTREE,
INDEX `IX_AppApiGatewayAggregateConfig_AggregateReRouteId`(`AggregateReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayAggregateConfig_AppApiGatewayAggregate_Aggregat~` FOREIGN KEY (`AggregateReRouteId`) REFERENCES `appapigatewayaggregate` (`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for appapigatewayauthoptions
@ -90,7 +90,7 @@ CREATE TABLE `appapigatewayauthoptions` (
PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `IX_AppApiGatewayAuthOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayAuthOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 138 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 145 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of appapigatewayauthoptions
@ -198,6 +198,13 @@ INSERT INTO `appapigatewayauthoptions` VALUES (134, 1316629112428756992, '', '')
INSERT INTO `appapigatewayauthoptions` VALUES (135, 1316652047017246720, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (136, 1316913899996737536, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (137, 1319200951383199744, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (138, 1319221929807024128, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (139, 1319554431134306304, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (140, 1319554550458060800, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (141, 1319554948434595840, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (142, 1319555067183730688, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (143, 1319555230765780992, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (144, 1319555333790470144, '', '');
-- ----------------------------
-- Table structure for appapigatewaybalanceroptions
@ -215,7 +222,7 @@ CREATE TABLE `appapigatewaybalanceroptions` (
UNIQUE INDEX `IX_AppApiGatewayBalancerOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayBalancerOptions_AppApiGatewayGlobalConfiguratio~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT,
CONSTRAINT `FK_AppApiGatewayBalancerOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 141 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 148 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of appapigatewaybalanceroptions
@ -324,6 +331,13 @@ INSERT INTO `appapigatewaybalanceroptions` VALUES (137, NULL, 131662911242875699
INSERT INTO `appapigatewaybalanceroptions` VALUES (138, NULL, 1316652047017246720, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (139, NULL, 1316913899996737536, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (140, NULL, 1319200951383199744, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (141, NULL, 1319221929807024128, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (142, NULL, 1319554431134306304, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (143, NULL, 1319554550458060800, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (144, NULL, 1319554948434595840, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (145, NULL, 1319555067183730688, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (146, NULL, 1319555230765780992, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (147, NULL, 1319555333790470144, '', '', 0);
-- ----------------------------
-- Table structure for appapigatewaycacheoptions
@ -337,7 +351,7 @@ CREATE TABLE `appapigatewaycacheoptions` (
PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `IX_AppApiGatewayCacheOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayCacheOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 138 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 145 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of appapigatewaycacheoptions
@ -407,8 +421,8 @@ INSERT INTO `appapigatewaycacheoptions` VALUES (95, 1288657941770854400, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (96, 1288658134067109888, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (97, 1288658305156964352, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (98, 1288658491216289792, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (99, 1288658638302142464, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (100, 1288658791784308736, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (99, 1288658638302142464, NULL, NULL);
INSERT INTO `appapigatewaycacheoptions` VALUES (100, 1288658791784308736, NULL, NULL);
INSERT INTO `appapigatewaycacheoptions` VALUES (101, 1290849478956199936, NULL, NULL);
INSERT INTO `appapigatewaycacheoptions` VALUES (102, 1290849628051124224, NULL, NULL);
INSERT INTO `appapigatewaycacheoptions` VALUES (103, 1290849798553776128, NULL, NULL);
@ -445,6 +459,13 @@ INSERT INTO `appapigatewaycacheoptions` VALUES (134, 1316629112428756992, 0, '')
INSERT INTO `appapigatewaycacheoptions` VALUES (135, 1316652047017246720, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (136, 1316913899996737536, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (137, 1319200951383199744, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (138, 1319221929807024128, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (139, 1319554431134306304, NULL, NULL);
INSERT INTO `appapigatewaycacheoptions` VALUES (140, 1319554550458060800, NULL, NULL);
INSERT INTO `appapigatewaycacheoptions` VALUES (141, 1319554948434595840, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (142, 1319555067183730688, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (143, 1319555230765780992, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (144, 1319555333790470144, 0, '');
-- ----------------------------
-- Table structure for appapigatewaydiscovery
@ -522,7 +543,7 @@ CREATE TABLE `appapigatewayheaders` (
`Key` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`Value` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for appapigatewayhostandport
@ -534,7 +555,7 @@ CREATE TABLE `appapigatewayhostandport` (
`Host` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`Port` int(0) NULL DEFAULT 0,
PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for appapigatewayhttpoptions
@ -554,7 +575,7 @@ CREATE TABLE `appapigatewayhttpoptions` (
UNIQUE INDEX `IX_AppApiGatewayHttpOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayHttpOptions_AppApiGatewayGlobalConfiguration_It~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT,
CONSTRAINT `FK_AppApiGatewayHttpOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 141 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 148 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of appapigatewayhttpoptions
@ -663,6 +684,13 @@ INSERT INTO `appapigatewayhttpoptions` VALUES (137, NULL, 1316629112428756992, 0
INSERT INTO `appapigatewayhttpoptions` VALUES (138, NULL, 1316652047017246720, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (139, NULL, 1316913899996737536, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (140, NULL, 1319200951383199744, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (141, NULL, 1319221929807024128, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (142, NULL, 1319554431134306304, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (143, NULL, 1319554550458060800, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (144, NULL, 1319554948434595840, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (145, NULL, 1319555067183730688, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (146, NULL, 1319555230765780992, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (147, NULL, 1319555333790470144, 0, 0, 0, 0, 0);
-- ----------------------------
-- Table structure for appapigatewayqosoptions
@ -680,7 +708,7 @@ CREATE TABLE `appapigatewayqosoptions` (
UNIQUE INDEX `IX_AppApiGatewayQoSOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayQoSOptions_AppApiGatewayGlobalConfiguration_Ite~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT,
CONSTRAINT `FK_AppApiGatewayQoSOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 141 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 148 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of appapigatewayqosoptions
@ -789,6 +817,13 @@ INSERT INTO `appapigatewayqosoptions` VALUES (137, NULL, 1316629112428756992, 50
INSERT INTO `appapigatewayqosoptions` VALUES (138, NULL, 1316652047017246720, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (139, NULL, 1316913899996737536, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (140, NULL, 1319200951383199744, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (141, NULL, 1319221929807024128, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (142, NULL, 1319554431134306304, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (143, NULL, 1319554550458060800, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (144, NULL, 1319554948434595840, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (145, NULL, 1319555067183730688, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (146, NULL, 1319555230765780992, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (147, NULL, 1319555333790470144, 50, 60000, 30000);
-- ----------------------------
-- Table structure for appapigatewayratelimitoptions
@ -830,7 +865,7 @@ CREATE TABLE `appapigatewayratelimitrule` (
UNIQUE INDEX `IX_AppApiGatewayRateLimitRule_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayRateLimitRule_AppApiGatewayDynamicReRoute_Dynam~` FOREIGN KEY (`DynamicReRouteId`) REFERENCES `appapigatewaydynamicreroute` (`DynamicReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT,
CONSTRAINT `FK_AppApiGatewayRateLimitRule_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 138 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 145 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of appapigatewayratelimitrule
@ -938,6 +973,13 @@ INSERT INTO `appapigatewayratelimitrule` VALUES (134, 1316629112428756992, NULL,
INSERT INTO `appapigatewayratelimitrule` VALUES (135, 1316652047017246720, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (136, 1316913899996737536, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (137, 1319200951383199744, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (138, 1319221929807024128, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (139, 1319554431134306304, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (140, 1319554550458060800, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (141, 1319554948434595840, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (142, 1319555067183730688, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (143, 1319555230765780992, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (144, 1319555333790470144, NULL, '', 0, NULL, NULL, NULL);
-- ----------------------------
-- Table structure for appapigatewayreroute
@ -977,7 +1019,7 @@ CREATE TABLE `appapigatewayreroute` (
PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `AK_AppApiGatewayReRoute_ReRouteId`(`ReRouteId`) USING BTREE,
UNIQUE INDEX `IX_AppApiGatewayReRoute_AppId_DownstreamPathTemplate_UpstreamPa~`(`AppId`, `DownstreamPathTemplate`, `UpstreamPathTemplate`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 145 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 152 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of appapigatewayreroute
@ -999,8 +1041,8 @@ INSERT INTO `appapigatewayreroute` VALUES (17, '{}', '8c308f1386ad49c799cd281eb9
INSERT INTO `appapigatewayreroute` VALUES (18, '{}', 'e659ebbf61534a978335cfeabdc0b375', 1261606600242085888, '【服务网关管理】- 通过应用标识查询聚合路由', '/api/ApiGateway/Aggregates/by-AppId/{AppId}', '', NULL, '/api/ApiGateway/Aggregates/by-AppId/{AppId}', 'GET,', '', '', '', '', '', '', NULL, 1, NULL, NULL, 'HTTP', '127.0.0.1:30001,', '', NULL, NULL, NULL, 30000, 1, NULL, 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (19, '{}', 'd665e4491b81413385858601d9cf9a1d', 1261606689601732608, '【服务网关管理】- 聚合路由', '/api/ApiGateway/Aggregates', '', NULL, '/api/ApiGateway/Aggregates', 'GET,POST,PUT,DELETE,', '', '', '', '', '', '', NULL, 1, NULL, NULL, 'HTTP', '127.0.0.1:30001,', '', NULL, NULL, NULL, 30000, 1, NULL, 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (22, '{}', '2aad614e2c2a497593a4784ff639c3d9', 1262220447629058048, '【身份认证服务】- 克隆客户端', '/api/identity-server/clients/{id}/clone', '', NULL, '/api/identity-server/clients/{id}/clone', 'POST,', '', '', '', '', '', '', NULL, 1, NULL, NULL, 'HTTP', '127.0.0.1:30015,', '', NULL, NULL, NULL, 30000, 1, NULL, 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (23, '{}', '892101e2e4e34bcfab42cdb5c4452643', 1262230734939758592, '【身份认证服务】- 可用的Api资源', '/api/identity-server/clients/assignable-api-resources', '', NULL, '/api/identity-server/clients/assignable-api-resources', 'GET,', '', '', '', '', '', '', NULL, 1, NULL, NULL, 'HTTP', '127.0.0.1:30015,', '', NULL, NULL, NULL, 30000, 1, NULL, 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (25, '{}', '38833181fe6b4ab0a0baf21ea22edb94', 1262296916350869504, '【身份认证服务】- 可用的身份资源', '/api/identity-server/clients/assignable-identity-resources', '', NULL, '/api/identity-server/clients/assignable-identity-resources', 'GET,', '', '', '', '', '', '', NULL, 1, NULL, NULL, 'HTTP', '127.0.0.1:30015,', '', NULL, NULL, NULL, 30000, 1, NULL, 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (23, '{}', '1504c5e4a7334298878339a305445b21', 1262230734939758592, '【身份认证服务】- 可用的Api资源', '/api/identity-server/clients/assignable-api-resources', '', NULL, '/api/identity-server/clients/assignable-api-resources', 'GET,', '', '', '', '', '', '', NULL, 1, NULL, NULL, 'HTTP', '127.0.0.1:30015,', '', NULL, 'assignable-api-resources', NULL, 30000, 1, NULL, 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (25, '{}', '53dd1751d9104940a966006a5e93d1fa', 1262296916350869504, '【身份认证服务】- 可用的身份资源', '/api/identity-server/clients/assignable-identity-resources', '', NULL, '/api/identity-server/clients/assignable-identity-resources', 'GET,', '', '', '', '', '', '', NULL, 1, NULL, NULL, 'HTTP', '127.0.0.1:30015,', '', NULL, 'assignable-identity-resources', NULL, 30000, 1, NULL, 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (26, '{}', '3fccd1318d0d47d9aef85542668829a6', 1262632376348594176, '【身份认证服务】- Api资源', '/api/identity-server/api-resources', '', '', '/api/identity-server/api-resources', 'GET,POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (27, '{}', 'de6bd0ddea6d4019b4855be5442fafdc', 1262632791869902848, '【身份认证服务】- 管理Api资源', '/api/identity-server/api-resources/{id}', '', '', '/api/identity-server/api-resources/{id}', 'GET,DELETE,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (30, '{}', '0f9875697b74420c9dc2eaf77099b210', 1262660336921235456, '【身份认证服务】- 用户登录', '/api/account/login', '', '', '/api/account/login', 'POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
@ -1021,7 +1063,7 @@ INSERT INTO `appapigatewayreroute` VALUES (44, '{}', '8c8ec5ad6aaa4145981ee7ac87
INSERT INTO `appapigatewayreroute` VALUES (45, '{}', 'f5c0c8c02c0846fdbe5015cd86f3d81b', 1262665456471920640, '【身份认证服务】- 通过名称查询用户', '/api/identity/users/lookup/by-username/{userName}', '', '', '/api/identity/users/lookup/by-username/{userName}', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (46, '{}', 'ecf0ea4a3e3c4b2e8fa3621514d00c74', 1262665628165754880, '【基础服务】- 通过名称查询租户', '/api/abp/multi-tenancy/tenants/by-name/{name}', '', '', '/api/abp/multi-tenancy/tenants/by-name/{name}', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (47, '{}', '69132bc515b64005af4292ce0dee5626', 1262666172682883072, '【基础服务】- 通过标识查询租户', '/api/abp/multi-tenancy/tenants/by-id/{id}', '', '', '/api/abp/multi-tenancy/tenants/by-id/{id}', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (49, '{}', 'b8d2dd9d366540dd95f91023b626472f', 1262723402331885568, '【身份认证服务】- 已有的跨域资源', '/api/identity-server/clients/distinct-cors-origins', '', '', '/api/identity-server/clients/distinct-cors-origins', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (49, '{}', '35f48d7bc3694bbf95d64fe59aa631ac', 1262723402331885568, '【身份认证服务】- 已有的跨域资源', '/api/identity-server/clients/distinct-cors-origins', '', '', '/api/identity-server/clients/distinct-cors-origins', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', 'distinct-cors-origins', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (50, '{}', 'f333d028839d4fc2aafa8509e674d7dd', 1262935771746734080, '【身份认证服务】- 身份资源', '/api/identity-server/identity-resources', '', '', '/api/identity-server/identity-resources', 'GET,POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (51, '{}', 'dffd1bfaca5b4c1890221678f2b16cd5', 1262935906522304512, '【身份认证服务】- 身份资源管理', '/api/identity-server/identity-resources/{id}', '', '', '/api/identity-server/identity-resources/{id}', 'GET,PUT,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (54, '{}', '7b847d8434bc4d1db07fa8961d90c14a', 1263074419073593344, '【服务网关管理】- 接口代理', '/api/abp/api-definition', '', '', '/api/abp/apigateway/api-definition', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30001,', '', '', 'apigateway-api-definition', 0, 30000, 1, '', 'TEST-APP');
@ -1047,8 +1089,8 @@ INSERT INTO `appapigatewayreroute` VALUES (102, '{}', 'a2c6acc9882a425ab26bd3ad5
INSERT INTO `appapigatewayreroute` VALUES (103, '{}', '390acfb0e16943c6b61e731d47c282e9', 1288658134067109888, '【身份认证服务】- 组织机构移动', '/api/identity/organization-units/{id}/move', '', '', '/api/identity/organization-units/{id}/move', 'PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (104, '{}', '3515e75becf9447492ad60466b27c397', 1288658305156964352, '【身份认证服务】- 查询组织机构子级', '/api/identity/organization-units/find-children', '', '', '/api/identity/organization-units/find-children', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (105, '{}', 'aab0a24d930f4f9687497e5ccaac2a31', 1288658491216289792, '【身份认证服务】- 查询组织机构最后一个子节点', '/api/identity/organization-units/last-children', '', '', '/api/identity/organization-units/last-children', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (106, '{}', 'edf67e297c6d494baf3ea66465418faf', 1288658638302142464, '【身份认证服务】- 组织机构角色管理', '/api/identity/organization-units/management-roles', '', '', '/api/identity/organization-units/management-roles', 'GET,POST,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (107, '{}', '21bcb13e71c648a98861ce9b6fb3e7b0', 1288658791784308736, '【身份认证服务】- 组织机构用户管理', '/api/identity/organization-units/management-users', '', '', '/api/identity/organization-units/management-users', 'GET,POST,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (106, '{}', '9b7c999b1c5140c497bc15914a815401', 1288658638302142464, '【身份认证服务】- 未加入组织机构角色', '/api/identity/organization-units/{id}/unadded-roles', '', '', '/api/identity/organization-units/{id}/unadded-roles', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (107, '{}', 'b0cdb3f6908e42bd934ca99a78f22c3f', 1288658791784308736, '【身份认证服务】- 未加入组织机构用户', '/api/identity/organization-units/{id}/unadded-users', '', '', '/api/identity/organization-units/{id}/unadded-users', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (108, '{}', '1982bc6ffd92445b9b3f47067378d1fc', 1290849478956199936, '【后台管理】- 当前租户设置', '/api/setting-management/settings/by-current-tenant', '', '', '/api/setting-management/settings/by-current-tenant', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (109, '{}', 'a7df3a04805d4cc8a6e6b3823c6dd468', 1290849628051124224, '【后台管理】- 用户设置', '/api/setting-management/settings/by-user/{userId}', '', '', '/api/setting-management/settings/by-user/{userId}', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (110, '{}', 'ef6e38a529a345fab67f6a627cf20635', 1290849798553776128, '【后台管理】- 当前用户设置', '/api/setting-management/settings/by-current-user', '', '', '/api/setting-management/settings/by-current-user', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
@ -1085,6 +1127,13 @@ INSERT INTO `appapigatewayreroute` VALUES (141, '{}', '25c19106baff4cf3a877ae8cd
INSERT INTO `appapigatewayreroute` VALUES (142, '{}', 'd42f8b779cf344eeaa24df0ae37fb7cf', 1316652047017246720, '【身份认证服务】- 管理用户声明', '/api/identity/users/claims/{id}', '', '', '/api/identity/users/claims/{id}', 'POST,PUT,DELETE,GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (143, '{}', 'b86af44a34a14db4b482df8550f1bde1', 1316913899996737536, '【身份认证管理】- 管理角色声明', '/api/identity/roles/claims/{id}', '', '', '/api/identity/roles/claims/{id}', 'GET,POST,PUT,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (144, '{}', '51a14bc295044de985ae014fbcc5bddf', 1319200951383199744, '【IdentityServer4】- 发现端点', '/.well-known/openid-configuration', '', '', '/.well-known/openid-configuration', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:44385,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (145, '{}', '9d859a444d774e93818237e53b6cc102', 1319221929807024128, '【身份认证服务】- 查询所有组织机构', '/api/identity/organization-units/all', '', '', '/api/identity/organization-units/all', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (146, '{}', '89f42175b24540caba2a1fded145acf8', 1319554431134306304, '【身份认证服务】- 管理组织机构用户', '/api/identity/organization-units/{id}/users', '', '', '/api/identity/organization-units/{id}/users', 'POST,GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (147, '{}', '126d82509cec43eda712e94737b01039', 1319554550458060800, '【身份认证服务】- 管理组织机构角色', '/api/identity/organization-units/{id}/roles', '', '', '/api/identity/organization-units/{id}/roles', 'POST,GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (148, '{}', '824f5eee6877489f96f1022e306c968a', 1319554948434595840, '【身份认证服务】- 管理角色组织机构', '/api/identity/roles/{id}/organization-units', '', '', '/api/identity/roles/{id}/organization-units', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (149, '{}', 'fe1379d4a13f41afb6410f4c948871f3', 1319555067183730688, '【身份认证服务】- 删除角色组织机构', '/api/identity/roles/{id}/organization-units/{ouId}', '', '', '/api/identity/roles/{id}/organization-units/{ouId}', 'DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (150, '{}', '197a69bb723346aba3601bd61e7fa655', 1319555230765780992, '【身份认证服务】- 管理用户组织机构', '/api/identity/users/{id}/organization-units', '', '', '/api/identity/users/{id}/organization-units', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (151, '{}', '1a7e6d0b1c95484f82a75a2ce6e6f453', 1319555333790470144, '【身份认证服务】- 删除用户组织机构', '/api/identity/users/{id}/organization-units/{ouId}', '', '', '/api/identity/users/{id}/organization-units/{ouId}', 'DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
-- ----------------------------
-- Table structure for appapigatewayroutegroup
@ -1128,7 +1177,7 @@ CREATE TABLE `appapigatewaysecurityoptions` (
PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `IX_AppApiGatewaySecurityOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewaySecurityOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 138 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 145 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of appapigatewaysecurityoptions
@ -1236,6 +1285,13 @@ INSERT INTO `appapigatewaysecurityoptions` VALUES (134, 1316629112428756992, '',
INSERT INTO `appapigatewaysecurityoptions` VALUES (135, 1316652047017246720, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (136, 1316913899996737536, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (137, 1319200951383199744, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (138, 1319221929807024128, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (139, 1319554431134306304, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (140, 1319554550458060800, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (141, 1319554948434595840, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (142, 1319555067183730688, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (143, 1319555230765780992, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (144, 1319555333790470144, '', '');
-- ----------------------------
-- Table structure for cap.published
@ -1257,21 +1313,25 @@ CREATE TABLE `cap.published` (
-- ----------------------------
-- Records of cap.published
-- ----------------------------
INSERT INTO `cap.published` VALUES (1316913901179531264, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1316913901179531264\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/16 9:28:35 +08:00\",\"cap-corr-id\":\"1316913901179531264\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-16T09:28:35.7734416+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-10-16 09:28:36', '2020-10-17 09:28:36', 'Succeeded');
INSERT INTO `cap.published` VALUES (1317010396352376832, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1317010396352376832\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/16 15:52:02 +08:00\",\"cap-corr-id\":\"1317010396352376832\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-16T15:52:02.0169083+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-16 15:52:02', '2020-10-17 15:52:02', 'Succeeded');
INSERT INTO `cap.published` VALUES (1317010428531077120, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1317010428531077120\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/16 15:52:09 +08:00\",\"cap-corr-id\":\"1317010428531077120\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-16T15:52:09.6896583+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-16 15:52:10', '2020-10-17 15:52:10', 'Succeeded');
INSERT INTO `cap.published` VALUES (1317010521804009472, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1317010521804009472\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/16 15:52:31 +08:00\",\"cap-corr-id\":\"1317010521804009472\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-16T15:52:31.9268977+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-16 15:52:32', '2020-10-17 15:52:32', 'Succeeded');
INSERT INTO `cap.published` VALUES (1317010532486901760, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1317010532486901760\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/16 15:52:34 +08:00\",\"cap-corr-id\":\"1317010532486901760\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-16T15:52:34.474519+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Delete\",\"Object\":\"ReRoute\"}}', 0, '2020-10-16 15:52:34', '2020-10-17 15:52:34', 'Succeeded');
INSERT INTO `cap.published` VALUES (1317010545040453632, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1317010545040453632\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/16 15:52:37 +08:00\",\"cap-corr-id\":\"1317010545040453632\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-16T15:52:37.4659098+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Delete\",\"Object\":\"ReRoute\"}}', 0, '2020-10-16 15:52:37', '2020-10-17 15:52:37', 'Succeeded');
INSERT INTO `cap.published` VALUES (1317073463182389248, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1317073463182389248\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/16 20:02:38 +08:00\",\"cap-corr-id\":\"1317073463182389248\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-16T20:02:38.320969+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-16 20:02:38', '2020-10-17 20:02:38', 'Succeeded');
INSERT INTO `cap.published` VALUES (1317073573329006592, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1317073573329006592\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/16 20:03:04 +08:00\",\"cap-corr-id\":\"1317073573329006592\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-16T20:03:04.5820788+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-16 20:03:05', '2020-10-17 20:03:05', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319200204608344064, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319200204608344064\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 16:53:32 +08:00\",\"cap-corr-id\":\"1319200204608344064\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T16:53:32.9840134+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-22 16:53:33', '2020-10-23 16:53:33', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319200280713990144, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319200280713990144\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 16:53:51 +08:00\",\"cap-corr-id\":\"1319200280713990144\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T16:53:51.1354824+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-22 16:53:51', '2020-10-23 16:53:51', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319200384619483136, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319200384619483136\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 16:54:15 +08:00\",\"cap-corr-id\":\"1319200384619483136\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T16:54:15.9078421+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-22 16:54:16', '2020-10-23 16:54:16', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319200560994160640, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319200560994160640\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 16:54:57 +08:00\",\"cap-corr-id\":\"1319200560994160640\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T16:54:57.9595375+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-22 16:54:58', '2020-10-23 16:54:58', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319200657442181120, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319200657442181120\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 16:55:20 +08:00\",\"cap-corr-id\":\"1319200657442181120\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T16:55:20.9536617+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-22 16:55:21', '2020-10-23 16:55:21', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319200806365138944, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319200806365138944\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 16:55:56 +08:00\",\"cap-corr-id\":\"1319200806365138944\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T16:55:56.4604217+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-22 16:55:56', '2020-10-23 16:55:56', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319200951785852928, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319200951785852928\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 16:56:31 +08:00\",\"cap-corr-id\":\"1319200951785852928\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T16:56:31.1318192+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-10-22 16:56:31', '2020-10-23 16:56:31', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319249373444280320, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319249373444280320\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 20:08:55 +08:00\",\"cap-corr-id\":\"1319249373444280320\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T20:08:55.7543668+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-22 20:08:56', '2020-10-23 20:08:56', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319249405602009088, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319249405602009088\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 20:09:03 +08:00\",\"cap-corr-id\":\"1319249405602009088\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T20:09:03.4203308+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-22 20:09:03', '2020-10-23 20:09:03', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319249482190000128, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319249482190000128\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 20:09:21 +08:00\",\"cap-corr-id\":\"1319249482190000128\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T20:09:21.681402+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-22 20:09:22', '2020-10-23 20:09:22', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319249848986079232, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319249848986079232\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 20:10:49 +08:00\",\"cap-corr-id\":\"1319249848986079232\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T20:10:49.1328929+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"AggregateRoute\"}}', 0, '2020-10-22 20:10:49', '2020-10-23 20:10:49', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319250220064542720, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319250220064542720\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 20:12:17 +08:00\",\"cap-corr-id\":\"1319250220064542720\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T20:12:17.6028009+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Update\",\"Object\":\"AggregateRoute\"}}', 0, '2020-10-22 20:12:18', '2020-10-23 20:12:18', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319253036082499584, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319253036082499584\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 20:23:28 +08:00\",\"cap-corr-id\":\"1319253036082499584\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T20:23:28.995489+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"AddRouteConfig\",\"Object\":\"AggregateRoute\"}}', 0, '2020-10-22 20:23:29', '2020-10-23 20:23:29', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319269094700978176, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319269094700978176\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 21:27:17 +08:00\",\"cap-corr-id\":\"1319269094700978176\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T21:27:17.6683764+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Delete\",\"Object\":\"AggregateRoute\"}}', 0, '2020-10-22 21:27:18', '2020-10-23 21:27:18', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319269302629404672, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319269302629404672\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 21:28:07 +08:00\",\"cap-corr-id\":\"1319269302629404672\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T21:28:07.2407943+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Delete\",\"Object\":\"AggregateRoute\"}}', 0, '2020-10-22 21:28:07', '2020-10-23 21:28:07', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319269513921662976, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319269513921662976\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 21:28:57 +08:00\",\"cap-corr-id\":\"1319269513921662976\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T21:28:57.6185875+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Delete\",\"Object\":\"AggregateRoute\"}}', 0, '2020-10-22 21:28:58', '2020-10-23 21:28:58', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319554100082085888, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319554100082085888\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 16:19:48 +08:00\",\"cap-corr-id\":\"1319554100082085888\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T16:19:48.2464771+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 16:19:48', '2020-10-24 16:19:48', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319554182298832896, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319554182298832896\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 16:20:07 +08:00\",\"cap-corr-id\":\"1319554182298832896\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T16:20:07.8366727+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 16:20:08', '2020-10-24 16:20:08', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319554431205609472, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319554431205609472\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 16:21:07 +08:00\",\"cap-corr-id\":\"1319554431205609472\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T16:21:07.192283+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 16:21:07', '2020-10-24 16:21:07', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319554550520975360, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319554550520975360\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 16:21:35 +08:00\",\"cap-corr-id\":\"1319554550520975360\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T16:21:35.6396895+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 16:21:36', '2020-10-24 16:21:36', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319554948505899008, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319554948505899008\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 16:23:10 +08:00\",\"cap-corr-id\":\"1319554948505899008\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T16:23:10.5258597+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 16:23:11', '2020-10-24 16:23:11', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319555067250839552, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319555067250839552\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 16:23:38 +08:00\",\"cap-corr-id\":\"1319555067250839552\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T16:23:38.8355819+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 16:23:39', '2020-10-24 16:23:39', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319555230837084160, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319555230837084160\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 16:24:17 +08:00\",\"cap-corr-id\":\"1319555230837084160\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T16:24:17.8394311+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 16:24:18', '2020-10-24 16:24:18', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319555333865967616, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319555333865967616\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 16:24:42 +08:00\",\"cap-corr-id\":\"1319555333865967616\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T16:24:42.403288+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 16:24:42', '2020-10-24 16:24:42', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319567388383744000, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319567388383744000\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 17:12:36 +08:00\",\"cap-corr-id\":\"1319567388383744000\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T17:12:36.4191302+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 17:12:36', '2020-10-24 17:12:36', 'Succeeded');
INSERT INTO `cap.published` VALUES (1319567469363171328, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319567469363171328\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 17:12:55 +08:00\",\"cap-corr-id\":\"1319567469363171328\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T17:12:55.7317902+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 17:12:56', '2020-10-24 17:12:56', 'Succeeded');
-- ----------------------------
-- Table structure for cap.received

12
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddRoleDto.cs

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace LINGYUN.Abp.Identity
{
public class OrganizationUnitAddRoleDto
{
[Required]
public List<Guid> RoleIds { get; set; }
}
}

12
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddUserDto.cs

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace LINGYUN.Abp.Identity
{
public class OrganizationUnitAddUserDto
{
[Required]
public List<Guid> UserIds { get; set; }
}
}

15
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitDtoAddOrRemoveRoleDto.cs

@ -1,15 +0,0 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
namespace LINGYUN.Abp.Identity
{
public class OrganizationUnitDtoAddOrRemoveRoleDto : IEntityDto<Guid>
{
[Required]
public Guid Id { get; set; }
[Required]
public Guid RoleId { get; set; }
}
}

15
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitDtoAddOrRemoveUserDto.cs

@ -1,15 +0,0 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
namespace LINGYUN.Abp.Identity
{
public class OrganizationUnitDtoAddOrRemoveUserDto : IEntityDto<Guid>
{
[Required]
public Guid Id { get; set; }
[Required]
public Guid UserId { get; set; }
}
}

14
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetRoleByPagedDto.cs

@ -1,14 +0,0 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
namespace LINGYUN.Abp.Identity
{
public class OrganizationUnitGetRoleByPagedDto : PagedAndSortedResultRequestDto, IEntityDto<Guid>
{
[Required]
public Guid Id { get; set; }
public string Filter { get; set; }
}
}

10
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedRoleByPagedDto.cs

@ -0,0 +1,10 @@
using Volo.Abp.Application.Dtos;
namespace LINGYUN.Abp.Identity
{
public class OrganizationUnitGetUnaddedRoleByPagedDto : PagedAndSortedResultRequestDto
{
public string Filter { get; set; }
}
}

9
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedUserByPagedDto.cs

@ -0,0 +1,9 @@
using Volo.Abp.Application.Dtos;
namespace LINGYUN.Abp.Identity
{
public class OrganizationUnitGetUnaddedUserByPagedDto : PagedAndSortedResultRequestDto
{
public string Filter { get; set; }
}
}

14
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUserDto.cs

@ -1,14 +0,0 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
namespace LINGYUN.Abp.Identity
{
public class OrganizationUnitGetUserDto : IEntityDto<Guid>
{
[Required]
public Guid Id { get; set; }
public string Filter { get; set; }
}
}

3
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentityRoleAppService.cs

@ -10,8 +10,11 @@ namespace LINGYUN.Abp.Identity
#region OrganizationUnit
Task<ListResultDto<OrganizationUnitDto>> GetOrganizationUnitsAsync(Guid id);
Task SetOrganizationUnitsAsync(Guid id, IdentityRoleAddOrRemoveOrganizationUnitDto input);
Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId);
#endregion
#region ClaimType

5
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentityUserAppService.cs

@ -12,7 +12,10 @@ namespace LINGYUN.Abp.Identity
Task<ListResultDto<OrganizationUnitDto>> GetOrganizationUnitsAsync(Guid id);
Task UpdateOrganizationUnitsAsync(Guid id, IdentityUserOrganizationUnitUpdateDto input);
Task SetOrganizationUnitsAsync(Guid id, IdentityUserOrganizationUnitUpdateDto input);
Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId);
#endregion

14
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IOrganizationUnitAppService.cs

@ -13,6 +13,8 @@ namespace LINGYUN.Abp.Identity
OrganizationUnitCreateDto,
OrganizationUnitUpdateDto>
{
Task<ListResultDto<OrganizationUnitDto>> GetAllListAsync();
Task<OrganizationUnitDto> GetLastChildOrNullAsync(Guid? parentId);
Task MoveAsync(Guid id, OrganizationUnitMoveDto input);
@ -23,8 +25,16 @@ namespace LINGYUN.Abp.Identity
Task<ListResultDto<string>> GetRoleNamesAsync(Guid id);
Task<PagedResultDto<IdentityRoleDto>> GetRolesAsync(OrganizationUnitGetRoleByPagedDto input);
Task<PagedResultDto<IdentityRoleDto>> GetUnaddedRolesAsync(Guid id, OrganizationUnitGetUnaddedRoleByPagedDto input);
Task<PagedResultDto<IdentityRoleDto>> GetRolesAsync(Guid id, PagedAndSortedResultRequestDto input);
Task AddRolesAsync(Guid id, OrganizationUnitAddRoleDto input);
Task<PagedResultDto<IdentityUserDto>> GetUnaddedUsersAsync(Guid id, OrganizationUnitGetUnaddedUserByPagedDto input);
Task<PagedResultDto<IdentityUserDto>> GetUsersAsync(Guid id, GetIdentityUsersInput input);
Task<ListResultDto<IdentityUserDto>> GetUsersAsync(OrganizationUnitGetUserDto input);
Task AddUsersAsync(Guid id, OrganizationUnitAddUserDto input);
}
}

3
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IdentityPermissionDefinitionProvider.cs

@ -33,7 +33,8 @@ namespace LINGYUN.Abp.Identity
origanizationUnitPermission.AddChild(IdentityPermissions.OrganizationUnits.ManageRoles, L("Permission:ManageRoles"));
origanizationUnitPermission.AddChild(IdentityPermissions.OrganizationUnits.ManageUsers, L("Permission:ManageUsers"));
var identityClaimType = identityGroup.AddPermission(IdentityPermissions.IdentityClaimType.Default, L("Permission:IdentityClaimTypeManagement"), MultiTenancySides.Host);
// 2020-10-23 修复Bug 租户用户也必须能查询自定义的声明, 管理权限只能为主机
var identityClaimType = identityGroup.AddPermission(IdentityPermissions.IdentityClaimType.Default, L("Permission:IdentityClaimTypeManagement"));
identityClaimType.AddChild(IdentityPermissions.IdentityClaimType.Create, L("Permission:Create"), MultiTenancySides.Host);
identityClaimType.AddChild(IdentityPermissions.IdentityClaimType.Update, L("Permission:Edit"), MultiTenancySides.Host);
identityClaimType.AddChild(IdentityPermissions.IdentityClaimType.Delete, L("Permission:Delete"), MultiTenancySides.Host);

12
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Localization/en.json

@ -7,6 +7,18 @@
"Permission:ManageClaims": "Management claims",
"Permission:ManageOrganizationUnits": "Management organization units",
"Permission:IdentityClaimTypeManagement": "Management claim types",
"OrganizationUnit:Tree": "Organization tree",
"OrganizationUnit:New": "Add New",
"OrganizationUnit:Members": "Organization Members",
"OrganizationUnit:AddRoot": "Add Root",
"OrganizationUnit:AddChildren": "Add Children",
"OrganizationUnit:AddMember": "Add Member",
"OrganizationUnit:AddRole": "Add Role",
"OrganizationUnit:WillDelete": "Organization: {0} will be deleted",
"OrganizationUnit:AreYouSureRemoveUser": "Are you sure you want to delete user {0} from your organization?",
"OrganizationUnit:AreYouSureRemoveRole": "Are you sure you want to remove the role {0} from the organization?",
"OrganizationUnit:SelectUsers": "Select Users",
"OrganizationUnit:SelectRoles": "Select Roles",
"IdentityClaimTypeAlreadyExists": "The identity claim type {0} already exists!",
"UserClaimAlreadyExists": "User claim with the same parameters have been added!",
"RoleClaimAlreadyExists": "Role claim with the same parameters has been added!",

13
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Localization/zh-Hans.json

@ -7,6 +7,19 @@
"Permission:ManageClaims": "管理声明",
"Permission:ManageOrganizationUnits": "管理组织机构",
"Permission:IdentityClaimTypeManagement": "管理声明类型",
"OrganizationUnit:Tree": "组织机构树",
"OrganizationUnit:New": "新组织结构",
"OrganizationUnit:Members": "机构成员",
"OrganizationUnit:AddRoot": "添加根机构",
"OrganizationUnit:AddChildren": "添加子机构",
"OrganizationUnit:AddMember": "添加成员",
"OrganizationUnit:AddRole": "添加角色",
"OrganizationUnit:DisplayName": "显示名称",
"OrganizationUnit:WillDelete": "组织机构: {0} 将被删除",
"OrganizationUnit:AreYouSureRemoveUser": "你确定要从组织机构中删除用户 {0} 吗?",
"OrganizationUnit:AreYouSureRemoveRole": "你确定要从组织机构中删除角色 {0} 吗?",
"OrganizationUnit:SelectUsers": "选择用户",
"OrganizationUnit:SelectRoles": "选择角色",
"IdentityClaimTypeAlreadyExists": "声明类型 {0} 已经存在!",
"UserClaimAlreadyExists": "已经添加相同参数的用户声明!",
"RoleClaimAlreadyExists": "已经添加相同参数的角色声明",

8
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityRoleAppService.cs

@ -56,6 +56,14 @@ namespace LINGYUN.Abp.Identity
await CurrentUnitOfWork.SaveChangesAsync();
}
[Authorize(IdentityPermissions.Roles.ManageOrganizationUnits)]
public virtual async Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId)
{
await OrganizationUnitManager.RemoveRoleFromOrganizationUnitAsync(id, ouId);
await CurrentUnitOfWork.SaveChangesAsync();
}
#endregion
#region ClaimType

11
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityUserAppService.cs

@ -23,6 +23,7 @@ namespace LINGYUN.Abp.Identity
#region OrganizationUnit
[Authorize(IdentityPermissions.Users.ManageOrganizationUnits)]
public virtual async Task<ListResultDto<OrganizationUnitDto>> GetOrganizationUnitsAsync(Guid id)
{
@ -35,7 +36,7 @@ namespace LINGYUN.Abp.Identity
}
[Authorize(IdentityPermissions.Users.ManageOrganizationUnits)]
public virtual async Task UpdateOrganizationUnitsAsync(Guid id, IdentityUserOrganizationUnitUpdateDto input)
public virtual async Task SetOrganizationUnitsAsync(Guid id, IdentityUserOrganizationUnitUpdateDto input)
{
var user = await UserManager.GetByIdAsync(id);
@ -44,6 +45,14 @@ namespace LINGYUN.Abp.Identity
await CurrentUnitOfWork.SaveChangesAsync();
}
[Authorize(IdentityPermissions.Users.ManageOrganizationUnits)]
public virtual async Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId)
{
await UserManager.RemoveFromOrganizationUnitAsync(id, ouId);
await CurrentUnitOfWork.SaveChangesAsync();
}
#endregion
#region Claim

106
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/OrganizationUnitAppService.cs

@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Authorization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Identity;
@ -15,15 +16,18 @@ namespace LINGYUN.Abp.Identity
protected IOrganizationUnitRepository OrganizationUnitRepository { get; }
protected IdentityUserManager UserManager { get; }
protected IIdentityRoleRepository RoleRepository { get; }
protected IIdentityUserRepository UserRepository { get; }
public OrganizationUnitAppService(
IdentityUserManager userManager,
IIdentityRoleRepository roleRepository,
IIdentityUserRepository userRepository,
OrganizationUnitManager organizationUnitManager,
IOrganizationUnitRepository organizationUnitRepository)
{
UserManager = userManager;
RoleRepository = roleRepository;
UserRepository = userRepository;
OrganizationUnitManager = organizationUnitManager;
OrganizationUnitRepository = organizationUnitRepository;
@ -88,6 +92,14 @@ namespace LINGYUN.Abp.Identity
return ObjectMapper.Map<OrganizationUnit, OrganizationUnitDto>(origanizationUnitLastChildren);
}
public virtual async Task<ListResultDto<OrganizationUnitDto>> GetAllListAsync()
{
var origanizationUnits = await OrganizationUnitRepository.GetListAsync(false);
return new ListResultDto<OrganizationUnitDto>(
ObjectMapper.Map<List<OrganizationUnit>, List<OrganizationUnitDto>>(origanizationUnits));
}
public virtual async Task<PagedResultDto<OrganizationUnitDto>> GetListAsync(OrganizationUnitGetByPagedDto input)
{
var origanizationUnitCount = await OrganizationUnitRepository.GetCountAsync();
@ -106,25 +118,69 @@ namespace LINGYUN.Abp.Identity
}
[Authorize(IdentityPermissions.OrganizationUnits.ManageRoles)]
public virtual async Task<PagedResultDto<IdentityRoleDto>> GetRolesAsync(OrganizationUnitGetRoleByPagedDto input)
public virtual async Task<PagedResultDto<IdentityRoleDto>> GetUnaddedRolesAsync(Guid id, OrganizationUnitGetUnaddedRoleByPagedDto input)
{
var origanizationUnit = await OrganizationUnitRepository.GetAsync(id);
var origanizationUnitRoleCount = await OrganizationUnitRepository
.GetUnaddedRolesCountAsync(origanizationUnit, input.Filter);
var origanizationUnitRoles = await OrganizationUnitRepository
.GetUnaddedRolesAsync(origanizationUnit,
input.Sorting, input.MaxResultCount,
input.SkipCount, input.Filter);
return new PagedResultDto<IdentityRoleDto>(origanizationUnitRoleCount,
ObjectMapper.Map<List<IdentityRole>, List<IdentityRoleDto>>(origanizationUnitRoles));
}
[Authorize(IdentityPermissions.OrganizationUnits.ManageRoles)]
public virtual async Task<PagedResultDto<IdentityRoleDto>> GetRolesAsync(Guid id, PagedAndSortedResultRequestDto input)
{
var origanizationUnit = await OrganizationUnitRepository.GetAsync(input.Id);
var origanizationUnitRoleCount = await OrganizationUnitRepository.GetRolesCountAsync(origanizationUnit);
var origanizationUnitRoles = await OrganizationUnitRepository.GetRolesAsync(origanizationUnit,
input.Sorting, input.MaxResultCount, input.SkipCount, false);
var origanizationUnit = await OrganizationUnitRepository.GetAsync(id);
var origanizationUnitRoleCount = await OrganizationUnitRepository
.GetRolesCountAsync(origanizationUnit);
var origanizationUnitRoles = await OrganizationUnitRepository
.GetRolesAsync(origanizationUnit,
input.Sorting, input.MaxResultCount,
input.SkipCount);
return new PagedResultDto<IdentityRoleDto>(origanizationUnitRoleCount,
ObjectMapper.Map<List<IdentityRole>, List<IdentityRoleDto>>(origanizationUnitRoles));
}
[Authorize(IdentityPermissions.OrganizationUnits.ManageUsers)]
public virtual async Task<ListResultDto<IdentityUserDto>> GetUsersAsync(OrganizationUnitGetUserDto input)
public virtual async Task<PagedResultDto<IdentityUserDto>> GetUnaddedUsersAsync(Guid id, OrganizationUnitGetUnaddedUserByPagedDto input)
{
var origanizationUnit = await OrganizationUnitRepository.GetAsync(input.Id);
// TODO: 官方库没有定义分页查询API,有可能是企业付费版本,需要自行实现
var origanizationUnitUsers = await UserRepository.GetUsersInOrganizationUnitAsync(origanizationUnit.Id);
var origanizationUnit = await OrganizationUnitRepository.GetAsync(id);
var origanizationUnitUserCount = await OrganizationUnitRepository
.GetUnaddedUsersCountAsync(origanizationUnit, input.Filter);
var origanizationUnitUsers = await OrganizationUnitRepository
.GetUnaddedUsersAsync(origanizationUnit,
input.Sorting, input.MaxResultCount,
input.SkipCount, input.Filter);
return new ListResultDto<IdentityUserDto>(
return new PagedResultDto<IdentityUserDto>(origanizationUnitUserCount,
ObjectMapper.Map<List<IdentityUser>, List<IdentityUserDto>>(origanizationUnitUsers));
}
[Authorize(IdentityPermissions.OrganizationUnits.ManageUsers)]
public virtual async Task<PagedResultDto<IdentityUserDto>> GetUsersAsync(Guid id, GetIdentityUsersInput input)
{
var origanizationUnit = await OrganizationUnitRepository.GetAsync(id);
var origanizationUnitUserCount = await OrganizationUnitRepository
.GetMembersCountAsync(origanizationUnit, input.Filter);
var origanizationUnitUsers = await OrganizationUnitRepository
.GetMembersAsync(origanizationUnit,
input.Sorting, input.MaxResultCount,
input.SkipCount, input.Filter);
return new PagedResultDto<IdentityUserDto>(origanizationUnitUserCount,
ObjectMapper.Map<List<IdentityUser>, List<IdentityUserDto>>(origanizationUnitUsers));
}
@ -146,5 +202,35 @@ namespace LINGYUN.Abp.Identity
return ObjectMapper.Map<OrganizationUnit, OrganizationUnitDto>(origanizationUnit);
}
[Authorize(IdentityPermissions.OrganizationUnits.ManageUsers)]
public virtual async Task AddUsersAsync(Guid id, OrganizationUnitAddUserDto input)
{
var origanizationUnit = await OrganizationUnitRepository.GetAsync(id);
var users = await UserRepository.GetListByIdListAsync(input.UserIds, includeDetails: true);
// 调用内部方法设置用户组织机构
foreach (var user in users)
{
await UserManager.AddToOrganizationUnitAsync(user, origanizationUnit);
}
await CurrentUnitOfWork.SaveChangesAsync();
}
[Authorize(IdentityPermissions.OrganizationUnits.ManageRoles)]
public virtual async Task AddRolesAsync(Guid id, OrganizationUnitAddRoleDto input)
{
var origanizationUnit = await OrganizationUnitRepository.GetAsync(id);
var roles = await RoleRepository.GetListByIdListAsync(input.RoleIds, includeDetails: true);
foreach (var role in roles)
{
await OrganizationUnitManager.AddRoleToOrganizationUnitAsync(role, origanizationUnit);
}
await CurrentUnitOfWork.SaveChangesAsync();
}
}
}

6
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityRoleRepository.cs

@ -8,6 +8,12 @@ namespace LINGYUN.Abp.Identity
{
public interface IIdentityRoleRepository : Volo.Abp.Identity.IIdentityRoleRepository
{
Task<List<IdentityRole>> GetListByIdListAsync(
List<Guid> roleIds,
bool includeDetails = false,
CancellationToken cancellationToken = default
);
Task<List<OrganizationUnit>> GetOrganizationUnitsAsync(
Guid id,
bool includeDetails = false,

68
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityUserRepository.cs

@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Identity;
namespace LINGYUN.Abp.Identity
{
public interface IIdentityUserRepository : Volo.Abp.Identity.IIdentityUserRepository
{
Task<List<IdentityUser>> GetListByIdListAsync(
List<Guid> userIds,
bool includeDetails = false,
CancellationToken cancellationToken = default
);
Task<List<OrganizationUnit>> GetOrganizationUnitsAsync(
Guid id,
string filter = null,
bool includeDetails = false,
int skipCount = 1,
int maxResultCount = 10,
CancellationToken cancellationToken = default
);
Task<long> GetUsersInOrganizationUnitCountAsync(
Guid organizationUnitId,
string filter = null,
CancellationToken cancellationToken = default
);
Task<List<IdentityUser>> GetUsersInOrganizationUnitAsync(
Guid organizationUnitId,
string filter = null,
int skipCount = 1,
int maxResultCount = 10,
CancellationToken cancellationToken = default
);
Task<long> GetUsersInOrganizationsListCountAsync(
List<Guid> organizationUnitIds,
string filter = null,
CancellationToken cancellationToken = default
);
Task<List<IdentityUser>> GetUsersInOrganizationsListAsync(
List<Guid> organizationUnitIds,
string filter = null,
int skipCount = 1,
int maxResultCount = 10,
CancellationToken cancellationToken = default
);
Task<long> GetUsersInOrganizationUnitWithChildrenCountAsync(
string code,
string filter = null,
CancellationToken cancellationToken = default
);
Task<List<IdentityUser>> GetUsersInOrganizationUnitWithChildrenAsync(
string code,
string filter = null,
int skipCount = 1,
int maxResultCount = 10,
CancellationToken cancellationToken = default
);
}
}

1
aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreModule.cs

@ -14,6 +14,7 @@ namespace LINGYUN.Abp.Identity.EntityFrameworkCore
context.Services.AddAbpDbContext<IdentityDbContext>(options =>
{
options.AddRepository<IdentityRole, EfCoreIdentityRoleRepository>();
options.AddRepository<IdentityUser, EfCoreIdentityUserRepository>();
});
}
}

11
aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityRoleRepository.cs

@ -20,6 +20,17 @@ namespace LINGYUN.Abp.Identity.EntityFrameworkCore
{
}
public virtual async Task<List<IdentityRole>> GetListByIdListAsync(
List<Guid> roleIds,
bool includeDetails = false,
CancellationToken cancellationToken = default
)
{
return await DbSet.IncludeDetails(includeDetails)
.Where(role => roleIds.Contains(role.Id))
.ToListAsync(GetCancellationToken(cancellationToken));
}
public virtual async Task<List<OrganizationUnit>> GetOrganizationUnitsAsync(
Guid id,
bool includeDetails = false,

173
aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs

@ -0,0 +1,173 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Identity;
using Volo.Abp.Identity.EntityFrameworkCore;
namespace LINGYUN.Abp.Identity.EntityFrameworkCore
{
public class EfCoreIdentityUserRepository : Volo.Abp.Identity.EntityFrameworkCore.EfCoreIdentityUserRepository, IIdentityUserRepository
{
public EfCoreIdentityUserRepository(
IDbContextProvider<IIdentityDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public virtual async Task<List<IdentityUser>> GetListByIdListAsync(
List<Guid> userIds,
bool includeDetails = false,
CancellationToken cancellationToken = default
)
{
return await DbSet.IncludeDetails(includeDetails)
.Where(user => userIds.Contains(user.Id))
.ToListAsync(GetCancellationToken(cancellationToken));
}
public virtual async Task<List<OrganizationUnit>> GetOrganizationUnitsAsync(
Guid id,
string filter = null,
bool includeDetails = false,
int skipCount = 1,
int maxResultCount = 10,
CancellationToken cancellationToken = default
)
{
var query = from userOU in DbContext.Set<IdentityUserOrganizationUnit>()
join ou in DbContext.OrganizationUnits.IncludeDetails(includeDetails) on userOU.OrganizationUnitId equals ou.Id
where userOU.UserId == id
select ou;
return await query
.WhereIf(!filter.IsNullOrWhiteSpace(), ou => ou.Code.Contains(filter) || ou.DisplayName.Contains(filter))
.PageBy(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken));
}
public virtual async Task<long> GetUsersInOrganizationUnitCountAsync(
Guid organizationUnitId,
string filter = null,
CancellationToken cancellationToken = default
)
{
var query = from userOu in DbContext.Set<IdentityUserOrganizationUnit>()
join user in DbSet on userOu.UserId equals user.Id
where userOu.OrganizationUnitId == organizationUnitId
select user;
return await query
.WhereIf(!filter.IsNullOrWhiteSpace(),
user => user.Name.Contains(filter) || user.UserName.Contains(filter) ||
user.Surname.Contains(filter) || user.Email.Contains(filter) ||
user.PhoneNumber.Contains(filter))
.LongCountAsync(GetCancellationToken(cancellationToken));
}
public virtual async Task<List<IdentityUser>> GetUsersInOrganizationUnitAsync(
Guid organizationUnitId,
string filter = null,
int skipCount = 1,
int maxResultCount = 10,
CancellationToken cancellationToken = default
)
{
var query = from userOu in DbContext.Set<IdentityUserOrganizationUnit>()
join user in DbSet on userOu.UserId equals user.Id
where userOu.OrganizationUnitId == organizationUnitId
select user;
return await query
.WhereIf(!filter.IsNullOrWhiteSpace(),
user => user.Name.Contains(filter) || user.UserName.Contains(filter) ||
user.Surname.Contains(filter) || user.Email.Contains(filter) ||
user.PhoneNumber.Contains(filter))
.PageBy(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken));
}
public virtual async Task<long> GetUsersInOrganizationsListCountAsync(
List<Guid> organizationUnitIds,
string filter = null,
CancellationToken cancellationToken = default
)
{
var query = from userOu in DbContext.Set<IdentityUserOrganizationUnit>()
join user in DbSet on userOu.UserId equals user.Id
where organizationUnitIds.Contains(userOu.OrganizationUnitId)
select user;
return await query
.WhereIf(!filter.IsNullOrWhiteSpace(),
user => user.Name.Contains(filter) || user.UserName.Contains(filter) ||
user.Surname.Contains(filter) || user.Email.Contains(filter) ||
user.PhoneNumber.Contains(filter))
.LongCountAsync(GetCancellationToken(cancellationToken));
}
public virtual async Task<List<IdentityUser>> GetUsersInOrganizationsListAsync(
List<Guid> organizationUnitIds,
string filter = null,
int skipCount = 1,
int maxResultCount = 10,
CancellationToken cancellationToken = default
)
{
var query = from userOu in DbContext.Set<IdentityUserOrganizationUnit>()
join user in DbSet on userOu.UserId equals user.Id
where organizationUnitIds.Contains(userOu.OrganizationUnitId)
select user;
return await query
.WhereIf(!filter.IsNullOrWhiteSpace(),
user => user.Name.Contains(filter) || user.UserName.Contains(filter) ||
user.Surname.Contains(filter) || user.Email.Contains(filter) ||
user.PhoneNumber.Contains(filter))
.PageBy(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken));
}
public virtual async Task<long> GetUsersInOrganizationUnitWithChildrenCountAsync(
string code,
string filter = null,
CancellationToken cancellationToken = default
)
{
var query = from userOu in DbContext.Set<IdentityUserOrganizationUnit>()
join user in DbSet on userOu.UserId equals user.Id
join ou in DbContext.Set<OrganizationUnit>() on userOu.OrganizationUnitId equals ou.Id
where ou.Code.StartsWith(code)
select user;
return await query
.WhereIf(!filter.IsNullOrWhiteSpace(),
user => user.Name.Contains(filter) || user.UserName.Contains(filter) ||
user.Surname.Contains(filter) || user.Email.Contains(filter) ||
user.PhoneNumber.Contains(filter))
.LongCountAsync(GetCancellationToken(cancellationToken));
}
public virtual async Task<List<IdentityUser>> GetUsersInOrganizationUnitWithChildrenAsync(
string code,
string filter = null,
int skipCount = 1,
int maxResultCount = 10,
CancellationToken cancellationToken = default
)
{
var query = from userOu in DbContext.Set<IdentityUserOrganizationUnit>()
join user in DbSet on userOu.UserId equals user.Id
join ou in DbContext.Set<OrganizationUnit>() on userOu.OrganizationUnitId equals ou.Id
where ou.Code.StartsWith(code)
select user;
return await query
.WhereIf(!filter.IsNullOrWhiteSpace(),
user => user.Name.Contains(filter) || user.UserName.Contains(filter) ||
user.Surname.Contains(filter) || user.Email.Contains(filter) ||
user.PhoneNumber.Contains(filter))
.PageBy(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken));
}
}
}

19
aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentityRoleController.cs

@ -24,46 +24,53 @@ namespace LINGYUN.Abp.Identity
#region OrganizationUnit
[HttpGet]
[Route("organization-units/{id}")]
[Route("{id}/organization-units")]
public virtual async Task<ListResultDto<OrganizationUnitDto>> GetOrganizationUnitsAsync(Guid id)
{
return await RoleAppService.GetOrganizationUnitsAsync(id);
}
[HttpPut]
[Route("organization-units/{id}")]
[Route("{id}/organization-units")]
public virtual async Task SetOrganizationUnitsAsync(Guid id, IdentityRoleAddOrRemoveOrganizationUnitDto input)
{
await RoleAppService.SetOrganizationUnitsAsync(id, input);
}
[HttpDelete]
[Route("{id}/organization-units/{ouId}")]
public virtual async Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId)
{
await RoleAppService.RemoveOrganizationUnitsAsync(id, ouId);
}
#endregion
#region Claim
[HttpGet]
[Route("claims/{id}")]
[Route("{id}/claims")]
public virtual async Task<ListResultDto<IdentityClaimDto>> GetClaimsAsync(Guid id)
{
return await RoleAppService.GetClaimsAsync(id);
}
[HttpPost]
[Route("claims/{id}")]
[Route("{id}/claims")]
public virtual async Task AddClaimAsync(Guid id, IdentityRoleClaimCreateDto input)
{
await RoleAppService.AddClaimAsync(id, input);
}
[HttpPut]
[Route("claims/{id}")]
[Route("{id}/claims")]
public virtual async Task UpdateClaimAsync(Guid id, IdentityRoleClaimUpdateDto input)
{
await RoleAppService.UpdateClaimAsync(id, input);
}
[HttpDelete]
[Route("claims/{id}")]
[Route("{id}/claims")]
public virtual async Task DeleteClaimAsync(Guid id, IdentityRoleClaimDeleteDto input)
{
await RoleAppService.DeleteClaimAsync(id, input);

23
aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentityUserController.cs

@ -24,17 +24,24 @@ namespace LINGYUN.Abp.Identity
#region OrganizationUnit
[HttpGet]
[Route("organization-units/{id}")]
[Route("{id}/organization-units")]
public virtual async Task<ListResultDto<OrganizationUnitDto>> GetOrganizationUnitsAsync(Guid id)
{
return await UserAppService.GetOrganizationUnitsAsync(id);
}
[HttpPut]
[Route("organization-units/{id}")]
public virtual async Task UpdateOrganizationUnitsAsync(Guid id, IdentityUserOrganizationUnitUpdateDto input)
[Route("{id}/organization-units")]
public virtual async Task SetOrganizationUnitsAsync(Guid id, IdentityUserOrganizationUnitUpdateDto input)
{
await UserAppService.UpdateOrganizationUnitsAsync(id, input);
await UserAppService.SetOrganizationUnitsAsync(id, input);
}
[HttpDelete]
[Route("{id}/organization-units/{ouId}")]
public virtual async Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId)
{
await UserAppService.RemoveOrganizationUnitsAsync(id, ouId);
}
#endregion
@ -42,28 +49,28 @@ namespace LINGYUN.Abp.Identity
#region Claim
[HttpGet]
[Route("claims/{id}")]
[Route("{id}/claims")]
public virtual async Task<ListResultDto<IdentityClaimDto>> GetClaimsAsync(Guid id)
{
return await UserAppService.GetClaimsAsync(id);
}
[HttpPost]
[Route("claims/{id}")]
[Route("{id}/claims")]
public virtual async Task AddClaimAsync(Guid id, IdentityUserClaimCreateDto input)
{
await UserAppService.AddClaimAsync(id, input);
}
[HttpPut]
[Route("claims/{id}")]
[Route("{id}/claims")]
public virtual async Task UpdateClaimAsync(Guid id, IdentityUserClaimUpdateDto input)
{
await UserAppService.UpdateClaimAsync(id, input);
}
[HttpDelete]
[Route("claims/{id}")]
[Route("{id}/claims")]
public virtual async Task DeleteClaimAsync(Guid id, IdentityUserClaimDeleteDto input)
{
await UserAppService.DeleteClaimAsync(id, input);

49
aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/OrganizationUnitController.cs

@ -63,6 +63,13 @@ namespace LINGYUN.Abp.Identity
return await OrganizationUnitAppService.GetLastChildOrNullAsync(parentId);
}
[HttpGet]
[Route("all")]
public virtual async Task<ListResultDto<OrganizationUnitDto>> GetAllListAsync()
{
return await OrganizationUnitAppService.GetAllListAsync();
}
[HttpGet]
public virtual async Task<PagedResultDto<OrganizationUnitDto>> GetListAsync(OrganizationUnitGetByPagedDto input)
{
@ -70,24 +77,52 @@ namespace LINGYUN.Abp.Identity
}
[HttpGet]
[Route("management-roles/{id}")]
[Route("{id}/role-names")]
public virtual async Task<ListResultDto<string>> GetRoleNamesAsync(Guid id)
{
return await OrganizationUnitAppService.GetRoleNamesAsync(id);
}
[HttpGet]
[Route("management-roles")]
public virtual async Task<PagedResultDto<IdentityRoleDto>> GetRolesAsync(OrganizationUnitGetRoleByPagedDto input)
[Route("{id}/unadded-roles")]
public virtual async Task<PagedResultDto<IdentityRoleDto>> GetUnaddedRolesAsync(Guid id, OrganizationUnitGetUnaddedRoleByPagedDto input)
{
return await OrganizationUnitAppService.GetUnaddedRolesAsync(id, input);
}
[HttpGet]
[Route("{id}/roles")]
public virtual async Task<PagedResultDto<IdentityRoleDto>> GetRolesAsync(Guid id, PagedAndSortedResultRequestDto input)
{
return await OrganizationUnitAppService.GetRolesAsync(id, input);
}
[HttpGet]
[Route("{id}/unadded-users")]
public virtual async Task<PagedResultDto<IdentityUserDto>> GetUnaddedUsersAsync(Guid id, OrganizationUnitGetUnaddedUserByPagedDto input)
{
return await OrganizationUnitAppService.GetRolesAsync(input);
return await OrganizationUnitAppService.GetUnaddedUsersAsync(id, input);
}
[HttpGet]
[Route("management-users")]
public virtual async Task<ListResultDto<IdentityUserDto>> GetUsersAsync(OrganizationUnitGetUserDto input)
[Route("{id}/users")]
public virtual async Task<PagedResultDto<IdentityUserDto>> GetUsersAsync(Guid id, GetIdentityUsersInput input)
{
return await OrganizationUnitAppService.GetUsersAsync(id, input);
}
[HttpPost]
[Route("{id}/users")]
public virtual async Task AddUsersAsync(Guid id, OrganizationUnitAddUserDto input)
{
await OrganizationUnitAppService.AddUsersAsync(id, input);
}
[HttpPost]
[Route("{id}/roles")]
public virtual async Task AddRolesAsync(Guid id, OrganizationUnitAddRoleDto input)
{
return await OrganizationUnitAppService.GetUsersAsync(input);
await OrganizationUnitAppService.AddRolesAsync(id, input);
}
[HttpPut]

BIN
aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/event-bus-cap.db

Binary file not shown.

169
vueJs/src/api/organizationunit.ts

@ -1,7 +1,7 @@
import ApiService from './serviceBase'
import { AuditedEntityDto, PagedResultDto, PagedAndSortedResultRequestDto, ListResultDto } from './types'
import { RoleDto } from './roles'
import { User } from './users'
import { RoleDto, RoleGetPagedDto } from './roles'
import { User, UsersGetPagedDto } from './users'
/** 远程服务地址 */
const serviceUrl = process.env.VUE_APP_BASE_API
@ -26,6 +26,15 @@ export default class OrganizationUnitService {
return ApiService.Get<ListResultDto<OrganizationUnit>>(_url, serviceUrl)
}
/**
*
* @returns OrganizationUnit
*/
public static getAllOrganizationUnits() {
const _url = '/api/identity/organization-units/all'
return ApiService.Get<ListResultDto<OrganizationUnit>>(_url, serviceUrl)
}
/**
*
* @param payload
@ -46,8 +55,7 @@ export default class OrganizationUnitService {
* @returns OrganizationUnit
*/
public static getOrganizationUnit(id: string) {
let _url = '/api/identity/organization-units/'
_url += '?id=' + id
const _url = '/api/identity/organization-units/' + id
return ApiService.Get<OrganizationUnit>(_url, serviceUrl)
}
@ -56,8 +64,8 @@ export default class OrganizationUnitService {
* @param payload OrganizationUnitUpdate
* @returns OrganizationUnit
*/
public static updateOrganizationUnit(payload: OrganizationUnitUpdate) {
const _url = '/api/identity/organization-units'
public static updateOrganizationUnit(id: string, payload: OrganizationUnitUpdate) {
const _url = '/api/identity/organization-units/' + id
return ApiService.Put<OrganizationUnit>(_url, payload, serviceUrl)
}
@ -110,72 +118,89 @@ export default class OrganizationUnitService {
}
/**
*
* @param payload OrganizationUnitGetRoleByPaged
* @returns RoleDto
*
* @param id
* @param payload UsersGetPagedDto
* @returns User
*/
public static organizationUnitGetRoles(payload: OrganizationUnitGetRoleByPaged) {
let _url = '/api/identity/organization-units/management-roles'
_url += '?id=' + payload.id
_url += '&filter=' + payload.filter
public static getUnaddedUsers(id: string, payload: UsersGetPagedDto) {
let _url = '/api/identity/organization-units/' + id
_url += '/unadded-users'
_url += '?filter=' + payload.filter
_url += '&sorting=' + payload.sorting
_url += '&skipCount=' + payload.skipCount
// _url += '&skipCount=' + pagerFormat(payload.skipCount)
_url += '&maxResultCount=' + payload.maxResultCount
return ApiService.Get<PagedResultDto<RoleDto>>(_url, serviceUrl)
return ApiService.Get<PagedResultDto<User>>(_url, serviceUrl)
}
/**
*
* @param payload OrganizationUnitAddRole
*
* @param id
* @param payload UsersGetPagedDto
* @returns User
*/
public static organizationUnitAddRole(payload: OrganizationUnitAddRole) {
const _url = '/api/identity/organization-units/management-roles'
return ApiService.Post<void>(_url, payload, serviceUrl)
public static getUsers(id: string, payload: UsersGetPagedDto) {
let _url = '/api/identity/organization-units/' + id
_url += '/users'
_url += '?filter=' + payload.filter
_url += '&sorting=' + payload.sorting
_url += '&skipCount=' + payload.skipCount
_url += '&maxResultCount=' + payload.maxResultCount
return ApiService.Get<PagedResultDto<User>>(_url, serviceUrl)
}
/**
*
* @param id
* @param roleId
*
* @param id
* @param payload
*/
public static organizationUnitRemoveRole(id: string, roleId: string) {
let _url = '/api/identity/organization-units/management-roles'
_url += '?id=' + id
_url += '&roleId=' + roleId
return ApiService.Delete(_url, serviceUrl)
public static addUsers(id: string, payload: OrganizationUnitAddUser) {
let _url = '/api/identity/organization-units/' + id
_url += '/users'
return ApiService.Post<void>(_url, payload, serviceUrl)
}
/**
*
* @param payload OrganizationUnitGetRoleByPaged
* @returns RoleDto
*
* @param id
* @param payload UsersGetPagedDto
* @returns User
*/
public static organizationUnitGetUsers(id: string) {
let _url = '/api/identity/organization-units/management-users'
_url += '?id=' + id
return ApiService.Get<ListResultDto<User>>(_url, serviceUrl)
public static getUnaddedRoles(id: string, payload: RoleGetPagedDto) {
let _url = '/api/identity/organization-units/' + id
_url += '/unadded-roles'
_url += '?filter=' + payload.filter
_url += '&sorting=' + payload.sorting
_url += '&skipCount=' + payload.skipCount
_url += '&maxResultCount=' + payload.maxResultCount
return ApiService.Get<PagedResultDto<RoleDto>>(_url, serviceUrl)
}
/**
*
* @param payload OrganizationUnitAddUser
*
* @param id
* @param payload UsersGetPagedDto
* @returns User
*/
public static organizationUnitAddUser(payload: OrganizationUnitAddUser) {
const _url = '/api/identity/organization-units/management-users'
return ApiService.Post<void>(_url, payload, serviceUrl)
public static getRoles(id: string, payload: RoleGetPagedDto) {
let _url = '/api/identity/organization-units/' + id
_url += '/roles'
_url += '?filter=' + payload.filter
_url += '&sorting=' + payload.sorting
_url += '&skipCount=' + payload.skipCount
_url += '&maxResultCount=' + payload.maxResultCount
return ApiService.Get<PagedResultDto<RoleDto>>(_url, serviceUrl)
}
/**
*
* @param id
* @param roleId
*
* @param id
* @param payload
*/
public static organizationUnitRemoveUser(id: string, userId: string) {
let _url = '/api/identity/organization-units/management-users'
_url += '?id=' + id
_url += '&userId=' + userId
return ApiService.Delete(_url, serviceUrl)
public static addRoles(id: string, payload: OrganizationUnitAddRole) {
let _url = '/api/identity/organization-units/' + id
_url += '/roles'
return ApiService.Post<void>(_url, payload, serviceUrl)
}
}
@ -197,14 +222,6 @@ export class OrganizationUnitGetByPaged extends PagedAndSortedResultRequestDto {
filter!: string
}
/** 组织机构角色分页查询对象 */
export class OrganizationUnitGetRoleByPaged extends PagedAndSortedResultRequestDto {
/** 主键标识 */
id!: string
/** 过滤字符 */
filter = ''
}
/** 组织机构创建对象 */
export class OrganizationUnitCreate {
/** 显示名称 */
@ -215,24 +232,44 @@ export class OrganizationUnitCreate {
/** 组织机构变更对象 */
export class OrganizationUnitUpdate {
/** 标识 */
id!: string
/** 显示名称 */
displayName!: string
}
/** 组织机构增加部门对象 */
export class OrganizationUnitAddRole {
/** 标识 */
id!: string
/** 部门标识 */
roleId!: string
/** 部门标识列表 */
roleIds = new Array<string>()
public isInOrganizationUnit(roleId: string) {
return this.roleIds.some(id => id === roleId)
}
public addRole(roleId: string) {
this.roleIds.push(roleId)
}
public removeRole(roleId: string) {
const index = this.roleIds.findIndex(id => id === roleId)
this.roleIds.splice(index, 1)
}
}
/** 组织机构增加用户对象 */
export class OrganizationUnitAddUser {
/** 标识 */
id!: string
/** 用户标识 */
userId!: string
/** 用户标识列表 */
userIds = new Array<string>()
public isInOrganizationUnit(userId: string) {
return this.userIds.some(id => id === userId)
}
public addUser(userId: string) {
this.userIds.push(userId)
}
public removeUser(userId: string) {
const index = this.userIds.findIndex(id => id === userId)
this.userIds.splice(index, 1)
}
}

15
vueJs/src/api/roles.ts

@ -26,10 +26,15 @@ export default class RoleService {
}
public static getRoleOrganizationUnits(roleId: string) {
const _url = '/api/identity/roles/organization-units/' + roleId
const _url = '/api/identity/roles/' + roleId + '/organization-units'
return ApiService.Get<ListResultDto<OrganizationUnit>>(_url, IdentityServiceUrl)
}
public static removeOrganizationUnits(roleId: string, ouId: string) {
const _url = '/api/identity/roles/' + roleId + '/organization-units/' + ouId
return ApiService.Delete(_url, IdentityServiceUrl)
}
public static changeRoleOrganizationUnits(roleId: string, payload: ChangeRoleOrganizationUnitDto) {
const _url = '/api/identity/roles/organization-units/' + roleId
return ApiService.Put<void>(_url, payload, IdentityServiceUrl)
@ -52,22 +57,22 @@ export default class RoleService {
}
public static getRoleClaims(roleId: string) {
const _url = '/api/identity/roles/claims/' + roleId
const _url = '/api/identity/roles/' + roleId + '/claims'
return ApiService.Get<ListResultDto<RoleClaim>>(_url, IdentityServiceUrl)
}
public static addRoleClaim(roleId: string, payload: RoleClaimCreateOrUpdate) {
const _url = '/api/identity/roles/claims/' + roleId
const _url = '/api/identity/roles/' + roleId + '/claims'
return ApiService.Post<void>(_url, payload, IdentityServiceUrl)
}
public static updateRoleClaim(roleId: string, payload: RoleClaimCreateOrUpdate) {
const _url = '/api/identity/roles/claims/' + roleId
const _url = '/api/identity/roles/' + roleId + '/claims'
return ApiService.Put<void>(_url, payload, IdentityServiceUrl)
}
public static deleteRoleClaim(roleId: string, payload: RoleClaimDelete) {
let _url = '/api/identity/roles/claims/' + roleId
let _url = '/api/identity/roles/' + roleId + '/claims'
_url += '?claimType=' + payload.claimType
_url += '&claimValue=' + payload.claimValue
return ApiService.Delete(_url, IdentityServiceUrl)

39
vueJs/src/api/users.ts

@ -57,34 +57,44 @@ export default class UserApiService {
}
public static getUserClaims(userId: string) {
const _url = '/api/identity/users/claims/' + userId
const _url = '/api/identity/users/' + userId + '/claims'
return ApiService.Get<ListResultDto<UserClaim>>(_url, IdentityServiceUrl)
}
public static addUserClaim(userId: string, payload: UserClaimCreateOrUpdate) {
const _url = '/api/identity/users/claims/' + userId
const _url = '/api/identity/users/' + userId + '/claims'
return ApiService.Post<void>(_url, payload, IdentityServiceUrl)
}
public static updateUserClaim(userId: string, payload: UserClaimCreateOrUpdate) {
const _url = '/api/identity/users/claims/' + userId
const _url = '/api/identity/users/' + userId + '/claims'
return ApiService.Put<void>(_url, payload, IdentityServiceUrl)
}
public static deleteUserClaim(userId: string, payload: UserClaimDelete) {
let _url = '/api/identity/users/claims/' + userId
let _url = '/api/identity/users/' + userId + '/claims'
_url += '?claimType=' + payload.claimType
_url += '&claimValue=' + payload.claimValue
return ApiService.Delete(_url, IdentityServiceUrl)
}
public static getUserOrganizationUnits(userId: string) {
const _url = '/api/identity/users/organization-units/' + userId
return ApiService.Get<ListResultDto<OrganizationUnit>>(_url, IdentityServiceUrl)
public static getOrganizationUnits(userId: string, payload: UsersGetPagedDto) {
let _url = '/api/identity/users/' + userId
_url += '/organization-units'
_url += '?filter=' + payload.filter
_url += '&sorting=' + payload.sorting
_url += '&skipCount=' + payload.skipCount
_url += '&maxResultCount=' + payload.maxResultCount
return ApiService.Get<PagedResultDto<OrganizationUnit>>(_url, IdentityServiceUrl)
}
public static changeUserOrganizationUnits(roleId: string, payload: ChangeUserOrganizationUnitDto) {
const _url = '/api/identity/users/organization-units/' + roleId
public static removeOrganizationUnit(userId: string, ouId: string) {
const _url = '/api/identity/users/' + userId + '/organization-units/' + ouId
return ApiService.Delete(_url, IdentityServiceUrl)
}
public static changeUserOrganizationUnits(userId: string, payload: ChangeUserOrganizationUnitDto) {
const _url = '/api/identity/users/organization-units/' + userId
return ApiService.Put<void>(_url, payload, IdentityServiceUrl)
}
@ -233,7 +243,7 @@ export default class UserApiService {
/** 用户列表查询对象 */
export class UsersGetPagedDto extends PagedAndSortedResultRequestDto {
/** 查询过滤字段 */
filter: string | undefined
filter = ''
constructor() {
super()
@ -441,6 +451,15 @@ export interface IUserRole {
export class ChangeUserOrganizationUnitDto {
organizationUnitIds = new Array<string>()
public addOrganizationUnit(id: string) {
this.organizationUnitIds.push(id)
}
public removeOrganizationUnit(id: string) {
const index = this.organizationUnitIds.findIndex(ouId => ouId === id)
this.organizationUnitIds.splice(index, 1)
}
}
export class UserClaimCreateOrUpdate {

60
vueJs/src/components/OrganizationUnitTree/index.vue

@ -17,18 +17,22 @@
import { Component, Prop, Watch, Vue } from 'vue-property-decorator'
import { ListResultDto } from '@/api/types'
import OrganizationUnitService, { OrganizationUnit } from '@/api/organizationunit'
import itemVue from '../MessageView/item.vue'
class OrganizationUnitTree {
class OrganizationUnitItem {
id?: string
parentId?: string
code!: string
displayName!: string
isLeaf!: boolean
children?: OrganizationUnitTree[]
children = new Array<OrganizationUnitItem>()
constructor() {
this.isLeaf = false
this.children = new Array<OrganizationUnitTree>()
}
public createChildren(chidlren: OrganizationUnitItem) {
this.children.push(chidlren)
}
}
@ -44,10 +48,11 @@ class OrganizationUnitTree {
}
}
})
export default class extends Vue {
export default class OrganizationUnitTree extends Vue {
@Prop({ default: () => { return new Array<string>() } })
private checkedOrganizationUnits!: string[]
private organizationUnits = new Array<OrganizationUnitItem>()
private selectionOrganizationUnits = new Array<string>()
@Watch('checkedOrganizationUnits')
@ -56,6 +61,45 @@ export default class extends Vue {
elTree.setCheckedKeys(this.checkedOrganizationUnits)
}
mounted() {
this.handleGetOrganizationUnits()
}
private handleGetOrganizationUnits() {
this.organizationUnits = new Array<OrganizationUnitItem>()
OrganizationUnitService.getAllOrganizationUnits()
.then(res => {
const rootOrganizationUnits = res.items.filter(item => !item.parentId)
rootOrganizationUnits.forEach(item => {
const organizationUnit = new OrganizationUnitItem()
organizationUnit.id = item.id
organizationUnit.parentId = item.parentId
organizationUnit.code = item.code
organizationUnit.displayName = item.displayName
const subOrganizationUnits = rootOrganizationUnits.filter(p => p.parentId === item.id)
this.generateOrganizationUnit(organizationUnit, subOrganizationUnits)
this.organizationUnits.push(organizationUnit)
})
})
}
private generateOrganizationUnit(organizationUnit: OrganizationUnitItem, organizationUnits: OrganizationUnit[]) {
const subOrganizationUnit = organizationUnits.filter(ou => ou.parentId !== organizationUnit.id)
organizationUnits = organizationUnits.filter(ou => ou.parentId === organizationUnit.id)
organizationUnits.forEach(ou => {
const children = new OrganizationUnitItem()
children.id = ou.id
children.parentId = ou.parentId
children.code = ou.code
children.displayName = ou.displayName
const itemSubOrganizationUnit = subOrganizationUnit.filter(sou => sou.parentId === ou.id)
if (itemSubOrganizationUnit.length > 0) {
this.generateOrganizationUnit(children, itemSubOrganizationUnit)
}
organizationUnit.createChildren(children)
})
}
private onOrganizationUnitsChecked(data: any, treeCheckData: any) {
const checkKeys = treeCheckData.checkedKeys
const valiadOuId = checkKeys.findIndex((key: string) => key === undefined)
@ -67,7 +111,7 @@ export default class extends Vue {
private async loadOrganizationUnit(node: any, resolve: any) {
if (node.level === 0) {
const rootOrganizationUnit = new OrganizationUnitTree()
const rootOrganizationUnit = new OrganizationUnitItem()
rootOrganizationUnit.id = undefined
rootOrganizationUnit.parentId = undefined
rootOrganizationUnit.code = 'root'
@ -83,15 +127,15 @@ export default class extends Vue {
organizationUnitItems = await OrganizationUnitService.findOrganizationUnitChildren(node.data.id, undefined)
}
if (organizationUnitItems.items.length !== 0) {
const organizationUnits = new Array<OrganizationUnitTree>()
const organizationUnits = new Array<OrganizationUnitItem>()
organizationUnitItems.items.map((item) => {
const organizationUnit = new OrganizationUnitTree()
const organizationUnit = new OrganizationUnitItem()
organizationUnit.id = item.id
organizationUnit.parentId = item.parentId
organizationUnit.code = item.code
organizationUnit.displayName = item.displayName
organizationUnits.push(organizationUnit)
const children = node.data.children as OrganizationUnitTree[]
const children = node.data.children as OrganizationUnitItem[]
if (!children.every(x => x.id === item.id)) {
children.push(organizationUnit)
}

1
vueJs/src/components/PermissionForm/index.vue

@ -122,6 +122,7 @@ export class PermissionItem {
public setGrant(grant: boolean) {
this.isGrant = grant
// TODO: bug ,
if (this.parent) {
this.parent.setGrant(grant)
}

4
vueJs/src/mixins/DataListMiXin.ts

@ -59,6 +59,7 @@ export default class DataListMiXin extends Vue {
.then(res => {
this.dataList = res.items
this.dataTotal = res.totalCount
this.onDataLoadCompleted()
})
.finally(() => {
this.dataLoading = false
@ -108,6 +109,9 @@ export default class DataListMiXin extends Vue {
this.refreshPagedData()
}
/** 数据加载完毕事件 */
protected onDataLoadCompleted() {}
/**
*
* @param column

19
vueJs/src/views/admin/claim-type/index.vue

@ -20,9 +20,9 @@
{{ $t('global.searchList') }}
</el-button>
<el-button
v-permission="['AbpIdentity.IdentityClaimTypes.Create']"
class="filter-item"
type="primary"
:disabled="!checkPermission(['AbpIdentity.IdentityClaimTypes.Create'])"
@click="handleCreateClaimType"
>
{{ $t('AbpIdentity.AddClaim') }}
@ -112,6 +112,7 @@
</template>
</el-table-column>
<el-table-column
v-if="checkPermission(['AbpIdentity.IdentityClaimTypes.Update', 'AbpIdentity.IdentityClaimTypes.Delete'])"
:label="$t('operaActions')"
align="center"
width="260px"
@ -119,7 +120,7 @@
>
<template slot-scope="{row}">
<el-button
:disabled="!allowedEditClaim(row)"
:disabled="!row.isStatic"
size="mini"
type="primary"
@click="handleUpdateClaimType(row)"
@ -127,7 +128,7 @@
{{ $t('AbpIdentity.UpdateClaim') }}
</el-button>
<el-button
:disabled="!allowedDeleteClaim(row)"
:disabled="!row.isStatic"
size="mini"
type="danger"
@click="handleDeleteClaimType(row)"
@ -196,18 +197,6 @@ export default class ClaimType extends mixins(DataListMiXin) {
this.refreshPagedData()
}
get allowedEditClaim() {
return (claimType: IdentityClaimType) => {
return !claimType.isStatic && checkPermission(['AbpIdentity.IdentityClaimTypes.Update'])
}
}
get allowedDeleteClaim() {
return (claimType: IdentityClaimType) => {
return !claimType.isStatic && checkPermission(['AbpIdentity.IdentityClaimTypes.Delete'])
}
}
protected processDataFilter() {
this.dataFilter.skipCount = abpPagerFormat(this.currentPage, this.pageSize)
}

146
vueJs/src/views/admin/organization-unit/components/CreateOrUpdateOrganizationUnit.vue

@ -0,0 +1,146 @@
<template>
<el-dialog
v-el-draggable-dialog
width="400px"
:visible="showDialog"
:title="title"
custom-class="modal-form"
:show-close="false"
:close-on-click-modal="false"
:close-on-press-escape="false"
@close="onFormClosed"
>
<el-form
ref="formOrganizationUnit"
:model="organizationUnit"
>
<el-form-item
prop="displayName"
:label="$t(('AbpIdentity.OrganizationUnit:DisplayName'))"
:rules="{
required: true,
message: $t('pleaseInputBy', {key: $t('AbpIdentity.OrganizationUnit:DisplayName')}),
trigger: 'blur'
}"
>
<el-input
v-model="organizationUnit.displayName"
/>
</el-form-item>
<el-form-item>
<el-button
class="cancel"
type="info"
@click="onFormClosed"
>
{{ $t('AbpIdentityServer.Cancel') }}
</el-button>
<el-button
class="confirm"
type="primary"
icon="el-icon-check"
@click="onSave"
>
{{ $t('AbpIdentityServer.Save') }}
</el-button>
</el-form-item>
</el-form>
</el-dialog>
</template>
<script lang="ts">
import { Component, Vue, Prop, Watch } from 'vue-property-decorator'
import { Form } from 'element-ui'
import OrganizationUnitService, {
OrganizationUnit,
OrganizationUnitCreate,
OrganizationUnitUpdate
} from '@/api/organizationunit'
@Component({
name: 'CreateOrUpdateOrganizationUnit'
})
export default class CreateOrUpdateOrganizationUnit extends Vue {
@Prop({ default: false })
private showDialog!: boolean
@Prop({ default: '' })
private title!: string
@Prop({ default: false })
private isEdit!: boolean
@Prop({ default: null })
private organizationUnitId?: string
@Prop({ default: () => { console.log('onOrganizationUnitChanged') } })
private onOrganizationUnitChanged!: Function
private organizationUnit = new OrganizationUnit()
@Watch('showDialog')
private onShowDialogChanged() {
this.handleGetOrganizationUnit()
}
private handleGetOrganizationUnit() {
if (this.showDialog && this.isEdit && this.organizationUnitId) {
OrganizationUnitService
.getOrganizationUnit(this.organizationUnitId)
.then(ou => {
this.organizationUnit = ou
})
}
}
private onSave() {
const formOrganizationUnit = this.$refs.formOrganizationUnit as Form
formOrganizationUnit
.validate(valid => {
if (valid) {
if (this.isEdit) {
const updateOu = new OrganizationUnitUpdate()
updateOu.displayName = this.organizationUnit.displayName
OrganizationUnitService
.updateOrganizationUnit(this.organizationUnit.id, updateOu)
.then(ou => {
this.onOrganizationUnitChanged(ou)
this.onFormClosed()
})
} else {
const createOu = new OrganizationUnitCreate()
createOu.displayName = this.organizationUnit.displayName
createOu.parentId = this.organizationUnitId
OrganizationUnitService
.createOrganizationUnit(createOu)
.then(ou => {
this.onOrganizationUnitChanged(ou)
this.onFormClosed()
})
}
}
})
}
private onFormClosed() {
const formOrganizationUnit = this.$refs.formOrganizationUnit as Form
formOrganizationUnit.resetFields()
this.$emit('closed')
}
}
</script>
<style scoped>
.confirm {
position: absolute;
right: 10px;
width:100px;
}
.cancel {
position: absolute;
right: 120px;
width:100px;
}
</style>

211
vueJs/src/views/admin/organization-unit/components/EditOrganizationUint.vue

@ -1,211 +0,0 @@
<template>
<div>
<el-card class="box-card">
<div
slot="header"
class="clearfix"
>
<span>组织机构</span>
</div>
<div>
<el-tree
ref="organizationUnitTree"
node-key="id"
:props="organizationProps"
:load="loadOrganizationUnit"
lazy
draggable
highlight-current
:allow-drag="handleAllowDrag"
:allow-drop="handleAllowDrop"
@node-drop="handleNodeDroped"
@node-click="handleNodeClick"
>
<span
slot-scope="{node, data}"
class="custom-tree-node"
>
<span>{{ node.label }}</span>
<el-dropdown @command="handleChangeOrganizationUint">
<span class="el-dropdown-link">
操作方法
<i class="el-icon-arrow-down el-icon--right" />
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{key: 'append', node: node, data: data}">新增机构</el-dropdown-item>
<el-dropdown-item :command="{key: 'remove', node: node, data: data}">删除机构</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</span>
</el-tree>
</div>
</el-card>
</div>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
import { ListResultDto } from '@/api/types'
import OrganizationUnitService, { OrganizationUnitCreate, OrganizationUnit } from '@/api/organizationunit'
class OrganizationUnitTree {
id?: string
parentId?: string
code!: string
displayName!: string
isLeaf!: boolean
children?: OrganizationUnitTree[]
constructor() {
this.isLeaf = false
this.children = new Array<OrganizationUnitTree>()
}
}
@Component({
name: 'EditOrganizationUint',
data() {
return {
organizationProps: {
label: 'displayName',
isLeaf: 'isLeaf',
children: 'children'
}
}
}
})
export default class extends Vue {
private showUserReferenceDialog = false
private async loadOrganizationUnit(node: any, resolve: any) {
if (node.level === 0) {
const rootOrganizationUnit = new OrganizationUnitTree()
rootOrganizationUnit.id = undefined
rootOrganizationUnit.parentId = undefined
rootOrganizationUnit.code = 'root'
rootOrganizationUnit.displayName = '组织机构'
return resolve([rootOrganizationUnit])
}
let organizationUnitItems = new ListResultDto<OrganizationUnit>()
if (node.data.id === undefined) {
//
organizationUnitItems = await OrganizationUnitService.getRootOrganizationUnits()
} else {
//
organizationUnitItems = await OrganizationUnitService.findOrganizationUnitChildren(node.data.id, undefined)
}
if (organizationUnitItems.items.length !== 0) {
const organizationUnits = new Array<OrganizationUnitTree>()
organizationUnitItems.items.map((item) => {
const organizationUnit = new OrganizationUnitTree()
organizationUnit.id = item.id
organizationUnit.parentId = item.parentId
organizationUnit.code = item.code
organizationUnit.displayName = item.displayName
organizationUnits.push(organizationUnit)
const children = node.data.children as OrganizationUnitTree[]
if (!children.every(x => x.id === item.id)) {
children.push(organizationUnit)
}
})
return resolve(organizationUnits)
}
return resolve([])
}
private handleChangeOrganizationUint(command: { key: string, node: any, data: any}) {
switch (command.key) {
case 'append' :
this.handleAppendOrganizationUnit(command.node, command.data)
break
case 'remove' :
this.handleRemoveOrganizationUnit(command.node, command.data)
break
default: break
}
}
private handleAppendOrganizationUnit(node: any, data: any) {
this.$prompt('请输入组织机构名称',
'新增组织机构', {
showInput: true,
inputValidator: (val) => {
return !(!val || val.length === 0)
},
inputErrorMessage: '组织机构名称不能为空',
inputPlaceholder: '请输入机构名称'
}).then((val: any) => {
const organizationUnit = new OrganizationUnitCreate()
organizationUnit.parentId = data.id
organizationUnit.displayName = val.value
OrganizationUnitService.createOrganizationUnit(organizationUnit).then(res => {
const organizationUnit = new OrganizationUnitTree()
organizationUnit.id = res.id
organizationUnit.parentId = res.parentId
organizationUnit.code = res.code
organizationUnit.displayName = res.displayName
data.children.push(organizationUnit)
})
}).catch(_ => _)
}
private handleRemoveOrganizationUnit(node: any, data: any) {
this.$confirm('删除组织机构',
'是否要删除组织机构 ' + data.displayName, {
callback: (action) => {
if (action === 'confirm') {
OrganizationUnitService.deleteOrganizationUnit(data.id).then(() => {
this.$message.success('组织机构 ' + data.displayName + ' 已删除')
const parent = node.parent
const children = parent.data.children as OrganizationUnitTree[]
const index = children.findIndex(d => d.id === data.id)
children.splice(index, 1)
parent.childNodes.splice(index, 1)
})
}
}
})
}
private handleAllowDrag(draggingNode: any) {
return draggingNode.data.parentId !== undefined && draggingNode.data.parentId !== null
}
private handleAllowDrop(draggingNode: any, dropNode: any) {
return dropNode.code !== 'root'
}
private handleNodeDroped(draggingNode: any, dropNode: any) {
OrganizationUnitService.moveOrganizationUnit(draggingNode.data.id, dropNode.data.id).then(res => {
const organizationUnit = new OrganizationUnitTree()
organizationUnit.id = res.id
organizationUnit.parentId = res.parentId
organizationUnit.code = res.code
organizationUnit.displayName = res.displayName
})
}
private handleNodeClick(data: any) {
if (data.id !== undefined) {
this.$emit('onOrganizationUnitChecked', data.id)
}
}
}
</script>
<style lang="scss" scoped>
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
.el-dropdown-link {
cursor: pointer;
color: #409EFF;
}
.el-icon-arrow-down {
font-size: 12px;
}
</style>

305
vueJs/src/views/admin/organization-unit/components/OrganizationUnitTree.vue

@ -0,0 +1,305 @@
<template>
<div>
<el-card class="box-card">
<div
slot="header"
class="clearfix"
>
<span>{{ $t('AbpIdentity.OrganizationUnit:Tree') }}</span>
<el-button
style="float: right;"
type="primary"
icon="ivu-icon ivu-icon-md-add"
@click="handleCreateRootOrganizationUnit(null)"
>
{{ $t('AbpIdentity.OrganizationUnit:AddRoot') }}
</el-button>
</div>
<div>
<el-tree
ref="organizationUnitTree"
node-key="id"
:props="organizationProps"
:data="organizationUnits"
draggable
highlight-current
default-expand-all
:expand-on-click-node="false"
icon-class="el-icon-arrow-right"
:allow-drag="handleAllowDrag"
:allow-drop="handleAllowDrop"
@node-drop="handleNodeDroped"
@node-click="handleNodeClick"
@node-contextmenu="onContextMenu"
/>
</div>
</el-card>
<user-reference
:organization-unit-id="editOrganizationUnitId"
:show-dialog="showUserReferenceDialog"
@closed="() => {
showUserReferenceDialog = false
}"
/>
<role-reference
:organization-unit-id="editOrganizationUnitId"
:show-dialog="showRoleReferenceDialog"
@closed="() => {
showRoleReferenceDialog = false
}"
/>
<create-or-update-organization-unit
:is-edit="isEditOrganizationUnit"
:title="editOrganizationUnitTitle"
:show-dialog="showOrganizationUnitDialog"
:organization-unit-id="editOrganizationUnitId"
:on-organization-unit-changed="onOrganizationUnitChanged"
@closed="onOrganizationUnitDialogClosed"
/>
</div>
</template>
<script lang="ts">
import { checkPermission } from '@/utils/permission'
import { Component, Vue } from 'vue-property-decorator'
import OrganizationUnitService, { OrganizationUnit } from '@/api/organizationunit'
import { Tree } from 'element-ui'
import UserReference from './UserReference.vue'
import RoleReference from './RoleReference.vue'
import CreateOrUpdateOrganizationUnit from './CreateOrUpdateOrganizationUnit.vue'
const $contextmenu = Vue.prototype.$contextmenu
class OrganizationUnitItem {
id!: string
parentId?: string
code!: string
displayName!: string
children = new Array<OrganizationUnitItem>()
constructor(
id: string,
code: string,
displayName: string,
parentId?: string
) {
this.id = id
this.code = code
this.displayName = displayName
this.parentId = parentId
}
public createChildren(chidlren: OrganizationUnitItem) {
this.children.push(chidlren)
}
}
@Component({
name: 'OrganizationUnitTree',
data() {
return {
organizationProps: {
label: 'displayName',
children: 'children'
}
}
},
components: {
UserReference,
RoleReference,
CreateOrUpdateOrganizationUnit
}
})
export default class OrganizationUnitTree extends Vue {
private showUserReferenceDialog = false
private showRoleReferenceDialog = false
private showOrganizationUnitDialog = false
private isEditOrganizationUnit = false
private editOrganizationUnitId = ''
private editOrganizationUnitTitle = ''
private onOrganizationUnitChanged = (ou: OrganizationUnitItem) => { console.log(ou) }
private organizationUnits = new Array<OrganizationUnitItem>()
private currentEditNode = {}
mounted() {
this.handleGetOrganizationUnits()
}
private handleGetOrganizationUnits() {
this.organizationUnits = new Array<OrganizationUnitItem>()
OrganizationUnitService.getAllOrganizationUnits()
.then(res => {
const rootOrganizationUnits = res.items.filter(item => !item.parentId)
rootOrganizationUnits.forEach(item => {
const organizationUnit = new OrganizationUnitItem(item.id, item.code, item.displayName, item.parentId)
const subOrganizationUnits = res.items.filter(p => p.code.startsWith(item.code))
this.generateOrganizationUnit(organizationUnit, subOrganizationUnits)
this.organizationUnits.push(organizationUnit)
})
})
}
private generateOrganizationUnit(organizationUnit: OrganizationUnitItem, organizationUnits: OrganizationUnit[]) {
const subOrganizationUnit = organizationUnits.filter(ou => ou.parentId !== organizationUnit.id)
organizationUnits = organizationUnits.filter(ou => ou.parentId === organizationUnit.id)
organizationUnits.forEach(ou => {
const children = new OrganizationUnitItem(ou.id, ou.code, ou.displayName, ou.parentId)
const itemSubOrganizationUnit = subOrganizationUnit.filter(sou => sou.parentId === ou.id)
if (itemSubOrganizationUnit.length > 0) {
this.generateOrganizationUnit(children, itemSubOrganizationUnit)
}
organizationUnit.createChildren(children)
})
}
private onContextMenu(event: any, ou: OrganizationUnitItem) {
const organizationUnitTree = this.$refs.organizationUnitTree as Tree
$contextmenu({
items: [
{
label: this.l('AbpIdentity.Edit'),
icon: 'el-icon-edit',
disabled: !checkPermission(['AbpIdentity.OrganizationUnits.Update']),
onClick: () => {
this.editOrganizationUnitTitle = this.l('AbpIdentity.Edit')
this.isEditOrganizationUnit = true
this.editOrganizationUnitId = ou.id
this.showOrganizationUnitDialog = true
this.onOrganizationUnitChanged = (res) => {
ou.displayName = res.displayName
}
}
},
{
label: this.l('AbpIdentity.OrganizationUnit:AddChildren'),
icon: 'ivu-icon ivu-icon-md-add',
disabled: !checkPermission(['AbpIdentity.OrganizationUnits.Create']),
onClick: () => {
this.handleCreateRootOrganizationUnit(ou)
}
},
{
label: this.$t('AbpIdentity.OrganizationUnit:AddMember'),
disabled: !checkPermission(['AbpIdentity.OrganizationUnits.ManageUsers']),
onClick: () => {
this.editOrganizationUnitId = ou.id
this.showUserReferenceDialog = true
}
},
{
label: this.$t('AbpIdentity.OrganizationUnit:AddRole'),
disabled: !checkPermission(['AbpIdentity.OrganizationUnits.ManageRoles']),
onClick: () => {
this.editOrganizationUnitId = ou.id
this.showRoleReferenceDialog = true
}
},
{
label: this.$t('AbpIdentity.Delete'),
icon: 'el-icon-delete',
disabled: !checkPermission(['AbpIdentity.OrganizationUnits.Delete']),
onClick: () => {
this.$confirm(this.l('AbpIdentity.OrganizationUnit:WillDelete', { 0: ou.displayName }),
this.l('AbpIdentity.AreYouSure'), {
callback: (action) => {
if (action === 'confirm') {
OrganizationUnitService
.deleteOrganizationUnit(ou.id)
.then(() => {
organizationUnitTree.remove(ou)
//
if (organizationUnitTree.data.length === 0) {
this.$emit('onOrganizationUnitChecked', '')
}
})
}
}
})
}
}
],
event,
customClass: 'context-menu',
zIndex: 2,
minWidth: 150
})
}
private onOrganizationUnitDialogClosed() {
this.showOrganizationUnitDialog = false
}
private handleCreateRootOrganizationUnit(ou: OrganizationUnitItem) {
const organizationUnitTree = this.$refs.organizationUnitTree as Tree
this.editOrganizationUnitTitle = this.l('AbpIdentity.OrganizationUnit:AddChildren')
this.isEditOrganizationUnit = false
if (ou) {
this.editOrganizationUnitId = ou.id
this.onOrganizationUnitChanged = (res) => {
organizationUnitTree.append(res, ou)
}
} else {
this.editOrganizationUnitId = ''
this.onOrganizationUnitChanged = (res) => {
if (this.organizationUnits.length > 0) {
const lastNode = organizationUnitTree.getNode(this.organizationUnits[this.organizationUnits.length - 1].id)
organizationUnitTree.insertAfter(res, lastNode)
} else {
this.handleGetOrganizationUnits()
}
}
}
this.showOrganizationUnitDialog = true
}
private handleAllowDrag(draggingNode: any) {
return draggingNode.data.parentId !== undefined && draggingNode.data.parentId !== null
}
private handleAllowDrop(draggingNode: any, dropNode: any) {
return dropNode.code !== 'root'
}
private handleNodeDroped(draggingNode: any, dropNode: any) {
OrganizationUnitService
.moveOrganizationUnit(draggingNode.data.id, dropNode.data.id)
.then(() => {
this.handleGetOrganizationUnits()
})
}
private handleNodeClick(data: any) {
if (data.id !== undefined) {
this.$emit('onOrganizationUnitChecked', data.id)
}
}
private l(name: string, values?: any[] | { [key: string]: any }) {
return this.$t(name, values).toString()
}
}
</script>
<style lang="scss" scoped>
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
.el-dropdown-link {
cursor: pointer;
color: #409EFF;
}
.el-icon-arrow-down {
font-size: 12px;
}
</style>

84
vueJs/src/views/admin/organization-unit/components/RoleOrganizationUint.vue

@ -9,7 +9,7 @@
:data="dataList"
>
<el-table-column
:label="$t('roles.name')"
:label="$t('AbpIdentity.DisplayName:RoleName')"
prop="name"
sortable
width="350px"
@ -23,36 +23,49 @@
v-if="row.isDefault"
type="success"
>
{{ $t('roles.isDefault') }}
{{ $t('AbpIdentity.DisplayName:IsDefault') }}
</el-tag>
</template>
</el-table-column>
<el-table-column
:label="$t('roles.isPublic')"
:label="$t('AbpIdentity.DisplayName:IsPublic')"
prop="isPublic"
width="200px"
align="center"
>
<template slot-scope="{row}">
<el-tag
:type="row.isPublic ? 'success' : 'warning'"
>
{{ row.isPublic ? $t('roles.isPublic') : $t('roles.isPrivate') }}
</el-tag>
<el-switch
v-model="row.isPublic"
disabled
/>
</template>
</el-table-column>
<el-table-column
:label="$t('roles.type')"
:label="$t('AbpIdentity.DisplayName:IsStatic')"
prop="isStatic"
width="200px"
align="center"
>
<template slot-scope="{row}">
<el-tag
:type="row.isStatic ? 'info' : 'success'"
<el-switch
v-model="row.isStatic"
disabled
/>
</template>
</el-table-column>
<el-table-column
v-if="checkPermission(['AbpIdentity.Roles.ManageOrganizationUnits'])"
:label="$t('AbpIdentity.Actions')"
align="center"
width="100px"
>
{{ row.isStatic ? $t('roles.system') : $t('roles.custom') }}
</el-tag>
<template slot-scope="{row}">
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDeleteRole(row)"
/>
</template>
</el-table-column>
</el-table>
@ -69,43 +82,70 @@
<script lang="ts">
import { abpPagerFormat } from '@/utils'
import { checkPermission } from '@/utils/permission'
import EventBusMiXin from '@/mixins/EventBusMiXin'
import DataListMiXin from '@/mixins/DataListMiXin'
import { Prop, Watch } from 'vue-property-decorator'
import Component, { mixins } from 'vue-class-component'
import OrganizationUnitService, { OrganizationUnitGetRoleByPaged } from '@/api/organizationunit'
import Pagination from '@/components/Pagination/index.vue'
import RoleApiService, { RoleGetPagedDto } from '@/api/roles'
import OrganizationUnitService from '@/api/organizationunit'
@Component({
name: 'RoleOrganizationUint',
components: {
Pagination
},
methods: {
checkPermission
}
})
export default class extends mixins(DataListMiXin) {
export default class extends mixins(DataListMiXin, EventBusMiXin) {
@Prop({ default: '' })
private organizationUnitId?: string
private organizationUnitId!: string
public dataFilter = new OrganizationUnitGetRoleByPaged()
public dataFilter = new RoleGetPagedDto()
@Watch('organizationUnitId', { immediate: true })
private onOrganizationUnitIdChanged() {
this.dataList = new Array<any>()
if (this.organizationUnitId) {
this.dataFilter.id = this.organizationUnitId
this.refreshPagedData()
}
mounted() {
this.subscribe('onRoleOrganizationUintChanged', this.refreshPagedData)
}
destroyed() {
this.unSubscribe('onRoleOrganizationUintChanged')
}
protected processDataFilter() {
this.dataFilter.skipCount = abpPagerFormat(this.currentPage, this.pageSize)
}
protected getPagedList(filter: any) {
protected getPagedList(dataFilter: any) {
if (this.organizationUnitId) {
return OrganizationUnitService.organizationUnitGetRoles(filter)
return OrganizationUnitService.getRoles(this.organizationUnitId, dataFilter)
}
return this.getEmptyPagedList()
}
private handleDeleteRole(row: any) {
this.$confirm(this.$t('AbpIdentity.OrganizationUnit:AreYouSureRemoveRole', { 0: row.name }).toString(),
this.$t('AbpIdentity.AreYouSure').toString(), {
callback: (action) => {
if (action === 'confirm') {
RoleApiService
.removeOrganizationUnits(row.id, this.organizationUnitId)
.then(() => {
this.refreshPagedData()
})
}
}
})
}
}
</script>

218
vueJs/src/views/admin/organization-unit/components/RoleReference.vue

@ -0,0 +1,218 @@
<template>
<el-dialog
v-el-draggable-dialog
width="800px"
:visible="showDialog"
:title="$t('AbpIdentity.OrganizationUnit:AddRole')"
custom-class="modal-form"
:show-close="false"
:close-on-click-modal="false"
:close-on-press-escape="false"
@close="onFormClosed"
>
<el-form
style="height: 500px;"
>
<el-table
ref="roleTable"
v-loading="dataLoading"
row-key="id"
:data="dataList"
border
fit
highlight-current-row
height="380px"
style="width: 100%;"
@sort-change="handleSortChange"
@selection-change="onSelectionChanged"
>
<el-table-column
type="selection"
width="50"
align="center"
reserve-selection
/>
<el-table-column
:label="$t('AbpIdentity.DisplayName:RoleName')"
prop="name"
sortable
width="350px"
min-width="350px"
align="center"
>
<template slot-scope="{row}">
<span>{{ row.name }}</span>
<el-tag
v-if="row.isDefault"
type="success"
>
{{ $t('AbpIdentity.DisplayName:IsDefault') }}
</el-tag>
</template>
</el-table-column>
<el-table-column
:label="$t('AbpIdentity.DisplayName:IsPublic')"
prop="isPublic"
width="200px"
align="center"
>
<template slot-scope="{row}">
<el-switch
v-model="row.isPublic"
disabled
/>
</template>
</el-table-column>
<el-table-column
:label="$t('AbpIdentity.DisplayName:IsStatic')"
prop="isStatic"
width="200px"
align="center"
>
<template slot-scope="{row}">
<el-switch
v-model="row.isStatic"
disabled
/>
</template>
</el-table-column>
</el-table>
<pagination
:total="dataTotal"
:page.sync="currentPage"
:limit.sync="pageSize"
@pagination="refreshPagedData"
/>
<el-form-item>
<el-button
class="cancel"
type="info"
@click="onFormClosed"
>
{{ $t('AbpIdentityServer.Cancel') }}
</el-button>
<el-button
class="confirm"
type="primary"
icon="el-icon-check"
@click="onSave"
>
{{ $t('AbpIdentityServer.Save') }}
</el-button>
</el-form-item>
</el-form>
</el-dialog>
</template>
<script lang="ts">
import EventBusMiXin from '@/mixins/EventBusMiXin'
import DataListMiXin from '@/mixins/DataListMiXin'
import Component, { mixins } from 'vue-class-component'
import { Prop, Watch } from 'vue-property-decorator'
import Pagination from '@/components/Pagination/index.vue'
import OrganizationUnitService, { OrganizationUnitAddRole } from '@/api/organizationunit'
import { RoleGetPagedDto } from '@/api/roles'
import { dateFormat, abpPagerFormat } from '@/utils'
import { Table } from 'element-ui'
@Component({
name: 'RoleReference',
components: {
Pagination
},
filters: {
dateTimeFilter(datetime: string) {
const date = new Date(datetime)
return dateFormat(date, 'YYYY-mm-dd HH:MM')
}
}
})
export default class extends mixins(DataListMiXin, EventBusMiXin) {
@Prop({ default: false })
private showDialog!: boolean
@Prop({ default: '' })
private organizationUnitId!: string
private ouAddRole = new OrganizationUnitAddRole()
public dataFilter = new RoleGetPagedDto()
@Watch('showDialog')
private onShowDialogChanged() {
if (this.showDialog) {
this.refreshPagedData()
}
}
protected processDataFilter() {
this.dataFilter.skipCount = abpPagerFormat(this.currentPage, this.pageSize)
}
protected getPagedList(dataFilter: any) {
return OrganizationUnitService.getUnaddedRoles(this.organizationUnitId, dataFilter)
}
private onSelectionChanged(selection: any[]) {
this.ouAddRole.roleIds.length = 0
selection.forEach(row => {
if (!this.ouAddRole.isInOrganizationUnit(row.id)) {
this.ouAddRole.addRole(row.id)
}
})
}
private onSave() {
if (this.ouAddRole.roleIds.length > 0) {
OrganizationUnitService
.addRoles(this.organizationUnitId, this.ouAddRole)
.then(() => {
this.ouAddRole.roleIds.length = 0
this.refreshPagedData()
// ,
this.trigger('onRoleOrganizationUintChanged')
})
}
}
private onFormClosed() {
if (this.ouAddRole.roleIds.length > 0) {
this.$confirm(this.$t('AbpIdentity.AreYouSureYouWantToCancelEditingWarningMessage').toString(),
this.$t('AbpIdentity.AreYouSure').toString(), {
callback: (action) => {
if (action === 'confirm') {
this.resetFields()
this.$emit('closed')
}
}
})
} else {
this.resetFields()
this.$emit('closed')
}
}
private resetFields() {
const roleTable = this.$refs.roleTable as Table
roleTable.clearSelection()
this.ouAddRole.roleIds.length = 0
}
}
</script>
<style scoped>
.confirm {
position: absolute;
right: 10px;
width:100px;
}
.cancel {
position: absolute;
right: 120px;
width:100px;
}
</style>

93
vueJs/src/views/admin/organization-unit/components/UserOrganizationUint.vue

@ -1,4 +1,5 @@
<template>
<div>
<el-table
row-key="id"
border
@ -8,7 +9,7 @@
:data="dataList"
>
<el-table-column
:label="$t('users.userName')"
:label="$t('AbpIdentity.DisplayName:UserName')"
prop="userName"
sortable
width="110px"
@ -19,7 +20,7 @@
</template>
</el-table-column>
<el-table-column
:label="$t('users.name')"
:label="$t('AbpIdentity.DisplayName:Name')"
prop="name"
width="110px"
align="center"
@ -29,7 +30,7 @@
</template>
</el-table-column>
<el-table-column
:label="$t('users.email')"
:label="$t('AbpIdentity.DisplayName:Email')"
prop="email"
sortable
min-width="180"
@ -40,7 +41,7 @@
</template>
</el-table-column>
<el-table-column
:label="$t('users.phoneNumber')"
:label="$t('AbpIdentity.DisplayName:PhoneNumber')"
prop="phoneNumber"
width="140px"
align="center"
@ -50,7 +51,7 @@
</template>
</el-table-column>
<el-table-column
:label="$t('users.lockoutEnd')"
:label="$t('AbpIdentity.LockoutEnd')"
prop="lockoutEnd"
sortable
width="140px"
@ -61,7 +62,7 @@
</template>
</el-table-column>
<el-table-column
:label="$t('users.creationTime')"
:label="$t('AbpIdentity.CreationTime')"
prop="creationTime"
sortable
width="140px"
@ -71,42 +72,104 @@
<span>{{ row.creationTime | dateTimeFilter }}</span>
</template>
</el-table-column>
<el-table-column
v-if="checkPermission(['AbpIdentity.Users.ManageOrganizationUnits'])"
:label="$t('AbpIdentity.Actions')"
align="center"
width="100px"
>
<template slot-scope="{row}">
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDeleteUser(row)"
/>
</template>
</el-table-column>
</el-table>
<pagination
v-show="dataTotal > 0"
:total="dataTotal"
:page.sync="currentPage"
:limit.sync="pageSize"
@pagination="refreshPagedData"
/>
</div>
</template>
<script lang="ts">
import EventBusMiXin from '@/mixins/EventBusMiXin'
import DataListMiXin from '@/mixins/DataListMiXin'
import Component, { mixins } from 'vue-class-component'
import { Prop, Watch } from 'vue-property-decorator'
import { dateFormat } from '@/utils'
import Pagination from '@/components/Pagination/index.vue'
import { checkPermission } from '@/utils/permission'
import { dateFormat, abpPagerFormat } from '@/utils'
import UserApiService, { UsersGetPagedDto } from '@/api/users'
import OrganizationUnitService from '@/api/organizationunit'
@Component({
name: 'UserOrganizationUint',
components: {
Pagination
},
filters: {
dateTimeFilter(datetime: string) {
const date = new Date(datetime)
return dateFormat(date, 'YYYY-mm-dd HH:MM')
}
},
methods: {
checkPermission
}
})
export default class extends mixins(DataListMiXin) {
export default class extends mixins(DataListMiXin, EventBusMiXin) {
@Prop({ default: '' })
private organizationUnitId?: string
private organizationUnitId!: string
public dataFilter = new UsersGetPagedDto()
@Watch('organizationUnitId', { immediate: true })
private onOrganizationUnitIdChanged() {
this.dataList = new Array<any>()
if (this.organizationUnitId) {
this.refreshData()
this.refreshPagedData()
}
mounted() {
this.subscribe('onUserOrganizationUintChanged', this.refreshPagedData)
}
destroyed() {
this.unSubscribe('onUserOrganizationUintChanged')
}
protected getList() {
protected processDataFilter() {
this.dataFilter.skipCount = abpPagerFormat(this.currentPage, this.pageSize)
}
protected getPagedList(dataFilter: any) {
if (this.organizationUnitId) {
return OrganizationUnitService.organizationUnitGetUsers(this.organizationUnitId)
return OrganizationUnitService.getUsers(this.organizationUnitId, dataFilter)
}
return this.getEmptyPagedList()
}
return this.getEmptyList()
private handleDeleteUser(row: any) {
this.$confirm(this.$t('AbpIdentity.OrganizationUnit:AreYouSureRemoveUser', { 0: row.userName }).toString(),
this.$t('AbpIdentity.AreYouSure').toString(), {
callback: (action) => {
if (action === 'confirm') {
UserApiService
.removeOrganizationUnit(row.id, this.organizationUnitId)
.then(() => {
this.refreshPagedData()
})
}
}
})
}
}
</script>

261
vueJs/src/views/admin/organization-unit/components/UserReference.vue

@ -0,0 +1,261 @@
<template>
<el-dialog
v-el-draggable-dialog
width="800px"
:visible="showDialog"
:title="$t('AbpIdentity.OrganizationUnit:AddMember')"
custom-class="modal-form"
:show-close="false"
:close-on-click-modal="false"
:close-on-press-escape="false"
@close="onFormClosed"
>
<el-form
ref="formUserReference"
:model="dataFilter"
style="height: 500px;"
>
<el-form-item
prop="filter"
label="搜索"
label-width="70%"
>
<el-input
v-model="dataFilter.filter"
@input="refreshPagedData"
/>
</el-form-item>
<el-table
ref="userTable"
v-loading="dataLoading"
row-key="id"
:data="dataList"
border
fit
highlight-current-row
height="330px"
style="width: 100%;"
@sort-change="handleSortChange"
@selection-change="onSelectionChanged"
>
<el-table-column
type="selection"
width="50"
align="center"
reserve-selection
/>
<el-table-column
:label="$t('AbpIdentity.DisplayName:UserName')"
prop="userName"
sortable
width="110px"
align="center"
>
<template slot-scope="{row}">
<span>{{ row.userName }}</span>
</template>
</el-table-column>
<el-table-column
:label="$t('AbpIdentity.DisplayName:Surname')"
prop="surname"
width="110px"
align="center"
>
<template slot-scope="{row}">
<span>{{ row.surname }}</span>
</template>
</el-table-column>
<el-table-column
:label="$t('AbpIdentity.DisplayName:Name')"
prop="name"
width="110px"
align="center"
>
<template slot-scope="{row}">
<span>{{ row.name }}</span>
</template>
</el-table-column>
<el-table-column
:label="$t('AbpIdentity.DisplayName:Email')"
prop="email"
sortable
min-width="180"
align="center"
>
<template slot-scope="{row}">
<span>{{ row.email }}</span>
</template>
</el-table-column>
<el-table-column
:label="$t('AbpIdentity.DisplayName:PhoneNumber')"
prop="phoneNumber"
width="140px"
align="center"
>
<template slot-scope="{row}">
<span>{{ row.phoneNumber }}</span>
</template>
</el-table-column>
<el-table-column
:label="$t('AbpIdentity.LockoutEnd')"
prop="lockoutEnd"
sortable
width="140px"
align="center"
>
<template slot-scope="{row}">
<span>{{ row.lockoutEnd | dateTimeFilter }}</span>
</template>
</el-table-column>
<el-table-column
:label="$t('AbpIdentity.CreationTime')"
prop="creationTime"
sortable
width="140px"
align="center"
>
<template slot-scope="{row}">
<span>{{ row.creationTime | dateTimeFilter }}</span>
</template>
</el-table-column>
</el-table>
<pagination
:total="dataTotal"
:page.sync="currentPage"
:limit.sync="pageSize"
@pagination="refreshPagedData"
/>
<el-form-item>
<el-button
class="cancel"
type="info"
@click="onFormClosed"
>
{{ $t('AbpIdentityServer.Cancel') }}
</el-button>
<el-button
class="confirm"
type="primary"
icon="el-icon-check"
@click="onSave"
>
{{ $t('AbpIdentityServer.Save') }}
</el-button>
</el-form-item>
</el-form>
</el-dialog>
</template>
<script lang="ts">
import EventBusMiXin from '@/mixins/EventBusMiXin'
import DataListMiXin from '@/mixins/DataListMiXin'
import Component, { mixins } from 'vue-class-component'
import { Prop, Watch } from 'vue-property-decorator'
import Pagination from '@/components/Pagination/index.vue'
import OrganizationUnitService, { OrganizationUnitAddUser } from '@/api/organizationunit'
import { UsersGetPagedDto } from '@/api/users'
import { dateFormat, abpPagerFormat } from '@/utils'
import { Form, Table } from 'element-ui'
@Component({
name: 'UserReference',
components: {
Pagination
},
filters: {
dateTimeFilter(datetime: string) {
const date = new Date(datetime)
return dateFormat(date, 'YYYY-mm-dd HH:MM')
}
}
})
export default class extends mixins(DataListMiXin, EventBusMiXin) {
@Prop({ default: false })
private showDialog!: boolean
@Prop({ default: '' })
private organizationUnitId!: string
private ouAddUser = new OrganizationUnitAddUser()
public dataFilter = new UsersGetPagedDto()
@Watch('showDialog')
private onShowDialogChanged() {
if (this.showDialog) {
this.refreshPagedData()
}
}
protected processDataFilter() {
this.dataFilter.skipCount = abpPagerFormat(this.currentPage, this.pageSize)
}
protected getPagedList(dataFilter: any) {
return OrganizationUnitService.getUnaddedUsers(this.organizationUnitId, dataFilter)
}
private onSelectionChanged(selection: any[]) {
this.ouAddUser.userIds.length = 0
selection.forEach(row => {
if (!this.ouAddUser.isInOrganizationUnit(row.id)) {
this.ouAddUser.addUser(row.id)
}
})
}
private onSave() {
if (this.ouAddUser.userIds.length > 0) {
OrganizationUnitService
.addUsers(this.organizationUnitId, this.ouAddUser)
.then(() => {
this.ouAddUser.userIds.length = 0
this.refreshPagedData()
// ,
this.trigger('onUserOrganizationUintChanged')
})
}
}
private onFormClosed() {
if (this.ouAddUser.userIds.length > 0) {
this.$confirm(this.$t('AbpIdentity.AreYouSureYouWantToCancelEditingWarningMessage').toString(),
this.$t('AbpIdentity.AreYouSure').toString(), {
callback: (action) => {
if (action === 'confirm') {
this.resetFields()
this.$emit('closed')
}
}
})
} else {
this.resetFields()
this.$emit('closed')
}
}
private resetFields() {
const formUserReference = this.$refs.formUserReference as Form
formUserReference.resetFields()
const userTable = this.$refs.userTable as Table
userTable.clearSelection()
this.ouAddUser.userIds.length = 0
}
}
</script>
<style scoped>
.confirm {
position: absolute;
right: 10px;
width:100px;
}
.cancel {
position: absolute;
right: 120px;
width:100px;
}
</style>

14
vueJs/src/views/admin/organization-unit/index.vue

@ -4,7 +4,7 @@
<el-col
:span="8"
>
<edit-organization-uint
<organization-unit-tree
@onOrganizationUnitChecked="handleOrganizationUnitChecked"
/>
</el-col>
@ -13,14 +13,14 @@
<div
slot="header"
>
<span>机构成员</span>
<span>{{ $t('AbpIdentity.OrganizationUnit:Members') }}</span>
</div>
<div>
<el-tabs>
<el-tab-pane label="角色列表">
<el-tab-pane :label="$t('AbpIdentity.Roles')">
<role-organization-uint :organization-unit-id="checkedOrganizationUintId" />
</el-tab-pane>
<el-tab-pane label="用户列表">
<el-tab-pane :label="$t('AbpIdentity.Users')">
<user-organization-uint :organization-unit-id="checkedOrganizationUintId" />
</el-tab-pane>
</el-tabs>
@ -33,20 +33,20 @@
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
import EditOrganizationUint from './components/EditOrganizationUint.vue'
import OrganizationUnitTree from './components/OrganizationUnitTree.vue'
import UserOrganizationUint from './components/UserOrganizationUint.vue'
import RoleOrganizationUint from './components/RoleOrganizationUint.vue'
@Component({
name: 'OrganizationUint',
components: {
EditOrganizationUint,
OrganizationUnitTree,
UserOrganizationUint,
RoleOrganizationUint
}
})
export default class extends Vue {
private checkedOrganizationUintId?: string = ''
private checkedOrganizationUintId = ''
private handleOrganizationUnitChecked(id: string) {
this.checkedOrganizationUintId = id

74
vueJs/src/views/admin/roles/components/RoleEditForm.vue

@ -14,49 +14,39 @@
ref="roleEditForm"
label-width="110px"
:model="role"
:rules="roleRules"
>
<el-tabs v-model="roleTabItem">
<el-tab-pane
:label="$t('roles.basic')"
name="basic"
>
<el-form-item
prop="name"
:label="$t('roles.name')"
:label="$t('AbpIdentity.DisplayName:RoleName')"
:rules="{
required: true,
message: $t('global.pleaseInputBy', {key: $t('AbpIdentity.DisplayName:RoleName')}),
trigger: 'blur'
}"
>
<el-input
v-model="role.name"
:disabled="role.isStatic"
:placeholder="$t('global.pleaseInputBy', {key: $t('roles.name')})"
:placeholder="$t('global.pleaseInputBy', {key: $t('AbpIdentity.DisplayName:RoleName')})"
/>
</el-form-item>
</el-tab-pane>
<el-tab-pane
:label="$t('roles.organizationUnits')"
name="organizationUnits"
>
<organization-unit-tree
:checked-organization-units="roleOrganizationUnits"
@onOrganizationUnitsChanged="onOrganizationUnitsChanged"
/>
</el-tab-pane>
</el-tabs>
<el-form-item>
<el-button
class="cancel"
style="width:100px"
type="info"
@click="onFormClosed(false)"
>
{{ $t('global.cancel') }}
{{ $t('AbpIdentity.Cancel') }}
</el-button>
<el-button
class="confirm"
type="primary"
style="width:100px"
icon="el-icon-check"
@click="onSave"
>
{{ $t('global.confirm') }}
{{ $t('AbpIdentity.Save') }}
</el-button>
</el-form-item>
</el-form>
@ -67,15 +57,10 @@
import { checkPermission } from '@/utils/permission'
import { Component, Prop, Watch, Vue } from 'vue-property-decorator'
import RoleService, { RoleDto, UpdateRoleDto } from '@/api/roles'
import OrganizationUnitTree from '@/components/OrganizationUnitTree/index.vue'
import { ChangeUserOrganizationUnitDto } from '@/api/users'
import { Form } from 'element-ui'
@Component({
name: 'RoleEditForm',
components: {
OrganizationUnitTree
},
methods: {
checkPermission
}
@ -87,19 +72,7 @@ export default class extends Vue {
@Prop({ default: false })
private showDialog!: boolean
private roleTabItem = 'basic'
private role = new RoleDto()
/** 是否加载用户权限 */
private rolePermissionLoaded = false
private roleOrganizationUnitChanged = false
private roleOrganizationUnits = new Array<string>()
private roleRules = {
name: [
{ required: true, message: this.l('global.pleaseInputBy', { key: this.l('roles.name') }), trigger: 'blur' },
{ min: 3, max: 20, message: this.l('global.charLengthRange', { min: 3, max: 20 }), trigger: 'blur' }
]
}
@Watch('showDialog', { immediate: true })
private onShowDialogChanged() {
@ -110,24 +83,10 @@ export default class extends Vue {
if (this.showDialog && this.roleId) {
RoleService.getRoleById(this.roleId).then(role => {
this.role = role
this.handledGetRoleOrganizationUnits(role.id)
})
this.roleOrganizationUnitChanged = false
this.roleOrganizationUnits = new Array<string>()
}
}
private handledGetRoleOrganizationUnits(roleId: string) {
RoleService.getRoleOrganizationUnits(roleId).then(res => {
this.roleOrganizationUnits = res.items.map(ou => ou.id)
})
}
private onOrganizationUnitsChanged(checkedKeys: string[]) {
this.roleOrganizationUnitChanged = true
this.roleOrganizationUnits = checkedKeys
}
private onSave() {
const roleEditForm = this.$refs.roleEditForm as any
roleEditForm.validate(async(valid: boolean) => {
@ -137,13 +96,8 @@ export default class extends Vue {
roleUpdateDto.isPublic = this.role.isPublic
roleUpdateDto.isDefault = this.role.isDefault
roleUpdateDto.concurrencyStamp = this.role.concurrencyStamp
if (this.roleOrganizationUnitChanged) {
const roleOrganizationUnitDto = new ChangeUserOrganizationUnitDto()
roleOrganizationUnitDto.organizationUnitIds = this.roleOrganizationUnits
await RoleService.changeRoleOrganizationUnits(this.roleId, roleOrganizationUnitDto)
}
RoleService.updateRole(this.roleId, roleUpdateDto).then(role => {
this.$message.success(this.l('roles.updateRoleSuccess', { name: role.name }))
RoleService.updateRole(this.roleId, roleUpdateDto).then(() => {
this.$message.success(this.l('global.successful'))
this.onFormClosed(true)
})
}
@ -151,8 +105,6 @@ export default class extends Vue {
}
private onFormClosed(changed: boolean) {
this.roleTabItem = 'basic'
this.rolePermissionLoaded = false
const roleEditForm = this.$refs.roleEditForm as Form
roleEditForm.resetFields()
this.$emit('closed', changed)

Loading…
Cancel
Save