feat: improve ui design for linkage action (#1659)
* feat: improve ui design for linkage action * revert * fix: not working
This commit is contained in:
parent
06d67a93ab
commit
1654b42037
@ -3,7 +3,7 @@
|
||||
.ant-space-item:empty:not(:last-child) + .ant-space-item-split {
|
||||
display: none;
|
||||
}
|
||||
.ant-space-item-split:has(+ .ant-space-item:empty) {
|
||||
.ant-space-item-split:has(+ .ant-space-item:last-child:empty) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
@ -98,48 +98,53 @@ export const Action: ComposedAction = observer((props: any) => {
|
||||
field.linkageProperty = {};
|
||||
linkageRules
|
||||
.filter((k) => !k.disabled)
|
||||
.map((v) => {
|
||||
.forEach((v) => {
|
||||
return v.actions?.map((h) => {
|
||||
linkageAction(h.operator, field, v.condition, values);
|
||||
});
|
||||
});
|
||||
}, [linkageRules, values]);
|
||||
const renderButton = () => (
|
||||
<SortableItem
|
||||
{...others}
|
||||
loading={field?.data?.loading}
|
||||
icon={<Icon type={icon} />}
|
||||
disabled={disabled}
|
||||
style={{
|
||||
display: !designable && field?.data?.hidden && 'none',
|
||||
opacity: designable && field?.data?.hidden && 0.1,
|
||||
}}
|
||||
onClick={(e: React.MouseEvent) => {
|
||||
if (!disabled) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const onOk = () => {
|
||||
onClick?.(e);
|
||||
setVisible(true);
|
||||
run();
|
||||
};
|
||||
if (confirm) {
|
||||
Modal.confirm({
|
||||
...confirm,
|
||||
onOk,
|
||||
});
|
||||
} else {
|
||||
onOk();
|
||||
}, [linkageRules, values, designable]);
|
||||
|
||||
const renderButton = () => {
|
||||
if (!designable && field?.data?.hidden) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<SortableItem
|
||||
{...others}
|
||||
loading={field?.data?.loading}
|
||||
icon={<Icon type={icon} />}
|
||||
disabled={disabled}
|
||||
style={{
|
||||
opacity: designable && field?.data?.hidden && 0.1,
|
||||
}}
|
||||
onClick={(e: React.MouseEvent) => {
|
||||
if (!disabled) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const onOk = () => {
|
||||
onClick?.(e);
|
||||
setVisible(true);
|
||||
run();
|
||||
};
|
||||
if (confirm) {
|
||||
Modal.confirm({
|
||||
...confirm,
|
||||
onOk,
|
||||
});
|
||||
} else {
|
||||
onOk();
|
||||
}
|
||||
}
|
||||
}
|
||||
}}
|
||||
component={tarComponent || Button}
|
||||
className={classnames(className, actionDesignerCss)}
|
||||
>
|
||||
{title || compile(fieldSchema.title)}
|
||||
<Designer {...designerProps} />
|
||||
</SortableItem>
|
||||
);
|
||||
}}
|
||||
component={tarComponent || Button}
|
||||
className={classnames(className, actionDesignerCss)}
|
||||
>
|
||||
{title || compile(fieldSchema.title)}
|
||||
<Designer {...designerProps} />
|
||||
</SortableItem>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<ActionContext.Provider
|
||||
|
@ -56,10 +56,8 @@ export const ReadPrettyRecordPicker: React.FC = observer((props: any) => {
|
||||
return (
|
||||
<Fragment key={`${record.id}_${index}`}>
|
||||
<span>
|
||||
{snapshot ? (
|
||||
{snapshot || isTagsMode ? (
|
||||
text
|
||||
) : isTagsMode ? (
|
||||
<Typography.Text underline>{text}</Typography.Text>
|
||||
) : (
|
||||
<a
|
||||
onClick={(e) => {
|
||||
|
Loading…
Reference in New Issue
Block a user