pull/81/MERGE
awenes 2024-07-18 22:36:27 +08:00
parent 208ea9b8a5
commit 163a267a16
7 changed files with 38 additions and 49 deletions

View File

@ -1,6 +1,6 @@
#
# eiam-common - Employee Identity and Access Management
# Copyright \u00A9 2022-Present Jinan Yuanchuang Network Technology Co., Ltd. (support@topiam.cn)
# Copyright © 2022-Present Jinan Yuanchuang Network Technology Co., Ltd. (support@topiam.cn)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -92,13 +92,9 @@ const DingTalkConfig = (props: DingTalkConfigProps) => {
}
}, [formRef, onConfigValidator]);
useImperativeHandle(
basicConfigRef,
() => {
return { configValidator: configValidator };
},
[configValidator],
);
useImperativeHandle(basicConfigRef, () => {
return { configValidator: configValidator };
}, [configValidator]);
return (
<>
<ProFormText

View File

@ -81,13 +81,9 @@ const FeiShuConfig = (props: {
}
}, [formRef, onConfigValidator]);
useImperativeHandle(
basicConfigRef,
() => {
return { configValidator: configValidator };
},
[configValidator],
);
useImperativeHandle(basicConfigRef, () => {
return { configValidator: configValidator };
}, [configValidator]);
return (
<>

View File

@ -15,10 +15,8 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { DraggablePanel } from '@ant-design/pro-editor';
import { PageContainer } from '@ant-design/pro-components';
import { Col, Flex, Row } from 'antd';
import { Col, Row } from 'antd';
import { useState } from 'react';
import OrgTree from './components/Organization';
import UserList from './components/User';
@ -50,19 +48,16 @@ export const User = () => {
return (
<PageContainer content={intl.formatMessage({ id: 'pages.account.user_list.desc' })}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<Row gutter={[16, 16]}>
{/* 左侧 */}
<DraggablePanel
placement="left"
maxWidth={800}
style={{ flex: 1, padding: 0, borderRadius: 12 }}
>
<Col {...leftLayout} style={{ minHeight: '100%', overflow: 'auto' }}>
<OrgTree onSelect={treeOnSelect} />
</DraggablePanel>
<div style={{ width: 'auto', flex: 1, padding: '0px 6px' }}></div>
</Col>
{/* 表格 */}
<UserList organization={organization} />
</div>
<Col {...rightLayout} style={{ minHeight: '100%', overflow: 'auto' }}>
<UserList organization={organization} />
</Col>
</Row>
</PageContainer>
);
};

View File

@ -39,7 +39,6 @@ import {
updateOrganization,
} from '@/services/account';
import { useMount } from 'ahooks';
import type { ItemType } from 'antd/es/menu/hooks/useItems';
import CreateOrganization from '../CreateOrganization';
import MoveOrganization from './MoveDrawer';
import SearchTree from './SearchTree';
@ -47,6 +46,7 @@ import UpdateOrganization from '../UpdateOrganization';
import type { DataNode } from '@/utils/tree';
import { updateTreeData } from '@/utils/tree';
import { useIntl } from '@umijs/max';
import { ItemType } from 'antd/es/menu/interface';
const prefixCls = 'account-organization';
@ -318,7 +318,7 @@ export const OrganizationTree = (props: {
return (
<div className={styles}>
<Card
style={{ height: 'calc(100vh - 220px)', overflow: 'auto' }}
style={{ height: 'calc(100vh - 200px)', overflow: 'auto' }}
bordered={false}
className={classnames(`${prefixCls}`)}
>

View File

@ -387,7 +387,7 @@ export default (props: UserListProps) => {
return (
<>
{!organization ? (
<Card style={{ height: 'calc(100vh - 220px)' }} bordered={false}>
<Card style={{ height: 'calc(100vh - 200px)' }} bordered={false}>
<Skeleton paragraph={{ rows: 10 }} active={true} />
</Card>
) : (
@ -396,10 +396,10 @@ export default (props: UserListProps) => {
scroll={{ x: 1200 }}
params={{ organizationId: organization?.id, inclSubOrganization }}
style={{
height: 'calc(100vh - 220px)',
height: 'calc(100vh - 200px)',
overflow: 'auto',
}}
cardProps={{ style: { minHeight: 'calc(100vh - 220px)' } }}
cardProps={{ style: { minHeight: 'calc(100vh - 200px)' } }}
search={{
defaultCollapsed: true,
}}

View File

@ -290,16 +290,16 @@ export default (props: { app: GetApp | Record<string, any> }) => {
>
{(fields, { add, remove }, { errors }) => (
<>
{fields.map((field, index) => (
{fields.map(({ key, name, ...restField }, index) => (
<Form.Item
{...(index === 0 ? layout : formItemLayoutWithOutLabel)}
required={true}
key={field.key}
key={key}
label={
index === 0
? intl.formatMessage({
id: 'pages.app.config.detail.protocol_config.oidc.redirect_uris',
})
id: 'pages.app.config.detail.protocol_config.oidc.redirect_uris',
})
: ''
}
>
@ -311,7 +311,8 @@ export default (props: { app: GetApp | Record<string, any> }) => {
}}
>
<Form.Item
{...field}
{...restField}
name={[name]}
validateTrigger={['onChange', 'onBlur']}
rules={[
{
@ -335,7 +336,7 @@ export default (props: { app: GetApp | Record<string, any> }) => {
})}
/>
</Form.Item>
<DeleteOutlined onClick={() => remove(field.name)} />
<DeleteOutlined onClick={() => remove(name)} />
</div>
</Form.Item>
))}
@ -345,8 +346,8 @@ export default (props: { app: GetApp | Record<string, any> }) => {
label={
fields.length === 0
? intl.formatMessage({
id: 'pages.app.config.detail.protocol_config.oidc.redirect_uris',
})
id: 'pages.app.config.detail.protocol_config.oidc.redirect_uris',
})
: ''
}
extra={intl.formatMessage({
@ -369,16 +370,16 @@ export default (props: { app: GetApp | Record<string, any> }) => {
<Form.List name="postLogoutRedirectUris">
{(fields, { add, remove }, {}) => (
<>
{fields.map((field, index) => {
{fields.map(({ key, name, ...restField }, index) => {
return (
<Form.Item
{...(index === 0 ? layout : formItemLayoutWithOutLabel)}
key={field.key}
key={key}
label={
index === 0
? intl.formatMessage({
id: 'pages.app.config.detail.protocol_config.oidc.post_logout_redirect_uris',
})
id: 'pages.app.config.detail.protocol_config.oidc.post_logout_redirect_uris',
})
: ''
}
>
@ -390,7 +391,8 @@ export default (props: { app: GetApp | Record<string, any> }) => {
}}
>
<Form.Item
{...field}
{...restField}
name={[name]}
validateTrigger={['onChange', 'onBlur']}
rules={[
{
@ -414,7 +416,7 @@ export default (props: { app: GetApp | Record<string, any> }) => {
})}
/>
</Form.Item>
<DeleteOutlined onClick={() => remove(field.name)} />
<DeleteOutlined onClick={() => remove(name)} />
</div>
</Form.Item>
);
@ -424,8 +426,8 @@ export default (props: { app: GetApp | Record<string, any> }) => {
label={
fields.length === 0
? intl.formatMessage({
id: 'pages.app.config.detail.protocol_config.oidc.post_logout_redirect_uris',
})
id: 'pages.app.config.detail.protocol_config.oidc.post_logout_redirect_uris',
})
: ''
}
extra={intl.formatMessage({