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>
<!-- Lion.AbpPro包-->
<ItemGroup>
<PackageReference Update="Lion.AbpPro.Core" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.Shared.Hosting.Microservices" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.Shared.Hosting.Gateways" 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.5"/>
<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.Contracts" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Domain" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Domain.Shared" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.EntityFrameworkCore" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi.Client" 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.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Domain" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Domain.Shared" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.EntityFrameworkCore" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi" Version="7.2.2.5"/>
<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.Contracts" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Domain" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Domain.Shared" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.EntityFrameworkCore" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi.Client" 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.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Domain" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Domain.Shared" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.EntityFrameworkCore" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi" Version="7.2.2.5"/>
<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.Contracts" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain.Shared" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi.Client" 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.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain.Shared" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi.Client" Version="7.2.2.5"/>
</ItemGroup>
</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"
},
"Redis": {
"Configuration": "redis,password=1q2w3E*,defaultdatabase=1"
"Configuration": "localhost,password=1q2w3E*,defaultdatabase=1"
},
"Jwt": {
"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
{
[DbContext(typeof(MyProjectNameDbContext))]
[Migration("20230517131456_Init")]
[Migration("20230617073909_Init")]
partial class Init
{
/// <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,
"documentGenerator": {
"fromDocument": {
@ -71,4 +71,4 @@
"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;
align-items: center;
padding-left: 7px;
cursor: pointer;
transition: all 0.2s ease;
cursor: pointer;
&.light {
border-bottom: 1px solid @border-color-base;
@ -84,9 +84,9 @@
}
&__title {
transition: all 0.5s;
font-size: 16px;
font-weight: 700;
transition: all 0.5s;
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 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 { PageHeader } from 'ant-design-vue';
import { useContentHeight } from '/@/hooks/web/useContentHeight';
import { PageWrapperFixedHeightKey } from '..';
import { PageWrapperFixedHeightKey } from '/@/enums/pageEnum';
export default defineComponent({
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 { Table } from 'ant-design-vue';
import { BasicForm, useForm } from '/@/components/Form/index';
import { PageWrapperFixedHeightKey } from '/@/components/Page';
import { PageWrapperFixedHeightKey } from '/@/enums/pageEnum';
import HeaderCell from './components/HeaderCell.vue';
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 = '/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',
active: 'IsActive',
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',
userManagement: 'UserManagement',
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_name: 'Name',
userManagement_email: 'Email',
@ -35,10 +41,14 @@ export default {
audit_url: 'URL',
audit_entityInfo: 'EntityInformation',
audit_message: 'Message',
audit_hasException: 'HasException',
audit_hasException_all: 'All',
audit_hasException_yes: 'Yes',
audit_hasException_no: 'No',
audit_applicationName: 'ApplicationName',
audit_serviceName: 'serviceName',
audit_methodName: 'methodName',
audit_parameters: 'parameters',
grantedMessage: 'Authorization Successful, Please Login Again.',
close: 'close',
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',
mobile: 'Mobile',
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: '状态',
active: '是否激活',
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: '系统管理',
userManagement: '用户管理',
roleManagement: '角色管理',
languageManagement: '语言管理',
languageTextManagement: '语言文本管理',
language_cultureName: '语言名称',
language_uiCultureName: 'UI语言名称',
language_displayName: '显示名称',
language_flagIcon: '图标',
languageTexts_resourceName: '资源名称',
userManagement_userName: '用户名',
userManagement_name: '真实名称',
userManagement_email: '邮箱',
@ -37,6 +43,9 @@ export default {
audit_hasException_all: '全部',
audit_hasException_yes: '是',
audit_hasException_no: '否',
audit_serviceName: '服务名',
audit_methodName: '方法名',
audit_parameters: '参数',
grantedMessage: '授权成功,请重新登录.',
close: '关闭',
@ -71,6 +80,7 @@ export default {
editPasswordMessage: '输入的2次密码不一致',
executionTime: '执行时间',
executionDuration: '响应时间(毫秒)',
executionMessage: '异常内容',
organizationUnitName: '名称',
parentOrganizationUnitName: '上级组织机构',
organizationUnitManagement: '组织机构管理',

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

@ -95,5 +95,6 @@ export default {
smsCode: '短信验证码',
mobile: '手机号码',
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 (userStore.checkUserLoginExpire) {
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 {
options.headers = {
'Content-Type': 'application/json',
@ -37,21 +37,23 @@ export class ServiceProxyBase {
protected transformResult(
_url: string,
response: AxiosResponse,
processor: (response: AxiosResponse) => Promise<any>
processor: (response: AxiosResponse) => Promise<any>,
): Promise<any> {
const { t } = useI18n();
if (response.status == 401 || response.status == 403 || response.status == 302) {
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: '验证失败',
title: t('common.parameterValidationFailure'),
content: response.data.error.validationErrors[0].message,
});
} else if (response.status >= 500) {
Modal.error({
title: '请求异常',
title: t('common.systemErrorText'),
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) {
return {
// The sort field passed to the backend you
field,
sorting: field + ' ' + order.replace('end', ''),
// Sorting method passed to the background asc/desc
order,
//order,
};
} else {
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 { BasicColumn } from "/@/components/Table";
import { useI18n } from "/@/hooks/web/useI18n";
import { FormSchema } from '/@/components/Table';
import { BasicColumn } from '/@/components/Table';
import { useI18n } from '/@/hooks/web/useI18n';
import { formatToDateTime, dateUtil } from '/@/utils/dateUtil';
const { t } = useI18n();
import { formatToDateTime } from '/@/utils/dateUtil';
import { AuditLogsServiceProxy, PagingAuditLogListInput } from "/@/services/ServiceProxies";
import { AuditLogsServiceProxy, PagingAuditLogInput } from '/@/services/ServiceProxies';
export const searchFormSchema: FormSchema[] = [
{
field: "userName",
label: t("routes.admin.userManagement_userName"),
component: "Input",
colProps: { span: 8 }
field: 'userName',
label: t('routes.admin.userManagement_userName'),
component: 'Input',
colProps: { span: 3 },
},
{
field: "time",
component: "RangePicker",
label: t("routes.admin.audit_executeTime"),
field: 'time',
component: 'RangePicker',
label: t('routes.admin.audit_executeTime'),
colProps: {
span: 6
}
span: 4,
},
defaultValue: [dateUtil().subtract(7, 'days'), dateUtil().add(1, 'days')],
},
{
field: "hasException",
label: t("routes.admin.audit_hasException"),
component: "Select",
colProps: { span: 4 },
componentProps: ()=>{
field: 'hasException',
label: t('routes.admin.audit_hasException'),
component: 'Select',
colProps: { span: 2 },
componentProps: () => {
return {
options: [
{ label: t("routes.admin.audit_hasException_all"), value: null },
{ label: t("routes.admin.audit_hasException_yes"), value: true },
{ label: t("routes.admin.audit_hasException_no"), value: false },
]
}
}
{ label: t('routes.admin.audit_hasException_all'), value: null },
{ label: t('routes.admin.audit_hasException_yes'), value: true },
{ 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[] = [
// {
// title: t('routes.admin.tenant'),
// dataIndex: 'tenantName',
// width: 100,
// },
{
title: "Url",
dataIndex: "url",
title: 'Url',
dataIndex: 'url',
width: 350,
align: "left"
align: 'left',
},
{
title: t("routes.admin.userManagement_userName"),
dataIndex: "userName",
width: 100
title: t('routes.admin.tenant'),
dataIndex: 'tenantName',
width: 100,
},
{
title: t("routes.admin.executionTime"),
dataIndex: "executionTime",
width: 200,
title: t('routes.admin.userManagement_userName'),
dataIndex: 'userName',
width: 100,
},
{
title: t('routes.admin.executionTime'),
dataIndex: 'executionTime',
customRender: ({ text }) => {
return formatToDateTime(text);
}
},
width: 150,
sorter: true,
},
{
title: t("routes.admin.executionDuration"),
dataIndex: "executionDuration",
width: 150
title: t('routes.admin.executionDuration'),
dataIndex: 'executionDuration',
width: 120,
},
{
title: t("routes.admin.executionMessage"),
dataIndex: "exceptions",
resizable:false,
width: 350,
title: t('routes.admin.audit_ipAddress'),
dataIndex: 'clientIpAddress',
width: 150,
},
{
title: 'CorrelationId',
dataIndex: 'correlationId',
width: 280,
},
{
title: t('routes.admin.executionMessage'),
dataIndex: 'exceptions',
customRender: ({ text }) => {
if (text) {
return text.toString();
return text.toString().substring(0, 300);
}
}
}
},
},
];
/**
@ -86,48 +108,48 @@ export const tableColumns: BasicColumn[] = [
* @param params
* @returns
*/
export async function getTableListAsync(params: PagingAuditLogListInput) {
export async function getTableListAsync(params: PagingAuditLogInput) {
const _auditLogsServiceProxy = new AuditLogsServiceProxy();
return _auditLogsServiceProxy.page(params);
}
export function httpStatusCodeColor(statusCode?: number) {
if (!statusCode) {
return "";
return '';
}
if (statusCode >= 200 && statusCode < 300) {
return "#87d068";
return '#87d068';
}
if (statusCode >= 300 && statusCode < 400) {
return "#108ee9";
return '#108ee9';
}
if (statusCode >= 400 && statusCode < 500) {
return "orange";
return 'orange';
}
if (statusCode >= 500) {
return "red";
return 'red';
}
return "cyan";
return 'cyan';
}
export function httpMethodColor(method?: string) {
if (method == "GET") {
return "blue";
if (method == 'GET') {
return 'blue';
}
if (method == "POST") {
return "blue";
if (method == 'POST') {
return 'blue';
}
if (method == "PUT") {
return "orange";
if (method == 'PUT') {
return 'orange';
}
if (method == "DELETE") {
return "red";
if (method == 'DELETE') {
return 'red';
}
if (method == "OPTIONS") {
return "cyan";
if (method == 'OPTIONS') {
return 'cyan';
}
if (method == "PATCH") {
return "pink";
if (method == 'PATCH') {
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>
<div>
<BasicTable @register="registerTable" size="small">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'url'">
<Tag :color="httpStatusCodeColor(record.httpStatusCode)">{{ record.httpStatusCode }}</Tag>
<Tag style="margin-left: 5px" :color="httpMethodColor(record.httpMethod)">
{{ record.httpMethod }}
</Tag>
<span style="margin-left: 5px">{{ record.url }}</span>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'url'">
<Tag :color="httpStatusCodeColor(record.httpStatusCode)">{{ record.httpStatusCode }}</Tag>
<Tag style="margin-left: 5px" :color="httpMethodColor(record.httpMethod)">
{{ record.httpMethod }}
</Tag>
<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>
</BasicTable>
<AuditLogDetail @register="registerDrawer" />
</div>
</template>
<script lang="ts">
import { defineComponent } from "vue";
import { BasicTable, useTable } from "/@/components/Table";
import { tableColumns, searchFormSchema, getTableListAsync, httpStatusCodeColor, httpMethodColor } from "/@/views/admin/auditLog/AuditLog";
import { Tag } from "ant-design-vue";
import { useI18n } from "/@/hooks/web/useI18n";
export default defineComponent({
name: "AuditLog",
components: {
BasicTable,
Tag
},
setup() {
const { t } = useI18n();
// table
const [registerTable, { reload }] = useTable({
columns: tableColumns,
formConfig: {
labelWidth: 70,
schemas: searchFormSchema,
fieldMapToTime: [
["time", ["executionBeginTime", "executionEndTime"], "YYYY-MM-DD HH:mm:ss"]
]
},
api: getTableListAsync,
showTableSetting: true,
useSearchForm: true,
bordered: true,
canResize: true,
showIndexColumn: true,
immediate: true,
scroll: { x: true }
});
return {
registerTable,
reload,
t,
httpStatusCodeColor,
httpMethodColor
};
}
});
import { defineComponent } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import {
tableColumns,
searchFormSchema,
getTableListAsync,
httpStatusCodeColor,
httpMethodColor,
} from '/@/views/admin/auditLog/AuditLog';
import AuditLogDetail from './AuditLogDetail.vue';
import { Tag } from 'ant-design-vue';
import { useI18n } from '/@/hooks/web/useI18n';
import { useDrawer } from '/@/components/Drawer';
export default defineComponent({
name: 'AuditLog',
components: {
BasicTable,
Tag,
AuditLogDetail,
TableAction,
},
setup() {
const { t } = useI18n();
// table
const [registerTable, { reload }] = useTable({
columns: tableColumns,
formConfig: {
labelWidth: 70,
schemas: searchFormSchema,
fieldMapToTime: [['time', ['startTime', 'endTime'], 'YYYY-MM-DD']],
},
api: getTableListAsync,
showTableSetting: true,
useSearchForm: true,
bordered: true,
canResize: true,
showIndexColumn: true,
immediate: true,
scroll: { x: true },
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>

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>
<!-- Lion.AbpPro包-->
<ItemGroup>
<PackageReference Update="Lion.AbpPro.Core" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.Shared.Hosting.Microservices" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.Shared.Hosting.Gateways" 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.5"/>
<PackageReference Update="Lion.AbpPro.Shared.Hosting.Gateways" Version="7.2.2.5"/>
</ItemGroup>
</Project>

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

@ -1,34 +1,34 @@
<Project>
<!-- Lion.AbpPro包-->
<ItemGroup>
<PackageReference Update="Lion.AbpPro.Core" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.Shared.Hosting.Microservices" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.Shared.Hosting.Gateways" 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.5"/>
<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.Contracts" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Domain" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Domain.Shared" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.EntityFrameworkCore" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi.Client" 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.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Domain" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Domain.Shared" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.EntityFrameworkCore" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi" Version="7.2.2.5"/>
<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.Contracts" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Domain" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Domain.Shared" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.EntityFrameworkCore" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi.Client" 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.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Domain" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Domain.Shared" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.EntityFrameworkCore" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi" Version="7.2.2.5"/>
<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.Contracts" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain.Shared" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi" Version="7.2.2.1"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi.Client" 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.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain.Shared" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi" Version="7.2.2.5"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi.Client" Version="7.2.2.5"/>
</ItemGroup>
</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
{
[DbContext(typeof(MyProjectNameDbContext))]
[Migration("20230517130954_Init")]
[Migration("20230617074136_Init")]
partial class Init
{
/// <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>
<ItemGroup>
<ProjectReference Include="..\MyCompanyName.MyProjectName.Domain\MyCompanyName.MyProjectName.Domain.csproj"/>
<PackageReference Include="Volo.Abp.EntityFrameworkCore.MySQL"/>
<ProjectReference Include="..\MyCompanyName.MyProjectName.Domain\MyCompanyName.MyProjectName.Domain.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.MySQL" />
</ItemGroup>
<ItemGroup>
<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\DataDictionaryManagement\src\Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore\Lion.AbpPro.DataDictionaryManagement.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\DataDictionaryManagement\src\Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore\Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>

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

@ -1,5 +1,5 @@
{
"runtime": "Net60",
"runtime": "Net70",
"defaultVariables": null,
"documentGenerator": {
"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;
align-items: center;
padding-left: 7px;
cursor: pointer;
transition: all 0.2s ease;
cursor: pointer;
&.light {
border-bottom: 1px solid @border-color-base;
@ -84,9 +84,9 @@
}
&__title {
transition: all 0.5s;
font-size: 16px;
font-weight: 700;
transition: all 0.5s;
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 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 { PageHeader } from 'ant-design-vue';
import { useContentHeight } from '/@/hooks/web/useContentHeight';
import { PageWrapperFixedHeightKey } from '..';
import { PageWrapperFixedHeightKey } from '/@/enums/pageEnum';
export default defineComponent({
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 { Table } from 'ant-design-vue';
import { BasicForm, useForm } from '/@/components/Form/index';
import { PageWrapperFixedHeightKey } from '/@/components/Page';
import { PageWrapperFixedHeightKey } from '/@/enums/pageEnum';
import HeaderCell from './components/HeaderCell.vue';
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 = '/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 (userStore.checkUserLoginExpire) {
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 = {
'accept-language': language,
'Content-Type': 'application/json',
Authorization: 'Bearer ' + token,
__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 {
options.headers = {
'Content-Type': 'application/json',
@ -37,21 +124,23 @@ export class ServiceProxyBase {
protected transformResult(
_url: string,
response: AxiosResponse,
processor: (response: AxiosResponse) => Promise<any>
processor: (response: AxiosResponse) => Promise<any>,
): Promise<any> {
const { t } = useI18n();
if (response.status == 401 || response.status == 403 || response.status == 302) {
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: '验证失败',
title: t('common.parameterValidationFailure'),
content: response.data.error.validationErrors[0].message,
});
} else if (response.status >= 500) {
Modal.error({
title: '请求异常',
title: t('common.systemErrorText'),
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) {
return {
// The sort field passed to the backend you
field,
sorting: field + ' ' + order.replace('end', ''),
// Sorting method passed to the background asc/desc
order,
//order,
};
} else {
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 { BasicColumn } from "/@/components/Table";
import { useI18n } from "/@/hooks/web/useI18n";
import { FormSchema } from '/@/components/Table';
import { BasicColumn } from '/@/components/Table';
import { useI18n } from '/@/hooks/web/useI18n';
import { formatToDateTime, dateUtil } from '/@/utils/dateUtil';
const { t } = useI18n();
import { formatToDateTime } from '/@/utils/dateUtil';
import { AuditLogsServiceProxy, PagingAuditLogListInput } from "/@/services/ServiceProxies";
import { AuditLogsServiceProxy, PagingAuditLogInput } from '/@/services/ServiceProxies';
export const searchFormSchema: FormSchema[] = [
{
field: "userName",
label: t("routes.admin.userManagement_userName"),
component: "Input",
colProps: { span: 8 }
field: 'userName',
label: t('routes.admin.userManagement_userName'),
component: 'Input',
colProps: { span: 3 },
},
{
field: "time",
component: "RangePicker",
label: t("routes.admin.audit_executeTime"),
field: 'time',
component: 'RangePicker',
label: t('routes.admin.audit_executeTime'),
colProps: {
span: 6
}
span: 4,
},
defaultValue: [dateUtil().subtract(7, 'days'), dateUtil().add(1, 'days')],
},
{
field: "hasException",
label: t("routes.admin.audit_hasException"),
component: "Select",
colProps: { span: 4 },
componentProps: ()=>{
field: 'hasException',
label: t('routes.admin.audit_hasException'),
component: 'Select',
colProps: { span: 2 },
componentProps: () => {
return {
options: [
{ label: t("routes.admin.audit_hasException_all"), value: null },
{ label: t("routes.admin.audit_hasException_yes"), value: true },
{ label: t("routes.admin.audit_hasException_no"), value: false },
]
}
}
{ label: t('routes.admin.audit_hasException_all'), value: null },
{ label: t('routes.admin.audit_hasException_yes'), value: true },
{ 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[] = [
// {
// title: t('routes.admin.tenant'),
// dataIndex: 'tenantName',
// width: 100,
// },
{
title: "Url",
dataIndex: "url",
title: 'Url',
dataIndex: 'url',
width: 350,
align: "left"
align: 'left',
},
{
title: t("routes.admin.userManagement_userName"),
dataIndex: "userName",
width: 100
title: t('routes.admin.tenant'),
dataIndex: 'tenantName',
width: 100,
},
{
title: t("routes.admin.executionTime"),
dataIndex: "executionTime",
width: 200,
title: t('routes.admin.userManagement_userName'),
dataIndex: 'userName',
width: 100,
},
{
title: t('routes.admin.executionTime'),
dataIndex: 'executionTime',
customRender: ({ text }) => {
return formatToDateTime(text);
}
},
width: 150,
sorter: true,
},
{
title: t("routes.admin.executionDuration"),
dataIndex: "executionDuration",
width: 150
title: t('routes.admin.executionDuration'),
dataIndex: 'executionDuration',
width: 120,
},
{
title: t("routes.admin.executionMessage"),
dataIndex: "exceptions",
resizable:false,
width: 350,
title: t('routes.admin.audit_ipAddress'),
dataIndex: 'clientIpAddress',
width: 150,
},
{
title: 'CorrelationId',
dataIndex: 'correlationId',
width: 280,
},
{
title: t('routes.admin.executionMessage'),
dataIndex: 'exceptions',
customRender: ({ text }) => {
if (text) {
return text.toString();
return text.toString().substring(0, 300);
}
}
}
},
},
];
/**
@ -86,48 +108,48 @@ export const tableColumns: BasicColumn[] = [
* @param params
* @returns
*/
export async function getTableListAsync(params: PagingAuditLogListInput) {
export async function getTableListAsync(params: PagingAuditLogInput) {
const _auditLogsServiceProxy = new AuditLogsServiceProxy();
return _auditLogsServiceProxy.page(params);
}
export function httpStatusCodeColor(statusCode?: number) {
if (!statusCode) {
return "";
return '';
}
if (statusCode >= 200 && statusCode < 300) {
return "#87d068";
return '#87d068';
}
if (statusCode >= 300 && statusCode < 400) {
return "#108ee9";
return '#108ee9';
}
if (statusCode >= 400 && statusCode < 500) {
return "orange";
return 'orange';
}
if (statusCode >= 500) {
return "red";
return 'red';
}
return "cyan";
return 'cyan';
}
export function httpMethodColor(method?: string) {
if (method == "GET") {
return "blue";
if (method == 'GET') {
return 'blue';
}
if (method == "POST") {
return "blue";
if (method == 'POST') {
return 'blue';
}
if (method == "PUT") {
return "orange";
if (method == 'PUT') {
return 'orange';
}
if (method == "DELETE") {
return "red";
if (method == 'DELETE') {
return 'red';
}
if (method == "OPTIONS") {
return "cyan";
if (method == 'OPTIONS') {
return 'cyan';
}
if (method == "PATCH") {
return "pink";
if (method == 'PATCH') {
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>
<div>
<BasicTable @register="registerTable" size="small">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'url'">
<Tag :color="httpStatusCodeColor(record.httpStatusCode)">{{ record.httpStatusCode }}</Tag>
<Tag style="margin-left: 5px" :color="httpMethodColor(record.httpMethod)">
{{ record.httpMethod }}
</Tag>
<span style="margin-left: 5px">{{ record.url }}</span>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'url'">
<Tag :color="httpStatusCodeColor(record.httpStatusCode)">{{ record.httpStatusCode }}</Tag>
<Tag style="margin-left: 5px" :color="httpMethodColor(record.httpMethod)">
{{ record.httpMethod }}
</Tag>
<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>
</BasicTable>
<AuditLogDetail @register="registerDrawer" />
</div>
</template>
<script lang="ts">
import { defineComponent } from "vue";
import { BasicTable, useTable } from "/@/components/Table";
import { tableColumns, searchFormSchema, getTableListAsync, httpStatusCodeColor, httpMethodColor } from "/@/views/admin/auditLog/AuditLog";
import { Tag } from "ant-design-vue";
import { useI18n } from "/@/hooks/web/useI18n";
export default defineComponent({
name: "AuditLog",
components: {
BasicTable,
Tag
},
setup() {
const { t } = useI18n();
// table
const [registerTable, { reload }] = useTable({
columns: tableColumns,
formConfig: {
labelWidth: 70,
schemas: searchFormSchema,
fieldMapToTime: [
["time", ["executionBeginTime", "executionEndTime"], "YYYY-MM-DD HH:mm:ss"]
]
},
api: getTableListAsync,
showTableSetting: true,
useSearchForm: true,
bordered: true,
canResize: true,
showIndexColumn: true,
immediate: true,
scroll: { x: true }
});
return {
registerTable,
reload,
t,
httpStatusCodeColor,
httpMethodColor
};
}
});
import { defineComponent } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import {
tableColumns,
searchFormSchema,
getTableListAsync,
httpStatusCodeColor,
httpMethodColor,
} from '/@/views/admin/auditLog/AuditLog';
import AuditLogDetail from './AuditLogDetail.vue';
import { Tag } from 'ant-design-vue';
import { useI18n } from '/@/hooks/web/useI18n';
import { useDrawer } from '/@/components/Drawer';
export default defineComponent({
name: 'AuditLog',
components: {
BasicTable,
Tag,
AuditLogDetail,
TableAction,
},
setup() {
const { t } = useI18n();
// table
const [registerTable, { reload }] = useTable({
columns: tableColumns,
formConfig: {
labelWidth: 70,
schemas: searchFormSchema,
fieldMapToTime: [['time', ['startTime', 'endTime'], 'YYYY-MM-DD']],
},
api: getTableListAsync,
showTableSetting: true,
useSearchForm: true,
bordered: true,
canResize: true,
showIndexColumn: true,
immediate: true,
scroll: { x: true },
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>

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