mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 04:27:04 +00:00
Merge branch 'main' into next
This commit is contained in:
commit
cdc188c8c8
@ -13,6 +13,6 @@ export * from './FixedBlockDesignerItem';
|
||||
export * from './Page';
|
||||
export * from './Page.Settings';
|
||||
export { PagePopups } from './PagePopups';
|
||||
export { storePopupContext, getStoredPopupContext, withSearchParams, getPopupPathFromParams } from './pagePopupUtils';
|
||||
export { getPopupPathFromParams, getStoredPopupContext, storePopupContext, withSearchParams } from './pagePopupUtils';
|
||||
export * from './PageTab.Settings';
|
||||
export { PopupSettingsProvider } from './PopupSettingsProvider';
|
||||
export { PopupSettingsProvider, usePopupSettings } from './PopupSettingsProvider';
|
||||
|
@ -17,12 +17,13 @@ import {
|
||||
PopupContextProvider,
|
||||
useCollection,
|
||||
useCollectionRecordData,
|
||||
usePopupSettings,
|
||||
usePopupUtils,
|
||||
VariablePopupRecordProvider,
|
||||
} from '@nocobase/client';
|
||||
import { Schema } from '@nocobase/utils';
|
||||
import { Card } from 'antd';
|
||||
import React, { useCallback, useContext, useMemo } from 'react';
|
||||
import React, { useCallback, useContext, useMemo, useState } from 'react';
|
||||
import { KanbanCardContext } from './context';
|
||||
|
||||
const cardCss = css`
|
||||
@ -74,14 +75,20 @@ export const KanbanCard: any = observer(
|
||||
const { openPopup, getPopupSchemaFromSchema } = usePopupUtils();
|
||||
const recordData = useCollectionRecordData();
|
||||
const popupSchema = getPopupSchemaFromSchema(fieldSchema) || getPopupSchemaFromParent(fieldSchema);
|
||||
const [visible, setVisible] = useState(false);
|
||||
const { isPopupVisibleControlledByURL } = usePopupSettings();
|
||||
const handleCardClick = useCallback(
|
||||
(e: React.MouseEvent) => {
|
||||
const targetElement = e.target as Element; // 将事件目标转换为Element类型
|
||||
const currentTargetElement = e.currentTarget as Element;
|
||||
if (currentTargetElement.contains(targetElement)) {
|
||||
openPopup({
|
||||
popupUidUsedInURL: popupSchema?.['x-uid'],
|
||||
});
|
||||
if (!isPopupVisibleControlledByURL()) {
|
||||
setVisible(true);
|
||||
} else {
|
||||
openPopup({
|
||||
popupUidUsedInURL: popupSchema?.['x-uid'],
|
||||
});
|
||||
}
|
||||
e.stopPropagation();
|
||||
} else {
|
||||
e.stopPropagation();
|
||||
@ -130,7 +137,7 @@ export const KanbanCard: any = observer(
|
||||
</FormLayout>
|
||||
</DndContext>
|
||||
</Card>
|
||||
<PopupContextProvider>
|
||||
<PopupContextProvider visible={visible} setVisible={setVisible}>
|
||||
<VariablePopupRecordProvider recordData={recordData} collection={collection}>
|
||||
<MemorizedRecursionField schema={wrappedPopupSchema} />
|
||||
</VariablePopupRecordProvider>
|
||||
|
Loading…
Reference in New Issue
Block a user