feat: 本次提交更新内容如下

样式和功能补齐
This commit is contained in:
笔记本里的永平
2025-07-10 11:50:34 +08:00
parent b4797425fc
commit 2c1e0ab7ac
7 changed files with 68 additions and 29 deletions

View File

@@ -162,7 +162,7 @@ export default function MomentsSyncDetail() {
</div>
<div className="flex items-center justify-between">
<span className="text-gray-600"></span>
<span className="font-medium">{task.creator}</span>
<span className="font-medium">{task.creatorName}</span>
</div>
</div>
</div>

View File

@@ -107,7 +107,7 @@ export default function MomentsSync() {
deviceCount: task.deviceCount || 0,
targetGroup: task.targetGroup || '默认人群',
syncCount: task.todaySyncCount || task.syncCount || 0,
creator: task.creator || '未知',
creatorName: task.creatorName || '未知',
lastSyncTime: task.lastSyncTime || '暂无',
createTime: task.createTime || '未知',
syncInterval: task.syncInterval || 30,
@@ -117,7 +117,7 @@ export default function MomentsSync() {
targetTags: task.targetTags || [],
syncMode: task.syncMode || 'auto',
filterKeywords: task.filterKeywords || [],
contentLib: task.contentLib || '默认内容库'
contentLib: task.config?.contentLibraryNames?.join(',') || '默认内容库'
}));
setTasks(mappedTasks);
} catch (error) {
@@ -301,11 +301,16 @@ export default function MomentsSync() {
<div className="grid grid-cols-2 gap-4 mb-4">
<div className="text-sm text-gray-500">
<div>{task.deviceCount} </div>
<div>{task.contentLib || '默认内容库'}</div>
<div className="flex">
<span className="flex-shrink-0"></span>
<span className="truncate" title={task.contentLib || '默认内容库'}>
{task.contentLib || '默认内容库'}
</span>
</div>
</div>
<div className="text-sm text-gray-500">
<div>{task.syncCount} </div>
<div>{task.creator}</div>
<div>{task.creatorName}</div>
</div>
</div>

View File

@@ -23,19 +23,38 @@ function StepIndicator({ currentStep }: StepIndicatorProps) {
];
return (
<div className="flex justify-between px-6 mb-8">
<div className="relative flex justify-between px-6 mb-8">
{/* 连线 - 背景线 */}
<div className="absolute top-5 left-0 right-0 h-[1px] bg-gray-200" style={{ width: '100%', zIndex: 0 }} />
{/* 连线 - 已完成线 */}
<div
className="absolute top-5 left-0 h-[1px] bg-blue-600 transition-all duration-300"
style={{
width: `${((currentStep - 1) / (steps.length - 1)) * 100}%`,
zIndex: 1
}}
/>
{/* 步骤圆圈 */}
{steps.map((step, index) => (
<div key={step.id} className="flex flex-col items-center">
<div key={step.id} className="flex flex-col items-center relative z-10">
<div
className={`w-10 h-10 rounded-full flex items-center justify-center mb-2 ${
currentStep === index + 1
? "bg-blue-600 text-white"
: "bg-white text-gray-400 border border-gray-200"
: index + 1 < currentStep
? "bg-blue-600 text-white"
: "bg-white text-gray-400 border border-gray-200"
}`}
>
{index + 1}
</div>
<div className={`text-sm ${currentStep === index + 1 ? "text-blue-600" : "text-gray-400"}`}>
<div className={`text-sm ${
currentStep === index + 1 || index + 1 < currentStep
? "text-blue-600"
: "text-gray-400"
}`}>
{step.title}
</div>
</div>

View File

@@ -1,4 +1,4 @@
import React, { useState, ChangeEvent } from 'react';
import React, { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import {
ChevronLeft,
@@ -92,7 +92,7 @@ function StepIndicator({ currentStep, steps }: StepIndicatorProps) {
return (
<div className="w-full mb-6 px-12">
<Steps current={currentStep} layout="horizontal">
{steps.map((step, index) => (
{steps.map((step, index) => (
<StepItem
key={step.id}
title={step.title}
@@ -102,7 +102,7 @@ function StepIndicator({ currentStep, steps }: StepIndicatorProps) {
index < currentStep ? 'finish' : 'default'
}
/>
))}
))}
</Steps>
</div>
);

View File

@@ -2,7 +2,6 @@ import React, { useState, useEffect, useRef } from 'react';
import { useNavigate } from 'react-router-dom';
import {
Plus,
Filter,
Search,
RefreshCw,
MoreVertical,
@@ -12,7 +11,6 @@ import {
Pause,
Play,
Users,
Share2,
} from 'lucide-react';
import { Card } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
@@ -85,6 +83,8 @@ export default function TrafficDistribution() {
navigate(`/workspace/traffic-distribution/${ruleId}`);
};
// 注释掉未使用的函数
/*
const handleCopy = async (ruleId: string) => {
const ruleToCopy = tasks.find((rule) => rule.id === ruleId);
if (ruleToCopy) {
@@ -106,6 +106,7 @@ export default function TrafficDistribution() {
}
}
};
*/
const toggleRuleStatus = async (ruleId: string) => {
const rule = tasks.find((r) => r.id === ruleId);
@@ -284,7 +285,7 @@ export default function TrafficDistribution() {
// 初始加载和搜索
useEffect(() => {
fetchData(1, searchTerm);
}, []);
}, [searchTerm]); // 添加依赖项
// 处理搜索
const handleSearch = () => {