- 修复路由守卫:未登录时直接跳转,不显示提示信息 - 修复API拦截器:401错误直接跳转,无需确认 - 移除不必要的ElMessageBox确认框 - 优化Token过期处理逻辑 - 修复文件管理API引入路径和URL前缀 - 修复调拨/回收管理API端点不匹配问题 - 修复通知管理API方法不匹配问题 - 统一系统配置API路径为单数形式 影响文件: - src/router/index.ts - src/api/request.ts - src/api/file.ts - src/api/index.ts 测试状态: - 前端构建通过 - 所有API路径已验证 - 登录流程测试通过 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
194 lines
3.7 KiB
TypeScript
194 lines
3.7 KiB
TypeScript
/**
|
|
* 图表相关类型定义
|
|
*/
|
|
|
|
import type { EChartOption } from 'echarts'
|
|
|
|
/** 图表数据项 */
|
|
export interface ChartDataItem {
|
|
name: string
|
|
value: number
|
|
[key: string]: any
|
|
}
|
|
|
|
/** 图表系列数据 */
|
|
export interface ChartSeries {
|
|
name: string
|
|
data: number[]
|
|
color?: string
|
|
[key: string]: any
|
|
}
|
|
|
|
/** 饼图配置 */
|
|
export interface PieChartConfig {
|
|
data: ChartDataItem[]
|
|
title?: string
|
|
type?: 'pie' | 'doughnut'
|
|
showLegend?: boolean
|
|
showLabel?: boolean
|
|
height?: string
|
|
onClick?: (item: ChartDataItem) => void
|
|
}
|
|
|
|
/** 柱状图配置 */
|
|
export interface BarChartConfig {
|
|
data: ChartDataItem[]
|
|
title?: string
|
|
type?: 'vertical' | 'horizontal'
|
|
stacked?: boolean
|
|
grouped?: boolean
|
|
xAxisLabel?: string
|
|
yAxisLabel?: string
|
|
height?: string
|
|
onClick?: (item: ChartDataItem) => void
|
|
}
|
|
|
|
/** 折线图配置 */
|
|
export interface LineChartConfig {
|
|
data: ChartDataItem[]
|
|
series?: ChartSeries[]
|
|
title?: string
|
|
area?: boolean
|
|
smooth?: boolean
|
|
xAxisLabel?: string
|
|
yAxisLabel?: string
|
|
height?: string
|
|
onClick?: (item: ChartDataItem) => void
|
|
}
|
|
|
|
/** 仪表盘配置 */
|
|
export interface GaugeChartConfig {
|
|
value: number
|
|
min?: number
|
|
max?: number
|
|
title?: string
|
|
unit?: string
|
|
height?: string
|
|
color?: string[]
|
|
}
|
|
|
|
/** 漏斗图配置 */
|
|
export interface FunnelChartConfig {
|
|
data: ChartDataItem[]
|
|
title?: string
|
|
height?: string
|
|
onClick?: (item: ChartDataItem) => void
|
|
}
|
|
|
|
/** 统计卡片配置 */
|
|
export interface StatCardConfig {
|
|
title: string
|
|
value: number | string
|
|
unit?: string
|
|
icon?: string
|
|
trend?: 'up' | 'down' | 'flat'
|
|
trendValue?: number
|
|
color?: string
|
|
loading?: boolean
|
|
clickable?: boolean
|
|
onClick?: () => void
|
|
}
|
|
|
|
/** 图表主题 */
|
|
export type ChartTheme = 'default' | 'dark' | 'custom'
|
|
|
|
/** 图表尺寸 */
|
|
export type ChartSize = 'small' | 'medium' | 'large'
|
|
|
|
/** 图表事件 */
|
|
export interface ChartEvents {
|
|
onClick?: (params: any) => void
|
|
onDoubleClick?: (params: any) => void
|
|
onMouseOver?: (params: any) => void
|
|
onMouseOut?: (params: any) => void
|
|
}
|
|
|
|
/** 资产状态统计 */
|
|
export interface AssetStatusStatistics {
|
|
status: string
|
|
statusName: string
|
|
count: number
|
|
percentage: number
|
|
color: string
|
|
}
|
|
|
|
/** 资产分布统计 */
|
|
export interface AssetDistributionStatistics {
|
|
organizationId: number
|
|
organizationName: string
|
|
count: number
|
|
value: number
|
|
percentage: number
|
|
}
|
|
|
|
/** 资产趋势数据 */
|
|
export interface AssetTrendData {
|
|
date: string
|
|
count: number
|
|
value: number
|
|
depreciation?: number
|
|
netValue?: number
|
|
}
|
|
|
|
/** 资产类型统计 */
|
|
export interface AssetTypeStatistics {
|
|
deviceTypeId: number
|
|
typeName: string
|
|
count: number
|
|
value: number
|
|
percentage: number
|
|
icon?: string
|
|
}
|
|
|
|
/** 维修统计 */
|
|
export interface MaintenanceStatistics {
|
|
date: string
|
|
count: number
|
|
cost: number
|
|
completedCount: number
|
|
pendingCount: number
|
|
}
|
|
|
|
/** 图表导出配置 */
|
|
export interface ChartExportConfig {
|
|
filename?: string
|
|
type?: 'png' | 'jpeg' | 'svg'
|
|
quality?: number
|
|
pixelRatio?: number
|
|
backgroundColor?: string
|
|
}
|
|
|
|
/** 图表响应式配置 */
|
|
export interface ChartResponsiveConfig {
|
|
width?: number | string
|
|
height?: number | string
|
|
autoResize?: boolean
|
|
resizeDelay?: number
|
|
}
|
|
|
|
/** 图表加载状态 */
|
|
export interface ChartLoadingConfig {
|
|
show?: boolean
|
|
text?: string
|
|
color?: string
|
|
textColor?: string
|
|
maskColor?: string
|
|
zlevel?: number
|
|
}
|
|
|
|
/** 图表动画配置 */
|
|
export interface ChartAnimationConfig {
|
|
enable?: boolean
|
|
duration?: number
|
|
easing?: string
|
|
delay?: number
|
|
}
|
|
|
|
/** 图表性能配置 */
|
|
export interface ChartPerformanceConfig {
|
|
progressive?: number
|
|
progressiveThreshold?: number
|
|
hoverLayerThreshold?: number
|
|
useUTC?: boolean
|
|
}
|