fix: 修复前端登录体验和API调用问题
- 修复路由守卫:未登录时直接跳转,不显示提示信息 - 修复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>
This commit is contained in:
70
src/components/charts/business/AssetStatusChart.vue
Normal file
70
src/components/charts/business/AssetStatusChart.vue
Normal file
@@ -0,0 +1,70 @@
|
||||
<!--
|
||||
资产状态图组件
|
||||
展示8种资产状态分布
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="asset-status-chart">
|
||||
<PieChart
|
||||
:data="chartData"
|
||||
title="资产状态分布"
|
||||
type="doughnut"
|
||||
:show-legend="true"
|
||||
:show-label="true"
|
||||
height="400px"
|
||||
:custom-color="true"
|
||||
@click="handleClick"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import PieChart from '../PieChart.vue'
|
||||
import { assetStatusNames, assetStatusColors, formatPercentage } from '@/utils/echarts'
|
||||
import type { AssetStatusStatistics } from '@/types/charts'
|
||||
|
||||
/** Props */
|
||||
interface Props {
|
||||
data: AssetStatusStatistics[]
|
||||
loading?: boolean
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
data: () => [],
|
||||
loading: false,
|
||||
})
|
||||
|
||||
/** Emits */
|
||||
interface Emits {
|
||||
(e: 'click', item: AssetStatusStatistics): void
|
||||
}
|
||||
|
||||
const emit = defineEmits<Emits>()
|
||||
|
||||
/** 图表数据 */
|
||||
const chartData = computed(() => {
|
||||
return props.data.map(item => ({
|
||||
name: item.statusName || assetStatusNames[item.status],
|
||||
value: item.count,
|
||||
status: item.status,
|
||||
percentage: item.percentage,
|
||||
color: item.color || assetStatusColors[item.status],
|
||||
}))
|
||||
})
|
||||
|
||||
/** 处理点击 */
|
||||
const handleClick = (item: any) => {
|
||||
const statusItem = props.data.find(d => d.status === item.status)
|
||||
if (statusItem) {
|
||||
emit('click', statusItem)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.asset-status-chart {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user