diff --git a/frontend/packages/flow-pc/flow-pc-design/src/components/script/components/condition/condition-group.tsx b/frontend/packages/flow-pc/flow-pc-design/src/components/script/components/condition/condition-group.tsx new file mode 100644 index 00000000..c33ff816 --- /dev/null +++ b/frontend/packages/flow-pc/flow-pc-design/src/components/script/components/condition/condition-group.tsx @@ -0,0 +1,71 @@ +import React from "react"; +import {Table} from "@flow-engine/flow-pc-ui"; +import {Button, Space } from "antd"; +import { PlusOutlined } from "@ant-design/icons"; + +/** + * TODO 尚未完成 + * @constructor + */ +export const ConditionGroup = () => { + return ( +
+ { + return [ + + ] + }} + columns={[ + { + key:'id', + title:'id', + hidden:true, + dataIndex: 'id', + }, + { + key:'left', + title:'左侧参数', + dataIndex:'left', + }, + { + key:'type', + title:'条件关系', + dataIndex:'type', + }, + { + key:'right', + title:'右侧参数', + dataIndex: 'right', + }, + { + key:'option', + title:'操作', + render: (text, record) => { + return ( + + 交换 + 删除 + + ) + } + }, + ]} + dataSource={[ + { + id:1, + left:'用户编号', + type:'等于', + right:'1' + } + ]} + pagination={false} + /> + + + ) +} \ No newline at end of file diff --git a/frontend/packages/flow-pc/flow-pc-design/src/components/script/components/condition/condition-relation.tsx b/frontend/packages/flow-pc/flow-pc-design/src/components/script/components/condition/condition-relation.tsx new file mode 100644 index 00000000..cfe92bfc --- /dev/null +++ b/frontend/packages/flow-pc/flow-pc-design/src/components/script/components/condition/condition-relation.tsx @@ -0,0 +1,80 @@ +import {PlusCircleOutlined} from "@ant-design/icons"; +import {Dropdown, MenuProps} from "antd"; +import React from "react"; + +/** + * TODO 尚未完成 + * @constructor + */ +export const ConditionRelation = () => { + + const items: MenuProps['items'] = [ + { + key: '1', + label: ( + + 括号 + + ), + }, + { + key: '2', + label: ( + + 并且 + + ), + }, + { + key: '3', + label: ( + + 或者 + + ), + }, + { + key: '4', + label: '条件', + children: [ + { + key: '3-1', + label: '分组1', + }, + { + key: '3-2', + label: '分组2', + }, + ], + }, + { + key: '5', + label: ( + + 删除 + + ), + danger:true + }, + ]; + + return ( +
+ + + + + + +
+ ) +} \ No newline at end of file diff --git a/frontend/packages/flow-pc/flow-pc-design/src/components/script/components/groovy-script-preview.tsx b/frontend/packages/flow-pc/flow-pc-design/src/components/script/components/groovy-script-preview.tsx index 840de5df..e3e18ccf 100644 --- a/frontend/packages/flow-pc/flow-pc-design/src/components/script/components/groovy-script-preview.tsx +++ b/frontend/packages/flow-pc/flow-pc-design/src/components/script/components/groovy-script-preview.tsx @@ -21,7 +21,7 @@ export const GroovyScriptPreview: React.FC = (props) = minHeight: '45px', padding: '4px 11px', border: '1px solid #d9d9d9', - borderRadius: '6px 0 0 6px', + borderRadius: '6px', backgroundColor: value ? '#fff' : '#fafafa', color: value ? 'rgba(0,0,0,0.88)' : 'rgba(0,0,0,0.25)', }} diff --git a/frontend/packages/flow-pc/flow-pc-design/src/components/script/plugins/view/condition-view.tsx b/frontend/packages/flow-pc/flow-pc-design/src/components/script/plugins/view/condition-view.tsx index 56758b19..9f92bc12 100644 --- a/frontend/packages/flow-pc/flow-pc-design/src/components/script/plugins/view/condition-view.tsx +++ b/frontend/packages/flow-pc/flow-pc-design/src/components/script/plugins/view/condition-view.tsx @@ -1,8 +1,13 @@ import React from "react"; import {ConditionViewPlugin, VIEW_KEY} from "@/components/script/plugins/condition-view-type"; import {ViewBindPlugin} from "@flow-engine/flow-types"; -import {AdvancedScriptEditor} from "@/components/script/components/advanced-script-editor"; import {SCRIPT_DEFAULT_CONDITION} from "@/components/script/default-script"; +import {GroovyScriptConvertorUtil} from "@/components/script/utils/convertor"; +import {Button, Space} from "antd"; +import {CodeOutlined, ReloadOutlined} from "@ant-design/icons"; +import {GroovyScriptPreview} from "@/components/script/components/groovy-script-preview"; +import {ConditionRelation} from "@/components/script/components/condition/condition-relation"; +import {ConditionGroup} from "@/components/script/components/condition/condition-group"; /** * TODO 条件控制界面 @@ -17,13 +22,46 @@ export const ConditionPluginView: React.FC = (props) => { ); } - return ( - { - return SCRIPT_DEFAULT_CONDITION; - }} - /> +
+
+ 预览 + +
+
+ 关系 + +
+
+ 条件 + +
+ + + + +
); }