refactor(scheduling): remove 7日 客户日均 趋势徽章
详情页和列表里的 ↗ 7日 +X% / ↘ 7日 -X% 徽章移除,客户日均只保留 30 日均这一项。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { useState, useMemo } from 'react';
|
||||
import {
|
||||
X, MapPin, AlertTriangle, CheckCircle, ArrowDown, ArrowUp, ArrowRight, ArrowUpDown,
|
||||
TrendingUp, TrendingDown, Minus, Lock,
|
||||
X, MapPin, AlertTriangle, CheckCircle, ArrowDown, ArrowUp, ArrowRight, ArrowUpDown, Lock,
|
||||
} from 'lucide-react';
|
||||
import { motion } from 'motion/react';
|
||||
import type { SchedulingSuggestion, CandidateVehicle } from './types';
|
||||
@@ -189,27 +188,8 @@ export default function SuggestionDetail({ suggestion: s, onClose, onNotifySucce
|
||||
{v.manager && <span><b className="text-slate-700">{v.manager}</b></span>}
|
||||
{(v.department || v.manager) && <span className="text-slate-200">|</span>}
|
||||
<span>客户 <b className="text-slate-700"><Blur>{v.customer || '-'}</Blur></b></span>
|
||||
<span className="flex items-center gap-1">
|
||||
<span>
|
||||
30日均 <b className="text-slate-700">{Math.round(v.customerAvgDaily)}</b> km
|
||||
{v.customerAvgDaily > 0 && v.customerAvgDaily7d > 0 && (() => {
|
||||
const diff = (v.customerAvgDaily7d - v.customerAvgDaily) / v.customerAvgDaily;
|
||||
const pct = Math.round(diff * 100);
|
||||
if (diff >= 0.1) return (
|
||||
<span className="text-emerald-600 flex items-center gap-0.5" title={`7日均 ${Math.round(v.customerAvgDaily7d)} km`}>
|
||||
<TrendingUp size={10} /> 7日 +{pct}%
|
||||
</span>
|
||||
);
|
||||
if (diff <= -0.1) return (
|
||||
<span className="text-rose-500 flex items-center gap-0.5" title={`7日均 ${Math.round(v.customerAvgDaily7d)} km`}>
|
||||
<TrendingDown size={10} /> 7日 {pct}%
|
||||
</span>
|
||||
);
|
||||
return (
|
||||
<span className="text-slate-400 flex items-center gap-0.5" title={`7日均 ${Math.round(v.customerAvgDaily7d)} km`}>
|
||||
<Minus size={10} /> 7日平稳
|
||||
</span>
|
||||
);
|
||||
})()}
|
||||
</span>
|
||||
</div>
|
||||
{/* Metrics */}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState, useMemo } from 'react';
|
||||
import { ArrowRightLeft, ChevronRight, ArrowDown, ArrowUp, ArrowUpDown, CheckCircle, Check, TrendingUp, TrendingDown } from 'lucide-react';
|
||||
import { ArrowRightLeft, ChevronRight, ArrowDown, ArrowUp, ArrowUpDown, CheckCircle, Check } from 'lucide-react';
|
||||
import { motion } from 'motion/react';
|
||||
import type { SchedulingSuggestion } from './types';
|
||||
import Blur from '../../components/Blur';
|
||||
@@ -149,14 +149,8 @@ export default function SuggestionList({ suggestions, onSelect, selectMode = fal
|
||||
<span className="truncate"><Blur>{v.customer || '-'}</Blur></span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2 flex-shrink-0 ml-2">
|
||||
<span className="text-slate-500 flex items-center gap-0.5">
|
||||
<span className="text-slate-500">
|
||||
客户日均 <span className="text-slate-700 font-medium">{Math.round(v.customerAvgDaily)}</span> km
|
||||
{v.customerAvgDaily > 0 && v.customerAvgDaily7d > 0 && (() => {
|
||||
const diff = (v.customerAvgDaily7d - v.customerAvgDaily) / v.customerAvgDaily;
|
||||
if (diff >= 0.1) return <TrendingUp size={10} className="text-emerald-500" />;
|
||||
if (diff <= -0.1) return <TrendingDown size={10} className="text-rose-500" />;
|
||||
return null;
|
||||
})()}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user