feat: improve code
This commit is contained in:
parent
264a1e6c21
commit
08fcee6d90
@ -69,8 +69,8 @@ export const roleCollectionsSchema: ISchema = {
|
||||
resource: 'roles.collections',
|
||||
action: 'list',
|
||||
params: {
|
||||
pageSize: 5,
|
||||
filter: {},
|
||||
pageSize: 20,
|
||||
filter: { inherit: false },
|
||||
sort: ['sort'],
|
||||
appends: [],
|
||||
},
|
||||
|
@ -21,7 +21,7 @@ export const ActionModal: ComposedActionDrawer = observer((props) => {
|
||||
<>
|
||||
{createPortal(
|
||||
<Modal
|
||||
// width={'50%'}
|
||||
width={'80%'}
|
||||
title={field.title}
|
||||
{...others}
|
||||
destroyOnClose
|
||||
|
@ -49,6 +49,9 @@ FormItem.Designer = () => {
|
||||
{
|
||||
title: '编辑字段',
|
||||
'x-component': 'Action.Modal',
|
||||
'x-component-props': {
|
||||
width: 520,
|
||||
},
|
||||
'x-decorator': 'Form',
|
||||
'x-decorator-props': {
|
||||
initialValue,
|
||||
|
@ -26,5 +26,8 @@ export const toGroupDataSource = (groupField: IGroupField, dataSource: Array<any
|
||||
groupDataSource.__unknown__.cards.push(ds);
|
||||
}
|
||||
});
|
||||
if (groupDataSource.__unknown__.cards.length === 0) {
|
||||
delete groupDataSource.__unknown__;
|
||||
}
|
||||
return { columns: Object.values(groupDataSource) };
|
||||
};
|
||||
|
@ -317,7 +317,17 @@ Menu.Item = observer((props) => {
|
||||
<AntdMenu.Item {...others} key={schema.name} eventKey={schema.name} schema={schema}>
|
||||
<SortableItem className={designerCss}>
|
||||
<Icon type={icon} style={{ marginRight: 5 }} />
|
||||
{field.title}
|
||||
<span
|
||||
className={css`
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
vertical-align: middle;
|
||||
`}
|
||||
>
|
||||
{field.title}
|
||||
</span>
|
||||
<Designer />
|
||||
</SortableItem>
|
||||
</AntdMenu.Item>
|
||||
|
@ -39,6 +39,9 @@ export const TableColumnDeigner = (props) => {
|
||||
{
|
||||
title: '编辑字段',
|
||||
'x-component': 'Action.Modal',
|
||||
'x-component-props': {
|
||||
width: 520,
|
||||
},
|
||||
'x-decorator': 'Form',
|
||||
'x-decorator-props': {
|
||||
initialValue,
|
||||
|
@ -54,6 +54,9 @@ export const TabPaneInitializers = () => {
|
||||
drawer1: {
|
||||
'x-decorator': 'Form',
|
||||
'x-component': 'Action.Modal',
|
||||
'x-component-props': {
|
||||
width: 520,
|
||||
},
|
||||
type: 'void',
|
||||
title: '{{t("Add tab")}}',
|
||||
properties: {
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { useCookieState } from 'ahooks';
|
||||
import { Menu, Select } from 'antd';
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useCurrentUserContext } from './CurrentUserProvider';
|
||||
|
||||
const useCurrentRoles = () => {
|
||||
@ -10,6 +11,7 @@ const useCurrentRoles = () => {
|
||||
|
||||
export const SwitchRole = () => {
|
||||
const roles = useCurrentRoles();
|
||||
const { t } = useTranslation();
|
||||
const [roleName, setRoleName] = useCookieState('currentRoleName', {
|
||||
defaultValue: roles?.find((role) => role.default)?.name,
|
||||
});
|
||||
@ -18,7 +20,7 @@ export const SwitchRole = () => {
|
||||
}
|
||||
return (
|
||||
<Menu.Item>
|
||||
切换角色{' '}
|
||||
{t('Switch role')}{' '}
|
||||
<Select
|
||||
style={{ minWidth: 100 }}
|
||||
bordered={false}
|
||||
|
@ -28,6 +28,7 @@ const availableActions: {
|
||||
update: {
|
||||
displayName: '{{t("Edit")}}',
|
||||
type: 'old-data',
|
||||
aliases: ['update', 'move'],
|
||||
allowConfigureFields: true,
|
||||
},
|
||||
destroy: {
|
||||
|
Loading…
Reference in New Issue
Block a user