fix: Modify UserGroups and User definition

1. Modify UserGroups class definition to make it extensible
2. Modify getColumns definition to make it extensible

Change-Id: I8e97da2ec2078a8620cc212f76cfab9e1bedb14e
This commit is contained in:
xusongfu 2022-04-13 11:13:16 +08:00
parent 30229526a4
commit d76bd458fc
2 changed files with 7 additions and 7 deletions

View File

@ -73,7 +73,7 @@ export class User extends Base {
return this.inDetailPage && path.includes('identity/role-admin'); return this.inDetailPage && path.includes('identity/role-admin');
} }
getColumns = () => { getColumns() {
// const { // const {
// match: { path }, // match: { path },
// } = this.props; // } = this.props;
@ -254,7 +254,7 @@ export class User extends Base {
); );
} }
return columns; return columns;
}; }
get actionConfigs() { get actionConfigs() {
if (this.inDomainDetail) { if (this.inDomainDetail) {

View File

@ -20,9 +20,7 @@ import { Badge } from 'antd';
import { emptyActionConfig } from 'utils/constants'; import { emptyActionConfig } from 'utils/constants';
import actionConfigs from './actions'; import actionConfigs from './actions';
@inject('rootStore') export class UserGroups extends Base {
@observer
export default class UserGroups extends Base {
init() { init() {
this.store = globalGroupStore; this.store = globalGroupStore;
} }
@ -43,7 +41,7 @@ export default class UserGroups extends Base {
return false; return false;
} }
getColumns = () => { getColumns() {
const { const {
match: { path }, match: { path },
} = this.props; } = this.props;
@ -102,7 +100,7 @@ export default class UserGroups extends Base {
components.splice(2, 1); components.splice(2, 1);
} }
return components; return components;
}; }
get actionConfigs() { get actionConfigs() {
const { const {
@ -145,3 +143,5 @@ export default class UserGroups extends Base {
this.list.silent = false; this.list.silent = false;
} }
} }
export default inject('rootStore')(observer(UserGroups));