feat: improve ui design for linkage action (#1659)

* feat: improve ui design for linkage action

* revert

* fix: not working
This commit is contained in:
Dunqing 2023-04-17 10:30:13 +08:00 committed by GitHub
parent 06d67a93ab
commit 1654b42037
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 41 deletions

View File

@ -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;
}
}

View File

@ -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

View File

@ -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) => {