|
|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
import React from 'react';
|
|
|
|
|
import styles from '@/components/FlowEditor/node/style/baseOther.module.less';
|
|
|
|
|
import { Handle, Position, useStore } from '@xyflow/react';
|
|
|
|
|
import { deserializeValue, isJSON } from '@/utils/common';
|
|
|
|
|
import { deserializeValue, formatDataType, isJSON } from '@/utils/common';
|
|
|
|
|
import cronstrue from 'cronstrue/i18n';
|
|
|
|
|
|
|
|
|
|
interface NodeContentData {
|
|
|
|
|
@ -121,6 +121,7 @@ const NodeContent = ({ data }: { data: NodeContentData }) => {
|
|
|
|
|
{apiIns.length > 0 && (
|
|
|
|
|
<div className={styles['node-inputs']}>
|
|
|
|
|
{apiIns.map((input, index) => (
|
|
|
|
|
|
|
|
|
|
<div key={input.id || `input-${index}`} className={styles['node-input-label']}>
|
|
|
|
|
{input.desc}
|
|
|
|
|
</div>
|
|
|
|
|
@ -131,7 +132,7 @@ const NodeContent = ({ data }: { data: NodeContentData }) => {
|
|
|
|
|
{apiOuts.length > 0 && (
|
|
|
|
|
<div className={styles['node-outputs-api']}>
|
|
|
|
|
{apiOuts.map((output, index) => (
|
|
|
|
|
<div key={output.id || `output-${index}`} className={styles['node-input-label']}>
|
|
|
|
|
<div key={output.id || `output-${index}`} className={styles['node-output-label']}>
|
|
|
|
|
{output.desc}
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
@ -155,7 +156,10 @@ const NodeContent = ({ data }: { data: NodeContentData }) => {
|
|
|
|
|
<div className={styles['node-inputs']}>
|
|
|
|
|
{dataIns.map((input, index) => (
|
|
|
|
|
<div key={input.id || `input-${index}`} className={styles['node-input-label']}>
|
|
|
|
|
{input.id || `输入${index + 1}`} {input.dataType}
|
|
|
|
|
<span
|
|
|
|
|
className={styles['node-data-type']}
|
|
|
|
|
>{input.id || `输入${index + 1}`} {formatDataType(input.dataType)}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
@ -164,8 +168,12 @@ const NodeContent = ({ data }: { data: NodeContentData }) => {
|
|
|
|
|
{dataOuts.length > 0 && !isEndNode && (
|
|
|
|
|
<div className={styles['node-outputs']}>
|
|
|
|
|
{dataOuts.map((output, index) => (
|
|
|
|
|
<div key={output.id || `output-${index}`} className={styles['node-input-label']}>
|
|
|
|
|
{output.dataType} {`${output.id}` || `输出${index + 1}`}
|
|
|
|
|
<div key={output.id || `output-${index}`} className={styles['node-output-label']}>
|
|
|
|
|
|
|
|
|
|
<span
|
|
|
|
|
className={styles['node-data-type']}
|
|
|
|
|
>{formatDataType(output.dataType)} {output.id || `输出${index + 1}`}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
|