Browse Source

feat: 调整模板

pull/126/head 7.2.2.5
wangjun 3 years ago
parent
commit
4d5bf6d98e
  1. 48
      templates/abp-vnext-pro-nuget-all/aspnet-core/Directory.Build.Lion.targets
  2. 2
      templates/abp-vnext-pro-nuget-all/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.Production.json
  3. 1008
      templates/abp-vnext-pro-nuget-all/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/logs/logs-20230617.txt
  4. 2
      templates/abp-vnext-pro-nuget-all/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20230617073909_Init.Designer.cs
  5. 0
      templates/abp-vnext-pro-nuget-all/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20230617073909_Init.cs
  6. 4
      templates/abp-vnext-pro-nuget-all/vben28/nswag/nswag.json
  7. 2
      templates/abp-vnext-pro-nuget-all/vben28/nswag/refresh.bat
  8. 4
      templates/abp-vnext-pro-nuget-all/vben28/src/components/Application/src/AppLogo.vue
  9. 2
      templates/abp-vnext-pro-nuget-all/vben28/src/components/Page/index.ts
  10. 2
      templates/abp-vnext-pro-nuget-all/vben28/src/components/Page/src/PageWrapper.vue
  11. 2
      templates/abp-vnext-pro-nuget-all/vben28/src/components/Table/src/BasicTable.vue
  12. 2
      templates/abp-vnext-pro-nuget-all/vben28/src/enums/pageEnum.ts
  13. 8
      templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/en/common.ts
  14. 12
      templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/en/routes/admin.ts
  15. 1
      templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/en/sys.ts
  16. 8
      templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/zh-CN/common.ts
  17. 12
      templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/zh-CN/routes/admin.ts
  18. 1
      templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/zh-CN/sys.ts
  19. 784
      templates/abp-vnext-pro-nuget-all/vben28/src/services/ServiceProxies.ts
  20. 26
      templates/abp-vnext-pro-nuget-all/vben28/src/services/ServiceProxyBase.ts
  21. 4
      templates/abp-vnext-pro-nuget-all/vben28/src/settings/componentSetting.ts
  22. 164
      templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/auditLog/AuditLog.ts
  23. 137
      templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/auditLog/AuditLog.vue
  24. 23
      templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/auditLog/AuditLogDetail.vue
  25. 6
      templates/abp-vnext-pro-nuget-module/Directory.Build.Lion.targets
  26. 48
      templates/abp-vnext-pro-nuget-simplify/aspnet-core/Directory.Build.Lion.targets
  27. 2
      templates/abp-vnext-pro-nuget-simplify/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20230617074136_Init.Designer.cs
  28. 0
      templates/abp-vnext-pro-nuget-simplify/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20230617074136_Init.cs
  29. 10
      templates/abp-vnext-pro-nuget-simplify/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj
  30. 2
      templates/abp-vnext-pro-nuget-simplify/vben28/nswag/nswag.json
  31. 2
      templates/abp-vnext-pro-nuget-simplify/vben28/nswag/refresh.bat
  32. 4
      templates/abp-vnext-pro-nuget-simplify/vben28/src/components/Application/src/AppLogo.vue
  33. 2
      templates/abp-vnext-pro-nuget-simplify/vben28/src/components/Page/index.ts
  34. 2
      templates/abp-vnext-pro-nuget-simplify/vben28/src/components/Page/src/PageWrapper.vue
  35. 2
      templates/abp-vnext-pro-nuget-simplify/vben28/src/components/Table/src/BasicTable.vue
  36. 2
      templates/abp-vnext-pro-nuget-simplify/vben28/src/enums/pageEnum.ts
  37. 105
      templates/abp-vnext-pro-nuget-simplify/vben28/src/services/ServiceProxyBase.ts
  38. 4
      templates/abp-vnext-pro-nuget-simplify/vben28/src/settings/componentSetting.ts
  39. 164
      templates/abp-vnext-pro-nuget-simplify/vben28/src/views/admin/auditLog/AuditLog.ts
  40. 137
      templates/abp-vnext-pro-nuget-simplify/vben28/src/views/admin/auditLog/AuditLog.vue
  41. 23
      templates/abp-vnext-pro-nuget-simplify/vben28/src/views/admin/auditLog/AuditLogDetail.vue

48
templates/abp-vnext-pro-nuget-all/aspnet-core/Directory.Build.Lion.targets

@ -1,34 +1,34 @@
<Project> <Project>
<!-- Lion.AbpPro包--> <!-- Lion.AbpPro包-->
<ItemGroup> <ItemGroup>
<PackageReference Update="Lion.AbpPro.Core" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.Core" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.Shared.Hosting.Microservices" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.Shared.Hosting.Microservices" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.Shared.Hosting.Gateways" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.Shared.Hosting.Gateways" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Application" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.BasicManagement.Application" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Application.Contracts" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.BasicManagement.Application.Contracts" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Domain" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.BasicManagement.Domain" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Domain.Shared" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.BasicManagement.Domain.Shared" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.EntityFrameworkCore" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.BasicManagement.EntityFrameworkCore" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi.Client" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi.Client" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Application" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.NotificationManagement.Application" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Application.Contracts" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.NotificationManagement.Application.Contracts" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Domain" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.NotificationManagement.Domain" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Domain.Shared" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.NotificationManagement.Domain.Shared" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.EntityFrameworkCore" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.NotificationManagement.EntityFrameworkCore" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi.Client" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi.Client" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Application" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Application" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Application.Contracts" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Application.Contracts" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain.Shared" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain.Shared" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi.Client" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi.Client" Version="7.2.2.5"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

2
templates/abp-vnext-pro-nuget-all/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.Production.json

@ -37,7 +37,7 @@
"Default": "Data Source=mysql;Port=3306;Database=MyCompanyNameMyProjectNameDB;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true" "Default": "Data Source=mysql;Port=3306;Database=MyCompanyNameMyProjectNameDB;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true"
}, },
"Redis": { "Redis": {
"Configuration": "redis,password=1q2w3E*,defaultdatabase=1" "Configuration": "localhost,password=1q2w3E*,defaultdatabase=1"
}, },
"Jwt": { "Jwt": {
"Audience": "MyCompanyName.MyProjectName", "Audience": "MyCompanyName.MyProjectName",

1008
templates/abp-vnext-pro-nuget-all/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/logs/logs-20230617.txt

File diff suppressed because it is too large

2
templates/abp-vnext-pro-nuget-all/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20230517131456_Init.Designer.cs → templates/abp-vnext-pro-nuget-all/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20230617073909_Init.Designer.cs

@ -12,7 +12,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace MyCompanyName.MyProjectName.Migrations namespace MyCompanyName.MyProjectName.Migrations
{ {
[DbContext(typeof(MyProjectNameDbContext))] [DbContext(typeof(MyProjectNameDbContext))]
[Migration("20230517131456_Init")] [Migration("20230617073909_Init")]
partial class Init partial class Init
{ {
/// <inheritdoc /> /// <inheritdoc />

0
templates/abp-vnext-pro-nuget-all/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20230517131456_Init.cs → templates/abp-vnext-pro-nuget-all/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20230617073909_Init.cs

4
templates/abp-vnext-pro-nuget-all/vben28/nswag/nswag.json

@ -1,5 +1,5 @@
{ {
"runtime": "Net60", "runtime": "Net70",
"defaultVariables": null, "defaultVariables": null,
"documentGenerator": { "documentGenerator": {
"fromDocument": { "fromDocument": {
@ -71,4 +71,4 @@
"newLineBehavior": "Auto" "newLineBehavior": "Auto"
} }
} }
} }

2
templates/abp-vnext-pro-nuget-all/vben28/nswag/refresh.bat

@ -1 +1 @@
"..\node_modules\.bin\nswag" run /runtime:Net60 "..\node_modules\.bin\nswag" run /runtime:Net70

4
templates/abp-vnext-pro-nuget-all/vben28/src/components/Application/src/AppLogo.vue

@ -64,8 +64,8 @@
display: flex; display: flex;
align-items: center; align-items: center;
padding-left: 7px; padding-left: 7px;
cursor: pointer;
transition: all 0.2s ease; transition: all 0.2s ease;
cursor: pointer;
&.light { &.light {
border-bottom: 1px solid @border-color-base; border-bottom: 1px solid @border-color-base;
@ -84,9 +84,9 @@
} }
&__title { &__title {
transition: all 0.5s;
font-size: 16px; font-size: 16px;
font-weight: 700; font-weight: 700;
transition: all 0.5s;
line-height: normal; line-height: normal;
} }
} }

2
templates/abp-vnext-pro-nuget-all/vben28/src/components/Page/index.ts

@ -5,5 +5,3 @@ import pageWrapper from './src/PageWrapper.vue';
export const PageFooter = withInstall(pageFooter); export const PageFooter = withInstall(pageFooter);
export const PageWrapper = withInstall(pageWrapper); export const PageWrapper = withInstall(pageWrapper);
export const PageWrapperFixedHeightKey = 'PageWrapperFixedHeight';

2
templates/abp-vnext-pro-nuget-all/vben28/src/components/Page/src/PageWrapper.vue

@ -43,7 +43,7 @@
import { omit } from 'lodash-es'; import { omit } from 'lodash-es';
import { PageHeader } from 'ant-design-vue'; import { PageHeader } from 'ant-design-vue';
import { useContentHeight } from '/@/hooks/web/useContentHeight'; import { useContentHeight } from '/@/hooks/web/useContentHeight';
import { PageWrapperFixedHeightKey } from '..'; import { PageWrapperFixedHeightKey } from '/@/enums/pageEnum';
export default defineComponent({ export default defineComponent({
name: 'PageWrapper', name: 'PageWrapper',

2
templates/abp-vnext-pro-nuget-all/vben28/src/components/Table/src/BasicTable.vue

@ -49,7 +49,7 @@
import { defineComponent, ref, computed, unref, toRaw, inject, watchEffect } from 'vue'; import { defineComponent, ref, computed, unref, toRaw, inject, watchEffect } from 'vue';
import { Table } from 'ant-design-vue'; import { Table } from 'ant-design-vue';
import { BasicForm, useForm } from '/@/components/Form/index'; import { BasicForm, useForm } from '/@/components/Form/index';
import { PageWrapperFixedHeightKey } from '/@/components/Page'; import { PageWrapperFixedHeightKey } from '/@/enums/pageEnum';
import HeaderCell from './components/HeaderCell.vue'; import HeaderCell from './components/HeaderCell.vue';
import { InnerHandlers } from './types/table'; import { InnerHandlers } from './types/table';

2
templates/abp-vnext-pro-nuget-all/vben28/src/enums/pageEnum.ts

@ -8,3 +8,5 @@ export enum PageEnum {
// error log page path // error log page path
ERROR_LOG_PAGE = '/error-log/list', ERROR_LOG_PAGE = '/error-log/list',
} }
export const PageWrapperFixedHeightKey = 'PageWrapperFixedHeight';

8
templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/en/common.ts

@ -33,5 +33,11 @@ export default {
status: 'Status', status: 'Status',
active: 'IsActive', active: 'IsActive',
download: 'DownLoad', download: 'DownLoad',
export:"Export" export: 'Export',
isEnabled: 'IsEnabled',
default: 'Default',
name: 'Name',
value: 'Value',
parameterValidationFailure: 'Parameter Validation Failure',
permissionDenied: 'Permission Denied',
}; };

12
templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/en/routes/admin.ts

@ -2,7 +2,13 @@ export default {
systemManagement: 'SystemManagement', systemManagement: 'SystemManagement',
userManagement: 'UserManagement', userManagement: 'UserManagement',
roleManagement: 'RoleManagement', roleManagement: 'RoleManagement',
languageManagement: 'LanguageManagement',
languageTextManagement: 'LanguageTextManagement',
language_cultureName: 'CultureName',
language_uiCultureName: 'UICultureName',
language_displayName: 'DisplayName',
language_flagIcon: 'FlagIcon',
languageTexts_resourceName: 'ResourceName',
userManagement_userName: 'UserName', userManagement_userName: 'UserName',
userManagement_name: 'Name', userManagement_name: 'Name',
userManagement_email: 'Email', userManagement_email: 'Email',
@ -35,10 +41,14 @@ export default {
audit_url: 'URL', audit_url: 'URL',
audit_entityInfo: 'EntityInformation', audit_entityInfo: 'EntityInformation',
audit_message: 'Message', audit_message: 'Message',
audit_hasException: 'HasException',
audit_hasException_all: 'All', audit_hasException_all: 'All',
audit_hasException_yes: 'Yes', audit_hasException_yes: 'Yes',
audit_hasException_no: 'No', audit_hasException_no: 'No',
audit_applicationName: 'ApplicationName', audit_applicationName: 'ApplicationName',
audit_serviceName: 'serviceName',
audit_methodName: 'methodName',
audit_parameters: 'parameters',
grantedMessage: 'Authorization Successful, Please Login Again.', grantedMessage: 'Authorization Successful, Please Login Again.',
close: 'close', close: 'close',
auditLog: 'AuditLog', auditLog: 'AuditLog',

1
templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/en/sys.ts

@ -101,5 +101,6 @@ export default {
smsCode: 'SMS code', smsCode: 'SMS code',
mobile: 'Mobile', mobile: 'Mobile',
tenant: 'Tenant', tenant: 'Tenant',
tenantPlaceholder: 'Please input tenant',
}, },
}; };

8
templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/zh-CN/common.ts

@ -36,5 +36,11 @@ export default {
status: '状态', status: '状态',
active: '是否激活', active: '是否激活',
download: '下载', download: '下载',
export:"导出" export: '导出',
isEnabled: '是否启用',
default: '默认',
name: '名称',
value: '值',
parameterValidationFailure: '参数验证失败',
permissionDenied: '权限不足',
}; };

12
templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/zh-CN/routes/admin.ts

@ -2,7 +2,13 @@ export default {
systemManagement: '系统管理', systemManagement: '系统管理',
userManagement: '用户管理', userManagement: '用户管理',
roleManagement: '角色管理', roleManagement: '角色管理',
languageManagement: '语言管理',
languageTextManagement: '语言文本管理',
language_cultureName: '语言名称',
language_uiCultureName: 'UI语言名称',
language_displayName: '显示名称',
language_flagIcon: '图标',
languageTexts_resourceName: '资源名称',
userManagement_userName: '用户名', userManagement_userName: '用户名',
userManagement_name: '真实名称', userManagement_name: '真实名称',
userManagement_email: '邮箱', userManagement_email: '邮箱',
@ -37,6 +43,9 @@ export default {
audit_hasException_all: '全部', audit_hasException_all: '全部',
audit_hasException_yes: '是', audit_hasException_yes: '是',
audit_hasException_no: '否', audit_hasException_no: '否',
audit_serviceName: '服务名',
audit_methodName: '方法名',
audit_parameters: '参数',
grantedMessage: '授权成功,请重新登录.', grantedMessage: '授权成功,请重新登录.',
close: '关闭', close: '关闭',
@ -71,6 +80,7 @@ export default {
editPasswordMessage: '输入的2次密码不一致', editPasswordMessage: '输入的2次密码不一致',
executionTime: '执行时间', executionTime: '执行时间',
executionDuration: '响应时间(毫秒)', executionDuration: '响应时间(毫秒)',
executionMessage: '异常内容',
organizationUnitName: '名称', organizationUnitName: '名称',
parentOrganizationUnitName: '上级组织机构', parentOrganizationUnitName: '上级组织机构',
organizationUnitManagement: '组织机构管理', organizationUnitManagement: '组织机构管理',

1
templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/zh-CN/sys.ts

@ -95,5 +95,6 @@ export default {
smsCode: '短信验证码', smsCode: '短信验证码',
mobile: '手机号码', mobile: '手机号码',
tenant: '租户', tenant: '租户',
tenantPlaceholder: '请输入租户',
}, },
}; };

784
templates/abp-vnext-pro-nuget-all/vben28/src/services/ServiceProxies.ts

File diff suppressed because it is too large

26
templates/abp-vnext-pro-nuget-all/vben28/src/services/ServiceProxyBase.ts

@ -15,15 +15,15 @@ export class ServiceProxyBase {
if (!guard) { if (!guard) {
if (userStore.checkUserLoginExpire) { if (userStore.checkUserLoginExpire) {
router.replace(PageEnum.BASE_LOGIN); router.replace(PageEnum.BASE_LOGIN);
return; } else {
// 添加header
options.headers = {
'accept-language': language,
'Content-Type': 'application/json',
Authorization: 'Bearer ' + token,
__tenant: userStore.tenantId,
};
} }
// 添加header
options.headers = {
'accept-language': language,
'Content-Type': 'application/json',
Authorization: 'Bearer ' + token,
__tenant: userStore.tenantId,
};
} else { } else {
options.headers = { options.headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@ -37,21 +37,23 @@ export class ServiceProxyBase {
protected transformResult( protected transformResult(
_url: string, _url: string,
response: AxiosResponse, response: AxiosResponse,
processor: (response: AxiosResponse) => Promise<any> processor: (response: AxiosResponse) => Promise<any>,
): Promise<any> { ): Promise<any> {
const { t } = useI18n(); const { t } = useI18n();
if (response.status == 401 || response.status == 403 || response.status == 302) { if (response.status == 401) {
message.error(t('common.authorityText')); message.error(t('common.authorityText'));
router.replace(PageEnum.BASE_LOGIN); router.replace(PageEnum.BASE_LOGIN);
} else if (response.status == 403) {
message.error(t('common.permissionDenied'));
} else if (response.status == 400) { } else if (response.status == 400) {
Modal.error({ Modal.error({
title: '验证失败', title: t('common.parameterValidationFailure'),
content: response.data.error.validationErrors[0].message, content: response.data.error.validationErrors[0].message,
}); });
} else if (response.status >= 500) { } else if (response.status >= 500) {
Modal.error({ Modal.error({
title: '请求异常', title: t('common.systemErrorText'),
content: response.data.error.message, content: response.data.error.message,
}); });
} }

4
templates/abp-vnext-pro-nuget-all/vben28/src/settings/componentSetting.ts

@ -29,9 +29,9 @@ export default {
if (field && order) { if (field && order) {
return { return {
// The sort field passed to the backend you // The sort field passed to the backend you
field, sorting: field + ' ' + order.replace('end', ''),
// Sorting method passed to the background asc/desc // Sorting method passed to the background asc/desc
order, //order,
}; };
} else { } else {
return {}; return {};

164
templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/auditLog/AuditLog.ts

@ -1,84 +1,106 @@
import { FormSchema } from "/@/components/Table"; import { FormSchema } from '/@/components/Table';
import { BasicColumn } from "/@/components/Table"; import { BasicColumn } from '/@/components/Table';
import { useI18n } from "/@/hooks/web/useI18n"; import { useI18n } from '/@/hooks/web/useI18n';
import { formatToDateTime, dateUtil } from '/@/utils/dateUtil';
const { t } = useI18n(); const { t } = useI18n();
import { formatToDateTime } from '/@/utils/dateUtil'; import { AuditLogsServiceProxy, PagingAuditLogInput } from '/@/services/ServiceProxies';
import { AuditLogsServiceProxy, PagingAuditLogListInput } from "/@/services/ServiceProxies";
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ {
field: "userName", field: 'userName',
label: t("routes.admin.userManagement_userName"), label: t('routes.admin.userManagement_userName'),
component: "Input", component: 'Input',
colProps: { span: 8 } colProps: { span: 3 },
}, },
{ {
field: "time", field: 'time',
component: "RangePicker", component: 'RangePicker',
label: t("routes.admin.audit_executeTime"), label: t('routes.admin.audit_executeTime'),
colProps: { colProps: {
span: 6 span: 4,
} },
defaultValue: [dateUtil().subtract(7, 'days'), dateUtil().add(1, 'days')],
}, },
{ {
field: "hasException", field: 'hasException',
label: t("routes.admin.audit_hasException"), label: t('routes.admin.audit_hasException'),
component: "Select", component: 'Select',
colProps: { span: 4 }, colProps: { span: 2 },
componentProps: ()=>{ componentProps: () => {
return { return {
options: [ options: [
{ label: t("routes.admin.audit_hasException_all"), value: null }, { label: t('routes.admin.audit_hasException_all'), value: null },
{ label: t("routes.admin.audit_hasException_yes"), value: true }, { label: t('routes.admin.audit_hasException_yes'), value: true },
{ label: t("routes.admin.audit_hasException_no"), value: false }, { label: t('routes.admin.audit_hasException_no'), value: false },
] ],
} };
} },
},
{
field: 'correlationId',
label: 'CorrelationId',
labelWidth: 95,
component: 'Input',
colProps: { span: 4 },
},
{
field: 'url',
label: 'Url',
component: 'Input',
colProps: { span: 4 },
}, },
]; ];
export const tableColumns: BasicColumn[] = [ export const tableColumns: BasicColumn[] = [
// {
// title: t('routes.admin.tenant'),
// dataIndex: 'tenantName',
// width: 100,
// },
{ {
title: "Url", title: 'Url',
dataIndex: "url", dataIndex: 'url',
width: 350, width: 350,
align: "left" align: 'left',
}, },
{ {
title: t("routes.admin.userManagement_userName"), title: t('routes.admin.tenant'),
dataIndex: "userName", dataIndex: 'tenantName',
width: 100 width: 100,
}, },
{ {
title: t("routes.admin.executionTime"), title: t('routes.admin.userManagement_userName'),
dataIndex: "executionTime", dataIndex: 'userName',
width: 200, width: 100,
},
{
title: t('routes.admin.executionTime'),
dataIndex: 'executionTime',
customRender: ({ text }) => { customRender: ({ text }) => {
return formatToDateTime(text); return formatToDateTime(text);
} },
width: 150,
sorter: true,
}, },
{ {
title: t("routes.admin.executionDuration"), title: t('routes.admin.executionDuration'),
dataIndex: "executionDuration", dataIndex: 'executionDuration',
width: 150 width: 120,
}, },
{ {
title: t("routes.admin.executionMessage"), title: t('routes.admin.audit_ipAddress'),
dataIndex: "exceptions", dataIndex: 'clientIpAddress',
resizable:false, width: 150,
width: 350, },
{
title: 'CorrelationId',
dataIndex: 'correlationId',
width: 280,
},
{
title: t('routes.admin.executionMessage'),
dataIndex: 'exceptions',
customRender: ({ text }) => { customRender: ({ text }) => {
if (text) { if (text) {
return text.toString(); return text.toString().substring(0, 300);
} }
} },
} },
]; ];
/** /**
@ -86,48 +108,48 @@ export const tableColumns: BasicColumn[] = [
* @param params * @param params
* @returns * @returns
*/ */
export async function getTableListAsync(params: PagingAuditLogListInput) { export async function getTableListAsync(params: PagingAuditLogInput) {
const _auditLogsServiceProxy = new AuditLogsServiceProxy(); const _auditLogsServiceProxy = new AuditLogsServiceProxy();
return _auditLogsServiceProxy.page(params); return _auditLogsServiceProxy.page(params);
} }
export function httpStatusCodeColor(statusCode?: number) { export function httpStatusCodeColor(statusCode?: number) {
if (!statusCode) { if (!statusCode) {
return ""; return '';
} }
if (statusCode >= 200 && statusCode < 300) { if (statusCode >= 200 && statusCode < 300) {
return "#87d068"; return '#87d068';
} }
if (statusCode >= 300 && statusCode < 400) { if (statusCode >= 300 && statusCode < 400) {
return "#108ee9"; return '#108ee9';
} }
if (statusCode >= 400 && statusCode < 500) { if (statusCode >= 400 && statusCode < 500) {
return "orange"; return 'orange';
} }
if (statusCode >= 500) { if (statusCode >= 500) {
return "red"; return 'red';
} }
return "cyan"; return 'cyan';
} }
export function httpMethodColor(method?: string) { export function httpMethodColor(method?: string) {
if (method == "GET") { if (method == 'GET') {
return "blue"; return 'blue';
} }
if (method == "POST") { if (method == 'POST') {
return "blue"; return 'blue';
} }
if (method == "PUT") { if (method == 'PUT') {
return "orange"; return 'orange';
} }
if (method == "DELETE") { if (method == 'DELETE') {
return "red"; return 'red';
} }
if (method == "OPTIONS") { if (method == 'OPTIONS') {
return "cyan"; return 'cyan';
} }
if (method == "PATCH") { if (method == 'PATCH') {
return "pink"; return 'pink';
} }
return "cyan"; return 'cyan';
} }

137
templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/auditLog/AuditLog.vue

@ -1,61 +1,96 @@
<template> <template>
<div> <div>
<BasicTable @register="registerTable" size="small"> <BasicTable @register="registerTable" size="small">
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'url'"> <template v-if="column.key === 'url'">
<Tag :color="httpStatusCodeColor(record.httpStatusCode)">{{ record.httpStatusCode }}</Tag> <Tag :color="httpStatusCodeColor(record.httpStatusCode)">{{ record.httpStatusCode }}</Tag>
<Tag style="margin-left: 5px" :color="httpMethodColor(record.httpMethod)"> <Tag style="margin-left: 5px" :color="httpMethodColor(record.httpMethod)">
{{ record.httpMethod }} {{ record.httpMethod }}
</Tag> </Tag>
<span style="margin-left: 5px">{{ record.url }}</span> <span style="margin-left: 5px">{{ record.url }}</span>
</template>
</template>
<template #action="{ record }">
<TableAction
:actions="[
{
label: t('routes.admin.detail'),
icon: 'ant-design:schedule-outlined',
onClick: handleDetail.bind(null, record),
},
]"
/>
</template> </template>
</template>
</BasicTable> </BasicTable>
<AuditLogDetail @register="registerDrawer" />
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from "vue"; import { defineComponent } from 'vue';
import { BasicTable, useTable } from "/@/components/Table"; import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { tableColumns, searchFormSchema, getTableListAsync, httpStatusCodeColor, httpMethodColor } from "/@/views/admin/auditLog/AuditLog"; import {
import { Tag } from "ant-design-vue"; tableColumns,
import { useI18n } from "/@/hooks/web/useI18n"; searchFormSchema,
getTableListAsync,
export default defineComponent({ httpStatusCodeColor,
name: "AuditLog", httpMethodColor,
components: { } from '/@/views/admin/auditLog/AuditLog';
BasicTable, import AuditLogDetail from './AuditLogDetail.vue';
Tag import { Tag } from 'ant-design-vue';
}, import { useI18n } from '/@/hooks/web/useI18n';
setup() { import { useDrawer } from '/@/components/Drawer';
const { t } = useI18n(); export default defineComponent({
// table配置 name: 'AuditLog',
const [registerTable, { reload }] = useTable({ components: {
columns: tableColumns, BasicTable,
formConfig: { Tag,
labelWidth: 70, AuditLogDetail,
schemas: searchFormSchema, TableAction,
fieldMapToTime: [ },
["time", ["executionBeginTime", "executionEndTime"], "YYYY-MM-DD HH:mm:ss"] setup() {
] const { t } = useI18n();
}, // table配置
api: getTableListAsync, const [registerTable, { reload }] = useTable({
showTableSetting: true, columns: tableColumns,
useSearchForm: true, formConfig: {
bordered: true, labelWidth: 70,
canResize: true, schemas: searchFormSchema,
showIndexColumn: true, fieldMapToTime: [['time', ['startTime', 'endTime'], 'YYYY-MM-DD']],
immediate: true, },
scroll: { x: true } api: getTableListAsync,
}); showTableSetting: true,
useSearchForm: true,
return { bordered: true,
registerTable, canResize: true,
reload, showIndexColumn: true,
t, immediate: true,
httpStatusCodeColor, scroll: { x: true },
httpMethodColor actionColumn: {
}; width: 200,
} title: t('common.action'),
}); dataIndex: 'action',
slots: {
customRender: 'action',
},
fixed: 'right',
},
});
const [registerDrawer, { openDrawer }] = useDrawer();
const handleDetail = (record: Recordable) => {
openDrawer(true, {
record: record,
});
};
return {
registerTable,
reload,
t,
httpStatusCodeColor,
httpMethodColor,
registerDrawer,
handleDetail,
};
},
});
</script> </script>

23
templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/auditLog/AuditLogDetail.vue

@ -0,0 +1,23 @@
<template>
<BasicDrawer v-bind="$attrs" @register="register" :title="t('routes.admin.detail')" width="50%">
<JsonPreview :data="auditLogInfo" />
</BasicDrawer>
</template>
<script lang="ts">
import { defineComponent, ref, unref } from 'vue';
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
import { useI18n } from '/@/hooks/web/useI18n';
import { JsonPreview } from '/@/components/CodeEditor';
export default defineComponent({
components: { BasicDrawer, JsonPreview },
setup() {
const { t } = useI18n();
const auditLogInfo = ref({});
const [register] = useDrawerInner((data) => {
auditLogInfo.value = unref(data.record);
});
return { t, register, auditLogInfo };
},
});
</script>

6
templates/abp-vnext-pro-nuget-module/Directory.Build.Lion.targets

@ -1,8 +1,8 @@
<Project> <Project>
<!-- Lion.AbpPro包--> <!-- Lion.AbpPro包-->
<ItemGroup> <ItemGroup>
<PackageReference Update="Lion.AbpPro.Core" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.Core" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.Shared.Hosting.Microservices" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.Shared.Hosting.Microservices" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.Shared.Hosting.Gateways" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.Shared.Hosting.Gateways" Version="7.2.2.5"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

48
templates/abp-vnext-pro-nuget-simplify/aspnet-core/Directory.Build.Lion.targets

@ -1,34 +1,34 @@
<Project> <Project>
<!-- Lion.AbpPro包--> <!-- Lion.AbpPro包-->
<ItemGroup> <ItemGroup>
<PackageReference Update="Lion.AbpPro.Core" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.Core" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.Shared.Hosting.Microservices" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.Shared.Hosting.Microservices" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.Shared.Hosting.Gateways" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.Shared.Hosting.Gateways" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Application" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.BasicManagement.Application" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Application.Contracts" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.BasicManagement.Application.Contracts" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Domain" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.BasicManagement.Domain" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Domain.Shared" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.BasicManagement.Domain.Shared" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.EntityFrameworkCore" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.BasicManagement.EntityFrameworkCore" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi.Client" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi.Client" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Application" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.NotificationManagement.Application" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Application.Contracts" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.NotificationManagement.Application.Contracts" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Domain" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.NotificationManagement.Domain" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Domain.Shared" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.NotificationManagement.Domain.Shared" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.EntityFrameworkCore" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.NotificationManagement.EntityFrameworkCore" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi.Client" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi.Client" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Application" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Application" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Application.Contracts" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Application.Contracts" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain.Shared" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain.Shared" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi.Client" Version="7.2.2.1"/> <PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi.Client" Version="7.2.2.5"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

2
templates/abp-vnext-pro-nuget-simplify/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20230517130954_Init.Designer.cs → templates/abp-vnext-pro-nuget-simplify/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20230617074136_Init.Designer.cs

@ -12,7 +12,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace MyCompanyName.MyProjectName.Migrations namespace MyCompanyName.MyProjectName.Migrations
{ {
[DbContext(typeof(MyProjectNameDbContext))] [DbContext(typeof(MyProjectNameDbContext))]
[Migration("20230517130954_Init")] [Migration("20230617074136_Init")]
partial class Init partial class Init
{ {
/// <inheritdoc /> /// <inheritdoc />

0
templates/abp-vnext-pro-nuget-simplify/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20230517130954_Init.cs → templates/abp-vnext-pro-nuget-simplify/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20230617074136_Init.cs

10
templates/abp-vnext-pro-nuget-simplify/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj

@ -7,14 +7,14 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\MyCompanyName.MyProjectName.Domain\MyCompanyName.MyProjectName.Domain.csproj"/> <ProjectReference Include="..\MyCompanyName.MyProjectName.Domain\MyCompanyName.MyProjectName.Domain.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.MySQL"/> <PackageReference Include="Volo.Abp.EntityFrameworkCore.MySQL" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\..\..\aspnet-core\modules\BasicManagement\src\Lion.AbpPro.BasicManagement.EntityFrameworkCore\Lion.AbpPro.BasicManagement.EntityFrameworkCore.csproj"/> <ProjectReference Include="..\..\..\..\..\aspnet-core\modules\BasicManagement\src\Lion.AbpPro.BasicManagement.EntityFrameworkCore\Lion.AbpPro.BasicManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\..\aspnet-core\modules\NotificationManagement\src\Lion.AbpPro.NotificationManagement.EntityFrameworkCore\Lion.AbpPro.NotificationManagement.EntityFrameworkCore.csproj"/> <ProjectReference Include="..\..\..\..\..\aspnet-core\modules\NotificationManagement\src\Lion.AbpPro.NotificationManagement.EntityFrameworkCore\Lion.AbpPro.NotificationManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\..\aspnet-core\modules\DataDictionaryManagement\src\Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore\Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore.csproj"/> <ProjectReference Include="..\..\..\..\..\aspnet-core\modules\DataDictionaryManagement\src\Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore\Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

2
templates/abp-vnext-pro-nuget-simplify/vben28/nswag/nswag.json

@ -1,5 +1,5 @@
{ {
"runtime": "Net60", "runtime": "Net70",
"defaultVariables": null, "defaultVariables": null,
"documentGenerator": { "documentGenerator": {
"fromDocument": { "fromDocument": {

2
templates/abp-vnext-pro-nuget-simplify/vben28/nswag/refresh.bat

@ -1 +1 @@
"..\node_modules\.bin\nswag" run /runtime:Net60 "..\node_modules\.bin\nswag" run /runtime:Net70

4
templates/abp-vnext-pro-nuget-simplify/vben28/src/components/Application/src/AppLogo.vue

@ -64,8 +64,8 @@
display: flex; display: flex;
align-items: center; align-items: center;
padding-left: 7px; padding-left: 7px;
cursor: pointer;
transition: all 0.2s ease; transition: all 0.2s ease;
cursor: pointer;
&.light { &.light {
border-bottom: 1px solid @border-color-base; border-bottom: 1px solid @border-color-base;
@ -84,9 +84,9 @@
} }
&__title { &__title {
transition: all 0.5s;
font-size: 16px; font-size: 16px;
font-weight: 700; font-weight: 700;
transition: all 0.5s;
line-height: normal; line-height: normal;
} }
} }

2
templates/abp-vnext-pro-nuget-simplify/vben28/src/components/Page/index.ts

@ -5,5 +5,3 @@ import pageWrapper from './src/PageWrapper.vue';
export const PageFooter = withInstall(pageFooter); export const PageFooter = withInstall(pageFooter);
export const PageWrapper = withInstall(pageWrapper); export const PageWrapper = withInstall(pageWrapper);
export const PageWrapperFixedHeightKey = 'PageWrapperFixedHeight';

2
templates/abp-vnext-pro-nuget-simplify/vben28/src/components/Page/src/PageWrapper.vue

@ -43,7 +43,7 @@
import { omit } from 'lodash-es'; import { omit } from 'lodash-es';
import { PageHeader } from 'ant-design-vue'; import { PageHeader } from 'ant-design-vue';
import { useContentHeight } from '/@/hooks/web/useContentHeight'; import { useContentHeight } from '/@/hooks/web/useContentHeight';
import { PageWrapperFixedHeightKey } from '..'; import { PageWrapperFixedHeightKey } from '/@/enums/pageEnum';
export default defineComponent({ export default defineComponent({
name: 'PageWrapper', name: 'PageWrapper',

2
templates/abp-vnext-pro-nuget-simplify/vben28/src/components/Table/src/BasicTable.vue

@ -49,7 +49,7 @@
import { defineComponent, ref, computed, unref, toRaw, inject, watchEffect } from 'vue'; import { defineComponent, ref, computed, unref, toRaw, inject, watchEffect } from 'vue';
import { Table } from 'ant-design-vue'; import { Table } from 'ant-design-vue';
import { BasicForm, useForm } from '/@/components/Form/index'; import { BasicForm, useForm } from '/@/components/Form/index';
import { PageWrapperFixedHeightKey } from '/@/components/Page'; import { PageWrapperFixedHeightKey } from '/@/enums/pageEnum';
import HeaderCell from './components/HeaderCell.vue'; import HeaderCell from './components/HeaderCell.vue';
import { InnerHandlers } from './types/table'; import { InnerHandlers } from './types/table';

2
templates/abp-vnext-pro-nuget-simplify/vben28/src/enums/pageEnum.ts

@ -8,3 +8,5 @@ export enum PageEnum {
// error log page path // error log page path
ERROR_LOG_PAGE = '/error-log/list', ERROR_LOG_PAGE = '/error-log/list',
} }
export const PageWrapperFixedHeightKey = 'PageWrapperFixedHeight';

105
templates/abp-vnext-pro-nuget-simplify/vben28/src/services/ServiceProxyBase.ts

@ -15,15 +15,102 @@ export class ServiceProxyBase {
if (!guard) { if (!guard) {
if (userStore.checkUserLoginExpire) { if (userStore.checkUserLoginExpire) {
router.replace(PageEnum.BASE_LOGIN); router.replace(PageEnum.BASE_LOGIN);
return; } else {
// 添加header
options.headers = {
'accept-language': language,
'Content-Type': 'application/json',
Authorization: 'Bearer ' + token,
__tenant: userStore.tenantId,
};
} }
// 添加header } else {
options.headers = { options.headers = {
'accept-language': language,
'Content-Type': 'application/json', 'Content-Type': 'application/json',
Authorization: 'Bearer ' + token,
__tenant: userStore.tenantId, __tenant: userStore.tenantId,
'accept-language': language,
}; };
}
return Promise.resolve(options);
}
protected transformResult(
_url: string,
response: AxiosResponse,
processor: (response: AxiosResponse) => Promise<any>,
): Promise<any> {
const { t } = useI18n();
if (response.status == 401) {
message.error(t('common.authorityText'));
router.replace(PageEnum.BASE_LOGIN);
} else if (response.status == 403) {
message.error(t('common.permissionDenied'));
} else if (response.status == 400) {
Modal.error({
title: t('common.parameterValidationFailure'),
content: response.data.error.validationErrors[0].message,
});
} else if (response.status >= 500) {
Modal.error({
title: t('common.systemErrorText'),
content: response.data.error.message,
});
}
return processor(response);
}
//判决接口是否需要拦截
private urlGuard(url: string): boolean {
if (url == '/Tenants/find') {
return true;
}
if (url.startsWith('/api/app/account')) {
return true;
}
return false;
}
private buildRequestMessage(): any {
const userStore = useUserStoreWithOut();
const token = userStore.getToken;
const { getLocale } = useLocale();
const language = getLocale.value == 'en' ? getLocale.value : 'zh-Hans';
return {
token,
language,
};
}
}
import { AxiosRequestConfig, AxiosResponse } from 'axios';
import { message } from 'ant-design-vue';
import { useUserStoreWithOut } from '/@/store/modules/user';
import { router } from '/@/router';
import { PageEnum } from '/@/enums/pageEnum';
import { useI18n } from '/@/hooks/web/useI18n';
import { Modal } from 'ant-design-vue';
import { useLocale } from '/@/locales/useLocale';
export class ServiceProxyBase {
protected transformOptions(options: AxiosRequestConfig) {
options.baseURL = import.meta.env.VITE_API_URL as string;
const guard: boolean = this.urlGuard(options.url as string);
const userStore = useUserStoreWithOut();
const { token, language } = this.buildRequestMessage();
if (!guard) {
if (userStore.checkUserLoginExpire) {
router.replace(PageEnum.BASE_LOGIN);
} else {
// 添加header
options.headers = {
'accept-language': language,
'Content-Type': 'application/json',
Authorization: 'Bearer ' + token,
__tenant: userStore.tenantId,
};
}
} else { } else {
options.headers = { options.headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@ -37,21 +124,23 @@ export class ServiceProxyBase {
protected transformResult( protected transformResult(
_url: string, _url: string,
response: AxiosResponse, response: AxiosResponse,
processor: (response: AxiosResponse) => Promise<any> processor: (response: AxiosResponse) => Promise<any>,
): Promise<any> { ): Promise<any> {
const { t } = useI18n(); const { t } = useI18n();
if (response.status == 401 || response.status == 403 || response.status == 302) { if (response.status == 401) {
message.error(t('common.authorityText')); message.error(t('common.authorityText'));
router.replace(PageEnum.BASE_LOGIN); router.replace(PageEnum.BASE_LOGIN);
} else if (response.status == 403) {
message.error(t('common.permissionDenied'));
} else if (response.status == 400) { } else if (response.status == 400) {
Modal.error({ Modal.error({
title: '验证失败', title: t('common.parameterValidationFailure'),
content: response.data.error.validationErrors[0].message, content: response.data.error.validationErrors[0].message,
}); });
} else if (response.status >= 500) { } else if (response.status >= 500) {
Modal.error({ Modal.error({
title: '请求异常', title: t('common.systemErrorText'),
content: response.data.error.message, content: response.data.error.message,
}); });
} }

4
templates/abp-vnext-pro-nuget-simplify/vben28/src/settings/componentSetting.ts

@ -29,9 +29,9 @@ export default {
if (field && order) { if (field && order) {
return { return {
// The sort field passed to the backend you // The sort field passed to the backend you
field, sorting: field + ' ' + order.replace('end', ''),
// Sorting method passed to the background asc/desc // Sorting method passed to the background asc/desc
order, //order,
}; };
} else { } else {
return {}; return {};

164
templates/abp-vnext-pro-nuget-simplify/vben28/src/views/admin/auditLog/AuditLog.ts

@ -1,84 +1,106 @@
import { FormSchema } from "/@/components/Table"; import { FormSchema } from '/@/components/Table';
import { BasicColumn } from "/@/components/Table"; import { BasicColumn } from '/@/components/Table';
import { useI18n } from "/@/hooks/web/useI18n"; import { useI18n } from '/@/hooks/web/useI18n';
import { formatToDateTime, dateUtil } from '/@/utils/dateUtil';
const { t } = useI18n(); const { t } = useI18n();
import { formatToDateTime } from '/@/utils/dateUtil'; import { AuditLogsServiceProxy, PagingAuditLogInput } from '/@/services/ServiceProxies';
import { AuditLogsServiceProxy, PagingAuditLogListInput } from "/@/services/ServiceProxies";
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ {
field: "userName", field: 'userName',
label: t("routes.admin.userManagement_userName"), label: t('routes.admin.userManagement_userName'),
component: "Input", component: 'Input',
colProps: { span: 8 } colProps: { span: 3 },
}, },
{ {
field: "time", field: 'time',
component: "RangePicker", component: 'RangePicker',
label: t("routes.admin.audit_executeTime"), label: t('routes.admin.audit_executeTime'),
colProps: { colProps: {
span: 6 span: 4,
} },
defaultValue: [dateUtil().subtract(7, 'days'), dateUtil().add(1, 'days')],
}, },
{ {
field: "hasException", field: 'hasException',
label: t("routes.admin.audit_hasException"), label: t('routes.admin.audit_hasException'),
component: "Select", component: 'Select',
colProps: { span: 4 }, colProps: { span: 2 },
componentProps: ()=>{ componentProps: () => {
return { return {
options: [ options: [
{ label: t("routes.admin.audit_hasException_all"), value: null }, { label: t('routes.admin.audit_hasException_all'), value: null },
{ label: t("routes.admin.audit_hasException_yes"), value: true }, { label: t('routes.admin.audit_hasException_yes'), value: true },
{ label: t("routes.admin.audit_hasException_no"), value: false }, { label: t('routes.admin.audit_hasException_no'), value: false },
] ],
} };
} },
},
{
field: 'correlationId',
label: 'CorrelationId',
labelWidth: 95,
component: 'Input',
colProps: { span: 4 },
},
{
field: 'url',
label: 'Url',
component: 'Input',
colProps: { span: 4 },
}, },
]; ];
export const tableColumns: BasicColumn[] = [ export const tableColumns: BasicColumn[] = [
// {
// title: t('routes.admin.tenant'),
// dataIndex: 'tenantName',
// width: 100,
// },
{ {
title: "Url", title: 'Url',
dataIndex: "url", dataIndex: 'url',
width: 350, width: 350,
align: "left" align: 'left',
}, },
{ {
title: t("routes.admin.userManagement_userName"), title: t('routes.admin.tenant'),
dataIndex: "userName", dataIndex: 'tenantName',
width: 100 width: 100,
}, },
{ {
title: t("routes.admin.executionTime"), title: t('routes.admin.userManagement_userName'),
dataIndex: "executionTime", dataIndex: 'userName',
width: 200, width: 100,
},
{
title: t('routes.admin.executionTime'),
dataIndex: 'executionTime',
customRender: ({ text }) => { customRender: ({ text }) => {
return formatToDateTime(text); return formatToDateTime(text);
} },
width: 150,
sorter: true,
}, },
{ {
title: t("routes.admin.executionDuration"), title: t('routes.admin.executionDuration'),
dataIndex: "executionDuration", dataIndex: 'executionDuration',
width: 150 width: 120,
}, },
{ {
title: t("routes.admin.executionMessage"), title: t('routes.admin.audit_ipAddress'),
dataIndex: "exceptions", dataIndex: 'clientIpAddress',
resizable:false, width: 150,
width: 350, },
{
title: 'CorrelationId',
dataIndex: 'correlationId',
width: 280,
},
{
title: t('routes.admin.executionMessage'),
dataIndex: 'exceptions',
customRender: ({ text }) => { customRender: ({ text }) => {
if (text) { if (text) {
return text.toString(); return text.toString().substring(0, 300);
} }
} },
} },
]; ];
/** /**
@ -86,48 +108,48 @@ export const tableColumns: BasicColumn[] = [
* @param params * @param params
* @returns * @returns
*/ */
export async function getTableListAsync(params: PagingAuditLogListInput) { export async function getTableListAsync(params: PagingAuditLogInput) {
const _auditLogsServiceProxy = new AuditLogsServiceProxy(); const _auditLogsServiceProxy = new AuditLogsServiceProxy();
return _auditLogsServiceProxy.page(params); return _auditLogsServiceProxy.page(params);
} }
export function httpStatusCodeColor(statusCode?: number) { export function httpStatusCodeColor(statusCode?: number) {
if (!statusCode) { if (!statusCode) {
return ""; return '';
} }
if (statusCode >= 200 && statusCode < 300) { if (statusCode >= 200 && statusCode < 300) {
return "#87d068"; return '#87d068';
} }
if (statusCode >= 300 && statusCode < 400) { if (statusCode >= 300 && statusCode < 400) {
return "#108ee9"; return '#108ee9';
} }
if (statusCode >= 400 && statusCode < 500) { if (statusCode >= 400 && statusCode < 500) {
return "orange"; return 'orange';
} }
if (statusCode >= 500) { if (statusCode >= 500) {
return "red"; return 'red';
} }
return "cyan"; return 'cyan';
} }
export function httpMethodColor(method?: string) { export function httpMethodColor(method?: string) {
if (method == "GET") { if (method == 'GET') {
return "blue"; return 'blue';
} }
if (method == "POST") { if (method == 'POST') {
return "blue"; return 'blue';
} }
if (method == "PUT") { if (method == 'PUT') {
return "orange"; return 'orange';
} }
if (method == "DELETE") { if (method == 'DELETE') {
return "red"; return 'red';
} }
if (method == "OPTIONS") { if (method == 'OPTIONS') {
return "cyan"; return 'cyan';
} }
if (method == "PATCH") { if (method == 'PATCH') {
return "pink"; return 'pink';
} }
return "cyan"; return 'cyan';
} }

137
templates/abp-vnext-pro-nuget-simplify/vben28/src/views/admin/auditLog/AuditLog.vue

@ -1,61 +1,96 @@
<template> <template>
<div> <div>
<BasicTable @register="registerTable" size="small"> <BasicTable @register="registerTable" size="small">
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'url'"> <template v-if="column.key === 'url'">
<Tag :color="httpStatusCodeColor(record.httpStatusCode)">{{ record.httpStatusCode }}</Tag> <Tag :color="httpStatusCodeColor(record.httpStatusCode)">{{ record.httpStatusCode }}</Tag>
<Tag style="margin-left: 5px" :color="httpMethodColor(record.httpMethod)"> <Tag style="margin-left: 5px" :color="httpMethodColor(record.httpMethod)">
{{ record.httpMethod }} {{ record.httpMethod }}
</Tag> </Tag>
<span style="margin-left: 5px">{{ record.url }}</span> <span style="margin-left: 5px">{{ record.url }}</span>
</template>
</template>
<template #action="{ record }">
<TableAction
:actions="[
{
label: t('routes.admin.detail'),
icon: 'ant-design:schedule-outlined',
onClick: handleDetail.bind(null, record),
},
]"
/>
</template> </template>
</template>
</BasicTable> </BasicTable>
<AuditLogDetail @register="registerDrawer" />
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from "vue"; import { defineComponent } from 'vue';
import { BasicTable, useTable } from "/@/components/Table"; import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { tableColumns, searchFormSchema, getTableListAsync, httpStatusCodeColor, httpMethodColor } from "/@/views/admin/auditLog/AuditLog"; import {
import { Tag } from "ant-design-vue"; tableColumns,
import { useI18n } from "/@/hooks/web/useI18n"; searchFormSchema,
getTableListAsync,
export default defineComponent({ httpStatusCodeColor,
name: "AuditLog", httpMethodColor,
components: { } from '/@/views/admin/auditLog/AuditLog';
BasicTable, import AuditLogDetail from './AuditLogDetail.vue';
Tag import { Tag } from 'ant-design-vue';
}, import { useI18n } from '/@/hooks/web/useI18n';
setup() { import { useDrawer } from '/@/components/Drawer';
const { t } = useI18n(); export default defineComponent({
// table配置 name: 'AuditLog',
const [registerTable, { reload }] = useTable({ components: {
columns: tableColumns, BasicTable,
formConfig: { Tag,
labelWidth: 70, AuditLogDetail,
schemas: searchFormSchema, TableAction,
fieldMapToTime: [ },
["time", ["executionBeginTime", "executionEndTime"], "YYYY-MM-DD HH:mm:ss"] setup() {
] const { t } = useI18n();
}, // table配置
api: getTableListAsync, const [registerTable, { reload }] = useTable({
showTableSetting: true, columns: tableColumns,
useSearchForm: true, formConfig: {
bordered: true, labelWidth: 70,
canResize: true, schemas: searchFormSchema,
showIndexColumn: true, fieldMapToTime: [['time', ['startTime', 'endTime'], 'YYYY-MM-DD']],
immediate: true, },
scroll: { x: true } api: getTableListAsync,
}); showTableSetting: true,
useSearchForm: true,
return { bordered: true,
registerTable, canResize: true,
reload, showIndexColumn: true,
t, immediate: true,
httpStatusCodeColor, scroll: { x: true },
httpMethodColor actionColumn: {
}; width: 200,
} title: t('common.action'),
}); dataIndex: 'action',
slots: {
customRender: 'action',
},
fixed: 'right',
},
});
const [registerDrawer, { openDrawer }] = useDrawer();
const handleDetail = (record: Recordable) => {
openDrawer(true, {
record: record,
});
};
return {
registerTable,
reload,
t,
httpStatusCodeColor,
httpMethodColor,
registerDrawer,
handleDetail,
};
},
});
</script> </script>

23
templates/abp-vnext-pro-nuget-simplify/vben28/src/views/admin/auditLog/AuditLogDetail.vue

@ -0,0 +1,23 @@
<template>
<BasicDrawer v-bind="$attrs" @register="register" :title="t('routes.admin.detail')" width="50%">
<JsonPreview :data="auditLogInfo" />
</BasicDrawer>
</template>
<script lang="ts">
import { defineComponent, ref, unref } from 'vue';
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
import { useI18n } from '/@/hooks/web/useI18n';
import { JsonPreview } from '/@/components/CodeEditor';
export default defineComponent({
components: { BasicDrawer, JsonPreview },
setup() {
const { t } = useI18n();
const auditLogInfo = ref({});
const [register] = useDrawerInner((data) => {
auditLogInfo.value = unref(data.record);
});
return { t, register, auditLogInfo };
},
});
</script>
Loading…
Cancel
Save