Browse Source

Correct any inaccuracies

pull/100/head
cKey 5 years ago
parent
commit
a77a808b3d
  1. 2
      aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Application.Contracts/LINGYUN/Abp/FileManagement/Features/AbpFileManagementFeatureDefinitionProvider.cs
  2. 5
      vueJs/src/api/apiresources.ts
  3. 4
      vueJs/src/api/auditing.ts
  4. 4
      vueJs/src/api/clients.ts
  5. 59
      vueJs/src/api/feature-management.ts
  6. 5
      vueJs/src/api/identityresources.ts
  7. 6
      vueJs/src/api/organizationunit.ts
  8. 56
      vueJs/src/api/profile.ts
  9. 3
      vueJs/src/api/roles.ts
  10. 3
      vueJs/src/api/tenant-management.ts
  11. 2
      vueJs/src/api/types.ts
  12. 3
      vueJs/src/api/users.ts
  13. 2
      vueJs/src/icons/components/index.ts
  14. 12
      vueJs/src/icons/components/logout.ts
  15. 12
      vueJs/src/icons/components/profile.ts
  16. 1
      vueJs/src/icons/svg/logout.svg
  17. 1
      vueJs/src/icons/svg/profile.svg
  18. 20
      vueJs/src/lang/index.ts
  19. 12
      vueJs/src/layout/components/Navbar/index.vue
  20. 28
      vueJs/src/mixins/DataListMiXin.ts
  21. 34
      vueJs/src/router/index.ts
  22. 20
      vueJs/src/store/modules/abp.ts
  23. 1
      vueJs/src/store/modules/user.ts
  24. 1
      vueJs/src/utils/request.ts
  25. 4
      vueJs/src/views/admin/apigateway/aggregateRoute.vue
  26. 1
      vueJs/src/views/admin/apigateway/components/RouteGroupCreateOrEditForm.vue
  27. 4
      vueJs/src/views/admin/apigateway/global.vue
  28. 4
      vueJs/src/views/admin/apigateway/group.vue
  29. 4
      vueJs/src/views/admin/apigateway/route.vue
  30. 1
      vueJs/src/views/admin/auditing/audit-log/components/AuditLogDialog.vue
  31. 7
      vueJs/src/views/admin/auditing/audit-log/components/AuditLogProfile.vue
  32. 58
      vueJs/src/views/admin/auditing/audit-log/index.vue
  33. 1
      vueJs/src/views/admin/auditing/security-log/components/SecurityLogDialog.vue
  34. 26
      vueJs/src/views/admin/auditing/security-log/index.vue
  35. 267
      vueJs/src/views/admin/components/FeatureManagement.vue
  36. 36
      vueJs/src/views/admin/identityServer/api-resources/components/ApiResourceCreateOrEditForm.vue
  37. 24
      vueJs/src/views/admin/identityServer/api-resources/components/ApiResourceScopeEditForm.vue
  38. 26
      vueJs/src/views/admin/identityServer/api-resources/components/ApiResourceSecretEditForm.vue
  39. 76
      vueJs/src/views/admin/identityServer/api-resources/index.vue
  40. 22
      vueJs/src/views/admin/identityServer/client/components/ClientClaimEditForm.vue
  41. 23
      vueJs/src/views/admin/identityServer/client/components/ClientCloneForm.vue
  42. 27
      vueJs/src/views/admin/identityServer/client/components/ClientCreateForm.vue
  43. 1012
      vueJs/src/views/admin/identityServer/client/components/ClientEditForm.vue
  44. 101
      vueJs/src/views/admin/identityServer/client/components/ClientPermissionEditForm.vue
  45. 24
      vueJs/src/views/admin/identityServer/client/components/ClientPropertyEditForm.vue
  46. 24
      vueJs/src/views/admin/identityServer/client/components/ClientSecretEditForm.vue
  47. 162
      vueJs/src/views/admin/identityServer/client/index.vue
  48. 1
      vueJs/src/views/admin/identityServer/components/ScopeInput.vue
  49. 38
      vueJs/src/views/admin/identityServer/identity-resources/components/IdentityResourceCreateOrEditForm.vue
  50. 34
      vueJs/src/views/admin/identityServer/identity-resources/components/IdentityResourcePropertyEditForm.vue
  51. 49
      vueJs/src/views/admin/identityServer/identity-resources/index.vue
  52. 9
      vueJs/src/views/admin/organization-unit/components/RoleOrganizationUint.vue
  53. 9
      vueJs/src/views/admin/roles/index.vue
  54. 5
      vueJs/src/views/admin/settings/components/SettingEditForm.vue
  55. 41
      vueJs/src/views/admin/tenants/components/TenantConnectionEditForm.vue
  56. 34
      vueJs/src/views/admin/tenants/components/TenantCreateOrEditForm.vue
  57. 4
      vueJs/src/views/admin/tenants/components/TenantFeatureEditForm.vue
  58. 50
      vueJs/src/views/admin/tenants/index.vue
  59. 10
      vueJs/src/views/admin/users/index.vue
  60. 4
      vueJs/src/views/file-management/index.vue
  61. 144
      vueJs/src/views/profile-setting/components/MyProfile.vue
  62. 0
      vueJs/src/views/profile-setting/components/MySecurity.vue
  63. 33
      vueJs/src/views/profile-setting/index.vue

2
aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Application.Contracts/LINGYUN/Abp/FileManagement/Features/AbpFileManagementFeatureDefinitionProvider.cs

@ -38,7 +38,7 @@ namespace LINGYUN.Abp.FileManagement.Features
defaultValue: 1.ToString(), defaultValue: 1.ToString(),
displayName: L("Features:DisplayName:MaxUploadFileCount"), displayName: L("Features:DisplayName:MaxUploadFileCount"),
description: L("Features:Description:MaxUploadFileCount"), description: L("Features:Description:MaxUploadFileCount"),
valueType: new ToggleStringValueType(new NumericValueValidator(1, 10))); valueType: new FreeTextStringValueType(new NumericValueValidator(1, 10)));
} }
protected ILocalizableString L(string name) protected ILocalizableString L(string name)

5
vueJs/src/api/apiresources.ts

@ -1,5 +1,4 @@
import ApiService from './serviceBase' import ApiService from './serviceBase'
import { pagerFormat } from '@/utils/index'
import { FullAuditedEntityDto, PagedAndSortedResultRequestDto, PagedResultDto } from './types' import { FullAuditedEntityDto, PagedAndSortedResultRequestDto, PagedResultDto } from './types'
const serviceUrl = process.env.VUE_APP_BASE_API const serviceUrl = process.env.VUE_APP_BASE_API
@ -23,9 +22,7 @@ export default class ApiResourceService {
let _url = '/api/IdentityServer/ApiResources' let _url = '/api/IdentityServer/ApiResources'
_url += '?filter=' + payload.filter _url += '?filter=' + payload.filter
_url += '&sorting=' + payload.sorting _url += '&sorting=' + payload.sorting
// abp设计原因,需要前端计算分页 _url += '&skipCount=' + payload.skipCount
_url += '&skipCount=' + pagerFormat(payload.skipCount) * payload.maxResultCount
// _url += '&skipCount=' + pagerFormat(payload.skipCount)
_url += '&maxResultCount=' + payload.maxResultCount _url += '&maxResultCount=' + payload.maxResultCount
return ApiService.Get<PagedResultDto<ApiResource>>(_url, serviceUrl) return ApiService.Get<PagedResultDto<ApiResource>>(_url, serviceUrl)
} }

4
vueJs/src/api/auditing.ts

@ -1,4 +1,4 @@
import { urlStringify, abpPagerFormat } from '@/utils/index' import { urlStringify } from '@/utils/index'
import ApiService from './serviceBase' import ApiService from './serviceBase'
import { PagedAndSortedResultRequestDto, PagedResultDto } from './types' import { PagedAndSortedResultRequestDto, PagedResultDto } from './types'
@ -12,7 +12,6 @@ export default class AuditingService {
public static getAuditLogs(payload: AuditLogGetPaged) { public static getAuditLogs(payload: AuditLogGetPaged) {
let _url = '/api/auditing/audit-log?' let _url = '/api/auditing/audit-log?'
payload.skipCount = abpPagerFormat(payload.skipCount, payload.maxResultCount)
_url += urlStringify(payload) _url += urlStringify(payload)
return ApiService.Get<PagedResultDto<AuditLog>>(_url, serviceUrl) return ApiService.Get<PagedResultDto<AuditLog>>(_url, serviceUrl)
} }
@ -29,7 +28,6 @@ export default class AuditingService {
public static getSecurityLogs(payload: SecurityLogGetPaged) { public static getSecurityLogs(payload: SecurityLogGetPaged) {
let _url = '/api/auditing/security-log?' let _url = '/api/auditing/security-log?'
payload.skipCount = abpPagerFormat(payload.skipCount, payload.maxResultCount)
_url += urlStringify(payload) _url += urlStringify(payload)
return ApiService.Get<PagedResultDto<SecurityLog>>(_url, serviceUrl) return ApiService.Get<PagedResultDto<SecurityLog>>(_url, serviceUrl)
} }

4
vueJs/src/api/clients.ts

@ -1,5 +1,4 @@
import ApiService from './serviceBase' import ApiService from './serviceBase'
import { pagerFormat } from '@/utils/index'
import { FullAuditedEntityDto, PagedAndSortedResultRequestDto, PagedResultDto } from './types' import { FullAuditedEntityDto, PagedAndSortedResultRequestDto, PagedResultDto } from './types'
const serviceUrl = process.env.VUE_APP_BASE_API const serviceUrl = process.env.VUE_APP_BASE_API
@ -15,8 +14,7 @@ export default class ClientService {
let _url = '/api/IdentityServer/Clients' let _url = '/api/IdentityServer/Clients'
_url += '?filter=' + payload.filter _url += '?filter=' + payload.filter
_url += '&sorting=' + payload.sorting _url += '&sorting=' + payload.sorting
// 因为abp设计的原因, 需要前端组合页面 _url += '&skipCount=' + payload.skipCount
_url += '&skipCount=' + pagerFormat(payload.skipCount) * payload.maxResultCount
_url += '&maxResultCount=' + payload.maxResultCount _url += '&maxResultCount=' + payload.maxResultCount
return ApiService.Get<PagedResultDto<Client>>(_url, serviceUrl) return ApiService.Get<PagedResultDto<Client>>(_url, serviceUrl)
} }

59
vueJs/src/api/feature-management.ts

@ -7,7 +7,7 @@ export default class FeatureManagementService {
let _url = '/api/feature-management/features?' let _url = '/api/feature-management/features?'
_url += 'providerName=' + providerName _url += 'providerName=' + providerName
_url += '&providerKey=' + providerKey _url += '&providerKey=' + providerKey
return ApiService.Get<Features>(_url, serviceUrl) return ApiService.Get<FeatureGroups>(_url, serviceUrl)
} }
public static updateFeatures(providerName: string, providerKey: string, features: Features) { public static updateFeatures(providerName: string, providerKey: string, features: Features) {
@ -19,8 +19,8 @@ export default class FeatureManagementService {
} }
export class Provider { export class Provider {
providerName!: string Name!: string
providerKey!: string Key!: string
} }
export class ValueType { export class ValueType {
@ -37,6 +37,7 @@ export class Feature {
valueType?: ValueType valueType?: ValueType
depth?: number depth?: number
parentName?: string parentName?: string
provider!: Provider
constructor( constructor(
name: string, name: string,
@ -54,3 +55,55 @@ export class Features {
this.features = new Array<Feature>() this.features = new Array<Feature>()
} }
} }
export class FeatureGroup {
name!: string
displayName?: string
features = new Array<Feature>()
}
export class FeatureGroups {
groups = new Array<FeatureGroup>()
}
/**
*
*/
export class FeatureItem {
/** 功能名称 */
name!: string
/** 显示名称 */
displayName?: string
/** 当前值 */
value!: any
/** 说明 */
description?: string
/** 值类型 */
valueType?: ValueType
/** 深度 */
depth?: number
/** 子节点 */
children!: FeatureItem[]
/** 构造器 */
constructor(
name: string,
value: any,
displayName?: string,
description?: string,
valueType?: ValueType,
depth?: number
) {
this.name = name
this.depth = depth
this.valueType = valueType
this.displayName = displayName
this.description = description
this.children = new Array<FeatureItem>()
if (value !== null) {
this.value = value.toLowerCase() === 'true' ? true // boolean类型
: !isNaN(Number(value)) ? Number(value) // number类型
: value
}
}
}

5
vueJs/src/api/identityresources.ts

@ -1,5 +1,4 @@
import ApiService from './serviceBase' import ApiService from './serviceBase'
import { pagerFormat } from '@/utils/index'
import { FullAuditedEntityDto, PagedResultDto, PagedAndSortedResultRequestDto } from './types' import { FullAuditedEntityDto, PagedResultDto, PagedAndSortedResultRequestDto } from './types'
/** 远程服务地址 */ /** 远程服务地址 */
@ -27,9 +26,7 @@ export default class IdentityResourceService {
let _url = '/api/IdentityServer/IdentityResources' let _url = '/api/IdentityServer/IdentityResources'
_url += '?filter=' + payload.filter _url += '?filter=' + payload.filter
_url += '&sorting=' + payload.sorting _url += '&sorting=' + payload.sorting
// abp设计原因,需要前端计算分页 _url += '&skipCount=' + payload.skipCount
_url += '&skipCount=' + pagerFormat(payload.skipCount) * payload.maxResultCount
// _url += '&skipCount=' + pagerFormat(payload.skipCount)
_url += '&maxResultCount=' + payload.maxResultCount _url += '&maxResultCount=' + payload.maxResultCount
return ApiService.Get<PagedResultDto<IdentityResource>>(_url, serviceUrl) return ApiService.Get<PagedResultDto<IdentityResource>>(_url, serviceUrl)
} }

6
vueJs/src/api/organizationunit.ts

@ -1,5 +1,4 @@
import ApiService from './serviceBase' import ApiService from './serviceBase'
import { pagerFormat } from '@/utils/index'
import { AuditedEntityDto, PagedResultDto, PagedAndSortedResultRequestDto, ListResultDto } from './types' import { AuditedEntityDto, PagedResultDto, PagedAndSortedResultRequestDto, ListResultDto } from './types'
import { RoleDto } from './roles' import { RoleDto } from './roles'
import { UserDataDto } from './users' import { UserDataDto } from './users'
@ -36,7 +35,7 @@ export default class OrganizationUnitService {
let _url = '/api/identity/organization-units' let _url = '/api/identity/organization-units'
_url += '?filter=' + payload.filter _url += '?filter=' + payload.filter
_url += '&sorting=' + payload.sorting _url += '&sorting=' + payload.sorting
_url += '&skipCount=' + pagerFormat(payload.skipCount) _url += '&skipCount=' + payload.skipCount
_url += '&maxResultCount=' + payload.maxResultCount _url += '&maxResultCount=' + payload.maxResultCount
return ApiService.Get<PagedResultDto<OrganizationUnit>>(_url, serviceUrl) return ApiService.Get<PagedResultDto<OrganizationUnit>>(_url, serviceUrl)
} }
@ -120,8 +119,7 @@ export default class OrganizationUnitService {
_url += '?id=' + payload.id _url += '?id=' + payload.id
_url += '&filter=' + payload.filter _url += '&filter=' + payload.filter
_url += '&sorting=' + payload.sorting _url += '&sorting=' + payload.sorting
// abp设计原因,需要前端计算分页 _url += '&skipCount=' + payload.skipCount
_url += '&skipCount=' + pagerFormat(payload.skipCount) * payload.maxResultCount
// _url += '&skipCount=' + pagerFormat(payload.skipCount) // _url += '&skipCount=' + pagerFormat(payload.skipCount)
_url += '&maxResultCount=' + payload.maxResultCount _url += '&maxResultCount=' + payload.maxResultCount
return ApiService.Get<PagedResultDto<RoleDto>>(_url, serviceUrl) return ApiService.Get<PagedResultDto<RoleDto>>(_url, serviceUrl)

56
vueJs/src/api/profile.ts

@ -0,0 +1,56 @@
import ApiService from './serviceBase'
const IdentityServiceUrl = process.env.VUE_APP_BASE_API
export default class MyProfileService {
public static getMyProfile() {
const _url = '/api/identity/my-profile'
return ApiService.Get<MyProfile>(_url, IdentityServiceUrl)
}
public static updateMyProfile(payload: UpdateMyProfile) {
const _url = '/api/identity/my-profile'
return ApiService.Put<MyProfile>(_url, payload, IdentityServiceUrl)
}
public static changePassword(payload: ChangePassword) {
const _url = '/api/identity/my-profile/change-password'
return ApiService.Post<void>(_url, payload, IdentityServiceUrl)
}
}
export class MyProfileBase {
userName?: string
email?: string
name?: string
surname?: string
phoneNumber?: string
constructor(
name = '',
email = '',
userName = '',
surname = '',
phoneNumber = ''
) {
this.name = name
this.email = email
this.userName = userName
this.surname = surname
this.phoneNumber = phoneNumber
}
}
export class MyProfile extends MyProfileBase {
isExternal!: boolean
hasPassword!: boolean
extraProperties?: {[key: string]: any }
}
export class UpdateMyProfile extends MyProfileBase {
}
export class ChangePassword {
currentPassword!: string
newPassword!: string
}

3
vueJs/src/api/roles.ts

@ -1,4 +1,3 @@
import { pagerFormat } from '@/utils/index'
import ApiService from './serviceBase' import ApiService from './serviceBase'
import { OrganizationUnit } from './organizationunit' import { OrganizationUnit } from './organizationunit'
import { ListResultDto, PagedAndSortedResultRequestDto, PagedResultDto } from './types' import { ListResultDto, PagedAndSortedResultRequestDto, PagedResultDto } from './types'
@ -13,7 +12,7 @@ export default class RoleService {
public static getRoles(payload: RoleGetPagedDto) { public static getRoles(payload: RoleGetPagedDto) {
let _url = '/api/identity/roles' let _url = '/api/identity/roles'
// 因为abp设计的原因, 需要前端组合页面 // 因为abp设计的原因, 需要前端组合页面
_url += '?skipCount=' + pagerFormat(payload.skipCount) * payload.maxResultCount _url += '?skipCount=' + payload.skipCount
_url += '&maxResultCount=' + payload.maxResultCount _url += '&maxResultCount=' + payload.maxResultCount
_url += '&sorting=' + payload.sorting _url += '&sorting=' + payload.sorting
_url += '&filter=' + payload.filter _url += '&filter=' + payload.filter

3
vueJs/src/api/tenant-management.ts

@ -1,4 +1,3 @@
import { pagerFormat } from '@/utils'
import { ListResultDto, PagedResultDto, PagedAndSortedResultRequestDto, FullAuditedEntityDto } from './types' import { ListResultDto, PagedResultDto, PagedAndSortedResultRequestDto, FullAuditedEntityDto } from './types'
import ApiService from './serviceBase' import ApiService from './serviceBase'
@ -28,7 +27,7 @@ export default class TenantService {
_url += '?filter=' + payload.filter _url += '?filter=' + payload.filter
_url += '&sorting=' + payload.sorting _url += '&sorting=' + payload.sorting
// 因为abp设计的原因, 需要前端组合页面 // 因为abp设计的原因, 需要前端组合页面
_url += '&skipCount=' + pagerFormat(payload.skipCount) * payload.maxResultCount _url += '&skipCount=' + payload.skipCount
_url += '&maxResultCount=' + payload.maxResultCount _url += '&maxResultCount=' + payload.maxResultCount
return ApiService.Get<PagedResultDto<TenantDto>>(_url, serviceUrl) return ApiService.Get<PagedResultDto<TenantDto>>(_url, serviceUrl)
} }

2
vueJs/src/api/types.ts

@ -77,7 +77,7 @@ export class PagedAndSortedResultRequestDto implements IPagedResultRequest, ISor
constructor() { constructor() {
this.sorting = '' this.sorting = ''
this.skipCount = 1 this.skipCount = 1
this.maxResultCount = 30 this.maxResultCount = 10
} }
} }

3
vueJs/src/api/users.ts

@ -1,5 +1,4 @@
import qs from 'querystring' import qs from 'querystring'
import { pagerFormat } from '@/utils/index'
import { PagedAndSortedResultRequestDto, FullAuditedEntityDto, PagedResultDto, ListResultDto } from '@/api/types' import { PagedAndSortedResultRequestDto, FullAuditedEntityDto, PagedResultDto, ListResultDto } from '@/api/types'
import { OrganizationUnit } from './organizationunit' import { OrganizationUnit } from './organizationunit'
import ApiService from './serviceBase' import ApiService from './serviceBase'
@ -11,7 +10,7 @@ export default class UserApiService {
public static getUsers(input: UsersGetPagedDto) { public static getUsers(input: UsersGetPagedDto) {
let _url = '/api/identity/users' let _url = '/api/identity/users'
// 因为abp设计的原因, 需要前端组合页面 // 因为abp设计的原因, 需要前端组合页面
_url += '?skipCount=' + pagerFormat(input.skipCount) * input.maxResultCount _url += '?skipCount=' + input.skipCount
_url += '&maxResultCount=' + input.maxResultCount _url += '&maxResultCount=' + input.maxResultCount
if (input.sorting) { if (input.sorting) {
_url += '&sorting=' + input.sorting _url += '&sorting=' + input.sorting

2
vueJs/src/icons/components/index.ts

@ -43,6 +43,7 @@ import './like'
import './link' import './link'
import './list' import './list'
import './lock' import './lock'
import './logout'
import './manager' import './manager'
import './message' import './message'
import './money' import './money'
@ -52,6 +53,7 @@ import './password'
import './pdf' import './pdf'
import './people' import './people'
import './peoples' import './peoples'
import './profile'
import './qq' import './qq'
import './role' import './role'
import './route' import './route'

12
vueJs/src/icons/components/logout.ts

@ -0,0 +1,12 @@
/* eslint-disable */
/* tslint:disable */
// @ts-ignore
import icon from 'vue-svgicon'
icon.register({
'logout': {
width: 128,
height: 128,
viewBox: '0 0 1024 1024',
data: '<path pid="0" _fill="#333" d="M783.536 240.464a32 32 0 10-45.248 45.248c124.768 124.768 124.768 327.776 0 452.544-124.768 124.768-327.776 124.768-452.544 0s-124.768-327.776 0-452.544a32 32 0 10-45.248-45.248c-149.968 149.968-149.968 393.104 0 543.056s393.104 149.968 543.056 0 149.936-393.088-.016-543.056zM512 512a32 32 0 01-32-32V160a32 32 0 0164 0v320a32 32 0 01-32 32z"/>'
}
})

12
vueJs/src/icons/components/profile.ts

@ -0,0 +1,12 @@
/* eslint-disable */
/* tslint:disable */
// @ts-ignore
import icon from 'vue-svgicon'
icon.register({
'profile': {
width: 128,
height: 128,
viewBox: '0 0 1024 1024',
data: '<path pid="0" _fill="#333" d="M639.3 483.2c55.9-39.4 89.3-103.5 89.6-171.9-2.8-120.2-102.5-215.6-222.8-212.9-116.5 2.6-210.3 96.4-212.9 212.9.3 68.4 33.6 132.5 89.6 171.9-137.9 50.4-230 181.1-231.1 327.8.9 65.4 54.6 117.8 120 116.9h478.8c65.4.8 119.1-51.5 120-116.9-1.3-146.7-93.4-277.4-231.2-327.8zM358.4 311.4c-2.1-84.3 64.5-154.3 148.8-156.4 84.3-2.1 154.3 64.5 156.4 148.8S599.1 458 514.8 460.1H511c-83.1 1-151.4-65.6-152.6-148.7zm392 552.8H271.6c-29.7.5-54.2-23.2-54.7-53v-.2c4.4-162.4 139.7-290.5 302.2-286.1 156.2 4.3 281.8 129.9 286.1 286.1-.4 29.7-24.8 53.5-54.5 53.1-.2.1-.2.1-.3.1z"/>'
}
})

1
vueJs/src/icons/svg/logout.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="128px" height="128.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#333333" d="M783.536 240.464a32 32 0 1 0-45.248 45.248c124.768 124.768 124.768 327.776 0 452.544-124.768 124.768-327.776 124.768-452.544 0s-124.768-327.776 0-452.544a32 32 0 1 0-45.248-45.248c-149.968 149.968-149.968 393.104 0 543.056s393.104 149.968 543.056 0 149.936-393.088-0.016-543.056zM512 512a32 32 0 0 1-32-32V160a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32z" /></svg>

After

Width:  |  Height:  |  Size: 641 B

1
vueJs/src/icons/svg/profile.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="128px" height="128.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#333333" d="M639.3 483.2c55.9-39.4 89.3-103.5 89.6-171.9-2.8-120.2-102.5-215.6-222.8-212.9-116.5 2.6-210.3 96.4-212.9 212.9 0.3 68.4 33.6 132.5 89.6 171.9-137.9 50.4-230 181.1-231.1 327.8 0.9 65.4 54.6 117.8 120 116.9h478.8c65.4 0.8 119.1-51.5 120-116.9-1.3-146.7-93.4-277.4-231.2-327.8zM358.4 311.4c-2.1-84.3 64.5-154.3 148.8-156.4 84.3-2.1 154.3 64.5 156.4 148.8S599.1 458 514.8 460.1H511c-83.1 1-151.4-65.6-152.6-148.7z m392 552.8H271.6c-29.7 0.5-54.2-23.2-54.7-53v-0.2c4.4-162.4 139.7-290.5 302.2-286.1 156.2 4.3 281.8 129.9 286.1 286.1-0.4 29.7-24.8 53.5-54.5 53.1-0.2 0.1-0.2 0.1-0.3 0.1z" /></svg>

After

Width:  |  Height:  |  Size: 874 B

20
vueJs/src/lang/index.ts

@ -29,14 +29,13 @@ export const getLocale = () => {
if (cookieLanguage) { if (cookieLanguage) {
return cookieLanguage return cookieLanguage
} }
// const language = navigator.language.toLowerCase() const language = navigator.language.toLowerCase()
// const locales = Object.keys(messages) const locales = Object.keys(messages)
// for (const locale of locales) { for (const locale of locales) {
// if (language.indexOf(locale) > -1) { if (language.indexOf(locale) > -1) {
// return locale return locale
// } }
// } }
return 'zh-Hans' return 'zh-Hans'
} }
@ -45,4 +44,9 @@ const i18n = new VueI18n({
messages messages
}) })
export function setLanguage(language: string, values: any) {
i18n.mergeLocaleMessage(language, values)
i18n.locale = language
}
export default i18n export default i18n

12
vueJs/src/layout/components/Navbar/index.vue

@ -37,12 +37,14 @@
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<router-link to="/profile/"> <router-link to="/profile/">
<el-dropdown-item> <el-dropdown-item>
{{ $t('navbar.profile') }} <svg-icon name="profile" />
{{ $t('AbpAccount.PersonalInfo') }}
</el-dropdown-item> </el-dropdown-item>
</router-link> </router-link>
<router-link to="/"> <router-link to="/profile-setting/">
<el-dropdown-item> <el-dropdown-item>
{{ $t('navbar.dashboard') }} <svg-icon name="setting" />
{{ $t('AbpAccount.PersonalSettings') }}
</el-dropdown-item> </el-dropdown-item>
</router-link> </router-link>
<el-dropdown-item <el-dropdown-item
@ -50,7 +52,8 @@
@click.native="logout" @click.native="logout"
> >
<span style="display:block;"> <span style="display:block;">
{{ $t('navbar.logOut') }} <svg-icon name="logout" />
{{ $t('AbpAccount.Logout') }}
</span> </span>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
@ -95,7 +98,6 @@ export default class extends Vue {
} }
get name() { get name() {
console.log(navigator)
return UserModule.name ?? UserModule.userName return UserModule.name ?? UserModule.userName
} }

28
vueJs/src/mixins/DataListMiXin.ts

@ -10,12 +10,27 @@ export default class DataListMiXin extends Vue {
public dataList = new Array<any>() public dataList = new Array<any>()
/** 数据总数 */ /** 数据总数 */
public dataTotal = 0 public dataTotal = 0
/** 当前页码 */
public currentPage = 1
/** 是否正在加载数据 */ /** 是否正在加载数据 */
public dataLoading = false public dataLoading = false
/** /**
*, *,
*/ */
public dataFilter = new PagedAndSortedResultRequestDto() public dataFilter = new PagedAndSortedResultRequestDto()
/** 页大小 */
get pageSize() {
return this.dataFilter.maxResultCount
}
set pageSize(value: number) {
this.dataFilter.maxResultCount = value
}
protected processDataFilter() {
this.dataFilter.skipCount = this.currentPage
this.dataFilter.maxResultCount = this.pageSize
}
/** /**
* *
@ -39,6 +54,7 @@ export default class DataListMiXin extends Vue {
this.dataLoading = true this.dataLoading = true
// 这里还可以处理对于过滤器的变动 // 这里还可以处理对于过滤器的变动
// 例如 abp 框架的skipCount区别于常见的pageNumber // 例如 abp 框架的skipCount区别于常见的pageNumber
this.processDataFilter()
this.getPagedList(this.dataFilter) this.getPagedList(this.dataFilter)
.then(res => { .then(res => {
this.dataList = res.items this.dataList = res.items
@ -64,6 +80,12 @@ export default class DataListMiXin extends Vue {
}) })
} }
/** 重置列表数据 */
protected resetList() {
this.currentPage = 1
this.refreshData()
}
/** /**
* *
* @param filter * @param filter
@ -80,6 +102,12 @@ export default class DataListMiXin extends Vue {
}) })
} }
/** 重置分页数据 */
protected resetPagedList() {
this.currentPage = 1
this.refreshPagedData()
}
/** /**
* *
* @param column * @param column

34
vueJs/src/router/index.ts

@ -107,6 +107,22 @@ export const constantRoutes: RouteConfig[] = [
] ]
export const asyncRoutes: RouteConfig[] = [ export const asyncRoutes: RouteConfig[] = [
{
path: '/icon',
component: Layout,
children: [
{
path: 'index',
component: () => import(/* webpackChunkName: "icons" */ '@/views/icons/index.vue'),
name: 'Icons',
meta: {
title: 'icons',
icon: 'icon',
noCache: true
}
}
]
},
{ {
path: '/profile', path: '/profile',
component: Layout, component: Layout,
@ -125,6 +141,24 @@ export const asyncRoutes: RouteConfig[] = [
} }
] ]
}, },
{
path: '/profile-setting',
component: Layout,
redirect: '/profile-setting/index',
meta: { hidden: true },
children: [
{
path: 'index',
component: () => import(/* webpackChunkName: "profile" */ '@/views/profile-setting/index.vue'),
name: '个人设置',
meta: {
title: '个人设置',
icon: 'setting',
noCache: true
}
}
]
},
adminRouter, adminRouter,
auditingRouter, auditingRouter,
apigatewayRouter, apigatewayRouter,

20
vueJs/src/store/modules/abp.ts

@ -1,5 +1,5 @@
import store from '@/store' import store from '@/store'
import i18n from '@/lang/index' import { setLanguage } from '@/lang/index'
import { getOrDefault, setItem } from '@/utils/localStorage' import { getOrDefault, setItem } from '@/utils/localStorage'
import AbpConfigurationService, { IAbpConfiguration, AbpConfiguration as AbpConfig } from '@/api/abpconfiguration' import AbpConfigurationService, { IAbpConfiguration, AbpConfiguration as AbpConfig } from '@/api/abpconfiguration'
import { VuexModule, Module, Mutation, Action, getModule } from 'vuex-module-decorators' import { VuexModule, Module, Mutation, Action, getModule } from 'vuex-module-decorators'
@ -22,22 +22,8 @@ class AbpConfiguration extends VuexModule implements IAbpState {
@Mutation @Mutation
private SET_ABPLOCALIZER(configuration: IAbpConfiguration) { private SET_ABPLOCALIZER(configuration: IAbpConfiguration) {
const { cultureName } = configuration.localization.currentCulture const { currentCulture, values } = configuration.localization
const localeMessage = i18n.getLocaleMessage(cultureName) setLanguage(currentCulture.cultureName, values)
// const resources: { [key: string]: any} = {}
Object.keys(configuration.localization.values).forEach(key => {
const resource = configuration.localization.values[key]
if (typeof resource !== 'object') return
Object.keys(resource).forEach(key2 => {
if (/'{|{/g.test(resource[key2])) {
resource[key2] = resource[key2].replace(/'{|{/g, '{').replace(/}'|}/g, '}')
}
})
localeMessage[key] = resource
// resources[key] = resource
})
i18n.setLocaleMessage(cultureName, localeMessage)
// i18n.mergeLocaleMessage(cultureName, resources)
} }
@Action({ rawError: true }) @Action({ rawError: true })

1
vueJs/src/store/modules/user.ts

@ -73,7 +73,6 @@ class User extends VuexModule implements IUserState {
this.SET_TOKEN(token) this.SET_TOKEN(token)
this.SET_REFRESHTOKEN(loginResult.refresh_token) this.SET_REFRESHTOKEN(loginResult.refresh_token)
await this.PostLogin() await this.PostLogin()
console.log(this.token)
} }
@Action({ rawError: true }) @Action({ rawError: true })

1
vueJs/src/utils/request.ts

@ -102,7 +102,6 @@ service.interceptors.response.use(
return response return response
}, },
(error) => { (error) => {
console.log(error.response)
if (error.response.status === 401) { if (error.response.status === 401) {
UserModule.RefreshSession().then(token => { UserModule.RefreshSession().then(token => {
const config = error.response.config const config = error.response.config

4
vueJs/src/views/admin/apigateway/aggregateRoute.vue

@ -174,8 +174,8 @@
<Pagination <Pagination
v-show="dataTotal>0" v-show="dataTotal>0"
:total="dataTotal" :total="dataTotal"
:page.sync="dataFilter.skipCount" :page.sync="currentPage"
:limit.sync="dataFilter.maxResultCount" :limit.sync="pageSize"
@pagination="refreshPagedData" @pagination="refreshPagedData"
@sort-change="handleSortChange" @sort-change="handleSortChange"
/> />

1
vueJs/src/views/admin/apigateway/components/RouteGroupCreateOrEditForm.vue

@ -117,7 +117,6 @@ export default class extends Vue {
private handleAppIdChange(val: any) { private handleAppIdChange(val: any) {
if (val) { if (val) {
ApiGateWayService.getRouteGroupByAppId(val).then(router => { ApiGateWayService.getRouteGroupByAppId(val).then(router => {
console.log(router)
this.apiGateWayRouteGroup = router this.apiGateWayRouteGroup = router
}) })
} }

4
vueJs/src/views/admin/apigateway/global.vue

@ -140,8 +140,8 @@
<Pagination <Pagination
v-show="dataTotal>0" v-show="dataTotal>0"
:total="dataTotal" :total="dataTotal"
:page.sync="dataFilter.skipCount" :page.sync="currentPage"
:limit.sync="dataFilter.maxResultCount" :limit.sync="pageSize"
@pagination="refreshPagedData" @pagination="refreshPagedData"
/> />

4
vueJs/src/views/admin/apigateway/group.vue

@ -156,8 +156,8 @@
<Pagination <Pagination
v-show="dataTotal>0" v-show="dataTotal>0"
:total="dataTotal" :total="dataTotal"
:page.sync="dataFilter.skipCount" :page.sync="currentPage"
:limit.sync="dataFilter.maxResultCount" :limit.sync="pageSize"
@pagination="refreshPagedData" @pagination="refreshPagedData"
/> />

4
vueJs/src/views/admin/apigateway/route.vue

@ -189,8 +189,8 @@
<Pagination <Pagination
v-show="dataTotal>0" v-show="dataTotal>0"
:total="dataTotal" :total="dataTotal"
:page.sync="dataFilter.skipCount" :page.sync="currentPage"
:limit.sync="dataFilter.maxResultCount" :limit.sync="pageSize"
@pagination="refreshPagedData" @pagination="refreshPagedData"
@sort-change="handleSortChange" @sort-change="handleSortChange"
/> />

1
vueJs/src/views/admin/auditing/audit-log/components/AuditLogDialog.vue

@ -3,6 +3,7 @@
:visible="showDialog" :visible="showDialog"
:title="$t('AbpAuditLogging.AuditLog')" :title="$t('AbpAuditLogging.AuditLog')"
width="800px" width="800px"
custom-class="modal-form"
:close-on-click-modal="true" :close-on-click-modal="true"
@close="onFormClosed" @close="onFormClosed"
> >

7
vueJs/src/views/admin/auditing/audit-log/components/AuditLogProfile.vue

@ -131,7 +131,7 @@
name="methodInvoke" name="methodInvoke"
style="height:300px;overflow-y:auto;overflow-x:hidden;" style="height:300px;overflow-y:auto;overflow-x:hidden;"
> >
<el-timeline> <el-timeline class="timeline-card">
<el-timeline-item <el-timeline-item
v-for="(action, index) in getActions" v-for="(action, index) in getActions"
:key="index" :key="index"
@ -173,7 +173,7 @@
name="entitiesChanged" name="entitiesChanged"
style="height:300px;overflow-y:auto;overflow-x:hidden;" style="height:300px;overflow-y:auto;overflow-x:hidden;"
> >
<el-timeline> <el-timeline class="timeline-card">
<el-timeline-item <el-timeline-item
v-for="(entity, index) in getEntitiesChanges" v-for="(entity, index) in getEntitiesChanges"
:key="index" :key="index"
@ -415,4 +415,7 @@ export default class extends Vue {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.timeline-card {
margin: 5px;
}
</style> </style>

58
vueJs/src/views/admin/auditing/audit-log/index.vue

@ -112,7 +112,7 @@
class="filter-item" class="filter-item"
style="display:block;margin:0 auto; width: 150px;" style="display:block;margin:0 auto; width: 150px;"
type="primary" type="primary"
@click="refreshPagedData" @click="resetPagedList"
> >
<i class="el-icon-search" /> <i class="el-icon-search" />
{{ $t('AbpAuditLogging.SecrchLog') }} {{ $t('AbpAuditLogging.SecrchLog') }}
@ -157,11 +157,36 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
:label="$t('AbpAuditLogging.HttpMethod')"
prop="httpMethod"
sortable
width="150px"
align="center"
>
<template slot-scope="{row}">
<el-tag
:type="row.httpMethod | httpMethodFilter"
>
{{ row.httpMethod }}
</el-tag>
</template>
</el-table-column>
<el-table-column
:label="$t('AbpAuditLogging.ExecutionTime')"
prop="executionTime"
sortable
width="200px"
>
<template slot-scope="{row}">
<span>{{ row.executionTime | dateTimeFormatFilter }}</span>
</template>
</el-table-column>
<el-table-column <el-table-column
:label="$t('AbpAuditLogging.ExecutionDuration')" :label="$t('AbpAuditLogging.ExecutionDuration')"
prop="executionDuration" prop="executionDuration"
sortable sortable
width="130px" width="160px"
align="center" align="center"
> >
<template slot-scope="{row}"> <template slot-scope="{row}">
@ -176,7 +201,7 @@
:label="$t('AbpAuditLogging.HttpStatusCode')" :label="$t('AbpAuditLogging.HttpStatusCode')"
prop="httpStatusCode" prop="httpStatusCode"
sortable sortable
width="100px" width="130px"
align="center" align="center"
> >
<template slot-scope="{row}"> <template slot-scope="{row}">
@ -231,21 +256,6 @@
<span>{{ row.clientIpAddress }}</span> <span>{{ row.clientIpAddress }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
:label="$t('AbpAuditLogging.HttpMethod')"
prop="httpMethod"
sortable
width="150px"
align="center"
>
<template slot-scope="{row}">
<el-tag
:type="row.httpMethod | httpMethodFilter"
>
{{ row.httpMethod }}
</el-tag>
</template>
</el-table-column>
<el-table-column <el-table-column
:label="$t('operaActions')" :label="$t('operaActions')"
align="center" align="center"
@ -276,8 +286,8 @@
<pagination <pagination
v-show="dataTotal>0" v-show="dataTotal>0"
:total="dataTotal" :total="dataTotal"
:page.sync="dataFilter.skipCount" :page.sync="currentPage"
:limit.sync="dataFilter.maxResultCount" :limit.sync="pageSize"
@pagination="refreshPagedData" @pagination="refreshPagedData"
@sort-change="handleSortChange" @sort-change="handleSortChange"
/> />
@ -291,6 +301,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { dateFormat, abpPagerFormat } from '@/utils'
import { checkPermission } from '@/utils/permission' import { checkPermission } from '@/utils/permission'
import AuditingService, { AuditLog, AuditLogGetPaged } from '@/api/auditing' import AuditingService, { AuditLog, AuditLogGetPaged } from '@/api/auditing'
import DataListMiXin from '@/mixins/DataListMiXin' import DataListMiXin from '@/mixins/DataListMiXin'
@ -313,6 +324,9 @@ const statusMap: { [key: string]: string } = {
AuditLogDialog AuditLogDialog
}, },
filters: { filters: {
dateTimeFormatFilter(dateTime: Date) {
return dateFormat(new Date(dateTime), 'YYYY-mm-dd HH:MM:SS:NS')
},
httpMethodFilter(httpMethod: string) { httpMethodFilter(httpMethod: string) {
return statusMap[httpMethod] return statusMap[httpMethod]
}, },
@ -357,6 +371,10 @@ export default class extends mixins(DataListMiXin) {
this.refreshPagedData() this.refreshPagedData()
} }
protected processDataFilter() {
this.dataFilter.skipCount = abpPagerFormat(this.currentPage, this.pageSize)
}
protected getPagedList(filter: any) { protected getPagedList(filter: any) {
return AuditingService.getAuditLogs(filter) return AuditingService.getAuditLogs(filter)
} }

1
vueJs/src/views/admin/auditing/security-log/components/SecurityLogDialog.vue

@ -3,6 +3,7 @@
:visible="showDialog" :visible="showDialog"
:title="$t('AbpAuditLogging.SecurityLog')" :title="$t('AbpAuditLogging.SecurityLog')"
width="800px" width="800px"
custom-class="modal-form"
:close-on-click-modal="true" :close-on-click-modal="true"
@close="onFormClosed" @close="onFormClosed"
> >

26
vueJs/src/views/admin/auditing/security-log/index.vue

@ -84,7 +84,7 @@
class="filter-item" class="filter-item"
style="display:block;margin:0 auto; width: 150px;" style="display:block;margin:0 auto; width: 150px;"
type="primary" type="primary"
@click="refreshPagedData" @click="resetPagedList"
> >
<i class="el-icon-search" /> <i class="el-icon-search" />
{{ $t('AbpAuditLogging.SecrchLog') }} {{ $t('AbpAuditLogging.SecrchLog') }}
@ -117,6 +117,16 @@
<span>{{ row.applicationName }}</span> <span>{{ row.applicationName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
:label="$t('AbpAuditLogging.CreationTime')"
prop="creationTime"
sortable
width="200px"
>
<template slot-scope="{row}">
<span>{{ row.creationTime | dateTimeFormatFilter }}</span>
</template>
</el-table-column>
<el-table-column <el-table-column
:label="$t('AbpAuditLogging.UserName')" :label="$t('AbpAuditLogging.UserName')"
prop="userName" prop="userName"
@ -213,8 +223,8 @@
<pagination <pagination
v-show="dataTotal>0" v-show="dataTotal>0"
:total="dataTotal" :total="dataTotal"
:page.sync="dataFilter.skipCount" :page.sync="currentPage"
:limit.sync="dataFilter.maxResultCount" :limit.sync="pageSize"
@pagination="refreshPagedData" @pagination="refreshPagedData"
@sort-change="handleSortChange" @sort-change="handleSortChange"
/> />
@ -228,6 +238,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { dateFormat, abpPagerFormat } from '@/utils'
import { checkPermission } from '@/utils/permission' import { checkPermission } from '@/utils/permission'
import AuditingService, { SecurityLog, SecurityLogGetPaged } from '@/api/auditing' import AuditingService, { SecurityLog, SecurityLogGetPaged } from '@/api/auditing'
import DataListMiXin from '@/mixins/DataListMiXin' import DataListMiXin from '@/mixins/DataListMiXin'
@ -241,6 +252,11 @@ import SecurityLogDialog from './components/SecurityLogDialog.vue'
Pagination, Pagination,
SecurityLogDialog SecurityLogDialog
}, },
filters: {
dateTimeFormatFilter(dateTime: Date) {
return dateFormat(new Date(dateTime), 'YYYY-mm-dd HH:MM:SS:NS')
}
},
methods: { methods: {
checkPermission checkPermission
} }
@ -254,6 +270,10 @@ export default class extends mixins(DataListMiXin) {
this.refreshPagedData() this.refreshPagedData()
} }
protected processDataFilter() {
this.dataFilter.skipCount = abpPagerFormat(this.currentPage, this.pageSize)
}
protected getPagedList(filter: any) { protected getPagedList(filter: any) {
return AuditingService.getSecurityLogs(filter) return AuditingService.getSecurityLogs(filter)
} }

267
vueJs/src/views/admin/components/FeatureManagement.vue

@ -2,66 +2,75 @@
<div class="app-container"> <div class="app-container">
<el-form <el-form
ref="frmFeature" ref="frmFeature"
:model="features" :model="featureGroups"
label-width="100px" label-width="130px"
> >
<el-tabs v-model="selectTab"> <el-tabs v-model="selectTab">
<el-tab-pane <el-tab-pane
v-for="(feature, fi) in features.features" v-for="(group, gi) in featureGroups.groups"
:key="feature.name" :key="group.name"
:label="feature.displayName" :label="group.displayName"
:name="feature.name" :name="group.name"
> >
<el-form-item <div
v-for="(featureChildren, fci) in feature.children" v-for="(feature, fi) in group.features"
:key="featureChildren.name" :key="feature.name"
:label="featureChildren.displayName"
:prop="'features.' + fi + '.children.' + fci + '.value'"
:rules="featureChildren.valueType.validator | inputRuleFilter(localizer)"
> >
<el-popover <el-form-item
:ref="'popover_' + fi + '_' + fci" v-if="feature.valueType !== null"
trigger="hover" :label="feature.displayName"
:title="featureChildren.displayName" :prop="'groups.' + gi + '.features.' + fi + '.value'"
:content="featureChildren.description" :rules="feature.valueType.validator | inputRuleFilter(localizer)"
/>
<span
slot="label"
v-popover="'popover_' + fi + '_' + fci"
>{{ featureChildren.displayName }}</span>
<div
v-if="featureChildren.valueType.name === 'ToggleStringValueType'"
> >
<el-switch <el-popover
v-if="featureChildren.valueType.validator.name === 'BOOLEAN'" :ref="'popover_' + gi + '_' + fi"
v-model="featureChildren.value" trigger="hover"
:title="feature.displayName"
:content="feature.description"
/> />
<el-input <span
v-else-if="featureChildren.valueType.validator.name === 'NUMERIC'" slot="label"
v-model.number="featureChildren.value" v-popover="'popover_' + gi + '_' + fi"
type="number" >{{ feature.displayName }}</span>
/> <div
<el-input v-if="feature.valueType.name === 'ToggleStringValueType'"
v-else-if="featureChildren.valueType.validator.name === 'STRING'"
v-model="featureChildren.value"
type="text"
/>
</div>
<div
v-else-if="featureChildren.valueType.name === 'SELECTION'"
>
<el-select
v-model="featureChildren.value"
> >
<el-option <el-switch
v-for="valueItem in featureChildren.valueType.itemSource.items" :value="getBooleanValue(feature.value)"
:key="valueItem.value" @change="(value) => handleCheckBoxValueChanged(feature, value)"
:label="valueItem.displayText" />
:value="valueItem.value" </div>
<div
v-else-if="feature.valueType.name === 'FreeTextStringValueType'"
>
<el-input
v-if="feature.valueType.validator.name === 'NUMERIC'"
v-model.number="feature.value"
type="number"
/>
<el-input
v-else
v-model="feature.value"
type="text"
/> />
</el-select> </div>
</div> <div
</el-form-item> v-else-if="feature.valueType.name === 'SelectionStringValueType'"
>
<el-select
v-model="feature.value"
style="width: 100%;"
>
<el-option
v-for="valueItem in feature.valueType.itemSource.items"
:key="valueItem.value"
:label="localizer(valueItem.displayText.resourceName + ':' + valueItem.displayText.name)"
:value="valueItem.value"
/>
</el-select>
</div>
</el-form-item>
</div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-button <el-button
@ -83,80 +92,21 @@
<script lang="ts"> <script lang="ts">
import { Component, Prop, Vue, Watch } from 'vue-property-decorator' import { Component, Prop, Vue, Watch } from 'vue-property-decorator'
import FeatureManagementService, { ValueType, Feature, Features } from '@/api/feature-management' import FeatureManagementService, { Feature, FeatureGroups, Features } from '@/api/feature-management'
import { ElForm } from 'element-ui/types/form' import { ElForm } from 'element-ui/types/form'
/**
* 适用于动态表单的功能节点列表
*/
class FeatureItems {
features = new Array<FeatureItem>()
}
/**
* 适用于动态表单的功能节点
*/
class FeatureItem {
/** 功能名称 */
name!: string
/** 显示名称 */
displayName?: string
/** 当前值 */
value!: any
/** 说明 */
description?: string
/** 值类型 */
valueType?: ValueType
/** 深度 */
depth?: number
/** 子节点 */
children!: FeatureItem[]
/** 构造器 */
constructor(
name: string,
value: any,
displayName?: string,
description?: string,
valueType?: ValueType,
depth?: number
) {
this.name = name
this.depth = depth
this.valueType = valueType
this.displayName = displayName
this.description = description
this.children = new Array<FeatureItem>()
if (value !== null) {
this.value = value.toLowerCase() === 'true' ? true // boolean
: !isNaN(Number(value)) ? Number(value) // number
: value
}
}
/**
* 创建子节点
* @feature 子节点
*/
public appendChildren(feature: FeatureItem) {
this.children.push(feature)
}
/**
* 获取子节点
* @name 节点名称
*/
public getChildren(name: string) {
const childrenIndex = this.children.findIndex(feature => feature.name === name)
if (childrenIndex >= 0) {
return this.children[childrenIndex]
}
return undefined
}
}
@Component({ @Component({
name: 'FeatureManagement', name: 'FeatureManagement',
computed: {
getBooleanValue() {
return (value: any) => {
if (value === 'true') {
return true
}
return false
}
}
},
filters: { filters: {
/** /**
* 动态处理功能表单验证 * 动态处理功能表单验证
@ -214,6 +164,9 @@ export default class extends Vue {
@Prop({ default: '' }) @Prop({ default: '' })
private providerKey!: string private providerKey!: string
@Prop({ default: false })
private loadFeature!: boolean
/** /**
* 默认选择tab选项卡 * 默认选择tab选项卡
* 如果不定义的话,动态组合的表单需要手动点击一次才会显示? * 如果不定义的话,动态组合的表单需要手动点击一次才会显示?
@ -222,13 +175,21 @@ export default class extends Vue {
/** /**
* 用于拼接动态表单的功能数据,需要把abp返回的数据做一次调整 * 用于拼接动态表单的功能数据,需要把abp返回的数据做一次调整
*/ */
private features = new FeatureItems() // private features = new FeatureItems()
@Watch('providerKey', { immediate: true }) private featureGroups = new FeatureGroups()
mounted() {
this.handleGetFeatures()
}
@Watch('providerKey')
onProviderKeyChanged() { onProviderKeyChanged() {
if (this.providerKey) { this.handleGetFeatures()
this.handleGetFeatures() }
}
private handleCheckBoxValueChanged(feature: Feature, value: any) {
feature.value = value.toString()
} }
/** /**
@ -243,46 +204,31 @@ export default class extends Vue {
* 获取功能列表 * 获取功能列表
*/ */
private handleGetFeatures() { private handleGetFeatures() {
FeatureManagementService.getFeatures(this.providerName, this.providerKey).then(res => { if (this.loadFeature && this.providerKey) {
this.features = new FeatureItems() FeatureManagementService.getFeatures(this.providerName, this.providerKey).then(res => {
res.features.forEach(feature => { this.featureGroups = res
const featureItem = new FeatureItem( if (this.featureGroups.groups.length > 0) {
feature.name, this.selectTab = this.featureGroups.groups[0].name
feature.value,
feature.displayName,
feature.description,
feature.valueType,
feature.depth
)
if (feature.parentName) {
const children = this.features.features.find(f => f.name === feature.parentName)
if (children) {
children.appendChildren(featureItem)
} else {
this.features.features.push(featureItem)
}
} else {
this.features.features.push(featureItem)
} }
}) })
// ? }
if (this.features.features.length > 0) {
this.selectTab = this.features.features[0].name
}
})
} }
/** /**
* 保存变更 * 保存变更
*/ */
private onSave() { private onSave() {
if (this.features.features.length > 0) { if (this.featureGroups.groups.length > 0) {
const frmFeature = this.$refs.frmFeature as any const frmFeature = this.$refs.frmFeature as any
frmFeature.validate((valid: boolean) => { frmFeature.validate((valid: boolean) => {
if (valid) { if (valid) {
const updateFeatures = new Features() const updateFeatures = new Features()
this.features.features.forEach(feature => { this.featureGroups.groups.forEach(group => {
this.getChangedFeatures(feature, updateFeatures) group.features.forEach(feature => {
if (feature.valueType != null) {
updateFeatures.features.push(new Feature(feature.name, feature.value))
}
})
}) })
FeatureManagementService FeatureManagementService
.updateFeatures(this.providerName, this.providerKey, updateFeatures) .updateFeatures(this.providerName, this.providerKey, updateFeatures)
@ -295,23 +241,12 @@ export default class extends Vue {
} }
} }
/**
* 递归获取abp的功能接口格式数据
*/
private getChangedFeatures(feature: FeatureItem, features: Features) {
const updateFeature = new Feature(feature.name, feature.value)
features.features.push(updateFeature)
feature.children.forEach(children => {
this.getChangedFeatures(children, features)
})
}
/** /**
* 关闭模态窗口 * 关闭模态窗口
*/ */
private onClosed() { private onClosed() {
this.$emit('closed')
this.resetFeature() this.resetFeature()
this.$emit('closed')
} }
} }
</script> </script>

36
vueJs/src/views/admin/identityServer/api-resources/components/ApiResourceCreateOrEditForm.vue

@ -1,6 +1,16 @@
<template> <template>
<div class="app-container"> <el-dialog
<div class="filter-container"> v-el-draggable-dialog
width="800px"
:visible="showDialog"
:title="title"
custom-class="modal-form"
:show-close="false"
:close-on-click-modal="false"
:close-on-press-escape="false"
@close="onFormClosed(false)"
>
<div class="app-container">
<el-form <el-form
ref="formApiResource" ref="formApiResource"
label-width="100px" label-width="100px"
@ -70,7 +80,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</div> </el-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -85,6 +95,12 @@ import ElInputTagEx from '@/components/InputTagEx/index.vue'
} }
}) })
export default class extends Vue { export default class extends Vue {
@Prop({ default: false })
private showDialog!: boolean
@Prop({ default: '' })
private title!: string
@Prop({ default: '' }) @Prop({ default: '' })
private apiResourceId!: string private apiResourceId!: string
@ -128,8 +144,7 @@ export default class extends Vue {
this.apiResource = resource this.apiResource = resource
const successMessage = this.l('identityServer.updateApiResourceSuccess', { name: resource.name }) const successMessage = this.l('identityServer.updateApiResourceSuccess', { name: resource.name })
this.$message.success(successMessage) this.$message.success(successMessage)
frmApiResource.resetFields() this.onFormClosed(true)
this.$emit('closed', true)
}) })
} else { } else {
const createApiResource = ApiResourceCreate.create(this.apiResource) const createApiResource = ApiResourceCreate.create(this.apiResource)
@ -137,17 +152,20 @@ export default class extends Vue {
this.apiResource = resource this.apiResource = resource
const successMessage = this.l('identityServer.createApiResourceSuccess', { name: resource.name }) const successMessage = this.l('identityServer.createApiResourceSuccess', { name: resource.name })
this.$message.success(successMessage) this.$message.success(successMessage)
frmApiResource.resetFields() this.onFormClosed(true)
this.$emit('closed', true)
}) })
} }
} }
}) })
} }
private onCancel() { private onFormClosed(changed: boolean) {
this.resetFields() this.resetFields()
this.$emit('closed', false) this.$emit('closed', changed)
}
private onCancel() {
this.onFormClosed(false)
} }
public resetFields() { public resetFields() {

24
vueJs/src/views/admin/identityServer/api-resources/components/ApiResourceScopeEditForm.vue

@ -1,6 +1,14 @@
<template> <template>
<div class="app-container"> <el-dialog
<div class="filter-container"> v-el-draggable-dialog
width="800px"
:visible="showDialog"
:title="$t('identityServer.apiResourceScope')"
custom-class="modal-form"
:show-close="false"
@close="onFormClosed"
>
<div class="app-container">
<el-form <el-form
v-if="checkPermission(['IdentityServer.ApiResources.Secrets.Create'])" v-if="checkPermission(['IdentityServer.ApiResources.Secrets.Create'])"
ref="formApiScope" ref="formApiScope"
@ -141,7 +149,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </el-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -170,6 +178,9 @@ import ElInputTagEx from '@/components/InputTagEx/index.vue'
} }
}) })
export default class extends Vue { export default class extends Vue {
@Prop({ default: false })
private showDialog!: boolean
@Prop({ default: '' }) @Prop({ default: '' })
private apiResourceId!: string private apiResourceId!: string
@ -220,13 +231,18 @@ export default class extends Vue {
this.apiScopes.push(scope) this.apiScopes.push(scope)
const successMessage = this.l('identityServer.createApiScopeSuccess', { name: this.apiScope.name }) const successMessage = this.l('identityServer.createApiScopeSuccess', { name: this.apiScope.name })
this.$message.success(successMessage) this.$message.success(successMessage)
frmApiScope.resetFields()
this.$emit('apiScopeChanged') this.$emit('apiScopeChanged')
this.onFormClosed()
}) })
} }
}) })
} }
private onFormClosed() {
this.resetFields()
this.$emit('closed')
}
public resetFields() { public resetFields() {
const frmApiScope = this.$refs.formApiScope as any const frmApiScope = this.$refs.formApiScope as any
frmApiScope.resetFields() frmApiScope.resetFields()

26
vueJs/src/views/admin/identityServer/api-resources/components/ApiResourceSecretEditForm.vue

@ -1,6 +1,14 @@
<template> <template>
<div class="app-container"> <el-dialog
<div class="filter-container"> v-el-draggable-dialog
width="800px"
:visible="showDialog"
:title="$t('identityServer.apiResourceSecret')"
custom-class="modal-form"
:show-close="false"
@close="onFormClosed"
>
<div class="app-container">
<el-form <el-form
v-if="checkPermission(['IdentityServer.ApiResources.Secrets.Create'])" v-if="checkPermission(['IdentityServer.ApiResources.Secrets.Create'])"
ref="formApiSecret" ref="formApiSecret"
@ -185,7 +193,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </el-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -210,6 +218,9 @@ import { checkPermission } from '@/utils/permission'
} }
}) })
export default class extends Vue { export default class extends Vue {
@Prop({ default: false })
private showDialog!: boolean
@Prop({ default: '' }) @Prop({ default: '' })
private apiResourceId!: string private apiResourceId!: string
@ -263,14 +274,19 @@ export default class extends Vue {
this.apiSecrets.push(secret) this.apiSecrets.push(secret)
const successMessage = this.l('identityServer.createApiSecretSuccess', { type: this.apiSecret.type }) const successMessage = this.l('identityServer.createApiSecretSuccess', { type: this.apiSecret.type })
this.$message.success(successMessage) this.$message.success(successMessage)
frmApiSecret.resetFields()
this.$emit('apiSecretChanged') this.$emit('apiSecretChanged')
this.onFormClosed()
}) })
} }
}) })
} }
public resetFields() { private onFormClosed() {
this.resetFields()
this.$emit('closed')
}
private resetFields() {
const frmApiSecret = this.$refs.formApiSecret as any const frmApiSecret = this.$refs.formApiSecret as any
frmApiSecret.resetFields() frmApiSecret.resetFields()
} }

76
vueJs/src/views/admin/identityServer/api-resources/index.vue

@ -167,66 +167,39 @@
<Pagination <Pagination
v-show="dataTotal>0" v-show="dataTotal>0"
:total="dataTotal" :total="dataTotal"
:page.sync="dataFilter.skipCount" :page.sync="currentPage"
:limit.sync="dataFilter.maxResultCount" :limit.sync="pageSize"
@pagination="refreshPagedData" @pagination="refreshPagedData"
@sort-change="handleSortChange" @sort-change="handleSortChange"
/> />
<el-dialog <api-resource-create-or-edit-form
v-el-draggable-dialog :show-dialog="showEditApiResourceDialog"
width="800px"
:visible.sync="showEditApiResourceDialog"
:title="editApiResourceTitle" :title="editApiResourceTitle"
custom-class="modal-form" :api-resource-id="editApiResource.id"
:show-close="false" @closed="handleApiResourceEditFormClosed"
:close-on-click-modal="false" />
:close-on-press-escape="false"
>
<ApiResourceCreateOrEditForm
:api-resource-id="editApiResource.id"
@closed="handleApiResourceEditFormClosed"
/>
</el-dialog>
<el-dialog <api-secret-edit-form
v-el-draggable-dialog :show-dialog="showEditApiSecretDialog"
width="800px" :api-resource-id="editApiResource.id"
:visible.sync="showEditApiSecretDialog" :api-secrets="editApiResource.secrets"
:title="$t('identityServer.apiResourceSecret')" @apiSecretChanged="refreshPagedData"
custom-class="modal-form"
:show-close="false"
@closed="handleApiSecretEditFormClosed" @closed="handleApiSecretEditFormClosed"
> />
<ApiSecretEditForm
ref="formApiSecret"
:api-resource-id="editApiResource.id"
:api-secrets="editApiResource.secrets"
@apiSecretChanged="refreshPagedData"
/>
</el-dialog>
<el-dialog <api-scope-edit-form
v-el-draggable-dialog :show-dialog="showEditApiScopeDialog"
width="800px" :api-resource-id="editApiResource.id"
:visible.sync="showEditApiScopeDialog" :api-scopes="editApiResource.scopes"
:title="$t('identityServer.apiResourceScope')" @apiSecretChanged="refreshPagedData"
custom-class="modal-form"
:show-close="false"
@closed="handleApiScopeEditFormClosed" @closed="handleApiScopeEditFormClosed"
> />
<ApiScopeEditForm
ref="formApiScope"
:api-resource-id="editApiResource.id"
:api-scopes="editApiResource.scopes"
@apiSecretChanged="refreshPagedData"
/>
</el-dialog>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { dateFormat } from '@/utils/index' import { dateFormat, abpPagerFormat } from '@/utils/index'
import { checkPermission } from '@/utils/permission' import { checkPermission } from '@/utils/permission'
import DataListMiXin from '@/mixins/DataListMiXin' import DataListMiXin from '@/mixins/DataListMiXin'
import Component, { mixins } from 'vue-class-component' import Component, { mixins } from 'vue-class-component'
@ -277,6 +250,10 @@ export default class extends mixins(DataListMiXin) {
this.refreshPagedData() this.refreshPagedData()
} }
protected processDataFilter() {
this.dataFilter.skipCount = abpPagerFormat(this.currentPage, this.pageSize)
}
protected getPagedList(filter: any) { protected getPagedList(filter: any) {
return ApiResourceService.getApiResources(filter) return ApiResourceService.getApiResources(filter)
} }
@ -294,7 +271,6 @@ export default class extends mixins(DataListMiXin) {
private handleApiResourceEditFormClosed(changed: boolean) { private handleApiResourceEditFormClosed(changed: boolean) {
this.editApiResourceTitle = '' this.editApiResourceTitle = ''
this.editApiResource = ApiResource.empty()
this.showEditApiResourceDialog = false this.showEditApiResourceDialog = false
if (changed) { if (changed) {
this.refreshPagedData() this.refreshPagedData()
@ -303,14 +279,10 @@ export default class extends mixins(DataListMiXin) {
private handleApiSecretEditFormClosed() { private handleApiSecretEditFormClosed() {
this.showEditApiSecretDialog = false this.showEditApiSecretDialog = false
const frmApiSecret = this.$refs.formApiSecret as ApiSecretEditForm
frmApiSecret.resetFields()
} }
private handleApiScopeEditFormClosed() { private handleApiScopeEditFormClosed() {
this.showEditApiScopeDialog = false this.showEditApiScopeDialog = false
const frmApiScope = this.$refs.formApiScope as ApiScopeEditForm
frmApiScope.resetFields()
} }
private handleDeleteApiResource(id: string, name: string) { private handleDeleteApiResource(id: string, name: string) {

22
vueJs/src/views/admin/identityServer/client/components/ClientClaimEditForm.vue

@ -1,6 +1,14 @@
<template> <template>
<div class="app-container"> <el-dialog
<div class="filter-container"> v-el-draggable-dialog
width="800px"
:visible="showDialog"
:title="$t('identityServer.clientClaim')"
custom-class="modal-form"
:show-close="false"
@close="onFormClosed"
>
<div class="app-container">
<el-form <el-form
ref="formClientClaim" ref="formClientClaim"
label-width="100px" label-width="100px"
@ -92,7 +100,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </el-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -107,6 +115,9 @@ import { checkPermission } from '@/utils/permission'
} }
}) })
export default class extends Vue { export default class extends Vue {
@Prop({ default: false })
private showDialog!: boolean
@Prop({ default: '' }) @Prop({ default: '' })
private clientId!: string private clientId!: string
@ -165,6 +176,11 @@ export default class extends Vue {
}) })
} }
private onFormClosed() {
this.resetFields()
this.$emit('closed')
}
public resetFields() { public resetFields() {
const frmClientClaim = this.$refs.formClientClaim as any const frmClientClaim = this.$refs.formClientClaim as any
frmClientClaim.resetFields() frmClientClaim.resetFields()

23
vueJs/src/views/admin/identityServer/client/components/ClientCloneForm.vue

@ -1,6 +1,16 @@
<template> <template>
<div class="app-container"> <el-dialog
<div class="filter-container"> v-el-draggable-dialog
width="800px"
:visible="showDialog"
:title="$t('identityServer.cloneClint')"
custom-class="modal-form"
:show-close="false"
:close-on-click-modal="false"
:close-on-press-escape="false"
@close="onFormClosed"
>
<div class="app-container">
<el-form <el-form
ref="formCloneClient" ref="formCloneClient"
label-width="175px" label-width="175px"
@ -117,7 +127,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</div> </el-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -128,6 +138,9 @@ import { Component, Vue, Prop, Watch } from 'vue-property-decorator'
name: 'ClientCloneForm' name: 'ClientCloneForm'
}) })
export default class extends Vue { export default class extends Vue {
@Prop({ default: false })
private showDialog!: boolean
@Prop({ default: '' }) @Prop({ default: '' })
private clientId!: string private clientId!: string
@ -165,6 +178,10 @@ export default class extends Vue {
}) })
} }
private onFormClosed() {
this.onCancel()
}
private onCancel() { private onCancel() {
this.resetFields() this.resetFields()
this.$emit('closed') this.$emit('closed')

27
vueJs/src/views/admin/identityServer/client/components/ClientCreateForm.vue

@ -1,6 +1,14 @@
<template> <template>
<div class="app-container"> <el-dialog
<div class="filter-container"> v-el-draggable-dialog
width="800px"
:visible="showDialog"
:title="$t('identityServer.createClient')"
custom-class="modal-form"
:show-close="false"
@close="onFormClosed(false)"
>
<div class="app-container">
<el-form <el-form
ref="formClient" ref="formClient"
label-width="100px" label-width="100px"
@ -59,12 +67,12 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</div> </el-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
import ClientService, { ClientCreate } from '@/api/clients' import ClientService, { ClientCreate } from '@/api/clients'
import { Component, Vue } from 'vue-property-decorator' import { Component, Vue, Prop } from 'vue-property-decorator'
import ElInputTagEx from '@/components/InputTagEx/index.vue' import ElInputTagEx from '@/components/InputTagEx/index.vue'
@Component({ @Component({
@ -74,6 +82,9 @@ import ElInputTagEx from '@/components/InputTagEx/index.vue'
} }
}) })
export default class extends Vue { export default class extends Vue {
@Prop({ default: false })
private showDialog!: boolean
private client: ClientCreate private client: ClientCreate
private clientRules = { private clientRules = {
clientId: [ clientId: [
@ -96,14 +107,18 @@ export default class extends Vue {
ClientService.createClient(this.client).then(client => { ClientService.createClient(this.client).then(client => {
const successMessage = this.l('identityServer.createClientSuccess', { id: client.clientId }) const successMessage = this.l('identityServer.createClientSuccess', { id: client.clientId })
this.$message.success(successMessage) this.$message.success(successMessage)
frmClient.resetFields()
this.$emit('clientChanged') this.$emit('clientChanged')
this.$emit('closed') this.onFormClosed(true)
}) })
} }
}) })
} }
private onFormClosed(changed: boolean) {
this.resetFields()
this.$emit('closed', changed)
}
public resetFields() { public resetFields() {
const frmClient = this.$refs.formClient as any const frmClient = this.$refs.formClient as any
frmClient.resetFields() frmClient.resetFields()

1012
vueJs/src/views/admin/identityServer/client/components/ClientEditForm.vue

File diff suppressed because it is too large

101
vueJs/src/views/admin/identityServer/client/components/ClientPermissionEditForm.vue

@ -1,38 +1,48 @@
<template> <template>
<el-form <el-dialog
ref="formClient" v-el-draggable-dialog
label-width="100px" width="800px"
:model="clientPermission" :visible="showDialog"
label-position="top" :title="$t('identityServer.clientPermission')"
custom-class="modal-form"
:show-close="false"
@close="onFormClosed"
> >
<el-form-item v-if="hasLoadPermission"> <el-form
<PermissionTree ref="formClient"
ref="PermissionTree" label-width="100px"
:expanded="false" :model="clientPermission"
:readonly="!checkPermission(['IdentityServer.Clients.ManagePermissions'])" label-position="top"
:permission="clientPermission" >
@onPermissionChanged="onPermissionChanged" <el-form-item v-if="hasLoadPermission">
/> <permission-tree
</el-form-item> ref="PermissionTree"
<el-form-item> :expanded="false"
<el-button :readonly="!checkPermission(['IdentityServer.Clients.ManagePermissions'])"
class="cancel" :permission="clientPermission"
style="width:100px" @onPermissionChanged="onPermissionChanged"
@click="onCancel" />
> </el-form-item>
{{ $t('table.cancel') }} <el-form-item>
</el-button> <el-button
<el-button class="cancel"
class="confirm" style="width:100px"
type="primary" @click="onCancel"
style="width:100px" >
:disabled="!checkPermission(['IdentityServer.Clients.ManagePermissions'])" {{ $t('table.cancel') }}
@click="onSaveClientPemissions" </el-button>
> <el-button
{{ $t('table.confirm') }} class="confirm"
</el-button> type="primary"
</el-form-item> style="width:100px"
</el-form> :disabled="!checkPermission(['IdentityServer.Clients.ManagePermissions'])"
@click="onSaveClientPemissions"
>
{{ $t('table.confirm') }}
</el-button>
</el-form-item>
</el-form>
</el-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -52,6 +62,9 @@ import PermissionService, { PermissionDto, UpdatePermissionsDto } from '@/api/pe
} }
}) })
export default class extends Vue { export default class extends Vue {
@Prop({ default: false })
private showDialog!: boolean
/** 客户端标识 */ /** 客户端标识 */
@Prop({ default: '' }) @Prop({ default: '' })
private clientId!: string private clientId!: string
@ -74,9 +87,17 @@ export default class extends Vue {
} }
/** 监听客户端标识变更事件,刷新客户端权限数据 */ /** 监听客户端标识变更事件,刷新客户端权限数据 */
@Watch('clientId', { immediate: true }) @Watch('clientId')
private onClientIdChanged() { private onClientIdChanged() {
if (this.clientId) { this.handledGetClientPermissions()
}
mounted() {
this.handledGetClientPermissions()
}
private handledGetClientPermissions() {
if (this.showDialog && this.clientId) {
PermissionService.getPermissionsByKey('C', this.clientId).then(permission => { PermissionService.getPermissionsByKey('C', this.clientId).then(permission => {
this.clientPermission = permission this.clientPermission = permission
this.hasLoadPermission = true this.hasLoadPermission = true
@ -98,16 +119,18 @@ export default class extends Vue {
const setClientPermissions = new UpdatePermissionsDto() const setClientPermissions = new UpdatePermissionsDto()
setClientPermissions.permissions = this.editClientPermissions setClientPermissions.permissions = this.editClientPermissions
PermissionService.setPermissionsByKey('C', this.clientId, setClientPermissions).then(() => { PermissionService.setPermissionsByKey('C', this.clientId, setClientPermissions).then(() => {
this.onCancel() this.onFormClosed()
}) })
} }
} }
private onFormClosed() {
this.$emit('closed')
}
/** 取消操作 */ /** 取消操作 */
private onCancel() { private onCancel() {
const permissionTree = this.$refs.PermissionTree as PermissionTree this.onFormClosed()
permissionTree.resetPermissions()
this.$emit('closed')
} }
} }
</script> </script>

24
vueJs/src/views/admin/identityServer/client/components/ClientPropertyEditForm.vue

@ -1,6 +1,14 @@
<template> <template>
<div class="app-container"> <el-dialog
<div class="filter-container"> v-el-draggable-dialog
width="800px"
:visible="showDialog"
:title="$t('identityServer.clientProperty')"
custom-class="modal-form"
:show-close="false"
@close="onFormClosed"
>
<div class="app-container">
<el-form <el-form
ref="formClientProperty" ref="formClientProperty"
label-width="100px" label-width="100px"
@ -92,7 +100,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </el-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -107,6 +115,9 @@ import { checkPermission } from '@/utils/permission'
} }
}) })
export default class extends Vue { export default class extends Vue {
@Prop({ default: false })
private showDialog!: boolean
@Prop({ default: '' }) @Prop({ default: '' })
private clientId!: string private clientId!: string
@ -158,13 +169,18 @@ export default class extends Vue {
this.clientProperties.push(property) this.clientProperties.push(property)
const successMessage = this.l('identityServer.createPropertySuccess', { type: this.clientProperty.key }) const successMessage = this.l('identityServer.createPropertySuccess', { type: this.clientProperty.key })
this.$message.success(successMessage) this.$message.success(successMessage)
frmClientProperty.resetFields()
this.$emit('clientPropertyChanged') this.$emit('clientPropertyChanged')
this.onFormClosed()
}) })
} }
}) })
} }
private onFormClosed() {
this.resetFields()
this.$emit('closed')
}
public resetFields() { public resetFields() {
const frmClientProperty = this.$refs.formClientProperty as any const frmClientProperty = this.$refs.formClientProperty as any
frmClientProperty.resetFields() frmClientProperty.resetFields()

24
vueJs/src/views/admin/identityServer/client/components/ClientSecretEditForm.vue

@ -1,6 +1,14 @@
<template> <template>
<div class="app-container"> <el-dialog
<div class="filter-container"> v-el-draggable-dialog
width="800px"
:visible="showDialog"
:title="$t('identityServer.clientSecret')"
custom-class="modal-form"
:show-close="false"
@close="onFormClosed"
>
<div class="app-container">
<el-form <el-form
ref="formClientSecret" ref="formClientSecret"
label-width="100px" label-width="100px"
@ -186,7 +194,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </el-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -211,6 +219,9 @@ import { checkPermission } from '@/utils/permission'
} }
}) })
export default class extends Vue { export default class extends Vue {
@Prop({ default: false })
private showDialog!: boolean
@Prop({ default: '' }) @Prop({ default: '' })
private clientId!: string private clientId!: string
@ -264,13 +275,18 @@ export default class extends Vue {
this.clientSecrets.push(secret) this.clientSecrets.push(secret)
const successMessage = this.l('identityServer.createSecretSuccess', { type: this.clientSecret.type }) const successMessage = this.l('identityServer.createSecretSuccess', { type: this.clientSecret.type })
this.$message.success(successMessage) this.$message.success(successMessage)
frmClientSecret.resetFields()
this.$emit('clientSecretChanged') this.$emit('clientSecretChanged')
this.onFormClosed()
}) })
} }
}) })
} }
private onFormClosed() {
this.resetFields()
this.$emit('closed')
}
public resetFields() { public resetFields() {
const frmClientSecret = this.$refs.formClientSecret as any const frmClientSecret = this.$refs.formClientSecret as any
frmClientSecret.resetFields() frmClientSecret.resetFields()

162
vueJs/src/views/admin/identityServer/client/index.vue

@ -218,130 +218,63 @@
<Pagination <Pagination
v-show="dataTotal>0" v-show="dataTotal>0"
:total="dataTotal" :total="dataTotal"
:page.sync="dataFilter.skipCount" :page.sync="currentPage"
:limit.sync="dataFilter.maxResultCount" :limit.sync="pageSize"
@pagination="refreshPagedData" @pagination="refreshPagedData"
@sort-change="handleSortChange" @sort-change="handleSortChange"
/> />
<el-dialog <client-create-form
v-el-draggable-dialog :show-dialog="showCreateClientDialog"
width="800px"
:visible.sync="showCreateClientDialog"
:title="$t('identityServer.createClient')"
custom-class="modal-form"
:show-close="false"
@closed="handleClientCreateFormClosed" @closed="handleClientCreateFormClosed"
> />
<ClientCreateForm
ref="formCreateClient"
@closed="handleClientCreateFormClosed"
/>
</el-dialog>
<el-dialog <client-clone-form
v-el-draggable-dialog :show-dialog="showCloneClientDialog"
width="800px" :client-id="editClient.id"
:visible.sync="showCloneClientDialog" @closed="handleClientCloneFormClosed"
:title="$t('identityServer.cloneClint')" />
custom-class="modal-form"
:show-close="false"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<ClientCloneForm
ref="formCloneClient"
:client-id="editClient.id"
@closed="handleClientCloneFormClosed"
/>
</el-dialog>
<el-dialog <client-edit-form
v-el-draggable-dialog :show-dialog="showEditClientDialog"
width="800px" :client-id="editClient.id"
:visible.sync="showEditClientDialog" @closed="handleClientEditFormClosed"
:title="editClientTitle" />
custom-class="modal-form"
:show-close="false"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<ClientEditForm
:client-id="editClient.id"
@closed="handleClientEditFormClosed"
/>
</el-dialog>
<el-dialog <client-secret-edit-form
v-el-draggable-dialog :show-dialog="showEditClientSecretDialog"
width="800px" :client-id="editClient.id"
:visible.sync="showEditClientSecretDialog" :client-secrets="editClient.clientSecrets"
:title="$t('identityServer.clientSecret')"
custom-class="modal-form"
:show-close="false"
@closed="handleClientSecretEditFormClosed" @closed="handleClientSecretEditFormClosed"
> @clientClaimChanged="refreshPagedData"
<ClientSecretEditForm />
ref="formClientSecret"
:client-id="editClient.id"
:client-secrets="editClient.clientSecrets"
@clientSecretChanged="refreshPagedData"
/>
</el-dialog>
<el-dialog <client-claim-edit-form
v-el-draggable-dialog :show-dialog="showEditClientClaimDialog"
width="800px" :client-id="editClient.id"
:visible.sync="showEditClientClaimDialog" :client-claims="editClient.claims"
:title="$t('identityServer.clientClaim')"
custom-class="modal-form"
:show-close="false"
@closed="handleClientClaimEditFormClosed" @closed="handleClientClaimEditFormClosed"
@clientClaimChanged="refreshPagedData" @clientClaimChanged="refreshPagedData"
> />
<ClientClaimEditForm
ref="formClientClaim"
:client-id="editClient.id"
:client-claims="editClient.claims"
/>
</el-dialog>
<el-dialog <client-property-edit-form
v-el-draggable-dialog :show-dialog="showEditClientPropertyDialog"
width="800px" :client-id="editClient.id"
:visible.sync="showEditClientPropertyDialog" :client-properties="editClient.properties"
:title="$t('identityServer.clientProperty')"
custom-class="modal-form"
:show-close="false"
@closed="handleClientPropertyEditFormClosed"
@clientPropertyChanged="refreshPagedData" @clientPropertyChanged="refreshPagedData"
> @closed="handleClientPropertyEditFormClosed"
<ClientPropertyEditForm />
ref="formClientProperty"
:client-id="editClient.id"
:client-properties="editClient.properties"
/>
</el-dialog>
<el-dialog <client-permission-edit-form
v-el-draggable-dialog :show-dialog="showEditClientPermissionDialog"
width="800px" :client-id="editClient.clientId"
:visible.sync="showEditClientPermissionDialog"
:title="$t('identityServer.clientPermission')"
custom-class="modal-form"
:show-close="false"
@closed="handleClientPermissionEditFormClosed" @closed="handleClientPermissionEditFormClosed"
> />
<ClientPermissionEditForm
ref="formClientPermission"
:client-id="editClient.clientId"
@closed="handleClientPermissionEditFormClosed"
/>
</el-dialog>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { abpPagerFormat } from '@/utils/index'
import { checkPermission } from '@/utils/permission' import { checkPermission } from '@/utils/permission'
import DataListMiXin from '@/mixins/DataListMiXin' import DataListMiXin from '@/mixins/DataListMiXin'
import Component, { mixins } from 'vue-class-component' import Component, { mixins } from 'vue-class-component'
@ -400,6 +333,10 @@ export default class extends mixins(DataListMiXin) {
this.refreshPagedData() this.refreshPagedData()
} }
protected processDataFilter() {
this.dataFilter.skipCount = abpPagerFormat(this.currentPage, this.pageSize)
}
protected getPagedList(filter: any) { protected getPagedList(filter: any) {
return ClientService.getClients(filter) return ClientService.getClients(filter)
} }
@ -417,30 +354,20 @@ export default class extends mixins(DataListMiXin) {
} }
private handleClientCreateFormClosed(changed: boolean) { private handleClientCreateFormClosed(changed: boolean) {
this.editClientTitle = ''
this.editClient = Client.empty()
this.showCreateClientDialog = false this.showCreateClientDialog = false
const frmClient = this.$refs.formCreateClient as ClientCreateForm
frmClient.resetFields()
if (changed) { if (changed) {
this.refreshPagedData() this.refreshPagedData()
} }
} }
private handleClientCloneFormClosed(changed: boolean) { private handleClientCloneFormClosed(changed: boolean) {
this.editClientTitle = ''
this.editClient = Client.empty()
this.showCloneClientDialog = false this.showCloneClientDialog = false
const frmClient = this.$refs.formCloneClient as ClientCloneForm
frmClient.resetFields()
if (changed) { if (changed) {
this.refreshPagedData() this.refreshPagedData()
} }
} }
private handleClientEditFormClosed(changed: boolean) { private handleClientEditFormClosed(changed: boolean) {
this.editClientTitle = ''
this.editClient = Client.empty()
this.showEditClientDialog = false this.showEditClientDialog = false
if (changed) { if (changed) {
this.refreshPagedData() this.refreshPagedData()
@ -449,24 +376,17 @@ export default class extends mixins(DataListMiXin) {
private handleClientSecretEditFormClosed() { private handleClientSecretEditFormClosed() {
this.showEditClientSecretDialog = false this.showEditClientSecretDialog = false
const frmClientSecret = this.$refs.formClientSecret as ClientSecretEditForm
frmClientSecret.resetFields()
} }
private handleClientClaimEditFormClosed() { private handleClientClaimEditFormClosed() {
this.showEditClientClaimDialog = false this.showEditClientClaimDialog = false
const frmClientClaim = this.$refs.formClientClaim as ClientClaimEditForm
frmClientClaim.resetFields()
} }
private handleClientPropertyEditFormClosed() { private handleClientPropertyEditFormClosed() {
this.showEditClientPropertyDialog = false this.showEditClientPropertyDialog = false
const frmClientProperty = this.$refs.formClientProperty as ClientPropertyEditForm
frmClientProperty.resetFields()
} }
private handleClientPermissionEditFormClosed() { private handleClientPermissionEditFormClosed() {
this.editClient = Client.empty()
this.showEditClientPermissionDialog = false this.showEditClientPermissionDialog = false
} }

1
vueJs/src/views/admin/identityServer/components/ScopeInput.vue

@ -107,7 +107,6 @@ export default class extends Vue {
} }
private remove(index: number) { private remove(index: number) {
console.log(index)
this.scopes.splice(index, 1) this.scopes.splice(index, 1)
this.tagChange() this.tagChange()
} }

38
vueJs/src/views/admin/identityServer/identity-resources/components/IdentityResourceCreateOrEditForm.vue

@ -1,6 +1,16 @@
<template> <template>
<div class="app-container"> <el-dialog
<div class="filter-container"> v-el-draggable-dialog
width="800px"
:visible="showDialog"
:title="title"
custom-class="modal-form"
:show-close="false"
:close-on-click-modal="false"
:close-on-press-escape="false"
@close="onFormClosed(false)"
>
<div class="app-container">
<el-form <el-form
ref="formIdentityResource" ref="formIdentityResource"
label-width="120px" label-width="120px"
@ -94,7 +104,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</div> </el-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -109,6 +119,12 @@ import ElInputTagEx from '@/components/InputTagEx/index.vue'
} }
}) })
export default class extends Vue { export default class extends Vue {
@Prop({ default: false })
private showDialog!: boolean
@Prop({ default: '' })
private title!: string
@Prop({ default: '' }) @Prop({ default: '' })
private identityResourceId!: string private identityResourceId!: string
@ -152,8 +168,7 @@ export default class extends Vue {
this.identityResource = resource this.identityResource = resource
const successMessage = this.l('identityServer.updateIdentityResourceSuccess', { name: resource.name }) const successMessage = this.l('identityServer.updateIdentityResourceSuccess', { name: resource.name })
this.$message.success(successMessage) this.$message.success(successMessage)
frmIdentityResource.resetFields() this.onFormClosed(true)
this.$emit('closed', true)
}) })
} else { } else {
const createIdentityResource = IdentityResourceCreate.create(this.identityResource) const createIdentityResource = IdentityResourceCreate.create(this.identityResource)
@ -161,20 +176,23 @@ export default class extends Vue {
this.identityResource = resource this.identityResource = resource
const successMessage = this.l('identityServer.createIdentityResourceSuccess', { name: resource.name }) const successMessage = this.l('identityServer.createIdentityResourceSuccess', { name: resource.name })
this.$message.success(successMessage) this.$message.success(successMessage)
this.resetFields() this.onFormClosed(true)
this.$emit('closed', true)
}) })
} }
} }
}) })
} }
private onCancel() { private onFormClosed(changed: boolean) {
this.resetFields() this.resetFields()
this.$emit('closed', false) this.$emit('closed', changed)
}
private onCancel() {
this.onFormClosed(false)
} }
public resetFields() { private resetFields() {
this.identityResource = IdentityResource.empty() this.identityResource = IdentityResource.empty()
const frmIdentityResource = this.$refs.formIdentityResource as any const frmIdentityResource = this.$refs.formIdentityResource as any
frmIdentityResource.resetFields() frmIdentityResource.resetFields()

34
vueJs/src/views/admin/identityServer/identity-resources/components/IdentityResourcePropertyEditForm.vue

@ -1,6 +1,14 @@
<template> <template>
<div class="app-container"> <el-dialog
<div class="filter-container"> v-el-draggable-dialog
width="800px"
:visible="showDialog"
:title="$t('identityServer.identityResourceProperties')"
custom-class="modal-form"
:show-close="false"
@close="onFormClosed(false)"
>
<div class="app-container">
<el-form <el-form
v-if="checkPermission(['IdentityServer.IdentityResources.Properties.Create'])" v-if="checkPermission(['IdentityServer.IdentityResources.Properties.Create'])"
ref="formIdentityProperty" ref="formIdentityProperty"
@ -76,7 +84,6 @@
:label="$t('operaActions')" :label="$t('operaActions')"
align="center" align="center"
width="150px" width="150px"
fixed="right"
> >
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-button <el-button
@ -90,13 +97,14 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </el-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
import IdentityResourceService, { IdentityResource, IdentityPropertyCreate } from '@/api/identityresources' import IdentityResourceService, { IdentityResource, IdentityPropertyCreate } from '@/api/identityresources'
import { Component, Vue, Prop } from 'vue-property-decorator' import { Component, Vue, Prop } from 'vue-property-decorator'
import { checkPermission } from '@/utils/permission' import { checkPermission } from '@/utils/permission'
import { ElForm } from 'element-ui/types/form'
@Component({ @Component({
name: 'IdentityPropertyEditForm', name: 'IdentityPropertyEditForm',
@ -105,6 +113,9 @@ import { checkPermission } from '@/utils/permission'
} }
}) })
export default class extends Vue { export default class extends Vue {
@Prop({ default: false })
private showDialog!: boolean
@Prop({ default: () => IdentityResource.empty() }) @Prop({ default: () => IdentityResource.empty() })
private identityResource!: IdentityResource private identityResource!: IdentityResource
@ -132,7 +143,7 @@ export default class extends Vue {
const deletePropertyIndex = this.identityResource.properties.findIndex(p => p.key === key && p.value === key) const deletePropertyIndex = this.identityResource.properties.findIndex(p => p.key === key && p.value === key)
this.identityResource.properties.splice(deletePropertyIndex, 1) this.identityResource.properties.splice(deletePropertyIndex, 1)
this.$message.success(this.l('identityServer.deleteIdentityPropertySuccess', { key: key })) this.$message.success(this.l('identityServer.deleteIdentityPropertySuccess', { key: key }))
this.$emit('closed', true) this.onFormClosed(true)
}) })
} }
} }
@ -149,15 +160,20 @@ export default class extends Vue {
this.identityResource.properties.push(property) this.identityResource.properties.push(property)
const successMessage = this.l('identityServer.createIdentityPropertySuccess', { key: this.identityProperty.key }) const successMessage = this.l('identityServer.createIdentityPropertySuccess', { key: this.identityProperty.key })
this.$message.success(successMessage) this.$message.success(successMessage)
this.resetFields() this.onFormClosed(true)
this.$emit('closed', true)
}) })
} }
}) })
} }
public resetFields() { private onFormClosed(changed: boolean) {
this.identityProperty = IdentityPropertyCreate.empty() this.resetFields()
this.$emit('closed', changed)
}
private resetFields() {
const frmIdentityProperty = this.$refs.formIdentityProperty as ElForm
frmIdentityProperty.resetFields()
} }
private l(name: string, values?: any[] | { [key: string]: any }) { private l(name: string, values?: any[] | { [key: string]: any }) {

49
vueJs/src/views/admin/identityServer/identity-resources/index.vue

@ -161,50 +161,29 @@
<Pagination <Pagination
v-show="dataTotal>0" v-show="dataTotal>0"
:total="dataTotal" :total="dataTotal"
:page.sync="dataFilter.skipCount" :page.sync="currentPage"
:limit.sync="dataFilter.maxResultCount" :limit.sync="pageSize"
@pagination="refreshPagedData" @pagination="refreshPagedData"
@sort-change="handleSortChange" @sort-change="handleSortChange"
/> />
<el-dialog <identity-resource-create-or-edit-form
v-el-draggable-dialog :show-dialog="showEditIdentityResourceDialog"
width="800px"
:visible.sync="showEditIdentityResourceDialog"
:title="editIdentityResourceTitle" :title="editIdentityResourceTitle"
custom-class="modal-form" :identity-resource-id="editIdentityResource.id"
:show-close="false"
:close-on-click-modal="false"
:close-on-press-escape="false"
@closed="handleIdentityResourceEditFormClosed" @closed="handleIdentityResourceEditFormClosed"
> />
<IdentityResourceCreateOrEditForm
ref="formIdentityResource"
:identity-resource-id="editIdentityResource.id"
@closed="handleIdentityResourceEditFormClosed"
/>
</el-dialog>
<el-dialog <identity-property-edit-form
v-el-draggable-dialog :show-dialog="showEditIdentityPropertyDialog"
width="800px" :identity-resource="editIdentityResource"
:visible.sync="showEditIdentityPropertyDialog"
:title="$t('identityServer.identityResourceProperties')"
custom-class="modal-form"
:show-close="false"
@closed="handleIdentityPropertyEditFormClosed" @closed="handleIdentityPropertyEditFormClosed"
> />
<IdentityPropertyEditForm
ref="formIdentityProperty"
:identity-resource="editIdentityResource"
@closed="handleIdentityPropertyEditFormClosed"
/>
</el-dialog>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { dateFormat } from '@/utils/index' import { dateFormat, abpPagerFormat } from '@/utils/index'
import { checkPermission } from '@/utils/permission' import { checkPermission } from '@/utils/permission'
import DataListMiXin from '@/mixins/DataListMiXin' import DataListMiXin from '@/mixins/DataListMiXin'
import Component, { mixins } from 'vue-class-component' import Component, { mixins } from 'vue-class-component'
@ -249,6 +228,10 @@ export default class extends mixins(DataListMiXin) {
this.refreshPagedData() this.refreshPagedData()
} }
protected processDataFilter() {
this.dataFilter.skipCount = abpPagerFormat(this.currentPage, this.pageSize)
}
protected getPagedList(filter: any) { protected getPagedList(filter: any) {
return IdentityResourceService.getIdentityResources(filter) return IdentityResourceService.getIdentityResources(filter)
} }
@ -287,9 +270,9 @@ export default class extends mixins(DataListMiXin) {
} }
private handleCommand(command: {key: string, row: IdentityResource}) { private handleCommand(command: {key: string, row: IdentityResource}) {
this.editIdentityResource = command.row
switch (command.key) { switch (command.key) {
case 'property' : case 'property' :
this.editIdentityResource = command.row
this.showEditIdentityPropertyDialog = true this.showEditIdentityPropertyDialog = true
break break
case 'delete' : case 'delete' :

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

@ -60,14 +60,15 @@
<pagination <pagination
v-show="dataTotal>0" v-show="dataTotal>0"
:total="dataTotal" :total="dataTotal"
:page.sync="dataFilter.skipCount" :page.sync="currentPage"
:limit.sync="dataFilter.maxResultCount" :limit.sync="pageSize"
@pagination="refreshPagedData" @pagination="refreshPagedData"
/> />
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { abpPagerFormat } from '@/utils'
import DataListMiXin from '@/mixins/DataListMiXin' import DataListMiXin from '@/mixins/DataListMiXin'
import { Prop, Watch } from 'vue-property-decorator' import { Prop, Watch } from 'vue-property-decorator'
import Component, { mixins } from 'vue-class-component' import Component, { mixins } from 'vue-class-component'
@ -95,6 +96,10 @@ export default class extends mixins(DataListMiXin) {
} }
} }
protected processDataFilter() {
this.dataFilter.skipCount = abpPagerFormat(this.currentPage, this.pageSize)
}
protected getPagedList(filter: any) { protected getPagedList(filter: any) {
if (this.organizationUnitId) { if (this.organizationUnitId) {
return OrganizationUnitService.organizationUnitGetRoles(filter) return OrganizationUnitService.organizationUnitGetRoles(filter)

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

@ -136,8 +136,8 @@
<pagination <pagination
v-show="dataTotal>0" v-show="dataTotal>0"
:total="dataTotal" :total="dataTotal"
:page.sync="dataFilter.skipCount" :page.sync="currentPage"
:limit.sync="dataFilter.maxResultCount" :limit.sync="pageSize"
@pagination="refreshPagedData" @pagination="refreshPagedData"
/> />
@ -156,6 +156,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { abpPagerFormat } from '@/utils'
import DataListMiXin from '@/mixins/DataListMiXin' import DataListMiXin from '@/mixins/DataListMiXin'
import Component, { mixins } from 'vue-class-component' import Component, { mixins } from 'vue-class-component'
import RoleService, { CreateRoleDto, RoleDto, UpdateRoleDto, RoleGetPagedDto } from '@/api/roles' import RoleService, { CreateRoleDto, RoleDto, UpdateRoleDto, RoleGetPagedDto } from '@/api/roles'
@ -185,6 +186,10 @@ export default class extends mixins(DataListMiXin) {
this.refreshPagedData() this.refreshPagedData()
} }
protected processDataFilter() {
this.dataFilter.skipCount = abpPagerFormat(this.currentPage, this.pageSize)
}
/** 获取角色权限列表 */ /** 获取角色权限列表 */
protected getPagedList(filter: any) { protected getPagedList(filter: any) {
return RoleService.getRoles(filter) return RoleService.getRoles(filter)

5
vueJs/src/views/admin/settings/components/SettingEditForm.vue

@ -6,7 +6,7 @@
label-width="180px" label-width="180px"
style="width: 96%" style="width: 96%"
> >
<el-tabs> <el-tabs :tab-position="tabPosition">
<el-tab-pane <el-tab-pane
v-if="hasSettingExistsed('Abp.Localization.DefaultLanguage')" v-if="hasSettingExistsed('Abp.Localization.DefaultLanguage')"
:label="$t('settings.systemSetting')" :label="$t('settings.systemSetting')"
@ -717,6 +717,9 @@ export default class extends Vue {
@Prop({ default: () => { return Array<Setting>() } }) @Prop({ default: () => { return Array<Setting>() } })
private settings!: Setting[] private settings!: Setting[]
@Prop({ default: 'top' })
private tabPosition!: 'left' | 'right' | 'top' | 'bottom'
private setting: {[key: string]: Setting} = {} private setting: {[key: string]: Setting} = {}
private settingChangeKeys = new Array<string>() private settingChangeKeys = new Array<string>()

41
vueJs/src/views/admin/tenants/components/TenantEditConnectionForm.vue → vueJs/src/views/admin/tenants/components/TenantConnectionEditForm.vue

@ -1,6 +1,16 @@
<template> <template>
<div class="app-container"> <el-dialog
<div class="filter-container"> v-el-draggable-dialog
:visible="showDialog"
:title="$t('tenant.connectionOptions')"
width="800px"
custom-class="modal-form"
close-on-click-modal
@close="onFormClosed"
>
<div
class="app-container"
>
<el-form <el-form
v-if="checkPermission(['AbpTenantManagement.Tenants.ManageConnectionStrings'])" v-if="checkPermission(['AbpTenantManagement.Tenants.ManageConnectionStrings'])"
ref="formTenantConnection" ref="formTenantConnection"
@ -90,7 +100,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </el-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -99,7 +109,7 @@ import { Component, Vue, Prop, Watch } from 'vue-property-decorator'
import { checkPermission } from '@/utils/permission' import { checkPermission } from '@/utils/permission'
@Component({ @Component({
name: 'TenantEditConnectionForm', name: 'TenantConnectionEditForm',
methods: { methods: {
checkPermission checkPermission
} }
@ -108,6 +118,9 @@ export default class extends Vue {
@Prop({ default: '' }) @Prop({ default: '' })
private tenantId!: string private tenantId!: string
@Prop({ default: false })
private showDialog!: boolean
private tenantConnection: TenantConnectionString private tenantConnection: TenantConnectionString
private tenantConnections: TenantConnectionString[] private tenantConnections: TenantConnectionString[]
private tenantConnectionRules = { private tenantConnectionRules = {
@ -125,9 +138,17 @@ export default class extends Vue {
this.tenantConnections = new Array<TenantConnectionString>() this.tenantConnections = new Array<TenantConnectionString>()
} }
@Watch('tenantId', { immediate: true }) @Watch('tenantId')
private onTenantIdChanged() { private onTenantIdChanged() {
if (this.tenantId) { this.handleGetTenantConnections()
}
mounted() {
this.handleGetTenantConnections()
}
private handleGetTenantConnections() {
if (this.showDialog && this.tenantId) {
TenantService.getTenantConnections(this.tenantId).then(connections => { TenantService.getTenantConnections(this.tenantId).then(connections => {
this.tenantConnections = connections.items this.tenantConnections = connections.items
}) })
@ -146,8 +167,7 @@ export default class extends Vue {
const deleteTenantConnectionIndex = this.tenantConnections.findIndex(p => p.name === name) const deleteTenantConnectionIndex = this.tenantConnections.findIndex(p => p.name === name)
this.tenantConnections.splice(deleteTenantConnectionIndex, 1) this.tenantConnections.splice(deleteTenantConnectionIndex, 1)
this.$message.success(this.l('tenant.deleteTenantConnectionSuccess', { name: name })) this.$message.success(this.l('tenant.deleteTenantConnectionSuccess', { name: name }))
this.resetFields() this.onFormClosed()
this.$emit('closed', true)
}) })
} }
} }
@ -172,6 +192,11 @@ export default class extends Vue {
}) })
} }
private onFormClosed() {
this.resetFields()
this.$emit('closed')
}
public resetFields() { public resetFields() {
this.tenantConnection = TenantConnectionString.empty() this.tenantConnection = TenantConnectionString.empty()
} }

34
vueJs/src/views/admin/tenants/components/TenantCreateOrEditForm.vue

@ -1,6 +1,15 @@
<template> <template>
<div class="app-container"> <el-dialog
<div class="filter-container"> :visible="showDialog"
:title="$t('tenant.updateTenant')"
width="800px"
custom-class="modal-form"
:show-close="false"
@close="onFormClosed"
>
<div
class="app-container"
>
<el-form <el-form
ref="formTenant" ref="formTenant"
label-width="120px" label-width="120px"
@ -56,7 +65,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</div> </el-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -70,6 +79,9 @@ export default class extends Vue {
@Prop({ default: '' }) @Prop({ default: '' })
private tenantId!: string private tenantId!: string
@Prop({ default: false })
private showDialog!: boolean
private tenant!: TenantCreateOrEdit private tenant!: TenantCreateOrEdit
get isEditTenant() { get isEditTenant() {
@ -97,9 +109,17 @@ export default class extends Vue {
this.tenant = TenantCreateOrEdit.empty() this.tenant = TenantCreateOrEdit.empty()
} }
@Watch('tenantId', { immediate: true }) @Watch('tenantId')
private onTenantIdChanged() { private onTenantIdChanged() {
if (this.tenantId) { this.handleGetEditTenant()
}
mounted() {
this.handleGetEditTenant()
}
private handleGetEditTenant() {
if (this.showDialog && this.tenantId) {
TenantService.getTenantById(this.tenantId).then(tenant => { TenantService.getTenantById(this.tenantId).then(tenant => {
this.tenant.name = tenant.name this.tenant.name = tenant.name
}) })
@ -131,6 +151,10 @@ export default class extends Vue {
}) })
} }
private onFormClosed() {
this.$emit('closed', false)
}
private onCancel() { private onCancel() {
this.reset() this.reset()
this.$emit('closed', false) this.$emit('closed', false)

4
vueJs/src/views/admin/tenants/components/TenantFeatureEditForm.vue

@ -3,13 +3,15 @@
:visible="showDialog" :visible="showDialog"
:title="$t('AbpTenantManagement.Permission:ManageFeatures')" :title="$t('AbpTenantManagement.Permission:ManageFeatures')"
width="800px" width="800px"
custom-class="modal-form"
:show-close="false" :show-close="false"
@closed="onFormClosed" @close="onFormClosed"
> >
<feature-management <feature-management
ref="featureManagement" ref="featureManagement"
provider-name="T" provider-name="T"
:provider-key="tenantId" :provider-key="tenantId"
:load-feature="showDialog"
@closed="onFormClosed" @closed="onFormClosed"
/> />
</el-dialog> </el-dialog>

50
vueJs/src/views/admin/tenants/index.vue

@ -144,43 +144,23 @@
<Pagination <Pagination
v-show="dataTotal>0" v-show="dataTotal>0"
:total="dataTotal" :total="dataTotal"
:page.sync="dataFilter.skipCount" :page.sync="currentPage"
:limit.sync="dataFilter.maxResultCount" :limit.sync="pageSize"
@pagination="refreshPagedData" @pagination="refreshPagedData"
@sort-change="handleSortChange" @sort-change="handleSortChange"
/> />
<el-dialog <tenant-create-or-edit-form
v-el-draggable-dialog :show-dialog="showCreateOrEditTenantDialog"
width="800px" :tenant-id="editTenantId"
:visible.sync="showCreateOrEditTenantDialog"
:title="$t('tenant.updateTenant')"
custom-class="modal-form"
:show-close="false"
@closed="handleCreateOrEditTenantFormClosed" @closed="handleCreateOrEditTenantFormClosed"
> />
<TenantCreateOrEditForm
ref="formCreateOrEditTenant"
:tenant-id="editTenantId"
@closed="handleCreateOrEditTenantFormClosed"
/>
</el-dialog>
<el-dialog <tenant-connection-edit-form
v-el-draggable-dialog :show-dialog="showEditTenantConnectionDialog"
width="800px" :tenant-id="editTenantId"
:visible.sync="showEditTenantConnectionDialog"
:title="$t('tenant.connectionOptions')"
custom-class="modal-form"
:show-close="false"
@closed="handleTenantConnectionEditFormClosed" @closed="handleTenantConnectionEditFormClosed"
> />
<TenantEditConnectionForm
ref="formEditTenantConnection"
:tenant-id="editTenantId"
@closed="handleTenantConnectionEditFormClosed"
/>
</el-dialog>
<tenant-feature-editForm <tenant-feature-editForm
:show-dialog="showFeatureEditFormDialog" :show-dialog="showFeatureEditFormDialog"
@ -194,12 +174,12 @@
import DataListMiXin from '@/mixins/DataListMiXin' import DataListMiXin from '@/mixins/DataListMiXin'
import Component, { mixins } from 'vue-class-component' import Component, { mixins } from 'vue-class-component'
import TenantService, { TenantDto, TenantGetByPaged } from '@/api/tenant-management' import TenantService, { TenantDto, TenantGetByPaged } from '@/api/tenant-management'
import { dateFormat } from '@/utils/index' import { dateFormat, abpPagerFormat } from '@/utils/index'
import { checkPermission } from '@/utils/permission' import { checkPermission } from '@/utils/permission'
import Pagination from '@/components/Pagination/index.vue' import Pagination from '@/components/Pagination/index.vue'
import TenantFeatureEditForm from './components/TenantFeatureEditForm.vue' import TenantFeatureEditForm from './components/TenantFeatureEditForm.vue'
import TenantCreateOrEditForm from './components/TenantCreateOrEditForm.vue' import TenantCreateOrEditForm from './components/TenantCreateOrEditForm.vue'
import TenantEditConnectionForm from './components/TenantEditConnectionForm.vue' import TenantConnectionEditForm from './components/TenantConnectionEditForm.vue'
@Component({ @Component({
name: 'RoleList', name: 'RoleList',
@ -207,7 +187,7 @@ import TenantEditConnectionForm from './components/TenantEditConnectionForm.vue'
Pagination, Pagination,
TenantFeatureEditForm, TenantFeatureEditForm,
TenantCreateOrEditForm, TenantCreateOrEditForm,
TenantEditConnectionForm TenantConnectionEditForm
}, },
methods: { methods: {
checkPermission checkPermission
@ -231,6 +211,10 @@ export default class extends mixins(DataListMiXin) {
this.refreshPagedData() this.refreshPagedData()
} }
protected processDataFilter() {
this.dataFilter.skipCount = abpPagerFormat(this.currentPage, this.pageSize)
}
protected getPagedList(filter: any) { protected getPagedList(filter: any) {
return TenantService.getTenants(filter) return TenantService.getTenants(filter)
} }

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

@ -152,8 +152,8 @@
<Pagination <Pagination
v-show="dataTotal>0" v-show="dataTotal>0"
:total="dataTotal" :total="dataTotal"
:page.sync="dataFilter.skipCount" :page.sync="currentPage"
:limit.sync="dataFilter.maxResultCount" :limit.sync="pageSize"
@pagination="refreshPagedData" @pagination="refreshPagedData"
/> />
@ -188,7 +188,7 @@
import DataListMiXin from '@/mixins/DataListMiXin' import DataListMiXin from '@/mixins/DataListMiXin'
import Component, { mixins } from 'vue-class-component' import Component, { mixins } from 'vue-class-component'
import Pagination from '@/components/Pagination/index.vue' import Pagination from '@/components/Pagination/index.vue'
import { dateFormat } from '@/utils' import { dateFormat, abpPagerFormat } from '@/utils'
import UserApiService, { UserDataDto, UsersGetPagedDto } from '@/api/users' import UserApiService, { UserDataDto, UsersGetPagedDto } from '@/api/users'
import UserCreateForm from './components/UserCreateForm.vue' import UserCreateForm from './components/UserCreateForm.vue'
import UserEditForm from './components/UserEditForm.vue' import UserEditForm from './components/UserEditForm.vue'
@ -224,6 +224,10 @@ export default class extends mixins(DataListMiXin) {
this.refreshPagedData() this.refreshPagedData()
} }
protected processDataFilter() {
this.dataFilter.skipCount = abpPagerFormat(this.currentPage, this.pageSize)
}
/** 查询用户列表 */ /** 查询用户列表 */
protected getPagedList(filter: any) { protected getPagedList(filter: any) {
return UserApiService.getUsers(filter) return UserApiService.getUsers(filter)

4
vueJs/src/views/file-management/index.vue

@ -154,8 +154,8 @@
<Pagination <Pagination
v-show="dataTotal>0" v-show="dataTotal>0"
:total="dataTotal" :total="dataTotal"
:page.sync="dataFilter.skipCount" :page.sync="currentPage"
:limit.sync="dataFilter.maxResultCount" :limit.sync="pageSize"
@pagination="refreshPagedData" @pagination="refreshPagedData"
/> />

144
vueJs/src/views/profile-setting/components/MyProfile.vue

@ -0,0 +1,144 @@
<template>
<div class="app-container">
<h4>{{ $t('AbpAccount.ManageYourProfile') }}</h4>
<el-divider />
<el-form
v-model="myProfile"
label-width="180px"
>
<el-row>
<el-col :span="16">
<el-form-item
:label="$t('AbpAccount.DisplayName:UserName')"
prop="userName"
>
<el-input v-model="myProfile.userName" />
</el-form-item>
<el-form-item
:label="$t('AbpAccount.DisplayName:Name')"
prop="name"
>
<el-input v-model="myProfile.name" />
</el-form-item>
<el-form-item
:label="$t('AbpAccount.DisplayName:Surname')"
prop="surname"
>
<el-input v-model="myProfile.surname" />
</el-form-item>
</el-col>
<el-col :span="8">
<div class="user-avatar">
<div class="box-center">
<el-row>
<pan-thumb
:image="myAvatar"
:height="'100px'"
:width="'100px'"
:hoverable="false"
/>
</el-row>
<el-row>
<el-button>
<i class="el-icon-upload2" />
更换头像
</el-button>
</el-row>
</div>
</div>
</el-col>
</el-row>
<el-form-item
:label="$t('AbpAccount.DisplayName:Email')"
prop="email"
>
<el-input v-model="myProfile.email" />
</el-form-item>
<el-form-item
:label="$t('AbpAccount.DisplayName:PhoneNumber')"
prop="phoneNumber"
>
<el-input v-model="myProfile.phoneNumber" />
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="handleUpdateMyProfile"
>
更新个人资料
</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script lang="ts">
import MyProfileService, { MyProfile, UpdateMyProfile } from '@/api/profile'
import { Component, Vue } from 'vue-property-decorator'
import PanThumb from '@/components/PanThumb/index.vue'
@Component({
name: 'MyProfile',
components: {
PanThumb
}
})
export default class extends Vue {
private myProfile = new MyProfile()
get myAvatar() {
if (this.myProfile.extraProperties) {
const avatar = this.myProfile.extraProperties.avatar
if (avatar) {
return avatar
}
}
return ''
}
set myAvatar(avatar: string) {
if (this.myProfile.extraProperties) {
this.myProfile.extraProperties.avatar = avatar
}
}
mounted() {
MyProfileService.getMyProfile().then(profile => {
this.myProfile = profile
})
}
private handleUpdateMyProfile() {
this.$confirm(this.$t('AbpAccount.ManageYourProfile').toString(),
this.$t('AbpAccount.AreYouSure').toString(), {
callback: (action) => {
if (action === 'confirm') {
const updateProfile = new UpdateMyProfile(
this.myProfile.name,
this.myProfile.email,
this.myProfile.userName,
this.myProfile.surname,
this.myProfile.phoneNumber
)
MyProfileService.updateMyProfile(updateProfile).then(profile => {
this.myProfile = profile
this.$message.success(this.$t('AbpAccount.PersonalSettingsSaved').toString())
})
}
}
})
}
}
</script>
<style lang="scss" scoped>
.box-center {
margin: 0 auto;
display: table;
}
.user-avatar {
.box-center {
padding-top: 10px;
}
}
</style>

0
vueJs/src/views/profile-setting/components/MySecurity.vue

33
vueJs/src/views/profile-setting/index.vue

@ -0,0 +1,33 @@
<template>
<el-tabs
tab-position="left"
style="margin: 30px;"
>
<el-tab-pane label="基本设置">
<my-profile />
</el-tab-pane>
<el-tab-pane label="安全设置">
安全设置
</el-tab-pane>
<el-tab-pane label="账号绑定">
账号绑定
</el-tab-pane>
<el-tab-pane label="消息通知">
消息通知
</el-tab-pane>
</el-tabs>
</template>
<script lang="ts">
import MyProfile from './components/MyProfile.vue'
import { Component, Vue } from 'vue-property-decorator'
@Component({
name: 'ProfileSettingEditForm',
components: {
MyProfile
}
})
export default class extends Vue {
}
</script>
Loading…
Cancel
Save