|
|
|
@ -1,7 +1,7 @@
|
|
|
|
import React from 'react';
|
|
|
|
import React from 'react';
|
|
|
|
import styles from '@/components/FlowEditor/node/style/baseOther.module.less';
|
|
|
|
import styles from '@/components/FlowEditor/node/style/baseOther.module.less';
|
|
|
|
import { Handle, Position, useStore } from '@xyflow/react';
|
|
|
|
import { Handle, Position, useStore } from '@xyflow/react';
|
|
|
|
import { isJSON } from '@/utils/common';
|
|
|
|
import { deserializeValue } from '@/utils/common';
|
|
|
|
import cronstrue from 'cronstrue/i18n';
|
|
|
|
import cronstrue from 'cronstrue/i18n';
|
|
|
|
|
|
|
|
|
|
|
|
interface NodeContentData {
|
|
|
|
interface NodeContentData {
|
|
|
|
@ -179,15 +179,16 @@ const renderRegularNodeHandles = (dataIns: any[], dataOuts: any[], apiIns: any[]
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const formatFooter = (data: any) => {
|
|
|
|
const formatFooter = (data: any) => {
|
|
|
|
|
|
|
|
try {
|
|
|
|
switch (data.type) {
|
|
|
|
switch (data.type) {
|
|
|
|
case 'WAIT':
|
|
|
|
case 'WAIT':
|
|
|
|
const { duration } = data.customDef;
|
|
|
|
const { duration } = deserializeValue(data.customDef);
|
|
|
|
const hours = Math.floor(duration / 3600);
|
|
|
|
const hours = Math.floor(duration / 3600);
|
|
|
|
const minutes = Math.floor((duration % 3600) / 60);
|
|
|
|
const minutes = Math.floor((duration % 3600) / 60);
|
|
|
|
const seconds = Math.floor(duration % 60);
|
|
|
|
const seconds = Math.floor(duration % 60);
|
|
|
|
return `${hours}小时${minutes}分钟${seconds}秒`;
|
|
|
|
return `${hours}小时${minutes}分钟${seconds}秒`;
|
|
|
|
case 'CYCLE':
|
|
|
|
case 'CYCLE':
|
|
|
|
const { intervalSeconds } = data.customDef;
|
|
|
|
const { intervalSeconds } = deserializeValue(data.customDef);
|
|
|
|
return cronstrue.toString(intervalSeconds, { locale: 'zh_CN' });
|
|
|
|
return cronstrue.toString(intervalSeconds, { locale: 'zh_CN' });
|
|
|
|
case 'EVENTSEND':
|
|
|
|
case 'EVENTSEND':
|
|
|
|
case 'EVENTLISTENE':
|
|
|
|
case 'EVENTLISTENE':
|
|
|
|
@ -196,6 +197,9 @@ const formatFooter = (data: any) => {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return '这个类型还没开发';
|
|
|
|
return '这个类型还没开发';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
console.log(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const NodeContent = ({ data }: { data: NodeContentData }) => {
|
|
|
|
const NodeContent = ({ data }: { data: NodeContentData }) => {
|
|
|
|
|