diff --git a/mobile-uni/src/components/StateBlock.vue b/mobile-uni/src/components/StateBlock.vue new file mode 100644 index 00000000..aa266890 --- /dev/null +++ b/mobile-uni/src/components/StateBlock.vue @@ -0,0 +1,253 @@ + + + + + diff --git a/mobile-uni/src/pages/supervisor/assign/index.vue b/mobile-uni/src/pages/supervisor/assign/index.vue index 4d88e0bd..d632573a 100644 --- a/mobile-uni/src/pages/supervisor/assign/index.vue +++ b/mobile-uni/src/pages/supervisor/assign/index.vue @@ -10,14 +10,14 @@ {{ message }} - - 无主管权限 - 当前账号不是主管或项目经理,无法查看团队训练数据。 - - - - - + @@ -189,6 +189,7 @@ import { clearAuth, getAuth, isLoggedIn, rememberLoginRedirect } from '@/service import { resetPageScroll } from '@/services/navigation'; import { createPracticeAssignmentsBatch, getPracticeAlerts, getPracticeScenarios, getPracticeTeamSnapshot } from '@/services/practice'; import SupervisorTabBar from '@/components/SupervisorTabBar.vue'; +import StateBlock from '@/components/StateBlock.vue'; import { createAsyncGenerationGuard, inferSupervisorScenarioId, diff --git a/mobile-uni/src/pages/supervisor/assign/result.vue b/mobile-uni/src/pages/supervisor/assign/result.vue index 3481a9ce..5fd94400 100644 --- a/mobile-uni/src/pages/supervisor/assign/result.vue +++ b/mobile-uni/src/pages/supervisor/assign/result.vue @@ -80,10 +80,14 @@ - - 暂无本次派发结果,请先在指派页完成派发。 - - + @@ -94,6 +98,7 @@ import { computed, ref } from 'vue'; import { onShow } from '@dcloudio/uni-app'; import { resetPageScroll } from '@/services/navigation'; import SupervisorTabBar from '@/components/SupervisorTabBar.vue'; +import StateBlock from '@/components/StateBlock.vue'; interface AssignResultItem { extPartyId: string; @@ -451,14 +456,4 @@ onShow(() => { background: #ffffff; color: var(--brand); } - -.empty-panel { - margin-top: 16px; - text-align: center; -} - -.empty-action { - width: 100%; - margin-top: 14px; -} diff --git a/mobile-uni/src/pages/supervisor/exams/index.vue b/mobile-uni/src/pages/supervisor/exams/index.vue index bd918d24..28c9c8e0 100644 --- a/mobile-uni/src/pages/supervisor/exams/index.vue +++ b/mobile-uni/src/pages/supervisor/exams/index.vue @@ -12,7 +12,7 @@ + 新建考试 - {{ message }} + {{ message }} @@ -40,7 +40,8 @@ >{{ tab.label }} - 考试列表加载中… + + - {{ emptyLabel }} + @@ -75,6 +76,7 @@ import { onShow } from '@dcloudio/uni-app'; import type { ExamSummary } from '@/types/api'; import { listSupervisorExams } from '@/services/exam'; import SupervisorTabBar from '@/components/SupervisorTabBar.vue'; +import StateBlock from '@/components/StateBlock.vue'; type ExamStateKey = 'active' | 'draft' | 'ended'; @@ -111,6 +113,7 @@ const filteredExams = computed(() => (statusFilter.value === 'all' : exams.value.filter((item) => examState(item).key === statusFilter.value))); const emptyLabel = computed(() => (statusFilter.value === 'all' ? '暂无考试,先创建岗位题目并派发。' : '当前状态下暂无考试')); +const loadFailed = computed(() => !loading.value && !!message.value && !exams.value.length); const dueDateLabel = (value?: string | null) => { const due = value?.slice(0, 10) || ''; diff --git a/mobile-uni/src/pages/supervisor/exams/results.vue b/mobile-uni/src/pages/supervisor/exams/results.vue index af77d7ee..ed389a43 100644 --- a/mobile-uni/src/pages/supervisor/exams/results.vue +++ b/mobile-uni/src/pages/supervisor/exams/results.vue @@ -9,7 +9,7 @@ - {{ message }} + {{ message }} {{ examTitle }} @@ -47,7 +47,9 @@ >{{ tab.label }} - + + + @@ -60,9 +62,7 @@ {{ statusLabel(item) }} - - 暂无符合筛选的派发结果 - + @@ -73,6 +73,7 @@ import { onLoad } from '@dcloudio/uni-app'; import type { ExamResultItem } from '@/types/api'; import { getSupervisorExam, getSupervisorExamResults } from '@/services/exam'; import SupervisorTabBar from '@/components/SupervisorTabBar.vue'; +import StateBlock from '@/components/StateBlock.vue'; type ResultFilter = 'all' | 'passed' | 'failed' | 'pending'; @@ -103,6 +104,8 @@ const filteredResults = computed(() => results.value.filter((item) => { if (resultFilter.value === 'pending') return isPending(item); return true; })); +const loadFailed = computed(() => !loading.value && !!message.value && !results.value.length); +const firstLoading = computed(() => loading.value && !results.value.length && !message.value); const statusLabel = (item: ExamResultItem) => (isPending(item) ? '未完成' : isPassed(item) ? '通过' : '未通过'); const statusClass = (item: ExamResultItem) => (isPending(item) ? 'pending' : isPassed(item) ? 'passed' : 'failed'); @@ -386,8 +389,4 @@ onLoad((options) => { background: #f1f5f9; color: #64748b; } - -.empty-panel { - margin-top: 12px; -} diff --git a/mobile-uni/src/pages/supervisor/index/index.vue b/mobile-uni/src/pages/supervisor/index/index.vue index a655b467..88ce14e5 100644 --- a/mobile-uni/src/pages/supervisor/index/index.vue +++ b/mobile-uni/src/pages/supervisor/index/index.vue @@ -22,16 +22,16 @@ - {{ message }} + {{ message }} - - 无主管权限 - 当前账号不是主管或项目经理,无法查看团队训练数据。 - - - - - + - {{ message }} + {{ message }} - - 无主管权限 - 当前账号不是主管或项目经理,无法查看团队训练数据。 - - - - - + @@ -86,6 +89,7 @@ import { authenticatedFileUrl, releaseAuthenticatedFileUrl } from '@/services/ap import { isLoggedIn, rememberLoginRedirect } from '@/services/auth'; import { getPracticeHistoryDetail } from '@/services/practice'; import { resetPageScroll } from '@/services/navigation'; +import StateBlock from '@/components/StateBlock.vue'; const detail = ref(null); const reviewId = ref(0); @@ -335,13 +339,11 @@ onUnload(releaseAudio); color: #fff; } -.login-panel, -.empty-panel { +.login-panel { text-align: center; } -.login-button, -.empty-panel button { +.login-button { margin-top: 14px; } diff --git a/mobile-uni/src/styles/base.css b/mobile-uni/src/styles/base.css index 99899cd4..14814d66 100644 --- a/mobile-uni/src/styles/base.css +++ b/mobile-uni/src/styles/base.css @@ -293,31 +293,6 @@ textarea:focus-visible { line-height: 1.5; } -.supervisor-access-panel { - border-left: 4px solid var(--brand); -} - -.supervisor-access-copy { - display: block; - margin-top: 8px; - font-size: 14px; - line-height: 1.6; -} - -.supervisor-access-actions { - display: grid; - margin-top: 18px; - grid-template-columns: 1fr 1fr; - gap: 10px; -} - -.supervisor-access-actions button { - width: 100%; - min-width: 0; - padding: 0 10px; - font-size: 14px; -} - .empty { padding: 28px 12px; color: var(--muted);