Skip to content

Commit 12230a2

Browse files
committed
backup
1 parent 84b3b1a commit 12230a2

File tree

3 files changed

+63
-8
lines changed

3 files changed

+63
-8
lines changed

src/example/setterss/ConditionPanel.tsx

Lines changed: 61 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import { memo, useState } from "react"
2-
import { Form, Input, Select } from "antd"
2+
import { Button, Form, Input, Select, Space } from "antd"
33
import { useTranslate } from "../../workflow-editor/react-locales"
44
import { styled } from "styled-components"
5+
import { CheckCircleFilled, CloseCircleFilled, MinusOutlined, PlusOutlined } from "@ant-design/icons";
56

67
const itemHeight = 48;
78

89
const ExpressionGroup = styled.div`
910
display: flex;
1011
align-items: stretch;
1112
`
12-
const Operator = styled.div`
13+
const GroupOperator = styled.div`
1314
position: relative;
1415
width: 80px;
1516
//border: solid 1px;
@@ -18,7 +19,7 @@ const Operator = styled.div`
1819
padding-right: 16px;
1920
`
2021

21-
const OperatorLine = styled.div`
22+
const GroupOperatorLine = styled.div`
2223
position: absolute;
2324
left: calc(50% - 8px);
2425
width: 20px;
@@ -60,7 +61,38 @@ export const Item = styled.div`
6061
display: flex;
6162
align-items: center;
6263
min-height: 48px;
64+
.actions-space{
65+
display: none;
66+
}
67+
&:hover{
68+
.actions-space{
69+
display: flex;
70+
}
71+
}
72+
`
73+
74+
export const ExpressionContent = styled(Space)`
75+
flex: 1;
76+
`
77+
78+
export const Actions = styled.div`
79+
width: 60px;
80+
display: flex;
81+
justify-content: flex-end;
82+
align-items: center;
6383
`
84+
export const AddIcon = styled(PlusOutlined)`
85+
font-size:12px;
86+
`
87+
export const RemoveIcon = styled(MinusOutlined)`
88+
font-size:12px;
89+
`
90+
// const SuccessIcon = styled(CheckCircleFilled)`
91+
// color:${props => props.theme.token?.colorSuccess};
92+
// `
93+
// const ErrorIcon = styled(CloseCircleFilled)`
94+
// color:${props => props.theme.token?.colorError};
95+
// `
6496

6597
export interface IConditionSettings {
6698

@@ -78,19 +110,41 @@ export const ConditionPanel = memo((
78110
return (
79111
<Form layout="vertical" colon={false}>
80112
<ExpressionGroup className="expression-group">
81-
<Operator className="operator">
82-
<OperatorLine className="operator-line" />
113+
<GroupOperator className="group-operator">
114+
<GroupOperatorLine className="group-operator-line" />
83115
<Select
84116
defaultValue="and"
85117
options={[
86118
{ value: 'and', label: '且' },
87119
{ value: 'or', label: '或' },
88120
]}
89121
/>
90-
</Operator>
122+
</GroupOperator>
91123
<ExpressionItems className="expression-items-container">
92124
<Item>
93-
<Input />
125+
<ExpressionContent>
126+
<Select
127+
defaultValue="and"
128+
options={[
129+
{ value: 'and', label: '物料' },
130+
{ value: 'or', label: '或' },
131+
]}
132+
/>
133+
<Select
134+
defaultValue="and"
135+
options={[
136+
{ value: 'and', label: '大于等于' },
137+
{ value: 'or', label: '或' },
138+
]}
139+
/>
140+
<Input />
141+
</ExpressionContent>
142+
<Actions className="actions">
143+
<Space className="actions-space">
144+
<Button size="small" type="text" icon={<RemoveIcon className="remove-icon" />} />
145+
<Button size="small" type="text" icon={<AddIcon className="add-icon" />} />
146+
</Space>
147+
</Actions>
94148
</Item>
95149
<Item>
96150
<Input />

src/workflow-editor/FlowEditor/FlowEditorScope/FlowEditorScopeInner.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export const FlowEditorScopeInner = memo((props: {
1818
const { mode, children, themeToken, materials, materialUis } = props;
1919
const [, token] = useToken();
2020
const t = useTranslate()
21-
2221
const theme: { token: IThemeToken, mode?: 'dark' | 'light' } = useMemo(() => {
2322
return {
2423
token: themeToken || token,

src/workflow-editor/theme.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ export interface IThemeToken {
66
colorTextSecondary?: string;
77
colorBgBase?: string;
88
colorPrimary?: string;
9+
colorError?: string;
10+
colorSuccess?: string;
911
}
1012

1113
//styled-components 的typescript使用

0 commit comments

Comments
 (0)