diff --git a/packages/client/src/acl/Configuration/MenuConfigure.tsx b/packages/client/src/acl/Configuration/MenuConfigure.tsx
index e5de69952d..87fbbd712d 100644
--- a/packages/client/src/acl/Configuration/MenuConfigure.tsx
+++ b/packages/client/src/acl/Configuration/MenuConfigure.tsx
@@ -4,10 +4,23 @@ import { useMenuItems } from '.';
import { useAPIClient, useRequest } from '../../api-client';
import { useRecord } from '../../record-provider';
+const findUids = (items) => {
+ if (!Array.isArray(items)) {
+ return [];
+ }
+ const uids = [];
+ for (const item of items) {
+ uids.push(item.uid);
+ uids.push(...findUids(item.children));
+ }
+ return uids;
+};
+
export const MenuConfigure = () => {
const record = useRecord();
const api = useAPIClient();
const items = useMenuItems();
+ const allUids = findUids(items);
const [uids, setUids] = useState([]);
const { loading, refresh } = useRequest(
{
@@ -25,7 +38,7 @@ export const MenuConfigure = () => {
},
);
const resource = api.resource('roles.menuUiSchemas', record.name);
- const allChecked = items.length === uids.length;
+ const allChecked = allUids.length === uids.length;
return (
{
});
} else {
await resource.set({
- values: items.map((item) => item.uid),
+ values: allUids,
});
}
refresh();
@@ -62,7 +75,8 @@ export const MenuConfigure = () => {
允许访问
>
),
- render: (checked, schema) => {
+ render: (_, schema) => {
+ const checked = uids.includes(schema.uid);
return (
{
},
},
]}
- dataSource={items.map((item) => {
- const accessible = uids.includes(item.uid);
- return { ...item, accessible };
- })}
+ dataSource={items}
/>
);
};
diff --git a/packages/client/src/schema-component/antd/action/Action.Modal.tsx b/packages/client/src/schema-component/antd/action/Action.Modal.tsx
index 41261ec5dc..0767ecd0b4 100644
--- a/packages/client/src/schema-component/antd/action/Action.Modal.tsx
+++ b/packages/client/src/schema-component/antd/action/Action.Modal.tsx
@@ -1,6 +1,7 @@
import { css } from '@emotion/css';
import { observer, RecursionField, useField, useFieldSchema } from '@formily/react';
import { Modal } from 'antd';
+import classNames from 'classnames';
import React from 'react';
import { createPortal } from 'react-dom';
import { useActionContext } from '.';
@@ -27,8 +28,18 @@ export const ActionModal: ComposedActionDrawer = observer((props) => {
destroyOnClose
visible={visible}
onCancel={() => setVisible(false)}
+ className={classNames(
+ others.className,
+ css`
+ &.nb-action-popup {
+ .ant-modal-body {
+ background: #f0f2f5;
+ }
+ }
+ `,
+ )}
footer={
- footerSchema && (
+ footerSchema ? (
{
}}
/>
+ ) : (
+ false
)
}
>
diff --git a/packages/client/src/schema-component/antd/kanban/Kanban.Card.tsx b/packages/client/src/schema-component/antd/kanban/Kanban.Card.tsx
index 3966939152..eba55b2ae8 100644
--- a/packages/client/src/schema-component/antd/kanban/Kanban.Card.tsx
+++ b/packages/client/src/schema-component/antd/kanban/Kanban.Card.tsx
@@ -1,3 +1,4 @@
+import { css } from '@emotion/css';
import { FormLayout } from '@formily/antd';
import { observer, RecursionField, useFieldSchema } from '@formily/react';
import { Card } from 'antd';
@@ -27,6 +28,18 @@ export const KanbanCard: any = observer((props: any) => {
hoverable
style={{ cursor: 'pointer', overflow: 'hidden' }}
bodyStyle={{ paddingBottom: 0 }}
+ className={css`
+ .ant-description-input {
+ text-overflow: ellipsis;
+ width: 100%;
+ overflow: hidden;
+ }
+ .ant-description-textarea {
+ text-overflow: ellipsis;
+ width: 100%;
+ overflow: hidden;
+ }
+ `}
>
{
);
})}
-
-
{
- setSync(false);
- if (multiple) {
- if (info.file.status === 'done') {
- onChange(toValue(info.fileList));
+ {!disabled && (multiple || toArr(value).length < 1) && (
+
+
{
+ setSync(false);
+ if (multiple) {
+ if (info.file.status === 'done') {
+ onChange(toValue(info.fileList));
+ }
+ setFileList(info.fileList.map(toItem));
+ } else {
+ if (info.file.status === 'done') {
+ console.log('field.value', info.file?.response?.data);
+ // TODO(BUG): object 的联动有问题,不响应,折中的办法先置空再赋值
+ onChange(null);
+ onChange(info.file?.response?.data);
+ }
+ setFileList([toItem(info.file)]);
}
- setFileList(info.fileList.map(toItem));
- } else {
- if (info.file.status === 'done') {
- console.log('field.value', info.file?.response?.data);
- // TODO(BUG): object 的联动有问题,不响应,折中的办法先置空再赋值
- onChange(null);
- onChange(info.file?.response?.data);
- }
- setFileList([toItem(info.file)]);
- }
- }}
- showUploadList={false}
- >
- {!disabled && (multiple || toArr(value).length < 1) && (
-
-
-
{t('Upload')}
-
- )}
-
-
+ }}
+ showUploadList={false}
+ >
+ {!disabled && (multiple || toArr(value).length < 1) && (
+
+
+
{t('Upload')}
+
+ )}
+
+
+ )}
{visible && (
diff --git a/packages/client/src/schema-component/common/sortable-item/SortableItem.tsx b/packages/client/src/schema-component/common/sortable-item/SortableItem.tsx
index a04979b806..74397a0985 100644
--- a/packages/client/src/schema-component/common/sortable-item/SortableItem.tsx
+++ b/packages/client/src/schema-component/common/sortable-item/SortableItem.tsx
@@ -80,7 +80,7 @@ export const DragHandler = (props) => {
{...listeners}
{...attributes}
>
- {props.children}
+ {props.children}
);