diff --git a/src/frontend/admin/src/api/production.ts b/src/frontend/admin/src/api/production.ts index 0d2820a..1ec1c3b 100644 --- a/src/frontend/admin/src/api/production.ts +++ b/src/frontend/admin/src/api/production.ts @@ -72,5 +72,5 @@ export async function exportProductionData(params: ProductionQueryParams): Promi params, responseType: 'blob' }) - return response + return response as unknown as Blob } \ No newline at end of file diff --git a/src/frontend/admin/src/router/index.ts b/src/frontend/admin/src/router/index.ts index c7b686e..3a83f00 100644 --- a/src/frontend/admin/src/router/index.ts +++ b/src/frontend/admin/src/router/index.ts @@ -75,7 +75,7 @@ const router = createRouter({ routes }) -router.beforeEach((to, from, next) => { +router.beforeEach((to, _from, next) => { const authStore = useAuthStore() const requiresAuth = to.matched.some(record => record.meta.requiresAuth !== false) diff --git a/src/frontend/admin/src/stores/auth.ts b/src/frontend/admin/src/stores/auth.ts index e051157..2a27059 100644 --- a/src/frontend/admin/src/stores/auth.ts +++ b/src/frontend/admin/src/stores/auth.ts @@ -14,8 +14,8 @@ export const useAuthStore = defineStore('auth', () => { try { const response = await login(loginRequest) if (response.success) { - token.value = response.token - user.value = response.user + token.value = response.token ?? null + user.value = response.user ?? null permissions.value = response.permissions || [] localStorage.setItem('token', response.token || '') return { success: true, message: response.message } diff --git a/src/frontend/admin/src/views/Dashboard.vue b/src/frontend/admin/src/views/Dashboard.vue index 359dc78..257099c 100644 --- a/src/frontend/admin/src/views/Dashboard.vue +++ b/src/frontend/admin/src/views/Dashboard.vue @@ -13,7 +13,6 @@ const statistics = ref(null) const onlineCount = ref(0) const offlineCount = ref(0) -const runningCount = ref(0) const trendChart = ref(null) const statusChart = ref(null) diff --git a/src/frontend/admin/src/views/Layout.vue b/src/frontend/admin/src/views/Layout.vue index 3b30d21..8745367 100644 --- a/src/frontend/admin/src/views/Layout.vue +++ b/src/frontend/admin/src/views/Layout.vue @@ -25,16 +25,22 @@ function handleMenuSelect(index: string) { router.push(index) } -async function handleLogout() { +async function handleCommand(command: string) { try { - await ElMessageBox.confirm('确定要退出登录吗?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }) - await authStore.logoutAction() - ElMessage.success('已退出登录') - router.push('/login') + if (command === 'logout') { + await ElMessageBox.confirm('确定要退出登录吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }) + await authStore.logoutAction() + ElMessage.success('已退出登录') + router.push('/login') + } else if (command === 'profile') { + ElMessage.info('个人中心功能开发中') + } else if (command === 'password') { + ElMessage.info('修改密码功能开发中') + } } catch { // 用户取消 } diff --git a/src/frontend/admin/src/views/Statistics.vue b/src/frontend/admin/src/views/Statistics.vue index ae0caae..4ad819b 100644 --- a/src/frontend/admin/src/views/Statistics.vue +++ b/src/frontend/admin/src/views/Statistics.vue @@ -96,7 +96,7 @@ async function handleToggleEnabled(row: StatisticRule) { ElMessage.success(row.isEnabled ? '已启用' : '已禁用') } -async function handleDelete(row: StatisticRule) { +async function handleDelete(_row: StatisticRule) { ElMessage.success('删除成功') loadRules() } diff --git a/src/frontend/dashboard/src/App.vue b/src/frontend/dashboard/src/App.vue index eea6190..8781f0d 100644 --- a/src/frontend/dashboard/src/App.vue +++ b/src/frontend/dashboard/src/App.vue @@ -2,7 +2,6 @@ import { ref, onMounted, onUnmounted } from 'vue' import * as echarts from 'echarts' import * as signalR from '@microsoft/signalr' -import { ElMessage } from 'element-plus' const connection = ref(null) const refreshInterval = ref | null>(null) @@ -31,13 +30,6 @@ const trendData = ref({ online: [8, 9, 8, 9, 10, 8, 9] }) -const utilizationData = ref([ - { name: '运行中', value: 65 }, - { name: '空闲中', value: 15 }, - { name: '维护中', value: 10 }, - { name: '故障中', value: 10 } -]) - let statusChart: echarts.ECharts | null = null let trendChart: echarts.ECharts | null = null let utilizationChart: echarts.ECharts | null = null