feat: modules

This commit is contained in:
archer
2023-08-04 10:39:39 +08:00
parent eb28bfb27b
commit 94a241bbb1
10 changed files with 42 additions and 27 deletions

View File

@@ -34,7 +34,7 @@ const NodeHttp = ({
key,
valueType: FlowValueTypeEnum.string,
type: FlowInputItemTypeEnum.target,
label: 'New Param',
label: `入参${inputs.length - 1}`,
edit: true
}
});
@@ -59,7 +59,7 @@ const NodeHttp = ({
value: outputs.concat([
{
key,
label: '出参1',
label: `出参${outputs.length}`,
valueType: FlowValueTypeEnum.string,
type: FlowOutputItemTypeEnum.source,
edit: true,

View File

@@ -3,7 +3,7 @@ import { BaseEdge, EdgeLabelRenderer, EdgeProps, getBezierPath } from 'reactflow
import { Flex } from '@chakra-ui/react';
import MyIcon from '@/components/Icon';
export default function ButtonEdge({
const ButtonEdge = ({
id,
sourceX,
sourceY,
@@ -16,7 +16,7 @@ export default function ButtonEdge({
data
}: EdgeProps<{
onDelete: (id: string) => void;
}>) {
}>) => {
const [edgePath, labelX, labelY] = getBezierPath({
sourceX,
sourceY,
@@ -53,4 +53,6 @@ export default function ButtonEdge({
</EdgeLabelRenderer>
</>
);
}
};
export default React.memo(ButtonEdge);

View File

@@ -10,4 +10,4 @@ const Container = ({ children, ...props }: BoxProps) => {
);
};
export default Container;
export default React.memo(Container);

View File

@@ -19,4 +19,4 @@ const Divider = ({ text }: { text: 'Input' | 'Output' | string }) => {
);
};
export default Divider;
export default React.memo(Divider);

View File

@@ -27,4 +27,4 @@ const Label = ({
</Box>
);
export default Label;
export default React.memo(Label);

View File

@@ -145,4 +145,4 @@ const RenderOutput = ({
);
};
export default RenderOutput;
export default React.memo(RenderOutput);

View File

@@ -344,7 +344,6 @@ const AppEdit = ({ app, fullScreen, onFullScreen }: Props) => {
const { mutate: onclickSave, isLoading } = useRequest({
mutationFn: () => {
console.log(flow2AppModules(), '====');
return updateAppDetail(app._id, {
modules: flow2AppModules()
});