fix(web): 修复 TypeScript 编译错误 — 10 处类型/未使用变量问题

- EntitySelect: 未使用的 searchFields 改为 _searchFields
- PluginKanbanPage: DragEndEvent/DragStartEvent 改为 type import, lane_order 改为 optional
- PluginDashboardPage: 添加 PluginPageSchema import, 移除未使用的 CHART_COLORS/palette/totalCount
- PluginGraphPage: 移除未使用的 Title/textColor, 修复 hovered → hoverState
This commit is contained in:
iven
2026-04-17 11:19:44 +08:00
parent 60799176ca
commit fb809f124c
4 changed files with 7 additions and 18 deletions

View File

@@ -15,7 +15,7 @@ import {
} from '@ant-design/icons';
import { Column, Pie, Funnel, Line } from '@ant-design/charts';
import { countPluginData, aggregatePluginData, type AggregateItem } from '../api/pluginData';
import { getPluginSchema, type PluginEntitySchema, type PluginSchemaResponse, type DashboardWidget } from '../api/plugins';
import { getPluginSchema, type PluginEntitySchema, type PluginSchemaResponse, type PluginPageSchema, type DashboardWidget } from '../api/plugins';
// ── 类型定义 ──
@@ -188,12 +188,10 @@ function SkeletonStatCard({ delay }: { delay: string }) {
function BreakdownCard({
breakdown,
totalCount,
palette,
index,
}: {
breakdown: FieldBreakdown;
totalCount: number;
palette: { tagColor: string };
index: number;
}) {
const maxCount = Math.max(...breakdown.items.map((i) => i.count), 1);
@@ -337,11 +335,6 @@ const WIDGET_ICON_MAP: Record<string, React.ReactNode> = {
line_chart: <LineChartOutlined />,
};
const CHART_COLORS = [
'#4F46E5', '#059669', '#D97706', '#E11D48', '#7C3AED',
'#2563EB', '#0891B2', '#C026D3', '#EA580C', '#65A30D',
];
interface WidgetData {
widget: DashboardWidget;
data: AggregateItem[];
@@ -751,7 +744,6 @@ export function PluginDashboardPage() {
setError(null);
try {
const totalCount = entityStats.find((s) => s.name === selectedEntity)?.count ?? 0;
const fieldResults: FieldBreakdown[] = [];
for (const field of filterableFields) {
@@ -951,7 +943,6 @@ export function PluginDashboardPage() {
key={bd.fieldName}
breakdown={bd}
totalCount={currentTotal}
palette={currentPalette}
index={i}
/>
))}