From 0c09ac21012250cb7eda6c2938a2a4e31e3e2b7a Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期三, 09 九月 2026 10:13:34 +0800
Subject: [PATCH] 移除首页刷新按钮
---
tests/refinement.ui.test.mjs | 2 +-
src/views/Dashboard.vue | 6 ++----
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue
index 79ec58a..b1e1752 100644
--- a/src/views/Dashboard.vue
+++ b/src/views/Dashboard.vue
@@ -16,13 +16,13 @@
const router = useRouter()
const activeTab = ref('running'); const chartPeriod = ref<'week' | 'month' | 'year'>('week')
const { snapshot, load: loadDashboard } = useDashboard()
-const dashboardError = ref(''); const todoError = ref(''); const loading = ref(false)
+const dashboardError = ref(''); const todoError = ref('')
const { records: todoRecords, load: loadTodos } = useTodos()
const permissions = ref<string[]>([])
const has = (permission: string) => permissions.value.includes('*:*:*') || permissions.value.includes(permission)
const displayName = computed(() => getCurrentUser()?.displayName || getCurrentUser()?.username || '')
async function loadPage() {
- loading.value = true; dashboardError.value = ''; todoError.value = ''
+ dashboardError.value = ''; todoError.value = ''
try {
permissions.value = (await getUserInfo()).permissions || []
const results = await Promise.allSettled([loadDashboard(), has('todo:list:query') || has('todo:list:list') ? loadTodos() : Promise.resolve()])
@@ -30,7 +30,6 @@
if (main.status === 'rejected') dashboardError.value = main.reason instanceof Error ? main.reason.message : '首页数据加载失败'
if (todos.status === 'rejected') todoError.value = todos.reason instanceof Error ? todos.reason.message : '待办加载失败'
} catch (error) { clearTodos(); clearDashboard(); dashboardError.value = error instanceof Error ? error.message : '首页加载失败' }
- finally { loading.value = false }
}
onMounted(loadPage)
const testFilterVisible = ref(false); const testType = ref('全部'); const testTypeDraft = ref('全部')
@@ -69,7 +68,6 @@
<template>
<div class="dashboard">
<el-alert v-if="dashboardError" :title="dashboardError" type="error" :closable="false" show-icon />
- <el-button :loading="loading" @click="loadPage">刷新</el-button>
<section class="welcome-row">
<div>
<h2>欢迎回来,{{ displayName }}</h2>
diff --git a/tests/refinement.ui.test.mjs b/tests/refinement.ui.test.mjs
index 42e3079..c069897 100644
--- a/tests/refinement.ui.test.mjs
+++ b/tests/refinement.ui.test.mjs
@@ -62,7 +62,7 @@
await expect(page.locator('.notification-drawer')).not.toBeVisible()
await page.screenshot({path:resolve(artifacts,'dashboard-desktop.png'),fullPage:true})
dashboardFails=true
- await page.getByRole('button',{name:'刷新',exact:true}).click()
+ await page.reload()
await expect(page.getByText('统计查询失败')).toBeVisible()
await expect(page.locator('.metrics')).not.toContainText('1001')
dashboardFails=false
--
Gitblit v1.7.1