mirror of https://gitee.com/topiam/eiam
⚡ 应用分组
parent
683e4106f2
commit
6527c62599
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import { history } from '@@/core/history';
|
import { history } from '@@/core/history';
|
||||||
import { DesktopOutlined, ProfileOutlined } from '@ant-design/icons';
|
import { DesktopOutlined, ProfileOutlined, SafetyOutlined } from '@ant-design/icons';
|
||||||
import { GridContent, PageContainer } from '@ant-design/pro-components';
|
import { GridContent, PageContainer } from '@ant-design/pro-components';
|
||||||
import { useAsyncEffect } from 'ahooks';
|
import { useAsyncEffect } from 'ahooks';
|
||||||
import type { MenuProps } from 'antd';
|
import type { MenuProps } from 'antd';
|
||||||
|
@ -32,6 +32,8 @@ import { useIntl, useLocation } from '@umijs/max';
|
||||||
import useStyle from './style';
|
import useStyle from './style';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { AppProtocolType } from '@/constant';
|
import { AppProtocolType } from '@/constant';
|
||||||
|
import PermissionResource from './components/PermissionResource';
|
||||||
|
import PermissionRole from './components/PermissionRole';
|
||||||
|
|
||||||
const prefixCls = 'app-config';
|
const prefixCls = 'app-config';
|
||||||
|
|
||||||
|
@ -118,6 +120,27 @@ export default () => {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: ConfigTabs.app_permission,
|
||||||
|
label: intl.formatMessage({ id: 'pages.app.config.items.app_permission' }),
|
||||||
|
icon: React.createElement(() => {
|
||||||
|
return <SafetyOutlined />;
|
||||||
|
}),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: ConfigTabs.permission_resource,
|
||||||
|
label: intl.formatMessage({
|
||||||
|
id: 'pages.app.config.items.app_permission.permission_resource',
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: ConfigTabs.permission_role,
|
||||||
|
label: intl.formatMessage({
|
||||||
|
id: 'pages.app.config.items.app_permission.permission_role',
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
useAsyncEffect(async () => {
|
useAsyncEffect(async () => {
|
||||||
|
@ -126,12 +149,12 @@ export default () => {
|
||||||
history.push('/app');
|
history.push('/app');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!type) {
|
if (!type || !ConfigTabs[type]) {
|
||||||
setKeys([ConfigTabs.protocol_config]);
|
setKeys([ConfigTabs.basic]);
|
||||||
history.replace({
|
history.replace({
|
||||||
pathname: location.pathname,
|
pathname: location.pathname,
|
||||||
search: queryString.stringify({
|
search: queryString.stringify({
|
||||||
type: ConfigTabs.protocol_config,
|
type: ConfigTabs.basic,
|
||||||
id,
|
id,
|
||||||
protocol,
|
protocol,
|
||||||
name,
|
name,
|
||||||
|
@ -152,6 +175,8 @@ export default () => {
|
||||||
[ConfigTabs.protocol_config]: AppProtocol,
|
[ConfigTabs.protocol_config]: AppProtocol,
|
||||||
[ConfigTabs.app_account]: AppAccount,
|
[ConfigTabs.app_account]: AppAccount,
|
||||||
[ConfigTabs.access_policy]: AccessPolicy,
|
[ConfigTabs.access_policy]: AccessPolicy,
|
||||||
|
[ConfigTabs.permission_resource]: PermissionResource,
|
||||||
|
[ConfigTabs.permission_role]: PermissionRole,
|
||||||
};
|
};
|
||||||
const Component = components[key];
|
const Component = components[key];
|
||||||
return <Component {...rest} />;
|
return <Component {...rest} />;
|
||||||
|
|
Loading…
Reference in New Issue