mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 05:57:53 +00:00
style: add child action style improve (#4289)
* style: add child style improve * refactor: tree table * fix: bug * refactor: code improve
This commit is contained in:
parent
61338eedb7
commit
4522dd09f3
@ -22,7 +22,7 @@ export const CreateChildInitializer = (props) => {
|
|||||||
openMode: 'drawer',
|
openMode: 'drawer',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
addChild: true,
|
addChild: true,
|
||||||
style: { padding: '0px', marginTop: '-5px' },
|
style: { height: 'auto', lineHeight: 'normal' },
|
||||||
component: 'CreateRecordAction',
|
component: 'CreateRecordAction',
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
|
@ -454,7 +454,7 @@ export const Table: any = withDynamicSchemaProps(
|
|||||||
if (!_.isEqual(newExpandesKeys, expandedKeys)) {
|
if (!_.isEqual(newExpandesKeys, expandedKeys)) {
|
||||||
setExpandesKeys(newExpandesKeys);
|
setExpandesKeys(newExpandesKeys);
|
||||||
}
|
}
|
||||||
}, [expandFlag, allIncludesChildren]);
|
}, [expandFlag]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 为没有设置 key 属性的表格行生成一个唯一的 key
|
* 为没有设置 key 属性的表格行生成一个唯一的 key
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { DownOutlined } from '@ant-design/icons';
|
import { DownOutlined } from '@ant-design/icons';
|
||||||
import { css } from '@emotion/css';
|
|
||||||
import { observer, RecursionField, useField, useFieldSchema, useForm } from '@formily/react';
|
import { observer, RecursionField, useField, useFieldSchema, useForm } from '@formily/react';
|
||||||
import { Button, Dropdown, MenuProps } from 'antd';
|
import { Button, Dropdown, MenuProps } from 'antd';
|
||||||
import React, { useEffect, useMemo, useState, forwardRef, createRef } from 'react';
|
import React, { useEffect, useMemo, useState, forwardRef, createRef } from 'react';
|
||||||
@ -26,46 +25,6 @@ import { linkageAction } from '../../schema-component/antd/action/utils';
|
|||||||
import { parseVariables } from '../../schema-component/common/utils/uitls';
|
import { parseVariables } from '../../schema-component/common/utils/uitls';
|
||||||
import { useLocalVariables, useVariables } from '../../variables';
|
import { useLocalVariables, useVariables } from '../../variables';
|
||||||
|
|
||||||
export const actionDesignerCss = css`
|
|
||||||
position: relative;
|
|
||||||
&:hover {
|
|
||||||
.general-schema-designer {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.general-schema-designer {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 999;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
display: none;
|
|
||||||
background: var(--colorBgSettingsHover);
|
|
||||||
border: 0;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
pointer-events: none;
|
|
||||||
> .general-schema-designer-icons {
|
|
||||||
position: absolute;
|
|
||||||
right: 2px;
|
|
||||||
top: 2px;
|
|
||||||
line-height: 16px;
|
|
||||||
pointer-events: all;
|
|
||||||
.ant-space-item {
|
|
||||||
background-color: var(--colorSettings);
|
|
||||||
color: #fff;
|
|
||||||
line-height: 16px;
|
|
||||||
width: 16px;
|
|
||||||
padding-left: 1px;
|
|
||||||
align-self: stretch;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
export function useAclCheck(actionPath) {
|
export function useAclCheck(actionPath) {
|
||||||
const aclCheck = useAclCheckFn();
|
const aclCheck = useAclCheckFn();
|
||||||
return aclCheck(actionPath);
|
return aclCheck(actionPath);
|
||||||
@ -138,7 +97,7 @@ const InternalCreateRecordAction = (props: any, ref) => {
|
|||||||
const buttonRef = composeRef(ref, internalRef);
|
const buttonRef = composeRef(ref, internalRef);
|
||||||
return (
|
return (
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
<div className={actionDesignerCss} ref={buttonRef as React.Ref<HTMLButtonElement>}>
|
<div ref={buttonRef as React.Ref<HTMLButtonElement>}>
|
||||||
<ActionContextProvider value={{ ...ctx, fieldSchema, visible, setVisible }}>
|
<ActionContextProvider value={{ ...ctx, fieldSchema, visible, setVisible }}>
|
||||||
<CreateAction
|
<CreateAction
|
||||||
{...props}
|
{...props}
|
||||||
@ -242,7 +201,7 @@ export const CreateAction = observer(
|
|||||||
});
|
});
|
||||||
}, [field, linkageRules, localVariables, variables]);
|
}, [field, linkageRules, localVariables, variables]);
|
||||||
return (
|
return (
|
||||||
<div className={actionDesignerCss}>
|
<div>
|
||||||
<FinallyButton
|
<FinallyButton
|
||||||
{...{
|
{...{
|
||||||
inheritsCollections,
|
inheritsCollections,
|
||||||
|
Loading…
Reference in New Issue
Block a user