Browse Source

Use a data dictionary instead of a **PlatformType**

pull/281/head
cKey 5 years ago
parent
commit
4b1e250f64
  1. 27
      aspnet-core/database/ApiGateway-Init.sql
  2. 2
      aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/IDataAppService.cs
  3. 7
      aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/GetLayoutListInput.cs
  4. 9
      aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateDto.cs
  5. 2
      aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateOrUpdateDto.cs
  6. 4
      aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutDto.cs
  7. 8
      aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/GetMenuInput.cs
  8. 4
      aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuDto.cs
  9. 7
      aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetAllInput.cs
  10. 7
      aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByRoleInput.cs
  11. 7
      aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByUserInput.cs
  12. 7
      aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetListInput.cs
  13. 17
      aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Datas/DataAppService.cs
  14. 13
      aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs
  15. 15
      aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Menus/MenuAppService.cs
  16. 7
      aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/en.json
  17. 7
      aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/zh-Hans.json
  18. 7
      aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/LayoutConsts.cs
  19. 10
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/Data.cs
  20. 8
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataDictionaryDataSeeder.cs
  21. 5
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItem.cs
  22. 1
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataDictionaryDataSeeder.cs
  23. 4
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/ILayoutRepository.cs
  24. 8
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/Layout.cs
  25. 12
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IMenuRepository.cs
  26. 8
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/Menu.cs
  27. 10
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/MenuManager.cs
  28. 2
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/IRouteDataSeeder.cs
  29. 6
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/RouteDataSeeder.cs
  30. 9
      aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContextModelBuilderExtensions.cs
  31. 8
      aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Layouts/EfCoreLayoutRepository.cs
  32. 24
      aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreMenuRepository.cs
  33. 7
      aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Datas/DataController.cs
  34. 12
      aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Menus/MenuController.cs
  35. 71
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/DataSeeder/ElementAdminDataSeedContributor.cs
  36. 291
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/DataSeeder/VbenAdminDataSeedContributor.cs
  37. 506
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantSynchronizer.cs
  38. 665
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20210621020117_Rename-Route-Field-PlantType-To-Framework.Designer.cs
  39. 81
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20210621020117_Rename-Route-Field-PlantType-To-Framework.cs
  40. 404
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/PlatformHttpApiHostMigrationsDbContextModelSnapshot.cs
  41. 5
      vueJs/src/api/data-dictionary.ts
  42. 38
      vueJs/src/api/layout.ts
  43. 21
      vueJs/src/api/menu.ts
  44. 3
      vueJs/src/store/modules/permission.ts
  45. 12
      vueJs/src/views/admin/data-dictionary/components/DataDictionaryTree.vue
  46. 36
      vueJs/src/views/admin/roles/components/ManageRoleMenuDialog.vue
  47. 2
      vueJs/src/views/admin/roles/index.vue
  48. 36
      vueJs/src/views/admin/users/components/ManageUserMenuDialog.vue
  49. 2
      vueJs/src/views/admin/users/index.vue
  50. 27
      vueJs/src/views/container/layouts/components/CreateOrUpdateLayoutDialog.vue
  51. 30
      vueJs/src/views/container/layouts/index.vue
  52. 29
      vueJs/src/views/container/menus/index.vue
  53. 6
      vueJs/vue.config.js

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

@ -11,7 +11,7 @@
Target Server Version : 80020
File Encoding : 65001
Date: 29/03/2021 21:22:25
Date: 21/06/2021 11:40:37
*/
SET NAMES utf8mb4;
@ -260,7 +260,7 @@ INSERT INTO `appapigatewayauthoptions` VALUES (201, 1376443586777047040, '', '')
INSERT INTO `appapigatewayauthoptions` VALUES (202, 1376467826087682048, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (203, 1376467990894469120, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (204, 1376468110214029312, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (220, 1406817452004757504, '', '');
-- ----------------------------
-- Table structure for appapigatewaybalanceroptions
-- ----------------------------
@ -445,6 +445,7 @@ INSERT INTO `appapigatewaybalanceroptions` VALUES (204, NULL, 137644358677704704
INSERT INTO `appapigatewaybalanceroptions` VALUES (205, NULL, 1376467826087682048, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (206, NULL, 1376467990894469120, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (207, NULL, 1376468110214029312, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (227, NULL, 1406817452004757504, '', '', 0);
-- ----------------------------
-- Table structure for appapigatewaycacheoptions
@ -625,6 +626,7 @@ INSERT INTO `appapigatewaycacheoptions` VALUES (201, 1376443586777047040, 0, '')
INSERT INTO `appapigatewaycacheoptions` VALUES (202, 1376467826087682048, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (203, 1376467990894469120, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (204, 1376468110214029312, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (220, 1406817452004757504, 0, '');
-- ----------------------------
-- Table structure for appapigatewaydiscovery
@ -902,6 +904,7 @@ INSERT INTO `appapigatewayhttpoptions` VALUES (204, NULL, 1376443586777047040, 0
INSERT INTO `appapigatewayhttpoptions` VALUES (205, NULL, 1376467826087682048, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (206, NULL, 1376467990894469120, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (207, NULL, 1376468110214029312, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (227, NULL, 1406817452004757504, 0, 0, 0, 0, 0);
-- ----------------------------
-- Table structure for appapigatewayqosoptions
@ -1087,6 +1090,7 @@ INSERT INTO `appapigatewayqosoptions` VALUES (204, NULL, 1376443586777047040, 50
INSERT INTO `appapigatewayqosoptions` VALUES (205, NULL, 1376467826087682048, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (206, NULL, 1376467990894469120, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (207, NULL, 1376468110214029312, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (227, NULL, 1406817452004757504, 50, 60000, 30000);
-- ----------------------------
-- Table structure for appapigatewayratelimitoptions
@ -1295,6 +1299,7 @@ INSERT INTO `appapigatewayratelimitrule` VALUES (201, 1376443586777047040, NULL,
INSERT INTO `appapigatewayratelimitrule` VALUES (202, 1376467826087682048, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (203, 1376467990894469120, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (204, 1376468110214029312, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (220, 1406817452004757504, NULL, '', 0, NULL, NULL, NULL);
-- ----------------------------
-- Table structure for appapigatewayreroute
@ -1501,6 +1506,7 @@ INSERT INTO `appapigatewayreroute` VALUES (208, '{}', '35f470892bf04571ab49efadb
INSERT INTO `appapigatewayreroute` VALUES (209, '{}', '72073c75c2fa4e1db162c7a74004558f', 1376467826087682048, '【身份认证服务】- 发送登录验证码', '/api/account/phone/send-signin-code', '', '', '/api/account/phone/send-signin-code', 'POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (210, '{}', 'e8e2f943dd56456f8f5dd957dd30e8b9', 1376467990894469120, '【身份认证服务】- 发送重置密码短信', '/api/account/phone/send-password-reset-code', '', '', '/api/account/phone/send-password-reset-code', 'POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (211, '{}', '89fd6b8a830d457f9d1d43263c7074b4', 1376468110214029312, '【身份认证服务】- 发送注册短信', '/api/account/phone/send-register-code', '', '', '/api/account/phone/send-register-code', 'POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (483, '{}', 'be25633a37d14ab4b94803698c528e4c', 1406817452004757504, '【平台服务】- 参照名称查询字典', '/api/platform/datas/by-name/{name}', '', '', '/api/platform/datas/by-name/{name}', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30025,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
-- ----------------------------
-- Table structure for appapigatewayroutegroup
@ -1711,6 +1717,7 @@ INSERT INTO `appapigatewaysecurityoptions` VALUES (201, 1376443586777047040, '',
INSERT INTO `appapigatewaysecurityoptions` VALUES (202, 1376467826087682048, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (203, 1376467990894469120, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (204, 1376468110214029312, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (220, 1406817452004757504, '', '');
-- ----------------------------
-- Table structure for cap.published
@ -1732,22 +1739,6 @@ CREATE TABLE `cap.published` (
-- ----------------------------
-- Records of cap.published
-- ----------------------------
INSERT INTO `cap.published` VALUES (1376442080048832512, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-abp-user-id\":\"bf289dbb-838e-a89b-c622-39f51dcc4f43\",\"cap-abp-client-id\":\"vue-admin-element\",\"cap-abp-tenant-id\":\"\",\"cap-msg-id\":\"1376442080048832512\",\"cap-corr-id\":\"1376442080048832512\",\"cap-corr-seq\":\"0\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2021/3/29 下午3:52:19 +08:00\"},\"Value\":{\"DateTime\":\"2021-03-29T15:52:19.593051+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2021-03-29 15:52:20', '2021-03-30 15:52:20', 'Succeeded');
INSERT INTO `cap.published` VALUES (1376442309972189184, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-abp-user-id\":\"bf289dbb-838e-a89b-c622-39f51dcc4f43\",\"cap-abp-client-id\":\"vue-admin-element\",\"cap-abp-tenant-id\":\"\",\"cap-msg-id\":\"1376442309972189184\",\"cap-corr-id\":\"1376442309972189184\",\"cap-corr-seq\":\"0\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2021/3/29 下午3:53:14 +08:00\"},\"Value\":{\"DateTime\":\"2021-03-29T15:53:14.4154232+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2021-03-29 15:53:14', '2021-03-30 15:53:14', 'Succeeded');
INSERT INTO `cap.published` VALUES (1376442440738004992, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-abp-user-id\":\"bf289dbb-838e-a89b-c622-39f51dcc4f43\",\"cap-abp-client-id\":\"vue-admin-element\",\"cap-abp-tenant-id\":\"\",\"cap-msg-id\":\"1376442440738004992\",\"cap-corr-id\":\"1376442440738004992\",\"cap-corr-seq\":\"0\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2021/3/29 下午3:53:45 +08:00\"},\"Value\":{\"DateTime\":\"2021-03-29T15:53:45.5924626+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2021-03-29 15:53:46', '2021-03-30 15:53:46', 'Succeeded');
INSERT INTO `cap.published` VALUES (1376442558023327744, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-abp-user-id\":\"bf289dbb-838e-a89b-c622-39f51dcc4f43\",\"cap-abp-client-id\":\"vue-admin-element\",\"cap-abp-tenant-id\":\"\",\"cap-msg-id\":\"1376442558023327744\",\"cap-corr-id\":\"1376442558023327744\",\"cap-corr-seq\":\"0\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2021/3/29 下午3:54:13 +08:00\"},\"Value\":{\"DateTime\":\"2021-03-29T15:54:13.5549538+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2021-03-29 15:54:14', '2021-03-30 15:54:14', 'Succeeded');
INSERT INTO `cap.published` VALUES (1376442689783193600, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-abp-user-id\":\"bf289dbb-838e-a89b-c622-39f51dcc4f43\",\"cap-abp-client-id\":\"vue-admin-element\",\"cap-abp-tenant-id\":\"\",\"cap-msg-id\":\"1376442689783193600\",\"cap-corr-id\":\"1376442689783193600\",\"cap-corr-seq\":\"0\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2021/3/29 下午3:54:44 +08:00\"},\"Value\":{\"DateTime\":\"2021-03-29T15:54:44.9636224+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2021-03-29 15:54:45', '2021-03-30 15:54:45', 'Succeeded');
INSERT INTO `cap.published` VALUES (1376442971116134400, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-abp-user-id\":\"bf289dbb-838e-a89b-c622-39f51dcc4f43\",\"cap-abp-client-id\":\"vue-admin-element\",\"cap-abp-tenant-id\":\"\",\"cap-msg-id\":\"1376442971116134400\",\"cap-corr-id\":\"1376442971116134400\",\"cap-corr-seq\":\"0\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2021/3/29 下午3:55:52 +08:00\"},\"Value\":{\"DateTime\":\"2021-03-29T15:55:52.0442879+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2021-03-29 15:55:52', '2021-03-30 15:55:52', 'Succeeded');
INSERT INTO `cap.published` VALUES (1376443123109322752, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-abp-user-id\":\"bf289dbb-838e-a89b-c622-39f51dcc4f43\",\"cap-abp-client-id\":\"vue-admin-element\",\"cap-abp-tenant-id\":\"\",\"cap-msg-id\":\"1376443123109322752\",\"cap-corr-id\":\"1376443123109322752\",\"cap-corr-seq\":\"0\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2021/3/29 下午3:56:28 +08:00\"},\"Value\":{\"DateTime\":\"2021-03-29T15:56:28.2817305+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2021-03-29 15:56:28', '2021-03-30 15:56:28', 'Succeeded');
INSERT INTO `cap.published` VALUES (1376443238922444800, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-abp-user-id\":\"bf289dbb-838e-a89b-c622-39f51dcc4f43\",\"cap-abp-client-id\":\"vue-admin-element\",\"cap-abp-tenant-id\":\"\",\"cap-msg-id\":\"1376443238922444800\",\"cap-corr-id\":\"1376443238922444800\",\"cap-corr-seq\":\"0\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2021/3/29 下午3:56:55 +08:00\"},\"Value\":{\"DateTime\":\"2021-03-29T15:56:55.8946549+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2021-03-29 15:56:56', '2021-03-30 15:56:56', 'Succeeded');
INSERT INTO `cap.published` VALUES (1376443392333307904, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-abp-user-id\":\"bf289dbb-838e-a89b-c622-39f51dcc4f43\",\"cap-abp-client-id\":\"vue-admin-element\",\"cap-abp-tenant-id\":\"\",\"cap-msg-id\":\"1376443392333307904\",\"cap-corr-id\":\"1376443392333307904\",\"cap-corr-seq\":\"0\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2021/3/29 下午3:57:32 +08:00\"},\"Value\":{\"DateTime\":\"2021-03-29T15:57:32.4706372+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2021-03-29 15:57:32', '2021-03-30 15:57:32', 'Succeeded');
INSERT INTO `cap.published` VALUES (1376443586886098944, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-abp-user-id\":\"bf289dbb-838e-a89b-c622-39f51dcc4f43\",\"cap-abp-client-id\":\"vue-admin-element\",\"cap-abp-tenant-id\":\"\",\"cap-msg-id\":\"1376443586886098944\",\"cap-corr-id\":\"1376443586886098944\",\"cap-corr-seq\":\"0\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2021/3/29 下午3:58:18 +08:00\"},\"Value\":{\"DateTime\":\"2021-03-29T15:58:18.8481239+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2021-03-29 15:58:19', '2021-03-30 15:58:19', 'Succeeded');
INSERT INTO `cap.published` VALUES (1376467826179956736, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-abp-user-id\":\"bf289dbb-838e-a89b-c622-39f51dcc4f43\",\"cap-abp-client-id\":\"vue-admin-element\",\"cap-abp-tenant-id\":\"\",\"cap-msg-id\":\"1376467826179956736\",\"cap-corr-id\":\"1376467826179956736\",\"cap-corr-seq\":\"0\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2021/3/29 下午5:34:37 +08:00\"},\"Value\":{\"DateTime\":\"2021-03-29T17:34:37.9529723+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2021-03-29 17:34:38', '2021-03-30 17:34:38', 'Succeeded');
INSERT INTO `cap.published` VALUES (1376467990969966592, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-abp-user-id\":\"bf289dbb-838e-a89b-c622-39f51dcc4f43\",\"cap-abp-client-id\":\"vue-admin-element\",\"cap-abp-tenant-id\":\"\",\"cap-msg-id\":\"1376467990969966592\",\"cap-corr-id\":\"1376467990969966592\",\"cap-corr-seq\":\"0\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2021/3/29 下午5:35:17 +08:00\"},\"Value\":{\"DateTime\":\"2021-03-29T17:35:17.2420976+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2021-03-29 17:35:17', '2021-03-30 17:35:17', 'Succeeded');
INSERT INTO `cap.published` VALUES (1376468110281138176, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-abp-user-id\":\"bf289dbb-838e-a89b-c622-39f51dcc4f43\",\"cap-abp-client-id\":\"vue-admin-element\",\"cap-abp-tenant-id\":\"\",\"cap-msg-id\":\"1376468110281138176\",\"cap-corr-id\":\"1376468110281138176\",\"cap-corr-seq\":\"0\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2021/3/29 下午5:35:45 +08:00\"},\"Value\":{\"DateTime\":\"2021-03-29T17:35:45.6880229+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2021-03-29 17:35:46', '2021-03-30 17:35:46', 'Succeeded');
INSERT INTO `cap.published` VALUES (1376516577204494336, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-abp-user-id\":\"bf289dbb-838e-a89b-c622-39f51dcc4f43\",\"cap-abp-client-id\":\"vue-admin-element\",\"cap-abp-tenant-id\":\"\",\"cap-msg-id\":\"1376516577204494336\",\"cap-corr-id\":\"1376516577204494336\",\"cap-corr-seq\":\"0\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2021/3/29 下午8:48:21 +08:00\"},\"Value\":{\"DateTime\":\"2021-03-29T20:48:21.103384+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2021-03-29 20:48:21', '2021-03-30 20:48:21', 'Succeeded');
INSERT INTO `cap.published` VALUES (1376516622045798400, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-abp-user-id\":\"bf289dbb-838e-a89b-c622-39f51dcc4f43\",\"cap-abp-client-id\":\"vue-admin-element\",\"cap-abp-tenant-id\":\"\",\"cap-msg-id\":\"1376516622045798400\",\"cap-corr-id\":\"1376516622045798400\",\"cap-corr-seq\":\"0\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2021/3/29 下午8:48:31 +08:00\"},\"Value\":{\"DateTime\":\"2021-03-29T20:48:31.7941785+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Update\",\"Object\":\"AggregateRoute\"}}', 0, '2021-03-29 20:48:32', '2021-03-30 20:48:32', 'Succeeded');
INSERT INTO `cap.published` VALUES (1376516635597594624, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-abp-user-id\":\"bf289dbb-838e-a89b-c622-39f51dcc4f43\",\"cap-abp-client-id\":\"vue-admin-element\",\"cap-abp-tenant-id\":\"\",\"cap-msg-id\":\"1376516635597594624\",\"cap-corr-id\":\"1376516635597594624\",\"cap-corr-seq\":\"0\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2021/3/29 下午8:48:35 +08:00\"},\"Value\":{\"DateTime\":\"2021-03-29T20:48:35.0253124+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Update\",\"Object\":\"AggregateRoute\"}}', 0, '2021-03-29 20:48:35', '2021-03-30 20:48:35', 'Succeeded');
-- ----------------------------
-- Table structure for cap.received

2
aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/IDataAppService.cs

@ -13,6 +13,8 @@ namespace LINGYUN.Platform.Datas
DataCreateDto,
DataUpdateDto>
{
Task<DataDto> GetAsync(string name);
Task<ListResultDto<DataDto>> GetAllAsync();
Task CreateItemAsync(Guid id, DataItemCreateDto input);

7
aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/GetLayoutListInput.cs

@ -1,4 +1,6 @@
using Volo.Abp.Application.Dtos;
using LINGYUN.Platform.Routes;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Validation;
namespace LINGYUN.Platform.Layouts
{
@ -8,6 +10,7 @@ namespace LINGYUN.Platform.Layouts
public bool Reverse { get; set; }
public PlatformType? PlatformType { get; set; }
[DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))]
public string Framework { get; set; }
}
}

9
aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateDto.cs

@ -1,9 +1,16 @@
using System;
using LINGYUN.Platform.Routes;
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Validation;
namespace LINGYUN.Platform.Layouts
{
public class LayoutCreateDto : LayoutCreateOrUpdateDto
{
public Guid DataId { get; set; }
[Required]
[DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))]
public string Framework { get; set; }
}
}

2
aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateOrUpdateDto.cs

@ -23,7 +23,5 @@ namespace LINGYUN.Platform.Layouts
[DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxRedirectLength))]
public string Redirect { get; set; }
public PlatformType PlatformType { get; set; }
}
}

4
aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutDto.cs

@ -6,9 +6,9 @@ namespace LINGYUN.Platform.Layouts
public class LayoutDto : RouteDto
{
/// <summary>
/// 所属平台
/// 框架
/// </summary>
public PlatformType PlatformType { get; set; }
public string Framework { get; set; }
/// <summary>
/// 约定的Meta采用哪种数据字典,主要是约束路由必须字段的一致性
/// </summary>

8
aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/GetMenuInput.cs

@ -1,7 +1,11 @@
namespace LINGYUN.Platform.Menus
using LINGYUN.Platform.Routes;
using Volo.Abp.Validation;
namespace LINGYUN.Platform.Menus
{
public class GetMenuInput
{
public PlatformType PlatformType { get; set; }
[DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))]
public string Framework { get; set; }
}
}

4
aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuDto.cs

@ -15,9 +15,9 @@ namespace LINGYUN.Platform.Menus
/// </summary>
public string Component { get; set; }
/// <summary>
/// 所属平台
/// 框架
/// </summary>
public PlatformType PlatformType { get; set; }
public string Framework { get; set; }
/// <summary>
/// 父节点
/// </summary>

7
aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetAllInput.cs

@ -1,11 +1,14 @@
using System;
using LINGYUN.Platform.Routes;
using System;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Validation;
namespace LINGYUN.Platform.Menus
{
public class MenuGetAllInput : ISortedResultRequest
{
public PlatformType? PlatformType { get; set; }
[DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))]
public string Framework { get; set; }
public string Filter { get; set; }

7
aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByRoleInput.cs

@ -1,4 +1,6 @@
using System.ComponentModel.DataAnnotations;
using LINGYUN.Platform.Routes;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Validation;
namespace LINGYUN.Platform.Menus
{
@ -8,6 +10,7 @@ namespace LINGYUN.Platform.Menus
[StringLength(80)]
public string Role { get; set; }
public PlatformType PlatformType { get; set; }
[DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))]
public string Framework { get; set; }
}
}

7
aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByUserInput.cs

@ -1,5 +1,7 @@
using System;
using LINGYUN.Platform.Routes;
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Validation;
namespace LINGYUN.Platform.Menus
{
@ -10,6 +12,7 @@ namespace LINGYUN.Platform.Menus
public string[] Roles { get; set; } = new string[0];
public PlatformType PlatformType { get; set; }
[DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))]
public string Framework { get; set; }
}
}

7
aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetListInput.cs

@ -1,11 +1,14 @@
using System;
using LINGYUN.Platform.Routes;
using System;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Validation;
namespace LINGYUN.Platform.Menus
{
public class MenuGetListInput : PagedAndSortedResultRequestDto
{
public PlatformType? PlatformType { get; set; }
[DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))]
public string Framework { get; set; }
public string Filter { get; set; }

17
aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Datas/DataAppService.cs

@ -27,7 +27,7 @@ namespace LINGYUN.Platform.Datas
var data = await DataRepository.FindByNameAsync(input.Name);
if (data != null)
{
throw new UserFriendlyException("指定名称的数据字典已经存在!");
throw new UserFriendlyException(L["DuplicateData", input.Name]);
}
string code = string.Empty;
@ -70,12 +70,19 @@ namespace LINGYUN.Platform.Datas
var children = await DataRepository.GetChildrenAsync(data.Id);
if (children.Any())
{
throw new UserFriendlyException("当前数据字典存在子节点,无法删除!");
throw new UserFriendlyException(L["UnableRemoveHasChildNode"]);
}
await DataRepository.DeleteAsync(data);
}
public virtual async Task<DataDto> GetAsync(string name)
{
var data = await DataRepository.FindByNameAsync(name);
return ObjectMapper.Map<Data, DataDto>(data);
}
public virtual async Task<DataDto> GetAsync(Guid id)
{
var data = await DataRepository.GetAsync(id);
@ -134,7 +141,7 @@ namespace LINGYUN.Platform.Datas
var dataItem = data.FindItem(name);
if (dataItem == null)
{
throw new UserFriendlyException($"不存在名为 {name} 的数据字典项!");
throw new UserFriendlyException(L["DataItemNotFound", name]);
}
if (!string.Equals(dataItem.DefaultValue, input.DefaultValue, StringComparison.InvariantCultureIgnoreCase))
@ -151,7 +158,7 @@ namespace LINGYUN.Platform.Datas
}
dataItem.AllowBeNull = input.AllowBeNull;
data = await DataRepository.UpdateAsync(data);
await DataRepository.UpdateAsync(data);
await CurrentUnitOfWork.SaveChangesAsync();
}
@ -162,7 +169,7 @@ namespace LINGYUN.Platform.Datas
var dataItem = data.FindItem(input.Name);
if (dataItem != null)
{
throw new UserFriendlyException($"已经存在名为 {input.Name} 的数据字典项!");
throw new UserFriendlyException(L["DuplicateDataItem", input.Name]);
}
data.AddItem(

13
aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs

@ -1,7 +1,4 @@
using LINGYUN.Platform.Datas;
using LINGYUN.Platform.Permissions;
using LINGYUN.Platform.Routes;
using LINGYUN.Platform.Utils;
using LINGYUN.Platform.Permissions;
using Microsoft.AspNetCore.Authorization;
using System;
using System.Collections.Generic;
@ -28,7 +25,7 @@ namespace LINGYUN.Platform.Layouts
var layout = await LayoutRepository.FindByNameAsync(input.Name);
if (layout != null)
{
throw new UserFriendlyException($"已经存在名为 {input.Name} 的布局!");
throw new UserFriendlyException(L["DuplicateLayout", input.Name]);
}
layout = new Layout(
@ -37,7 +34,7 @@ namespace LINGYUN.Platform.Layouts
input.Name,
input.DisplayName,
input.DataId,
input.PlatformType,
input.Framework,
input.Redirect,
input.Description,
CurrentTenant.Id);
@ -79,10 +76,10 @@ namespace LINGYUN.Platform.Layouts
public virtual async Task<PagedResultDto<LayoutDto>> GetListAsync(GetLayoutListInput input)
{
var count = await LayoutRepository.GetCountAsync(input.PlatformType, input.Filter);
var count = await LayoutRepository.GetCountAsync(input.Framework, input.Filter);
var layouts = await LayoutRepository.GetPagedListAsync(
input.PlatformType, input.Filter,
input.Framework, input.Filter,
input.Sorting, input.Reverse, false,
input.SkipCount, input.MaxResultCount);

15
aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Menus/MenuAppService.cs

@ -42,7 +42,7 @@ namespace LINGYUN.Platform.Menus
var myMenus = await MenuRepository.GetUserMenusAsync(
CurrentUser.GetId(),
CurrentUser.Roles,
input.PlatformType);
input.Framework);
return new ListResultDto<MenuDto>(
ObjectMapper.Map<List<Menu>, List<MenuDto>>(myMenus));
@ -61,7 +61,7 @@ namespace LINGYUN.Platform.Menus
{
var menus = await MenuRepository.GetAllAsync(
input.Filter, input.Sorting, input.Reverse,
input.PlatformType, input.ParentId, input.LayoutId);
input.Framework, input.ParentId, input.LayoutId);
return new ListResultDto<MenuDto>(
ObjectMapper.Map<List<Menu>, List<MenuDto>>(menus));
@ -70,11 +70,11 @@ namespace LINGYUN.Platform.Menus
[Authorize(PlatformPermissions.Menu.Default)]
public virtual async Task<PagedResultDto<MenuDto>> GetListAsync(MenuGetListInput input)
{
var count = await MenuRepository.GetCountAsync(input.Filter, input.PlatformType, input.ParentId, input.LayoutId);
var count = await MenuRepository.GetCountAsync(input.Filter, input.Framework, input.ParentId, input.LayoutId);
var menus = await MenuRepository.GetListAsync(
input.Filter, input.Sorting, input.Reverse,
input.PlatformType, input.ParentId, input.LayoutId,
input.Framework, input.ParentId, input.LayoutId,
input.SkipCount, input.MaxResultCount);
return new PagedResultDto<MenuDto>(count,
@ -88,15 +88,14 @@ namespace LINGYUN.Platform.Menus
var data = await DataRepository.GetAsync(layout.DataId);
var menu = await MenuManager.CreateAsync(
layout,
GuidGenerator.Create(),
layout.Id,
input.Path,
input.Name,
input.Component,
input.DisplayName,
input.Redirect,
input.Description,
layout.PlatformType,
input.ParentId,
CurrentTenant.Id,
input.IsPublic);
@ -210,7 +209,7 @@ namespace LINGYUN.Platform.Menus
[Authorize(PlatformPermissions.Menu.ManageUsers)]
public virtual async Task<ListResultDto<MenuDto>> GetUserMenuListAsync(MenuGetByUserInput input)
{
var menus = await MenuRepository.GetUserMenusAsync(input.UserId, input.Roles, input.PlatformType);
var menus = await MenuRepository.GetUserMenusAsync(input.UserId, input.Roles, input.Framework);
return new ListResultDto<MenuDto>(
ObjectMapper.Map<List<Menu>, List<MenuDto>>(menus));
@ -231,7 +230,7 @@ namespace LINGYUN.Platform.Menus
[Authorize(PlatformPermissions.Menu.ManageRoles)]
public virtual async Task<ListResultDto<MenuDto>> GetRoleMenuListAsync(MenuGetByRoleInput input)
{
var menus = await MenuRepository.GetRoleMenusAsync(new string[] { input.Role }, input.PlatformType);
var menus = await MenuRepository.GetRoleMenusAsync(new string[] { input.Role }, input.Framework);
return new ListResultDto<MenuDto>(
ObjectMapper.Map<List<Menu>, List<MenuDto>>(menus));

7
aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/en.json

@ -50,6 +50,11 @@
"Data:AppendItem": "Append Item",
"Data:EditItem": "Edit Item",
"Data:RemoveItem": "Remove Item",
"Data:Items": "Data Items"
"Data:Items": "Data Items",
"DuplicateData": "A data dictionary named {0} already exists!",
"DuplicateDataItem": "A data dictionary entry named {0} already exists!",
"DataItemNotFound": "There is no data dictionary entry named {0}!",
"UnableRemoveHasChildNode": "Current data dictionary exists child node, cannot delete!",
"DuplicateLayout": "A layout named {0} already exists!"
}
}

7
aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/zh-Hans.json

@ -50,6 +50,11 @@
"Data:AppendItem": "添加项目",
"Data:EditItem": "编辑项目",
"Data:RemoveItem": "删除项目",
"Data:Items": "字典项目"
"Data:Items": "字典项目",
"DuplicateData": "已经存在名为 {0} 的数据字典!",
"DuplicateDataItem": "已经存在名为 {0} 的数据字典项!",
"DataItemNotFound": "不存在名为 {0} 的数据字典项!",
"UnableRemoveHasChildNode": "当前数据字典存在子节点,无法删除!",
"DuplicateLayout": "已经存在名为 {0} 的布局!"
}
}

7
aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/LayoutConsts.cs

@ -0,0 +1,7 @@
namespace LINGYUN.Platform.Routes
{
public static class LayoutConsts
{
public static int MaxFrameworkLength { get; set; } = 64;
}
}

10
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/Data.cs

@ -27,6 +27,8 @@ namespace LINGYUN.Platform.Datas
public virtual Guid? ParentId { get; set; }
public virtual bool IsStatic { get; set; }
public virtual ICollection<DataItem> Items { get; protected set; }
protected Data()
@ -68,7 +70,8 @@ namespace LINGYUN.Platform.Datas
[CanBeNull] string defaultValue,
ValueType valueType = ValueType.String,
string description = "",
bool allowBeNull = true)
bool allowBeNull = true,
bool isStatic = false)
{
Check.NotNull(guidGenerator, nameof(guidGenerator));
Check.NotNull(name, nameof(name));
@ -86,7 +89,10 @@ namespace LINGYUN.Platform.Datas
description,
allowBeNull,
TenantId
);
)
{
IsStatic = isStatic
};
Items.Add(dataItem);
}

8
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataDictionaryDataSeeder.cs

@ -30,6 +30,7 @@ namespace LINGYUN.Platform.Datas
string description = "",
Guid? parentId = null,
Guid? tenantId = null,
bool isStatic = false,
CancellationToken cancellationToken = default)
{
using (CurrentTenant.Change(tenantId))
@ -45,9 +46,12 @@ namespace LINGYUN.Platform.Datas
displayName,
description,
parentId,
tenantId);
tenantId)
{
IsStatic = isStatic
};
data = await DataRepository.InsertAsync(data);
data = await DataRepository.InsertAsync(data, true);
}
return data;

5
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItem.cs

@ -1,6 +1,5 @@
using JetBrains.Annotations;
using System;
using System.Collections.Generic;
using Volo.Abp;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
@ -21,13 +20,15 @@ namespace LINGYUN.Platform.Datas
public virtual bool AllowBeNull { get; set; }
public virtual bool IsStatic { get; set; }
public virtual ValueType ValueType { get; protected set; }
public virtual Guid DataId { get; protected set; }
protected DataItem() { }
public DataItem(
internal DataItem(
[NotNull] Guid id,
[NotNull] Guid dataId,
[NotNull] string name,

1
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataDictionaryDataSeeder.cs

@ -13,6 +13,7 @@ namespace LINGYUN.Platform.Datas
string description = "",
Guid? parentId = null,
Guid? tenantId = null,
bool isStatic = false,
CancellationToken cancellationToken = default);
}
}

4
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/ILayoutRepository.cs

@ -21,12 +21,12 @@ namespace LINGYUN.Platform.Layouts
CancellationToken cancellationToken = default);
Task<int> GetCountAsync(
PlatformType? platformType = null,
string framework = "",
string filter = "",
CancellationToken cancellationToken = default);
Task<List<Layout>> GetPagedListAsync(
PlatformType? platformType = null,
string framework = "",
string filter = "",
string sorting = nameof(Layout.Name),
bool reverse = false,

8
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/Layout.cs

@ -10,9 +10,9 @@ namespace LINGYUN.Platform.Layouts
public class Layout : Route
{
/// <summary>
/// 所属平台
/// 框架
/// </summary>
public virtual PlatformType PlatformType { get; protected set; }
public virtual string Framework { get; protected set; }
/// <summary>
/// 约定的Meta采用哪种数据字典,主要是约束路由必须字段的一致性
/// </summary>
@ -26,14 +26,14 @@ namespace LINGYUN.Platform.Layouts
[NotNull] string name,
[NotNull] string displayName,
[NotNull] Guid dataId,
[NotNull] PlatformType platformType = PlatformType.None,
[NotNull] string framework,
[CanBeNull] string redirect = "",
[CanBeNull] string description = "",
[CanBeNull] Guid? tenantId = null)
: base(id, path, name, displayName, redirect, description, tenantId)
{
DataId = dataId;
PlatformType = platformType;
Framework = framework;
}
}
}

12
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IMenuRepository.cs

@ -24,7 +24,7 @@ namespace LINGYUN.Platform.Menus
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<Menu> FindMainAsync(
PlatformType platformType = PlatformType.None,
string framework = "",
CancellationToken cancellationToken = default);
/// <summary>
/// 获取子节点
@ -59,7 +59,7 @@ namespace LINGYUN.Platform.Menus
Task<List<Menu>> GetUserMenusAsync(
Guid userId,
string[] roles,
PlatformType platformType = PlatformType.None,
string framework = "",
CancellationToken cancellationToken = default);
/// <summary>
/// 查找角色可访问菜单
@ -70,12 +70,12 @@ namespace LINGYUN.Platform.Menus
/// <returns></returns>
Task<List<Menu>> GetRoleMenusAsync(
string[] roles,
PlatformType platformType = PlatformType.None,
string framework = "",
CancellationToken cancellationToken = default);
Task<int> GetCountAsync(
string filter = "",
PlatformType? platformType = null,
string framework = "",
Guid? parentId = null,
Guid? layoutId = null,
CancellationToken cancellationToken = default);
@ -84,7 +84,7 @@ namespace LINGYUN.Platform.Menus
string filter = "",
string sorting = nameof(Menu.Code),
bool reverse = false,
PlatformType? platformType = null,
string framework = "",
Guid? parentId = null,
Guid? layoutId = null,
int skipCount = 0,
@ -95,7 +95,7 @@ namespace LINGYUN.Platform.Menus
string filter = "",
string sorting = nameof(Menu.Code),
bool reverse = false,
PlatformType? platformType = null,
string framework = "",
Guid? parentId = null,
Guid? layoutId = null,
CancellationToken cancellationToken = default);

8
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/Menu.cs

@ -11,9 +11,9 @@ namespace LINGYUN.Platform.Menus
public class Menu : Route
{
/// <summary>
/// 所属平台
/// 框架
/// </summary>
public virtual PlatformType PlatformType { get; set; }
public virtual string Framework { get; set; }
/// <summary>
/// 菜单编号
/// </summary>
@ -46,9 +46,9 @@ namespace LINGYUN.Platform.Menus
[NotNull] string code,
[NotNull] string component,
[NotNull] string displayName,
[NotNull] string framework,
string redirect = "",
string description = "",
PlatformType platformType = PlatformType.None,
Guid? parentId = null,
Guid? tenantId = null)
: base(id, path, name, displayName, redirect, description, tenantId)
@ -58,7 +58,7 @@ namespace LINGYUN.Platform.Menus
LayoutId = layoutId;
Code = code;
Component = component;// 下属的一级菜单的Component应该是布局页, 例如vue-admin中的 component: Layout, 其他前端框架雷同, 此处应传递布局页的路径让前端import
PlatformType = platformType;
Framework = framework;
ParentId = parentId;
IsPublic = false;

10
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/MenuManager.cs

@ -1,4 +1,5 @@
using LINGYUN.Platform.Utils;
using LINGYUN.Platform.Layouts;
using LINGYUN.Platform.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
@ -29,15 +30,14 @@ namespace LINGYUN.Platform.Menus
[UnitOfWork]
public virtual async Task<Menu> CreateAsync(
Layout layout,
Guid id,
Guid layoutId,
string path,
string name,
string component,
string displayName,
string redirect = "",
string description = "",
PlatformType platformType = PlatformType.None,
Guid? parentId = null,
Guid? tenantId = null,
bool isPublic = false)
@ -50,15 +50,15 @@ namespace LINGYUN.Platform.Menus
}
var menu = new Menu(
id,
layoutId,
layout.Id,
path,
name,
code,
component,
displayName,
layout.Framework,
redirect,
description,
platformType,
parentId,
tenantId)
{

2
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/IRouteDataSeeder.cs

@ -13,7 +13,7 @@ namespace LINGYUN.Platform.Routes
string path,
string displayName,
Guid dataId,
PlatformType platformType = PlatformType.None,
string framework,
string redirect = "",
string description = "",
Guid? tenantId = null,

6
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/RouteDataSeeder.cs

@ -36,7 +36,7 @@ namespace LINGYUN.Platform.Routes
string path,
string displayName,
Guid dataId,
PlatformType platformType = PlatformType.None,
string framework,
string redirect = "",
string description = "",
Guid? tenantId = null,
@ -51,7 +51,7 @@ namespace LINGYUN.Platform.Routes
name,
displayName,
dataId,
platformType,
framework,
redirect,
description,
tenantId);
@ -94,9 +94,9 @@ namespace LINGYUN.Platform.Routes
code,
component,
displayName,
layout.Framework,
redirect,
description,
layout.PlatformType,
parentId,
tenantId)
{

9
aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContextModelBuilderExtensions.cs

@ -31,6 +31,11 @@ namespace LINGYUN.Platform.EntityFrameworkCore
{
b.ToTable(options.TablePrefix + "Layouts", options.Schema);
b.Property(p => p.Framework)
.HasMaxLength(LayoutConsts.MaxFrameworkLength)
.HasColumnName(nameof(Layout.Framework))
.IsRequired();
b.ConfigureRoute();
});
@ -40,6 +45,10 @@ namespace LINGYUN.Platform.EntityFrameworkCore
b.ConfigureRoute();
b.Property(p => p.Framework)
.HasMaxLength(LayoutConsts.MaxFrameworkLength)
.HasColumnName(nameof(Menu.Framework))
.IsRequired();
b.Property(p => p.Component)
.HasMaxLength(MenuConsts.MaxComponentLength)
.HasColumnName(nameof(Menu.Component))

8
aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Layouts/EfCoreLayoutRepository.cs

@ -30,12 +30,12 @@ namespace LINGYUN.Platform.Layouts
}
public virtual async Task<int> GetCountAsync(
PlatformType? platformType = null,
string framework = "",
string filter = "",
CancellationToken cancellationToken = default)
{
return await (await GetDbSetAsync())
.WhereIf(platformType.HasValue, x => x.PlatformType == platformType.Value)
.WhereIf(!framework.IsNullOrWhiteSpace(), x => x.Framework.Equals(framework))
.WhereIf(!filter.IsNullOrWhiteSpace(), x =>
x.Name.Contains(filter) || x.DisplayName.Contains(filter) ||
x.Description.Contains(filter) || x.Redirect.Contains(filter))
@ -43,7 +43,7 @@ namespace LINGYUN.Platform.Layouts
}
public virtual async Task<List<Layout>> GetPagedListAsync(
PlatformType? platformType = null,
string framework = "",
string filter = "",
string sorting = nameof(Layout.Name),
bool reverse = false,
@ -57,7 +57,7 @@ namespace LINGYUN.Platform.Layouts
return await (await GetDbSetAsync())
.IncludeDetails(includeDetails)
.WhereIf(platformType.HasValue, x => x.PlatformType == platformType.Value)
.WhereIf(!framework.IsNullOrWhiteSpace(), x => x.Framework.Equals(framework))
.WhereIf(!filter.IsNullOrWhiteSpace(), x =>
x.Name.Contains(filter) || x.DisplayName.Contains(filter) ||
x.Description.Contains(filter) || x.Redirect.Contains(filter))

24
aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreMenuRepository.cs

@ -57,21 +57,21 @@ namespace LINGYUN.Platform.Menus
}
public virtual async Task<Menu> FindMainAsync(
PlatformType platformType = PlatformType.None,
string framework = "",
CancellationToken cancellationToken = default)
{
return await (await GetDbSetAsync())
.Where(menu => menu.PlatformType.HasFlag(platformType) && menu.Path == "/")
.Where(menu => menu.Framework.Equals(framework) && menu.Path == "/")
.FirstOrDefaultAsync(GetCancellationToken(cancellationToken));
}
public virtual async Task<List<Menu>> GetRoleMenusAsync(
string[] roles,
PlatformType platformType = PlatformType.None,
string framework = "",
CancellationToken cancellationToken = default)
{
var menuQuery = (await GetDbSetAsync())
.Where(menu => menu.PlatformType.HasFlag(platformType));
.Where(menu => menu.Framework.Equals(framework));
var roleMenuQuery = (await GetDbContextAsync()).Set<RoleMenu>()
.Where(menu => roles.Contains(menu.RoleName));
@ -88,11 +88,11 @@ namespace LINGYUN.Platform.Menus
public virtual async Task<List<Menu>> GetUserMenusAsync(
Guid userId,
string[] roles,
PlatformType platformType = PlatformType.None,
string framework = "",
CancellationToken cancellationToken = default)
{
var menuQuery = (await GetDbSetAsync())
.Where(menu => menu.PlatformType.HasFlag(platformType));
.Where(menu => menu.Framework.Equals(framework));
var dbContext = await GetDbContextAsync();
var userMenuQuery = from userMenu in dbContext.Set<UserMenu>()
@ -147,7 +147,7 @@ namespace LINGYUN.Platform.Menus
string filter = "",
string sorting = nameof(Menu.Code),
bool reverse = false,
PlatformType? platformType = null,
string framework = "",
Guid? parentId = null,
Guid? layoutId = null,
CancellationToken cancellationToken = default)
@ -158,7 +158,7 @@ namespace LINGYUN.Platform.Menus
return await (await GetDbSetAsync())
.WhereIf(parentId.HasValue, x => x.ParentId == parentId)
.WhereIf(layoutId.HasValue, x => x.LayoutId == layoutId)
.WhereIf(platformType.HasValue, menu => menu.PlatformType.HasFlag(platformType.Value))
.WhereIf(!framework.IsNullOrWhiteSpace(), menu => menu.Framework.Equals(framework))
.WhereIf(!filter.IsNullOrWhiteSpace(), menu =>
menu.Path.Contains(filter) || menu.Name.Contains(filter) ||
menu.DisplayName.Contains(filter) || menu.Description.Contains(filter) ||
@ -169,7 +169,7 @@ namespace LINGYUN.Platform.Menus
public virtual async Task<int> GetCountAsync(
string filter = "",
PlatformType? platformType = null,
string framework = "",
Guid? parentId = null,
Guid? layoutId = null,
CancellationToken cancellationToken = default)
@ -177,7 +177,7 @@ namespace LINGYUN.Platform.Menus
return await (await GetDbSetAsync())
.WhereIf(parentId.HasValue, x => x.ParentId == parentId)
.WhereIf(layoutId.HasValue, x => x.LayoutId == layoutId)
.WhereIf(platformType.HasValue, menu => menu.PlatformType.HasFlag(platformType.Value))
.WhereIf(!framework.IsNullOrWhiteSpace(), menu => menu.Framework.Equals(framework))
.WhereIf(!filter.IsNullOrWhiteSpace(), menu =>
menu.Path.Contains(filter) || menu.Name.Contains(filter) ||
menu.DisplayName.Contains(filter) || menu.Description.Contains(filter) ||
@ -189,7 +189,7 @@ namespace LINGYUN.Platform.Menus
string filter = "",
string sorting = nameof(Menu.Code),
bool reverse = false,
PlatformType? platformType = null,
string framework = "",
Guid? parentId = null,
Guid? layoutId = null,
int skipCount = 0,
@ -202,7 +202,7 @@ namespace LINGYUN.Platform.Menus
return await (await GetDbSetAsync())
.WhereIf(parentId.HasValue, x => x.ParentId == parentId)
.WhereIf(layoutId.HasValue, x => x.LayoutId == layoutId)
.WhereIf(platformType.HasValue, menu => menu.PlatformType.HasFlag(platformType.Value))
.WhereIf(!framework.IsNullOrWhiteSpace(), menu => menu.Framework.Equals(framework))
.WhereIf(!filter.IsNullOrWhiteSpace(), menu =>
menu.Path.Contains(filter) || menu.Name.Contains(filter) ||
menu.DisplayName.Contains(filter) || menu.Description.Contains(filter) ||

7
aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Datas/DataController.cs

@ -47,6 +47,13 @@ namespace LINGYUN.Platform.Datas
await DataAppService.DeleteItemAsync(id, name);
}
[HttpGet]
[Route("by-name/{name}")]
public virtual async Task<DataDto> GetAsync(string name)
{
return await DataAppService.GetAsync(name);
}
[HttpGet]
[Route("{id}")]
public virtual async Task<DataDto> GetAsync(Guid id)

12
aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Menus/MenuController.cs

@ -86,8 +86,8 @@ namespace LINGYUN.Platform.Menus
}
[HttpGet]
[Route("by-user/{userId}/{platformType}")]
public virtual async Task<ListResultDto<MenuDto>> GetUserMenuListAsync(Guid userId, PlatformType platformType)
[Route("by-user/{userId}/{framework}")]
public virtual async Task<ListResultDto<MenuDto>> GetUserMenuListAsync(Guid userId, string framework)
{
var userRoles = await UserRoleFinder.GetRolesAsync(userId);
@ -95,7 +95,7 @@ namespace LINGYUN.Platform.Menus
{
UserId = userId,
Roles = userRoles,
PlatformType = platformType
Framework = framework
};
return await MenuAppService.GetUserMenuListAsync(getMenuByUser);
}
@ -115,13 +115,13 @@ namespace LINGYUN.Platform.Menus
}
[HttpGet]
[Route("by-role/{role}/{platformType}")]
public virtual async Task<ListResultDto<MenuDto>> GetRoleMenuListAsync(string role, PlatformType platformType)
[Route("by-role/{role}/{framework}")]
public virtual async Task<ListResultDto<MenuDto>> GetRoleMenuListAsync(string role, string framework)
{
return await MenuAppService.GetRoleMenuListAsync(new MenuGetByRoleInput
{
Role = role,
PlatformType = platformType
Framework = framework
});
}
}

71
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDataSeedContributor.cs → aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/DataSeeder/ElementAdminDataSeedContributor.cs

@ -11,9 +11,9 @@ using Volo.Abp.DependencyInjection;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Platform
namespace LINGYUN.Platform.DataSeeder
{
public class PlatformDataSeedContributor : IDataSeedContributor, ITransientDependency
public class ElementAdminDataSeedContributor : IDataSeedContributor, ITransientDependency
{
protected ICurrentTenant CurrentTenant { get; }
protected IGuidGenerator GuidGenerator { get; }
@ -22,7 +22,7 @@ namespace LINGYUN.Platform
protected IMenuRepository MenuRepository { get; }
protected ILayoutRepository LayoutRepository { get; }
public PlatformDataSeedContributor(
public ElementAdminDataSeedContributor(
ICurrentTenant currentTenant,
IRouteDataSeeder routeDataSeeder,
IMenuRepository menuRepository,
@ -42,9 +42,10 @@ namespace LINGYUN.Platform
{
using (CurrentTenant.Change(context.TenantId))
{
var data = await SeedDefaultDataDictionaryAsync(context.TenantId);
var uiItem = await SeedUIFrameworkDataAsync(context.TenantId);
var data = await SeedLayoutDataAsync(context.TenantId);
// 预置
var layout = await SeedDefaultLayoutAsync(data);
var layout = await SeedDefaultLayoutAsync(data, uiItem);
// 首页
await SeedHomeMenuAsync(layout, data);
// 管理菜单预置菜单数据
@ -66,7 +67,31 @@ namespace LINGYUN.Platform
}
}
private async Task<Data> SeedDefaultDataDictionaryAsync(Guid? tenantId)
private async Task<DataItem> SeedUIFrameworkDataAsync(Guid? tenantId)
{
var data = await DataDictionaryDataSeeder
.SeedAsync(
"UI Framewark",
CodeNumberGenerator.CreateCode(2),
"UI框架",
"UI Framewark",
null,
tenantId,
true);
data.AddItem(
GuidGenerator,
"Vue Element Admin",
"Vue Element Admin",
"Vue Element Admin",
Datas.ValueType.String,
"Vue Element Admin",
isStatic: true);
return data.FindItem("Vue Element Admin");
}
private async Task<Data> SeedLayoutDataAsync(Guid? tenantId)
{
var data = await DataDictionaryDataSeeder
.SeedAsync(
@ -75,7 +100,8 @@ namespace LINGYUN.Platform
"Vue Admin Layout Meta Dictionary",
"Vue Admin Layout Meta Dictionary",
null,
tenantId);
tenantId,
true);
data.AddItem(
GuidGenerator,
@ -83,75 +109,84 @@ namespace LINGYUN.Platform
"roles",
"",
Datas.ValueType.Array,
"will control the page roles (allow setting multiple roles)");
"will control the page roles (allow setting multiple roles)",
isStatic: true);
data.AddItem(
GuidGenerator,
"title",
"title",
"component",
Datas.ValueType.String,
"the name showed in subMenu and breadcrumb (recommend set)");
"the name showed in subMenu and breadcrumb (recommend set)",
isStatic: true);
data.AddItem(
GuidGenerator,
"icon",
"icon",
"icon",
Datas.ValueType.String,
"the icon showed in the sidebar");
"the icon showed in the sidebar",
isStatic: true);
data.AddItem(
GuidGenerator,
"hidden",
"hidden",
"false",
Datas.ValueType.Boolean,
"if true, this route will not show in the sidebar (default is false)");
"if true, this route will not show in the sidebar (default is false)",
isStatic: true);
data.AddItem(
GuidGenerator,
"alwaysShow",
"alwaysShow",
"false",
Datas.ValueType.Boolean,
"if true, will always show the root menu (default is false)");
"if true, will always show the root menu (default is false)",
isStatic: true);
data.AddItem(
GuidGenerator,
"breadcrumb",
"breadcrumb",
"true",
Datas.ValueType.Boolean,
"if false, the item will be hidden in breadcrumb (default is true)");
"if false, the item will be hidden in breadcrumb (default is true)",
isStatic: true);
data.AddItem(
GuidGenerator,
"noCache",
"noCache",
"false",
Datas.ValueType.Boolean,
"if true, the page will not be cached (default is false)");
"if true, the page will not be cached (default is false)",
isStatic: true);
data.AddItem(
GuidGenerator,
"affix",
"affix",
"false",
Datas.ValueType.Boolean,
"if true, the tag will affix in the tags-view");
"if true, the tag will affix in the tags-view",
isStatic: true);
data.AddItem(
GuidGenerator,
"activeMenu",
"activeMenu",
"",
Datas.ValueType.String,
"if set path, the sidebar will highlight the path you set");
"if set path, the sidebar will highlight the path you set",
isStatic: true);
return data;
}
private async Task<Layout> SeedDefaultLayoutAsync(Data data)
private async Task<Layout> SeedDefaultLayoutAsync(Data data, DataItem uiDataItem)
{
var layout = await RouteDataSeeder.SeedLayoutAsync(
"Layout",
"layout/index.vue",
"Vue Admin Layout",
data.Id,
PlatformType.WebMvvm, // 针对当前的vue管理页
uiDataItem.Name,
"",
"Vue Admin Layout",
data.TenantId

291
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/DataSeeder/VbenAdminDataSeedContributor.cs

@ -0,0 +1,291 @@
using LINGYUN.Platform.Datas;
using LINGYUN.Platform.Layouts;
using LINGYUN.Platform.Menus;
using LINGYUN.Platform.Routes;
using LINGYUN.Platform.Utils;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Platform.DataSeeder
{
public class VbenAdminDataSeedContributor : IDataSeedContributor, ITransientDependency
{
protected ICurrentTenant CurrentTenant { get; }
protected IGuidGenerator GuidGenerator { get; }
protected IRouteDataSeeder RouteDataSeeder { get; }
protected IDataDictionaryDataSeeder DataDictionaryDataSeeder { get; }
protected IMenuRepository MenuRepository { get; }
protected ILayoutRepository LayoutRepository { get; }
public VbenAdminDataSeedContributor(
ICurrentTenant currentTenant,
IRouteDataSeeder routeDataSeeder,
IMenuRepository menuRepository,
ILayoutRepository layoutRepository,
IGuidGenerator guidGenerator,
IDataDictionaryDataSeeder dataDictionaryDataSeeder)
{
CurrentTenant = currentTenant;
GuidGenerator = guidGenerator;
RouteDataSeeder = routeDataSeeder;
MenuRepository = menuRepository;
LayoutRepository = layoutRepository;
DataDictionaryDataSeeder = dataDictionaryDataSeeder;
}
public virtual async Task SeedAsync(DataSeedContext context)
{
using (CurrentTenant.Change(context.TenantId))
{
var uiDataItem = await SeedUIFrameworkDataAsync(context.TenantId);
var layoutData = await SeedLayoutDataAsync(context.TenantId);
var layout = await SeedDefaultLayoutAsync(layoutData, uiDataItem);
}
}
private async Task<DataItem> SeedUIFrameworkDataAsync(Guid? tenantId)
{
var data = await DataDictionaryDataSeeder
.SeedAsync(
"UI Framewark",
CodeNumberGenerator.CreateCode(2),
"UI框架",
"UI Framewark",
null,
tenantId,
true);
data.AddItem(
GuidGenerator,
"Vue Vben Admin",
"Vue Vben Admin",
"Vue Vben Admin",
Datas.ValueType.String,
"Vue Vben Admin",
isStatic: true);
return data.FindItem("Vue Vben Admin");
}
private async Task<Layout> SeedDefaultLayoutAsync(Data data, DataItem uiDataItem)
{
var layout = await RouteDataSeeder.SeedLayoutAsync(
"Vben Admin Layout",
"LAYOUT", // 路由层面已经处理好了,只需要传递LAYOUT可自动引用布局
"Vben Admin Layout",
data.Id,
uiDataItem.Name,
"",
"Vben Admin Layout",
data.TenantId
);
return layout;
}
private async Task<Data> SeedLayoutDataAsync(Guid? tenantId)
{
var data = await DataDictionaryDataSeeder
.SeedAsync(
"Vben Admin Layout",
CodeNumberGenerator.CreateCode(3),
"Vben Admin布局约束",
"Vben Admin Layout Meta Dictionary",
null,
tenantId,
true);
data.AddItem(
GuidGenerator,
"hideMenu",
"不在菜单显示",
"false",
Datas.ValueType.Boolean,
"当前路由不在菜单显示",
isStatic: true);
data.AddItem(
GuidGenerator,
"icon",
"图标",
"",
Datas.ValueType.String,
"图标,也是菜单图标",
isStatic: true);
data.AddItem(
GuidGenerator,
"currentActiveMenu",
"当前激活的菜单",
"",
Datas.ValueType.String,
"用于配置详情页时左侧激活的菜单路径",
isStatic: true);
data.AddItem(
GuidGenerator,
"ignoreKeepAlive",
"KeepAlive缓存",
"false",
Datas.ValueType.Boolean,
"是否忽略KeepAlive缓存",
isStatic: true);
data.AddItem(
GuidGenerator,
"frameSrc",
"IFrame地址",
"",
Datas.ValueType.String,
"内嵌iframe的地址",
isStatic: true);
data.AddItem(
GuidGenerator,
"transitionName",
"路由切换动画",
"",
Datas.ValueType.String,
"指定该路由切换的动画名",
isStatic: true);
data.AddItem(
GuidGenerator,
"roles",
"可以访问的角色",
"",
Datas.ValueType.Array,
"可以访问的角色,只在权限模式为Role的时候有效",
isStatic: true);
data.AddItem(
GuidGenerator,
"title",
"路由标题",
"",
Datas.ValueType.String,
"路由title 一般必填",
false,
isStatic: true);
data.AddItem(
GuidGenerator,
"carryParam",
"在tab页显示",
"false",
Datas.ValueType.Boolean,
"如果该路由会携带参数,且需要在tab页上面显示。则需要设置为true",
isStatic: true);
data.AddItem(
GuidGenerator,
"hideBreadcrumb",
"隐藏面包屑",
"false",
Datas.ValueType.Boolean,
"隐藏该路由在面包屑上面的显示",
isStatic: true);
data.AddItem(
GuidGenerator,
"ignoreAuth",
"忽略权限",
"false",
Datas.ValueType.Boolean,
"是否忽略权限,只在权限模式为Role的时候有效",
isStatic: true);
data.AddItem(
GuidGenerator,
"hideChildrenInMenu",
"隐藏所有子菜单",
"false",
Datas.ValueType.Boolean,
"隐藏所有子菜单",
isStatic: true);
data.AddItem(
GuidGenerator,
"hideTab",
"不在标签页显示",
"false",
Datas.ValueType.Boolean,
"当前路由不在标签页显示",
isStatic: true);
data.AddItem(
GuidGenerator,
"affix",
"固定标签页",
"false",
Datas.ValueType.Boolean,
"是否固定标签页",
isStatic: true);
data.AddItem(
GuidGenerator,
"frameFormat",
"格式化IFrame",
"false",
Datas.ValueType.Boolean,
"扩展的格式化frame,{token}: 在打开的iframe页面传递token请求头");
return data;
}
private async Task<Menu> SeedMenuAsync(
Layout layout,
Data data,
string name,
string path,
string code,
string component,
string displayName,
string redirect = "",
string description = "",
Guid? parentId = null,
Guid? tenantId = null,
Dictionary<string, object> meta = null,
string[] roles = null,
Guid[] users = null,
bool isPublic = false
)
{
var menu = await RouteDataSeeder.SeedMenuAsync(
layout,
name,
path,
code,
component,
displayName,
redirect,
description,
parentId,
tenantId,
isPublic
);
foreach (var item in data.Items)
{
menu.SetProperty(item.Name, item.DefaultValue);
}
if (meta != null)
{
foreach (var item in meta)
{
menu.SetProperty(item.Key, item.Value);
}
}
if (roles != null)
{
foreach (var role in roles)
{
await RouteDataSeeder.SeedRoleMenuAsync(role, menu, tenantId);
}
}
if (users != null)
{
foreach (var user in users)
{
await RouteDataSeeder.SeedUserMenuAsync(user, menu, tenantId);
}
}
return menu;
}
}
}

506
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantSynchronizer.cs

@ -1,17 +1,8 @@
using LINGYUN.Abp.MultiTenancy;
using LINGYUN.Platform.Datas;
using LINGYUN.Platform.Layouts;
using LINGYUN.Platform.Menus;
using LINGYUN.Platform.Routes;
using LINGYUN.Platform.Utils;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Platform.EventBus.Handlers
{
@ -19,507 +10,22 @@ namespace LINGYUN.Platform.EventBus.Handlers
IDistributedEventHandler<CreateEventData>,
ITransientDependency
{
protected ICurrentTenant CurrentTenant { get; }
protected IGuidGenerator GuidGenerator { get; }
protected IRouteDataSeeder RouteDataSeeder { get; }
protected IDataDictionaryDataSeeder DataDictionaryDataSeeder { get; }
protected IMenuRepository MenuRepository { get; }
protected ILayoutRepository LayoutRepository { get; }
protected IDataSeeder DataSeeder { get; }
public TenantSynchronizer(
ICurrentTenant currentTenant,
IRouteDataSeeder routeDataSeeder,
IMenuRepository menuRepository,
ILayoutRepository layoutRepository,
IGuidGenerator guidGenerator,
IDataDictionaryDataSeeder dataDictionaryDataSeeder)
public TenantSynchronizer(IDataSeeder dataSeeder)
{
CurrentTenant = currentTenant;
GuidGenerator = guidGenerator;
RouteDataSeeder = routeDataSeeder;
MenuRepository = menuRepository;
LayoutRepository = layoutRepository;
DataDictionaryDataSeeder = dataDictionaryDataSeeder;
DataSeeder = dataSeeder;
}
/// <summary>
/// 租户创建之后需要预置租户平台数据
/// 租户创建之后需要预置种子数据
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
public virtual async Task HandleEventAsync(CreateEventData eventData)
{
using (CurrentTenant.Change(eventData.Id))
{
var data = await SeedDefaultDataDictionaryAsync(eventData.Id);
// 预置
var layout = await SeedDefaultLayoutAsync(data);
// 首页
await SeedHomeMenuAsync(layout, data);
// 管理菜单预置菜单数据
await SeedAdminMenuAsync(layout, data);
// 审计日志菜单数据
await SeedAuditingMenuAsync(layout, data);
// 布局容器预置菜单数据
await SeedContainerMenuAsync(layout, data);
}
}
/// <summary>
/// 租户删除之后删除租户平台数据
/// TODO: 不应删除用户数据
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
//public virtual async Task HandleEventAsync(DeleteEventData eventData)
//{
// //await MenuRepository.GetAllAsync();
//}
private async Task<Data> SeedDefaultDataDictionaryAsync(Guid? tenantId)
{
var data = await DataDictionaryDataSeeder
.SeedAsync(
"Layout",
CodeNumberGenerator.CreateCode(1),
"Vue Admin Layout Meta Dictionary",
"Vue Admin Layout Meta Dictionary",
null,
tenantId);
data.AddItem(
GuidGenerator,
"roles", // TODO: 是否需要把这一项写入到预置数据?
"roles",
"",
Datas.ValueType.Array,
"will control the page roles (allow setting multiple roles)");
data.AddItem(
GuidGenerator,
"title",
"title",
"component",
Datas.ValueType.String,
"the name showed in subMenu and breadcrumb (recommend set)");
data.AddItem(
GuidGenerator,
"icon",
"icon",
"icon",
Datas.ValueType.String,
"the icon showed in the sidebar");
data.AddItem(
GuidGenerator,
"hidden",
"hidden",
"false",
Datas.ValueType.Boolean,
"if true, this route will not show in the sidebar (default is false)");
data.AddItem(
GuidGenerator,
"alwaysShow",
"alwaysShow",
"false",
Datas.ValueType.Boolean,
"if true, will always show the root menu (default is false)");
data.AddItem(
GuidGenerator,
"breadcrumb",
"breadcrumb",
"true",
Datas.ValueType.Boolean,
"if false, the item will be hidden in breadcrumb (default is true)");
data.AddItem(
GuidGenerator,
"noCache",
"noCache",
"false",
Datas.ValueType.Boolean,
"if true, the page will not be cached (default is false)");
data.AddItem(
GuidGenerator,
"affix",
"affix",
"false",
Datas.ValueType.Boolean,
"if true, the tag will affix in the tags-view");
data.AddItem(
GuidGenerator,
"activeMenu",
"activeMenu",
"",
Datas.ValueType.String,
"if set path, the sidebar will highlight the path you set");
return data;
}
private async Task<Layout> SeedDefaultLayoutAsync(Data data)
{
var layout = await RouteDataSeeder.SeedLayoutAsync(
"Layout",
"layout/index.vue",
"Vue Admin Layout",
data.Id,
PlatformType.WebMvvm, // 针对当前的vue管理页
"",
"Vue Admin Layout",
data.TenantId
);
return layout;
}
private async Task SeedHomeMenuAsync(Layout layout, Data data)
{
var adminMenu = await SeedMenuAsync(
layout,
data,
"home",
"/",
CodeNumberGenerator.CreateCode(1),
layout.Path,
"Home",
"/dashboard",
"Home",
null,
layout.TenantId,
new Dictionary<string, object>()
{
{ "title", "home" },
{ "icon", "home" },
{ "alwaysShow", true }
},
// isPublic: true,
isPublic: false); // 首页应该是共有的页面
await SeedMenuAsync(
layout,
data,
"dashboard",
"dashboard",
CodeNumberGenerator.AppendCode(adminMenu.Code, CodeNumberGenerator.CreateCode(1)),
"views/dashboard/index.vue",
"Dashboard",
"",
"Dashboard",
adminMenu.Id,
layout.TenantId,
new Dictionary<string, object>()
{
{ "title", "dashboard" },
{ "icon", "dashboard" }
},
isPublic: false);
}
private async Task SeedAdminMenuAsync(Layout layout, Data data)
{
var adminMenu = await SeedMenuAsync(
layout,
data,
"admin",
"/admin",
CodeNumberGenerator.CreateCode(2),
layout.Path,
"Admin",
"",
"Admin",
null,
layout.TenantId,
new Dictionary<string, object>()
{
{ "title", "admin" },
{ "icon", "admin" },
{ "alwaysShow", true }
},
new string[] { "admin" });
await SeedMenuAsync(
layout,
data,
"roles",
"roles",
CodeNumberGenerator.AppendCode(adminMenu.Code, CodeNumberGenerator.CreateCode(1)),
"views/admin/roles/index.vue",
"Manage Roles",
"",
"Manage Roles",
adminMenu.Id,
layout.TenantId,
new Dictionary<string, object>()
{
{ "title", "roles" },
{ "icon", "role" },
{ "roles", new string[] { "AbpIdentity.Roles" } }
},
new string[] { "admin" });
await SeedMenuAsync(
layout,
data,
"users",
"users",
CodeNumberGenerator.AppendCode(adminMenu.Code, CodeNumberGenerator.CreateCode(2)),
"views/admin/users/index.vue",
"Manage Users",
"",
"Manage Users",
adminMenu.Id,
layout.TenantId,
new Dictionary<string, object>()
{
{ "title", "users" },
{ "icon", "users" },
{ "roles", new string[] { "AbpIdentity.Users" } }
},
new string[] { "admin" });
await SeedMenuAsync(
layout,
data,
"organization-unit",
"organization-unit",
CodeNumberGenerator.AppendCode(adminMenu.Code, CodeNumberGenerator.CreateCode(3)),
"views/admin/organization-unit/index.vue",
"Manage Organization Units",
"",
"Manage Organization Units",
adminMenu.Id,
layout.TenantId,
new Dictionary<string, object>()
{
{ "title", "organization-unit" },
{ "icon", "organization-unit" },
{ "roles", new string[] { "AbpIdentity.OrganizationUnits" } }
},
new string[] { "admin" });
await SeedMenuAsync(
layout,
data,
"data-dictionary",
"data-dictionary",
CodeNumberGenerator.AppendCode(adminMenu.Code, CodeNumberGenerator.CreateCode(5)),
"views/admin/data-dictionary/index.vue",
"Manage Data Dictionarys",
"",
"Manage Data Dictionarys",
adminMenu.Id,
layout.TenantId,
new Dictionary<string, object>()
{
{ "title", "data-dictionary" },
{ "icon", "data-dictionary" },
{ "roles", new string[] { "Platform.DataDictionary" } }
},
new string[] { "admin" });
await SeedMenuAsync(
layout,
data,
"settings",
"settings",
CodeNumberGenerator.AppendCode(adminMenu.Code, CodeNumberGenerator.CreateCode(6)),
"views/admin/settings/index.vue",
"Manage Settings",
"",
"Manage Settings",
adminMenu.Id,
layout.TenantId,
new Dictionary<string, object>()
{
{ "title", "settings" },
{ "icon", "settings" },
{ "roles", new string[] { "AbpSettingManagement.Settings" } }
},
new string[] { "admin" });
}
private async Task SeedAuditingMenuAsync(Layout layout, Data data)
{
var auditingMenu = await SeedMenuAsync(
layout,
data,
"auditing",
"/auditing",
CodeNumberGenerator.CreateCode(5),
layout.Path,
"Auditing",
"",
"Auditing",
null,
layout.TenantId,
new Dictionary<string, object>()
{
{ "title", "auditing" },
{ "icon", "auditing" },
{ "alwaysShow", true },
{ "roles", new string[]{ "AbpAuditing.AuditLog", "AbpAuditing.SecurityLog" } }
},
new string[] { "admin" });
await SeedMenuAsync(
layout,
data,
"audit-log",
"audit-log",
CodeNumberGenerator.AppendCode(auditingMenu.Code, CodeNumberGenerator.CreateCode(1)),
"views/admin/auditing/audit-log/index.vue",
"Manage AuditLog",
"",
"Manage AuditLog",
auditingMenu.Id,
layout.TenantId,
new Dictionary<string, object>()
{
{ "title", "audit-log" },
{ "icon", "audit-log" },
{ "roles", new string[]{ "AbpAuditing.AuditLog" } }
},
new string[] { "admin" });
await SeedMenuAsync(
layout,
data,
"security-log",
"security-log",
CodeNumberGenerator.AppendCode(auditingMenu.Code, CodeNumberGenerator.CreateCode(2)),
"views/admin/auditing/security-log/index.vue",
"Manage SecurityLog",
"",
"Manage SecurityLog",
auditingMenu.Id,
layout.TenantId,
new Dictionary<string, object>()
{
{ "title", "security-log" },
{ "icon", "security-log" },
{ "roles", new string[]{ "AbpAuditing.SecurityLog" } }
},
new string[] { "admin" });
}
private async Task SeedContainerMenuAsync(Layout layout, Data data)
{
var containerRoot = await SeedMenuAsync(
layout,
data,
"container",
"/container",
CodeNumberGenerator.CreateCode(6),
layout.Path,
"Container",
"",
"Manage Container",
null,
layout.TenantId,
new Dictionary<string, object>()
{
{ "title", "container" },
{ "icon", "container" },
{ "alwaysShow", true }
},
new string[] { "admin" });
await SeedMenuAsync(
layout,
data,
"layouts",
"layouts",
CodeNumberGenerator.AppendCode(containerRoot.Code, CodeNumberGenerator.CreateCode(1)),
"views/container/layouts/index.vue",
"Manage Layouts",
"",
"Manage Layouts",
containerRoot.Id,
containerRoot.TenantId,
new Dictionary<string, object>()
{
{ "title", "layouts" },
{ "icon", "layout" }
},
new string[] { "admin" });
await SeedMenuAsync(
layout,
data,
"menus",
"menus",
CodeNumberGenerator.AppendCode(containerRoot.Code, CodeNumberGenerator.CreateCode(2)),
"views/container/menus/index.vue",
"Manage Menus",
"",
"Manage Menus",
containerRoot.Id,
containerRoot.TenantId,
new Dictionary<string, object>()
{
{ "title", "menus" },
{ "icon", "menu" }
},
new string[] { "admin" });
}
private async Task<Menu> SeedMenuAsync(
Layout layout,
Data data,
string name,
string path,
string code,
string component,
string displayName,
string redirect = "",
string description = "",
Guid? parentId = null,
Guid? tenantId = null,
Dictionary<string, object> meta = null,
string[] roles = null,
Guid[] users = null,
bool isPublic = false
)
{
var menu = await RouteDataSeeder.SeedMenuAsync(
layout,
name,
path,
code,
component,
displayName,
redirect,
description,
parentId,
tenantId,
isPublic
);
foreach (var item in data.Items)
{
menu.SetProperty(item.Name, item.DefaultValue);
}
if (meta != null)
{
foreach (var item in meta)
{
menu.SetProperty(item.Key, item.Value);
}
}
if (roles != null)
{
foreach (var role in roles)
{
await RouteDataSeeder.SeedRoleMenuAsync(role, menu, tenantId);
}
}
if (users != null)
{
foreach (var user in users)
{
await RouteDataSeeder.SeedUserMenuAsync(user, menu, tenantId);
}
}
return menu;
await DataSeeder.SeedAsync(
new DataSeedContext(eventData.Id));
}
}
}

665
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20210621020117_Rename-Route-Field-PlantType-To-Framework.Designer.cs

@ -0,0 +1,665 @@
// <auto-generated />
using System;
using LINGYUN.Platform.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Platform.Migrations
{
[DbContext(typeof(PlatformHttpApiHostMigrationsDbContext))]
[Migration("20210621020117_Rename-Route-Field-PlantType-To-Framework")]
partial class RenameRouteFieldPlantTypeToFramework
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.7");
modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasColumnName("Code");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasMaxLength(1024)
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasColumnName("Description");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasColumnName("DisplayName");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<bool>("IsStatic")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("varchar(30) CHARACTER SET utf8mb4")
.HasColumnName("Name");
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("Name");
b.ToTable("AppPlatformDatas");
});
modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<bool>("AllowBeNull")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(true);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid>("DataId")
.HasColumnType("char(36)");
b.Property<string>("DefaultValue")
.HasMaxLength(128)
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasColumnName("DefaultValue");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasMaxLength(1024)
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasColumnName("Description");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasColumnName("DisplayName");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<bool>("IsStatic")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("varchar(30) CHARACTER SET utf8mb4")
.HasColumnName("Name");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<int>("ValueType")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("DataId");
b.HasIndex("Name");
b.ToTable("AppPlatformDataItems");
});
modelBuilder.Entity("LINGYUN.Platform.Layouts.Layout", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid>("DataId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasColumnName("DisplayName");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasColumnName("ExtraProperties");
b.Property<string>("Framework")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasColumnName("Framework");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasColumnName("Name");
b.Property<string>("Path")
.HasMaxLength(255)
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasColumnName("Path");
b.Property<string>("Redirect")
.HasMaxLength(255)
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasColumnName("Redirect");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
b.ToTable("AppPlatformLayouts");
});
modelBuilder.Entity("LINGYUN.Platform.Menus.Menu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(23)
.HasColumnType("varchar(23) CHARACTER SET utf8mb4")
.HasColumnName("Code");
b.Property<string>("Component")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasColumnName("Component");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasColumnName("DisplayName");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasColumnName("ExtraProperties");
b.Property<string>("Framework")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasColumnName("Framework");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<bool>("IsPublic")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<Guid>("LayoutId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasColumnName("Name");
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<string>("Path")
.HasMaxLength(255)
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasColumnName("Path");
b.Property<string>("Redirect")
.HasMaxLength(255)
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasColumnName("Redirect");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
b.ToTable("AppPlatformMenus");
});
modelBuilder.Entity("LINGYUN.Platform.Menus.RoleMenu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasColumnName("RoleName");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("RoleName", "MenuId");
b.ToTable("AppPlatformRoleMenus");
});
modelBuilder.Entity("LINGYUN.Platform.Menus.UserMenu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("UserId", "MenuId");
b.ToTable("AppPlatformUserMenus");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.AppVersion", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasMaxLength(2048)
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasColumnName("Description");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<int>("PlatformType")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50) CHARACTER SET utf8mb4")
.HasColumnName("Title");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasColumnName("Version");
b.HasKey("Id");
b.HasIndex("Version");
b.ToTable("AppPlatformVersion");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<Guid>("AppVersionId")
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<int>("DownloadCount")
.HasColumnType("int");
b.Property<int>("FileType")
.HasColumnType("int");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasColumnName("Name");
b.Property<string>("Path")
.HasMaxLength(255)
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasColumnName("Path");
b.Property<string>("SHA256")
.IsRequired()
.HasMaxLength(65)
.HasColumnType("varchar(65) CHARACTER SET utf8mb4")
.HasColumnName("SHA256");
b.Property<long>("Size")
.HasColumnType("bigint");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasColumnName("Version");
b.HasKey("Id");
b.HasIndex("AppVersionId");
b.HasIndex("Path", "Name", "Version")
.IsUnique();
b.ToTable("AppPlatformVersionFile");
});
modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b =>
{
b.HasOne("LINGYUN.Platform.Datas.Data", null)
.WithMany("Items")
.HasForeignKey("DataId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b =>
{
b.HasOne("LINGYUN.Platform.Versions.AppVersion", "AppVersion")
.WithMany("Files")
.HasForeignKey("AppVersionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AppVersion");
});
modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b =>
{
b.Navigation("Items");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.AppVersion", b =>
{
b.Navigation("Files");
});
#pragma warning restore 612, 618
}
}
}

81
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20210621020117_Rename-Route-Field-PlantType-To-Framework.cs

@ -0,0 +1,81 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Platform.Migrations
{
public partial class RenameRouteFieldPlantTypeToFramework : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PlatformType",
table: "AppPlatformMenus");
migrationBuilder.DropColumn(
name: "PlatformType",
table: "AppPlatformLayouts");
migrationBuilder.AddColumn<string>(
name: "Framework",
table: "AppPlatformMenus",
type: "varchar(64) CHARACTER SET utf8mb4",
maxLength: 64,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "Framework",
table: "AppPlatformLayouts",
type: "varchar(64) CHARACTER SET utf8mb4",
maxLength: 64,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<bool>(
name: "IsStatic",
table: "AppPlatformDatas",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsStatic",
table: "AppPlatformDataItems",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Framework",
table: "AppPlatformMenus");
migrationBuilder.DropColumn(
name: "Framework",
table: "AppPlatformLayouts");
migrationBuilder.DropColumn(
name: "IsStatic",
table: "AppPlatformDatas");
migrationBuilder.DropColumn(
name: "IsStatic",
table: "AppPlatformDataItems");
migrationBuilder.AddColumn<int>(
name: "PlatformType",
table: "AppPlatformMenus",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "PlatformType",
table: "AppPlatformLayouts",
type: "int",
nullable: false,
defaultValue: 0);
}
}
}

404
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/PlatformHttpApiHostMigrationsDbContextModelSnapshot.cs

@ -16,8 +16,8 @@ namespace LINGYUN.Platform.Migrations
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "3.1.8")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.7");
modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b =>
{
@ -27,73 +27,76 @@ namespace LINGYUN.Platform.Migrations
b.Property<string>("Code")
.IsRequired()
.HasColumnName("Code")
.HasMaxLength(1024)
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasMaxLength(1024);
.HasColumnName("Code");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasMaxLength(40)
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasColumnName("Description")
.HasMaxLength(1024)
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasMaxLength(1024);
.HasColumnName("Description");
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasMaxLength(128)
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
.HasColumnName("DisplayName");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<bool>("IsStatic")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasMaxLength(30)
.HasColumnType("varchar(30) CHARACTER SET utf8mb4")
.HasMaxLength(30);
.HasColumnName("Name");
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
@ -115,72 +118,75 @@ namespace LINGYUN.Platform.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasMaxLength(40)
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid>("DataId")
.HasColumnType("char(36)");
b.Property<string>("DefaultValue")
.HasColumnName("DefaultValue")
.HasMaxLength(128)
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
.HasColumnName("DefaultValue");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasColumnName("Description")
.HasMaxLength(1024)
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasMaxLength(1024);
.HasColumnName("Description");
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasMaxLength(128)
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
.HasColumnName("DisplayName");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<bool>("IsStatic")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasMaxLength(30)
.HasColumnType("varchar(30) CHARACTER SET utf8mb4")
.HasMaxLength(30);
.HasColumnName("Name");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<int>("ValueType")
.HasColumnType("int");
@ -202,78 +208,81 @@ namespace LINGYUN.Platform.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasMaxLength(40)
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid>("DataId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasMaxLength(128)
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
.HasColumnName("DisplayName");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasColumnName("ExtraProperties");
b.Property<string>("Framework")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasColumnName("Framework");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasMaxLength(64)
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
.HasColumnName("Name");
b.Property<string>("Path")
.HasColumnName("Path")
.HasMaxLength(255)
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<int>("PlatformType")
.HasColumnType("int");
.HasColumnName("Path");
b.Property<string>("Redirect")
.HasColumnName("Redirect")
.HasMaxLength(255)
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
.HasColumnName("Redirect");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
@ -288,96 +297,99 @@ namespace LINGYUN.Platform.Migrations
b.Property<string>("Code")
.IsRequired()
.HasColumnName("Code")
.HasMaxLength(23)
.HasColumnType("varchar(23) CHARACTER SET utf8mb4")
.HasMaxLength(23);
.HasColumnName("Code");
b.Property<string>("Component")
.IsRequired()
.HasColumnName("Component")
.HasMaxLength(255)
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
.HasColumnName("Component");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasMaxLength(40)
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasMaxLength(128)
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
.HasColumnName("DisplayName");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasColumnName("ExtraProperties");
b.Property<string>("Framework")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasColumnName("Framework");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<bool>("IsPublic")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<Guid>("LayoutId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasMaxLength(64)
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
.HasColumnName("Name");
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<string>("Path")
.HasColumnName("Path")
.HasMaxLength(255)
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<int>("PlatformType")
.HasColumnType("int");
.HasColumnName("Path");
b.Property<string>("Redirect")
.HasColumnName("Redirect")
.HasMaxLength(255)
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
.HasColumnName("Redirect");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
@ -391,33 +403,33 @@ namespace LINGYUN.Platform.Migrations
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnName("RoleName")
.HasMaxLength(256)
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
.HasColumnName("RoleName");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
@ -433,27 +445,27 @@ namespace LINGYUN.Platform.Migrations
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
@ -473,48 +485,48 @@ namespace LINGYUN.Platform.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasMaxLength(40)
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasColumnName("Description")
.HasMaxLength(2048)
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(2048);
.HasColumnName("Description");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<int>("Level")
.HasColumnType("int");
@ -523,20 +535,20 @@ namespace LINGYUN.Platform.Migrations
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<string>("Title")
.IsRequired()
.HasColumnName("Title")
.HasMaxLength(50)
.HasColumnType("varchar(50) CHARACTER SET utf8mb4")
.HasMaxLength(50);
.HasColumnName("Title");
b.Property<string>("Version")
.IsRequired()
.HasColumnName("Version")
.HasMaxLength(20)
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
.HasColumnName("Version");
b.HasKey("Id");
@ -555,12 +567,12 @@ namespace LINGYUN.Platform.Migrations
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<int>("DownloadCount")
.HasColumnType("int");
@ -569,42 +581,42 @@ namespace LINGYUN.Platform.Migrations
.HasColumnType("int");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasMaxLength(255)
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
.HasColumnName("Name");
b.Property<string>("Path")
.HasColumnName("Path")
.HasMaxLength(255)
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
.HasColumnName("Path");
b.Property<string>("SHA256")
.IsRequired()
.HasColumnName("SHA256")
.HasMaxLength(65)
.HasColumnType("varchar(65) CHARACTER SET utf8mb4")
.HasMaxLength(65);
.HasColumnName("SHA256");
b.Property<long>("Size")
.HasColumnType("bigint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<string>("Version")
.IsRequired()
.HasColumnName("Version")
.HasMaxLength(20)
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
.HasColumnName("Version");
b.HasKey("Id");
@ -632,6 +644,18 @@ namespace LINGYUN.Platform.Migrations
.HasForeignKey("AppVersionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AppVersion");
});
modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b =>
{
b.Navigation("Items");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.AppVersion", b =>
{
b.Navigation("Files");
});
#pragma warning restore 612, 618
}

5
vueJs/src/api/data-dictionary.ts

@ -13,6 +13,11 @@ export default class DataDictionaryService {
return ApiService.Get<Data>(_url, serviceUrl)
}
public static getByName(name: string) {
const _url = sourceUrl + '/by-name/' + name
return ApiService.Get<Data>(_url, serviceUrl)
}
public static getList(payload: GetDataByPaged) {
const _url = sourceUrl + '?' + urlStringify(payload)
return ApiService.Get<PagedResultDto<Data >>(_url, serviceUrl)

38
vueJs/src/api/layout.ts

@ -38,38 +38,6 @@ export default class LayoutService {
}
}
export enum PlatformType {
None = 0,
WinCe = 2,
WinForm = 4,
Desktop = WinCe | WinForm,
WebForm = 8,
WebMvc = 16,
WebMvvm = 32,
Web = WebForm | WebMvc | WebMvvm,
Android = 64,
iOS = 128,
Mobile = Android | iOS,
MiniProgram = 256,
All = Desktop | Web | Mobile | MiniProgram
}
export const PlatformTypes = [
{ key: 'None', value: PlatformType.None },
{ key: 'WinCe', value: PlatformType.WinCe },
{ key: 'WinForm', value: PlatformType.WinForm },
{ key: 'Desktop', value: PlatformType.Desktop },
{ key: 'WebForm', value: PlatformType.WebForm },
{ key: 'WebMvc', value: PlatformType.WebMvc },
{ key: 'WebMvvm', value: PlatformType.WebMvvm },
{ key: 'Web', value: PlatformType.Web },
{ key: 'Android', value: PlatformType.Android },
{ key: 'iOS', value: PlatformType.iOS },
{ key: 'Mobile', value: PlatformType.Mobile },
{ key: 'MiniProgram', value: PlatformType.MiniProgram },
{ key: 'All', value: PlatformType.All }
]
export class Route {
id!: string
name!: string
@ -81,7 +49,7 @@ export class Route {
}
export class Layout extends Route {
platformType!: PlatformType
framework!: string
dataId!: string
}
@ -91,11 +59,11 @@ export class LayoutCreateOrUpdate {
displayName!: string
description?: string
redirect?: string
platformType!: PlatformType
}
export class LayoutCreate extends LayoutCreateOrUpdate {
dataId!: string
framework!: string
}
export class LayoutUpdate extends LayoutCreateOrUpdate {
@ -105,5 +73,5 @@ export class LayoutUpdate extends LayoutCreateOrUpdate {
export class GetLayoutByPaged extends PagedAndSortedResultRequestDto {
filter = ''
reverse = false
platformType?: PlatformType | null
framework = ''
}

21
vueJs/src/api/menu.ts

@ -1,5 +1,5 @@
import ApiService from './serviceBase'
import { Route, PlatformType } from './layout'
import { Route } from './layout'
import { urlStringify } from '@/utils/index'
import { ISortedResultRequest, PagedResultDto, PagedAndSortedResultRequestDto, ListResultDto } from './types'
@ -24,18 +24,18 @@ export default class MenuService {
return ApiService.Get<PagedResultDto<Menu>>(_url, serviceUrl)
}
public static getMyMenuList(platformType: PlatformType) {
const _url = sourceUrl + '/by-current-user?platformType=' + platformType
public static getMyMenuList(framework: string) {
const _url = sourceUrl + '/by-current-user?framework=' + framework
return ApiService.Get<ListResultDto<Menu>>(_url, serviceUrl)
}
public static getRoleMenuList(role: string, platformType: PlatformType) {
const _url = sourceUrl + `/by-role/${role}/${platformType}`
public static getRoleMenuList(role: string, framework: string) {
const _url = sourceUrl + `/by-role/${role}/${framework}`
return ApiService.Get<ListResultDto<Menu>>(_url, serviceUrl)
}
public static getUserMenuList(userId: string, platformType: PlatformType) {
const _url = sourceUrl + `/by-user/${userId}/${platformType}`
public static getUserMenuList(userId: string, framework: string) {
const _url = sourceUrl + `/by-user/${userId}/${framework}`
return ApiService.Get<ListResultDto<Menu>>(_url, serviceUrl)
}
@ -72,7 +72,6 @@ export class MenuCreateOrUpdate {
description?: string
redirect?: string
isPublic!: boolean
platformType!: PlatformType
meta: {[key: string]: any} = {}
}
@ -91,7 +90,7 @@ export class GetAllMenu implements ISortedResultRequest {
reverse = false
parentId?: string
layoutId?: string
platformType?: PlatformType
framework = ''
}
export class GetMenuByPaged extends PagedAndSortedResultRequestDto {
@ -99,14 +98,14 @@ export class GetMenuByPaged extends PagedAndSortedResultRequestDto {
reverse = false
layoutId?: string
parentId?: string
platformType?: PlatformType
framework = ''
}
export class Menu extends Route {
code!: string
layoutId!: string
component!: string
platformType!: PlatformType
framework = ''
parentId?: string
isPublic!: boolean
children = new Array<Menu>()

3
vueJs/src/store/modules/permission.ts

@ -5,7 +5,6 @@ import { asyncRoutes, constantRoutes } from '@/router'
import store from '@/store'
import { AbpModule } from '@/store/modules/abp'
import MenuService, { Menu } from '@/api/menu'
import { PlatformType } from '@/api/layout'
import { generateTree } from '@/utils'
const mapMetaBoolean = (key: string, meta: any) => {
@ -121,7 +120,7 @@ class Permission extends VuexModule implements IPermissionState {
// }
// 取消注释用来启用后端动态路由配置
const { items } = await MenuService.getMyMenuList(PlatformType.WebMvvm)
const { items } = await MenuService.getMyMenuList('Vue Element Admin')
const dynamicRoutes = filterDynamicRoutes(generateTree(items))
this.SET_ROUTES(dynamicRoutes)

12
vueJs/src/views/admin/data-dictionary/components/DataDictionaryTree.vue

@ -10,7 +10,7 @@
style="float: right;"
type="primary"
icon="ivu-icon ivu-icon-md-add"
@click="handleEditData('')"
@click="handleEditData(null)"
>
{{ $t('AppPlatform.Data:AddNew') }}
</el-button>
@ -74,7 +74,7 @@ const $contextmenu = Vue.prototype.$contextmenu
export default class DataDictionaryTree extends Mixins(LocalizationMiXin) {
private showDataDialog = false
private isEditData = false
private editDataId = ''
private editDataId: string | null = ''
private editDataTitle = ''
private datas = []
@ -108,7 +108,7 @@ export default class DataDictionaryTree extends Mixins(LocalizationMiXin) {
icon: 'ivu-icon ivu-icon-md-add',
disabled: !checkPermission(['Platform.DataDictionary.Create']),
onClick: () => {
this.handleEditData('')
this.handleEditData(null)
}
},
{
@ -153,15 +153,13 @@ export default class DataDictionaryTree extends Mixins(LocalizationMiXin) {
}
}
private handleEditData(dataId: string) {
private handleEditData(dataId: string | null) {
this.editDataTitle = this.l('AppPlatform.Data:AddNew')
this.isEditData = false
if (dataId) {
this.editDataId = dataId
if (dataId) {
this.isEditData = true
this.editDataTitle = this.l('AppPlatform.Data:Edit')
} else {
this.editDataId = ''
}
this.showDataDialog = true
}

36
vueJs/src/views/admin/roles/components/ManageRoleMenuDialog.vue

@ -14,21 +14,21 @@
<el-card>
<el-form-item
label-width="120px"
:label="$t('AppPlatform.DisplayName:PlatformType')"
:label="$t('AppPlatform.DisplayName:UIFramework')"
>
<el-select
v-model="getMenuQuery.platformType"
v-model="getMenuQuery.framework"
style="width: 100%;"
class="filter-item"
clearable
:placeholder="$t('pleaseSelectBy', {name: $t('AppPlatform.DisplayName:PlatformType')})"
@change="onPlatformTypeChanged"
:placeholder="$t('pleaseSelectBy', {name: $t('AppPlatform.DisplayName:UIFramework')})"
@change="onFrameworksChanged"
>
<el-option
v-for="item in platformTypes"
:key="item.key"
:label="item.key"
:value="item.value"
v-for="framework in uiFrameworks"
:key="framework"
:label="framework"
:value="framework"
/>
</el-select>
</el-form-item>
@ -74,9 +74,9 @@
<script lang="ts">
import { Component, Mixins, Prop, Watch } from 'vue-property-decorator'
import LocalizationMiXin from '@/mixins/LocalizationMiXin'
import DataService from '@/api/data-dictionary'
import MenuService, { Menu, GetAllMenu, RoleMenu } from '@/api/menu'
import { generateTree } from '@/utils'
import { PlatformType, PlatformTypes } from '@/api/layout'
import { Tree } from 'element-ui'
@Component({
@ -92,7 +92,7 @@ export default class ManageRoleMenuDialog extends Mixins(LocalizationMiXin) {
private menus = new Array<Menu>()
private roleMenuIds = new Array<string>()
private getMenuQuery = new GetAllMenu()
private platformTypes = PlatformTypes
private uiFrameworks: string[] = []
private confirmButtonBusy = false
private menuProps = {
children: 'children',
@ -111,11 +111,23 @@ export default class ManageRoleMenuDialog extends Mixins(LocalizationMiXin) {
this.handleGetRoleMenus()
}
private onPlatformTypeChanged() {
monted() {
this.getUIFrameworks()
}
private onFrameworksChanged() {
this.handleGetMenus()
this.handleGetRoleMenus()
}
private getUIFrameworks() {
DataService
.getByName('UI Framewark')
.then(res => {
this.uiFrameworks = res.items.map(item => item.name)
})
}
private handleGetMenus() {
MenuService
.getAll(this.getMenuQuery)
@ -127,7 +139,7 @@ export default class ManageRoleMenuDialog extends Mixins(LocalizationMiXin) {
private handleGetRoleMenus() {
if (this.showDialog && this.roleName) {
MenuService
.getRoleMenuList(this.roleName, this.getMenuQuery.platformType || PlatformType.None)
.getRoleMenuList(this.roleName, this.getMenuQuery.framework)
.then(res => {
this.roleMenuIds = res.items.map(item => item.id)
})

2
vueJs/src/views/admin/roles/index.vue

@ -3,7 +3,7 @@
<div class="filter-container">
<el-button
class="filter-item"
style="margin-left: 10px; text-alignt"
style="margin-left: 10px;"
type="primary"
@click="refreshPagedData"
>

36
vueJs/src/views/admin/users/components/ManageUserMenuDialog.vue

@ -14,21 +14,21 @@
<el-card>
<el-form-item
label-width="120px"
:label="$t('AppPlatform.DisplayName:PlatformType')"
:label="$t('AppPlatform.DisplayName:UIFramework')"
>
<el-select
v-model="getMenuQuery.platformType"
v-model="getMenuQuery.framework"
style="width: 100%;"
class="filter-item"
clearable
:placeholder="$t('pleaseSelectBy', {name: $t('AppPlatform.DisplayName:PlatformType')})"
@change="onPlatformTypeChanged"
:placeholder="$t('pleaseSelectBy', {name: $t('AppPlatform.DisplayName:UIFramework')})"
@change="onFrameworkChanged"
>
<el-option
v-for="item in platformTypes"
:key="item.key"
:label="item.key"
:value="item.value"
v-for="framework in uiFrameworks"
:key="framework"
:label="framework"
:value="framework"
/>
</el-select>
</el-form-item>
@ -74,9 +74,9 @@
<script lang="ts">
import { Component, Mixins, Prop, Watch } from 'vue-property-decorator'
import LocalizationMiXin from '@/mixins/LocalizationMiXin'
import DataService from '@/api/data-dictionary'
import MenuService, { Menu, GetAllMenu, UserMenu } from '@/api/menu'
import { generateTree } from '@/utils'
import { PlatformType, PlatformTypes } from '@/api/layout'
import { Tree } from 'element-ui'
@Component({
@ -90,9 +90,9 @@ export default class ManageUserMenuDialog extends Mixins(LocalizationMiXin) {
private userId!: string
private menus = new Array<Menu>()
private uiFrameworks: string[] = []
private userMenuIds = new Array<string>()
private getMenuQuery = new GetAllMenu()
private platformTypes = PlatformTypes
private confirmButtonBusy = false
private menuProps = {
children: 'children',
@ -111,11 +111,23 @@ export default class ManageUserMenuDialog extends Mixins(LocalizationMiXin) {
this.handleGetUserMenus()
}
private onPlatformTypeChanged() {
monted() {
this.getUIFrameworks()
}
private onFrameworkChanged() {
this.handleGetMenus()
this.handleGetUserMenus()
}
private getUIFrameworks() {
DataService
.getByName('UI Framewark')
.then(res => {
this.uiFrameworks = res.items.map(item => item.name)
})
}
private handleGetMenus() {
MenuService
.getAll(this.getMenuQuery)
@ -127,7 +139,7 @@ export default class ManageUserMenuDialog extends Mixins(LocalizationMiXin) {
private handleGetUserMenus() {
if (this.showDialog && this.userId) {
MenuService
.getUserMenuList(this.userId, this.getMenuQuery.platformType || PlatformType.None)
.getUserMenuList(this.userId, this.getMenuQuery.framework)
.then(res => {
this.userMenuIds = res.items.map(item => item.id)
})

2
vueJs/src/views/admin/users/index.vue

@ -13,7 +13,7 @@
/>
<el-button
class="filter-item"
style="margin-left: 10px; text-alignt"
style="margin-left: 10px;"
type="primary"
@click="refreshPagedData"
>

27
vueJs/src/views/container/layouts/components/CreateOrUpdateLayoutDialog.vue

@ -16,25 +16,27 @@
label-width="120px"
>
<el-form-item
:label="$t('AppPlatform.DisplayName:PlatformType')"
v-if="!isEdit"
prop="framework"
:label="$t('AppPlatform.DisplayName:UIFramework')"
:rules="{
required: true,
message: $t('pleaseInputBy', {key: $t('AppPlatform.DisplayName:PlatformType')}),
message: $t('pleaseInputBy', {key: $t('AppPlatform.DisplayName:UIFramework')}),
trigger: 'blur'
}"
>
<el-select
v-model="layout.platformType"
v-model="layout.framework"
style="width: 100%;"
class="filter-item"
clearable
:placeholder="$t('pleaseSelectBy', {name: $t('AppPlatform.DisplayName:PlatformType')})"
:placeholder="$t('pleaseSelectBy', {name: $t('AppPlatform.DisplayName:UIFramework')})"
>
<el-option
v-for="platformType in platformTypes"
:key="platformType.key"
:label="platformType.key"
:value="platformType.value"
v-for="framework in uiFrameworks"
:key="framework"
:label="framework"
:value="framework"
/>
</el-select>
</el-form-item>
@ -148,8 +150,7 @@ import LayoutService, {
Layout,
LayoutCreateOrUpdate,
LayoutCreate,
LayoutUpdate,
PlatformTypes
LayoutUpdate
} from '@/api/layout'
@Component({
@ -162,9 +163,11 @@ export default class CreateOrUpdateLayoutDialog extends Mixins(LocalizationMiXin
@Prop({ default: null })
private layoutId!: string
@Prop({ default: [] })
private uiFrameworks!: string[]
private layout = new Layout()
private datas = new Array<Data>()
private platformTypes = PlatformTypes
private dataId = ''
get isEdit() {
@ -233,6 +236,7 @@ export default class CreateOrUpdateLayoutDialog extends Mixins(LocalizationMiXin
const create = new LayoutCreate()
this.updateMenuByInput(create)
create.dataId = this.dataId
create.framework = this.layout.framework
LayoutService
.create(create)
.then(res => {
@ -257,7 +261,6 @@ export default class CreateOrUpdateLayoutDialog extends Mixins(LocalizationMiXin
update.displayName = this.layout.displayName
update.description = this.layout.description
update.redirect = this.layout.redirect
update.platformType = this.layout.platformType
}
}
</script>

30
vueJs/src/views/container/layouts/index.vue

@ -12,19 +12,19 @@
</el-form-item>
<el-form-item
label-width="100px"
:label="$t('AppPlatform.DisplayName:PlatformType')"
:label="$t('AppPlatform.DisplayName:UIFramework')"
>
<el-select
v-model="dataFilter.platformType"
v-model="dataFilter.framework"
class="filter-item"
clearable
:placeholder="$t('pleaseSelectBy', {name: $t('AppPlatform.DisplayName:PlatformType')})"
:placeholder="$t('pleaseSelectBy', {name: $t('AppPlatform.DisplayName:UIFramework')})"
>
<el-option
v-for="item in platformTypes"
:key="item.key"
:label="item.key"
:value="item.value"
v-for="framework in uiFrameworks"
:key="framework"
:label="framework"
:value="framework"
/>
</el-select>
</el-form-item>
@ -147,6 +147,7 @@
<create-or-update-layout-dialog
:show-dialog="showEditDialog"
:layout-id="editLayoutId"
:ui-frameworks="uiFrameworks"
@closed="onLayoutEditDialogClosed"
/>
</div>
@ -155,12 +156,14 @@
<script lang="ts">
import { dateFormat, abpPagerFormat } from '@/utils'
import { checkPermission } from '@/utils/permission'
import LayoutService, { Layout, GetLayoutByPaged, PlatformTypes } from '@/api/layout'
import LayoutService, { Layout, GetLayoutByPaged } from '@/api/layout'
import DataListMiXin from '@/mixins/DataListMiXin'
import { Component, Mixins } from 'vue-property-decorator'
import Pagination from '@/components/Pagination/index.vue'
import CreateOrUpdateLayoutDialog from './components/CreateOrUpdateLayoutDialog.vue'
import DataService from '@/api/data-dictionary'
@Component({
name: 'Layouts',
components: {
@ -181,10 +184,11 @@ export default class extends Mixins(DataListMiXin) {
private showEditDialog = false
private editLayoutId = ''
private platformTypes = PlatformTypes
private uiFrameworks: string[] = []
mounted() {
this.refreshPagedData()
this.getUIFrameworks()
}
protected processDataFilter() {
@ -195,6 +199,14 @@ export default class extends Mixins(DataListMiXin) {
return LayoutService.getList(filter)
}
private getUIFrameworks() {
DataService
.getByName('UI Framewark')
.then(res => {
this.uiFrameworks = res.items.map(item => item.name)
})
}
private handleRemoveLayout(layout: Layout) {
this.$confirm(this.l('questingDeleteByMessage', { message: layout.displayName }),
this.l('AppPlatform.Layout:Delete'), {

29
vueJs/src/views/container/menus/index.vue

@ -12,19 +12,19 @@
</el-form-item>
<el-form-item
label-width="100px"
:label="$t('AppPlatform.DisplayName:PlatformType')"
:label="$t('AppPlatform.DisplayName:UIFramework')"
>
<el-select
v-model="dataQueryFilter.platformType"
v-model="dataQueryFilter.framework"
class="filter-item"
clearable
:placeholder="$t('pleaseSelectBy', {name: $t('AppPlatform.DisplayName:PlatformType')})"
:placeholder="$t('pleaseSelectBy', {name: $t('AppPlatform.DisplayName:UIFramework')})"
>
<el-option
v-for="item in platformTypes"
:key="item.key"
:label="item.key"
:value="item.value"
v-for="framework in uiFrameworks"
:key="framework"
:label="framework"
:value="framework"
/>
</el-select>
</el-form-item>
@ -178,6 +178,7 @@
:show-dialog="showEditDialog"
:menu-id="editMenuId"
:parent-id="parentMenuId"
:ui-frameworks="uiFrameworks"
@closed="onMenuEditDialogClosed"
/>
</div>
@ -186,8 +187,9 @@
<script lang="ts">
import { dateFormat, generateTree } from '@/utils'
import { checkPermission } from '@/utils/permission'
import LayoutService, { PlatformTypes, Layout } from '@/api/layout'
import LayoutService, { Layout } from '@/api/layout'
import MenuService, { Menu, GetAllMenu } from '@/api/menu'
import DataService from '@/api/data-dictionary'
import DataListMiXin from '@/mixins/DataListMiXin'
import Component, { mixins } from 'vue-class-component'
import Pagination from '@/components/Pagination/index.vue'
@ -215,9 +217,10 @@ export default class extends mixins(DataListMiXin) {
private parentMenuId = ''
private layouts = new Array<Layout>()
private platformTypes = PlatformTypes
private uiFrameworks: string[] = []
mounted() {
this.getUIFrameworks()
this.handleGetLayouts()
this.refreshData()
}
@ -235,6 +238,14 @@ export default class extends mixins(DataListMiXin) {
})
}
private getUIFrameworks() {
DataService
.getByName('UI Framewark')
.then(res => {
this.uiFrameworks = res.items.map(item => item.name)
})
}
private handleGetLayouts() {
LayoutService
.getAllList()

6
vueJs/vue.config.js

@ -24,7 +24,7 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_IDENTITY_SERVER]: {
// IdentityServer4 address
target: 'http://127.0.0.1:44385',
target: 'http://10.21.15.28:44385',
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_IDENTITY_SERVER]: ''
@ -32,7 +32,7 @@ module.exports = {
},
[process.env.VUE_APP_SIGNALR_SERVER]: {
// api gateway address websocket protocol
target: 'ws://127.0.0.1:30000',
target: 'ws://10.21.15.28:30000',
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_SIGNALR_SERVER]: ''
@ -41,7 +41,7 @@ module.exports = {
},
[process.env.VUE_APP_BASE_API]: {
// api gateway address
target: 'http://127.0.0.1:30000',
target: 'http://10.21.15.28:30000',
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save