import { useTheme } from '@/contexts/ThemeContext'; import { ActionListItem, TaskListItem, taskStatusList } from '@/pages/TaskManagement'; import { Bot, ChevronRight, Download, Edit, Eye, FileText, Layers, MoreHorizontal, Play, Search, User, Users, Workflow } from 'lucide-react'; import React, { useEffect, useRef, useState } from 'react'; import { PageType } from '../Sidebar'; import { format } from 'date-fns'; import { useNavigate } from 'react-router-dom'; import { Col, Empty, Pagination, Progress, Row } from 'tdesign-react'; import { requestCrudService } from '@/service/request-axios-service'; interface ActionColumnProps { TaskType?: string; title: string; category: string; subCategory: string; icon: string; columnIndex: number; columnName: string; actionCount: number; actionList: ActionListItem[]; } const service = requestCrudService; const zncmUrl = import.meta.env.VITE_API_BASE_URL || ''; export const ActionColumn: React.FC = ({ title, category, subCategory, icon, columnName, columnIndex, actionCount, actionList }) => { const { theme } = useTheme(); const isDark = theme === 'dark'; // 主题颜色变量 const cardBg = isDark ? 'bg-slate-800/30' : 'bg-white'; const cardBorder = isDark ? 'border-blue-800/30' : 'border-red-100'; const textPrimary = isDark ? 'text-white' : 'text-gray-900'; const textSecondary = isDark ? 'text-slate-400' : 'text-gray-600'; const textMuted = isDark ? 'text-slate-500' : 'text-gray-400'; const inputBg = isDark ? 'bg-slate-900/50' : 'bg-white'; const navigate = useNavigate(); const [searchQuery, setSearchQuery] = useState(''); // 当前页码,默认为第 1 页 const [pageNum, setPageNum] = useState(1); // 每页显示数量,默认为 10 条 const [pageSize, setPageSize] = useState(10); // 每页显示 10 条 const [total, setTotal] = useState(0); // 查询任务总数 const state = useRef({ pageIndex: 1, pageSize: 10 }) /** * 页码变化时的回调函数 * 当用户切换页码时触发,更新页码并重新获取数据 * @param value - 新的页码值 */ const pageIndexChange = async (value: number) => { // 更新 ref 中存储的页码值 // 更新页码状态,触发组件重新渲染 setPageNum(value); state.current.pageIndex = value; } const actionRouterChange = (item: ActionListItem) => { if (item.actionStatus !== 0) { window.open(`https://ch1.b.uat.4.cn/web/#/action/item-aiceh/step-analysis-three?id=${item.id}`); } else { window.open(`https://ch1.b.uat.4.cn/web/#/action/item-aiceh/step-action-topic?id=${item.id}&isPassApply=false`); } } return (
{columnName} {actionCount}
{ actionList.map((item: ActionListItem, index: number) => (
actionRouterChange(item)}>
{ item.actionName }
{item.level === 1 ? '主要行动' : '次要行动'}
{item.deptName} { item.actionStatus === 0 ? XD签收 : 开始CEH }
)) } { actionList.length === 0 && } /> }
); }