1
This commit is contained in:
parent
50e0d99712
commit
07b99aac31
@ -12,7 +12,6 @@ interface IconSelectProps {
|
||||
}
|
||||
|
||||
const IconSelect: React.FC<IconSelectProps> = ({
|
||||
value,
|
||||
onChange,
|
||||
visible,
|
||||
onCancel
|
||||
|
||||
@ -115,7 +115,6 @@ interface DataTablePaginationProps {
|
||||
|
||||
const DataTablePagination: React.FC<DataTablePaginationProps> = ({
|
||||
pageIndex,
|
||||
pageSize,
|
||||
pageCount,
|
||||
onPageChange,
|
||||
}) => {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import type {Page} from '@/types/base/page';
|
||||
import type {RoleResponse, RoleRequest, RoleQuery, RoleTagResponse, RoleTagRequest, Permission} from './types';
|
||||
import {Page} from "@/types/base.ts";
|
||||
|
||||
const BASE_URL = '/api/v1/role';
|
||||
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
import type { BaseResponse } from '@/types/base/response';
|
||||
import {BaseRequest} from "@/types/base/request.ts";
|
||||
import {BaseQuery} from "@/types/base";
|
||||
import {BaseQuery, BaseRequest, BaseResponse} from "@/types/base";
|
||||
|
||||
// 权限类型枚举
|
||||
export enum PermissionType {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import request from '@/utils/request';
|
||||
import type { Page } from '@/types/base/page';
|
||||
import type { UserResponse, UserRequest, UserQuery } from './types';
|
||||
import {Page} from "@/types/base.ts";
|
||||
import {RoleResponse} from "@/pages/System/Role/types";
|
||||
|
||||
const BASE_URL = '/api/v1/user';
|
||||
const ROLE_BASE_URL = '/api/v1/role';
|
||||
|
||||
@ -169,10 +169,6 @@ const NodeConfigDrawer: React.FC<NodeConfigDrawerProps> = ({
|
||||
setLocalValues(prev => ({...prev, [key]: value}));
|
||||
};
|
||||
|
||||
const handleFormChange = (key: string, value: any) => {
|
||||
setFormValues(prev => ({...prev, [key]: value}));
|
||||
};
|
||||
|
||||
const items: TabsProps['items'] = [
|
||||
nodeDefinition?.panelVariablesSchema && {
|
||||
key: 'panel',
|
||||
|
||||
@ -1271,7 +1271,6 @@ const WorkflowDesign: React.FC = () => {
|
||||
});
|
||||
|
||||
const edges = graph.getEdges().map(edge => {
|
||||
const sourceNode = graph.getCellById(edge.getSourceCellId());
|
||||
const condition = edge.getProp('condition');
|
||||
const vertices = edge.getVertices(); // 获取边的顶点信息
|
||||
|
||||
|
||||
@ -140,7 +140,7 @@ const WorkflowDefinitionList: React.FC = () => {
|
||||
key: 'category',
|
||||
render: (category: string) => {
|
||||
const categoryInfo = categories.find(c => c.code === category);
|
||||
return categoryInfo?.lable || category;
|
||||
return categoryInfo?.label || category;
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Modal, Table, Tag, Button, Space } from 'antd';
|
||||
import { Modal, Table, Tag, Button } from 'antd';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import { WorkflowHistoricalInstance } from '../types';
|
||||
import { getHistoricalInstances } from '../service';
|
||||
|
||||
@ -9,7 +9,7 @@ import HistoryModal from './components/HistoryModal';
|
||||
|
||||
const WorkflowInstanceList: React.FC = () => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [data, setData] = useState<Page<WorkflowTemplateWithInstances[]>>([]);
|
||||
const [data, setData] = useState<Page<WorkflowTemplateWithInstances[]>>(null);
|
||||
const [query, setQuery] = useState({
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
@ -35,11 +35,6 @@ const WorkflowInstanceList: React.FC = () => {
|
||||
loadData(query);
|
||||
}, [query]);
|
||||
|
||||
const handleViewDetail = (record: WorkflowTemplateWithInstances) => {
|
||||
setSelectedInstance(record);
|
||||
setDetailVisible(true);
|
||||
};
|
||||
|
||||
const handleViewHistory = (record: WorkflowTemplateWithInstances) => {
|
||||
setSelectedWorkflowDefinitionId(record.id);
|
||||
setHistoryVisible(true);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Card, Row, Col, Statistic, Table, Tag, Space } from 'antd';
|
||||
import { PieChart, Pie, Cell, ResponsiveContainer, Tooltip, Legend } from 'recharts';
|
||||
import {Card, Row, Col, Statistic, Table, Tag, Space} from 'antd';
|
||||
import {PieChart, Pie, Cell, ResponsiveContainer, Tooltip, Legend} from 'recharts';
|
||||
|
||||
// Mock 数据
|
||||
const mockStatistics = {
|
||||
@ -11,10 +11,10 @@ const mockStatistics = {
|
||||
};
|
||||
|
||||
const mockStatusDistribution = [
|
||||
{ name: '运行中', value: 23, color: '#1890ff', percent: '1.8%' },
|
||||
{ name: '已完成', value: 892, color: '#52c41a', percent: '71.0%' },
|
||||
{ name: '失败', value: 45, color: '#ff4d4f', percent: '3.6%' },
|
||||
{ name: '已终止', value: 296, color: '#faad14', percent: '23.6%' }
|
||||
{name: '运行中', value: 23, color: '#1890ff', percent: '1.8%'},
|
||||
{name: '已完成', value: 892, color: '#52c41a', percent: '71.0%'},
|
||||
{name: '失败', value: 45, color: '#ff4d4f', percent: '3.6%'},
|
||||
{name: '已终止', value: 296, color: '#faad14', percent: '23.6%'}
|
||||
];
|
||||
|
||||
const mockRecentExecutions = [
|
||||
@ -47,12 +47,12 @@ const mockRecentExecutions = [
|
||||
const WorkflowMonitor: React.FC = () => {
|
||||
const getStatusTag = (status: string) => {
|
||||
const statusMap: Record<string, { color: string; text: string }> = {
|
||||
COMPLETED: { color: 'success', text: '已完成' },
|
||||
RUNNING: { color: 'processing', text: '运行中' },
|
||||
FAILED: { color: 'error', text: '失败' },
|
||||
TERMINATED: { color: 'warning', text: '已终止' }
|
||||
COMPLETED: {color: 'success', text: '已完成'},
|
||||
RUNNING: {color: 'processing', text: '运行中'},
|
||||
FAILED: {color: 'error', text: '失败'},
|
||||
TERMINATED: {color: 'warning', text: '已终止'}
|
||||
};
|
||||
const statusInfo = statusMap[status] || { color: 'default', text: status };
|
||||
const statusInfo = statusMap[status] || {color: 'default', text: status};
|
||||
return <Tag color={statusInfo.color}>{statusInfo.text}</Tag>;
|
||||
};
|
||||
|
||||
@ -81,7 +81,7 @@ const WorkflowMonitor: React.FC = () => {
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
render: (_, record: any) => (
|
||||
render: (record: any) => (
|
||||
<Space size="middle">
|
||||
<a onClick={() => console.log('查看详情', record)}>查看详情</a>
|
||||
{record.status === 'RUNNING' && (
|
||||
@ -92,7 +92,7 @@ const WorkflowMonitor: React.FC = () => {
|
||||
}
|
||||
];
|
||||
|
||||
const CustomTooltip = ({ active, payload }: any) => {
|
||||
const CustomTooltip = ({active, payload}: any) => {
|
||||
if (active && payload && payload.length) {
|
||||
const data = payload[0].payload;
|
||||
return (
|
||||
@ -115,7 +115,7 @@ const WorkflowMonitor: React.FC = () => {
|
||||
<Statistic
|
||||
title="总流程实例"
|
||||
value={mockStatistics.totalInstances}
|
||||
valueStyle={{ color: '#1890ff' }}
|
||||
valueStyle={{color: '#1890ff'}}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
@ -124,7 +124,7 @@ const WorkflowMonitor: React.FC = () => {
|
||||
<Statistic
|
||||
title="运行中实例"
|
||||
value={mockStatistics.runningInstances}
|
||||
valueStyle={{ color: '#52c41a' }}
|
||||
valueStyle={{color: '#52c41a'}}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
@ -133,7 +133,7 @@ const WorkflowMonitor: React.FC = () => {
|
||||
<Statistic
|
||||
title="今日完成"
|
||||
value={mockStatistics.completedToday}
|
||||
valueStyle={{ color: '#1890ff' }}
|
||||
valueStyle={{color: '#1890ff'}}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
@ -142,7 +142,7 @@ const WorkflowMonitor: React.FC = () => {
|
||||
<Statistic
|
||||
title="今日失败"
|
||||
value={mockStatistics.failedToday}
|
||||
valueStyle={{ color: '#ff4d4f' }}
|
||||
valueStyle={{color: '#ff4d4f'}}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
@ -152,7 +152,7 @@ const WorkflowMonitor: React.FC = () => {
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<Card title="状态分布">
|
||||
<div style={{ height: 300 }}>
|
||||
<div style={{height: 300}}>
|
||||
<ResponsiveContainer width="100%" height="100%">
|
||||
<PieChart>
|
||||
<Pie
|
||||
@ -163,15 +163,15 @@ const WorkflowMonitor: React.FC = () => {
|
||||
outerRadius={80}
|
||||
paddingAngle={5}
|
||||
dataKey="value"
|
||||
label={({ name, percent }) => `${name} ${(percent * 100).toFixed(1)}%`}
|
||||
label={({name, percent}) => `${name} ${(percent * 100).toFixed(1)}%`}
|
||||
labelLine={true}
|
||||
>
|
||||
{mockStatusDistribution.map((entry, index) => (
|
||||
<Cell key={index} fill={entry.color} />
|
||||
<Cell key={index} fill={entry.color}/>
|
||||
))}
|
||||
</Pie>
|
||||
<Tooltip content={<CustomTooltip />} />
|
||||
<Legend />
|
||||
<Tooltip content={<CustomTooltip/>}/>
|
||||
<Legend/>
|
||||
</PieChart>
|
||||
</ResponsiveContainer>
|
||||
</div>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import React, {useState, useEffect} from 'react';
|
||||
import {PageContainer} from '@ant-design/pro-layout';
|
||||
import {Button, Card, Form, Input, InputNumber, Select, Switch, Space, Menu, Tabs, Row, Col, message, ColorPicker} from 'antd';
|
||||
import {Button, Card, Form, Input, InputNumber, Select, Switch, Tabs, Row, Col, message, ColorPicker} from 'antd';
|
||||
import type {NodeDesignDataResponse} from './types';
|
||||
import * as service from './service';
|
||||
import {useParams} from 'react-router-dom';
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { PageContainer } from '@/components/ui/page-container';
|
||||
import { PlusOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||
import { NodeTypeEnum, type NodeDesignDataResponse } from './types';
|
||||
import React, {useState, useEffect} from 'react';
|
||||
import {useNavigate} from 'react-router-dom';
|
||||
import {PageContainer} from '@/components/ui/page-container';
|
||||
import {PlusOutlined, DeleteOutlined} from '@ant-design/icons';
|
||||
import {NodeTypeEnum, type NodeDesignDataResponse} from './types';
|
||||
import * as service from './service';
|
||||
import {
|
||||
Table,
|
||||
@ -18,9 +18,9 @@ import {
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { useToast } from "@/components/ui/use-toast";
|
||||
import {Button} from "@/components/ui/button";
|
||||
import {Badge} from "@/components/ui/badge";
|
||||
import {useToast} from "@/components/ui/use-toast";
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
@ -32,7 +32,7 @@ import {
|
||||
AlertDialogTitle,
|
||||
AlertDialogTrigger,
|
||||
} from "@/components/ui/alert-dialog";
|
||||
import { DataTablePagination } from "@/components/ui/pagination";
|
||||
import {DataTablePagination} from "@/components/ui/pagination";
|
||||
|
||||
// 节点类型标签样式映射
|
||||
const nodeTypeStyles = {
|
||||
@ -63,19 +63,19 @@ const NodeDesignList: React.FC = () => {
|
||||
const [detailVisible, setDetailVisible] = useState(false);
|
||||
const [currentNode, setCurrentNode] = useState<NodeDesignDataResponse>();
|
||||
const [list, setList] = useState<NodeDesignDataResponse[]>([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [setLoading] = useState(false);
|
||||
const [pagination, setPagination] = useState({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
totalElements: 0,
|
||||
});
|
||||
const { toast } = useToast();
|
||||
const {toast} = useToast();
|
||||
|
||||
const loadData = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const response = await service.getNodeDefinitions({
|
||||
current: pagination.pageNum,
|
||||
pageNum: pagination.pageNum,
|
||||
pageSize: pagination.pageSize,
|
||||
});
|
||||
setList(response.content || []);
|
||||
@ -127,7 +127,7 @@ const NodeDesignList: React.FC = () => {
|
||||
accessorKey: 'nodeCode',
|
||||
header: '节点编码',
|
||||
size: 180,
|
||||
cell: ({ row }) => (
|
||||
cell: ({row}) => (
|
||||
<div className="font-medium">{row.original.nodeCode}</div>
|
||||
),
|
||||
},
|
||||
@ -140,7 +140,7 @@ const NodeDesignList: React.FC = () => {
|
||||
accessorKey: 'nodeType',
|
||||
header: '节点类型',
|
||||
size: 120,
|
||||
cell: ({ row }) => {
|
||||
cell: ({row}) => {
|
||||
const style = nodeTypeStyles[row.original.nodeType as NodeTypeEnum] || {
|
||||
variant: 'secondary' as const,
|
||||
label: row.original.nodeType || '未知类型'
|
||||
@ -156,7 +156,7 @@ const NodeDesignList: React.FC = () => {
|
||||
accessorKey: 'panelVariablesSchema',
|
||||
header: '面板变量',
|
||||
size: 100,
|
||||
cell: ({ row }) => (
|
||||
cell: ({row}) => (
|
||||
<Badge variant={row.original.panelVariablesSchema ? "outline" : "secondary"}>
|
||||
{row.original.panelVariablesSchema ? '已配置' : '未配置'}
|
||||
</Badge>
|
||||
@ -166,7 +166,7 @@ const NodeDesignList: React.FC = () => {
|
||||
accessorKey: 'localVariablesSchema',
|
||||
header: '本地变量',
|
||||
size: 100,
|
||||
cell: ({ row }) => (
|
||||
cell: ({row}) => (
|
||||
<Badge variant={row.original.localVariablesSchema ? "outline" : "secondary"}>
|
||||
{row.original.localVariablesSchema ? '已配置' : '未配置'}
|
||||
</Badge>
|
||||
@ -176,7 +176,7 @@ const NodeDesignList: React.FC = () => {
|
||||
accessorKey: 'formVariablesSchema',
|
||||
header: '表单变量',
|
||||
size: 100,
|
||||
cell: ({ row }) => (
|
||||
cell: ({row}) => (
|
||||
<Badge variant={row.original.formVariablesSchema ? "outline" : "secondary"}>
|
||||
{row.original.formVariablesSchema ? '已配置' : '未配置'}
|
||||
</Badge>
|
||||
@ -186,7 +186,7 @@ const NodeDesignList: React.FC = () => {
|
||||
id: 'actions',
|
||||
header: '操作',
|
||||
size: 180,
|
||||
cell: ({ row }) => (
|
||||
cell: ({row}) => (
|
||||
<div className="flex items-center gap-2">
|
||||
<Button
|
||||
variant="ghost"
|
||||
@ -212,7 +212,7 @@ const NodeDesignList: React.FC = () => {
|
||||
size="sm"
|
||||
className="text-destructive"
|
||||
>
|
||||
<DeleteOutlined className="mr-1" />
|
||||
<DeleteOutlined className="mr-1"/>
|
||||
删除
|
||||
</Button>
|
||||
</AlertDialogTrigger>
|
||||
@ -244,7 +244,7 @@ const NodeDesignList: React.FC = () => {
|
||||
<div className="flex items-center justify-between">
|
||||
<h2 className="text-3xl font-bold tracking-tight">节点管理</h2>
|
||||
<Button onClick={() => navigate('/workflow/node-design/create')}>
|
||||
<PlusOutlined className="mr-1" />
|
||||
<PlusOutlined className="mr-1"/>
|
||||
新建节点
|
||||
</Button>
|
||||
</div>
|
||||
@ -261,7 +261,7 @@ const NodeDesignList: React.FC = () => {
|
||||
{columns.map((column) => (
|
||||
<TableHead
|
||||
key={column.accessorKey || column.id}
|
||||
style={{ width: column.size }}
|
||||
style={{width: column.size}}
|
||||
>
|
||||
{column.header}
|
||||
</TableHead>
|
||||
@ -276,7 +276,7 @@ const NodeDesignList: React.FC = () => {
|
||||
key={column.accessorKey || column.id}
|
||||
>
|
||||
{column.cell
|
||||
? column.cell({ row: { original: item } })
|
||||
? column.cell({row: {original: item}})
|
||||
: item[column.accessorKey!]}
|
||||
</TableCell>
|
||||
))}
|
||||
|
||||
@ -79,6 +79,7 @@ export interface NodeDesignDataResponse extends BaseResponse {
|
||||
description: string;
|
||||
panelVariablesSchema: NodeVariablesSchema | null;
|
||||
localVariablesSchema: NodeVariablesSchema | null;
|
||||
formVariablesSchema: NodeVariablesSchema | null;
|
||||
uiVariables: UIVariables;
|
||||
}
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"include": ["src"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user