feat(aihr): align figma pages for release
This commit is contained in:
@@ -92,17 +92,38 @@
|
||||
</view>
|
||||
<view v-else-if="!historyLoading" class="empty compact-empty">暂无专项指派记录</view>
|
||||
</view>
|
||||
|
||||
<view class="panel progress-panel">
|
||||
<view class="section-head">
|
||||
<text class="panel-title">派发进度与预警</text>
|
||||
<text class="muted">{{ progressSummary }}</text>
|
||||
</view>
|
||||
<view class="progress-metrics">
|
||||
<view><text>{{ progressCounts.pending }}</text><label>待训练</label></view>
|
||||
<view><text>{{ progressCounts.completed }}</text><label>已完成</label></view>
|
||||
<view><text>{{ progressCounts.retry }}</text><label>低分再练</label></view>
|
||||
</view>
|
||||
<view v-if="alerts.length" class="assignment-alert-list">
|
||||
<view v-for="alert in alerts" :key="alert.type" class="assignment-alert" :class="alert.severity">
|
||||
<text>{{ alert.title }}</text>
|
||||
<text>{{ alert.desc }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="detail-empty">当前暂无团队预警</view>
|
||||
</view>
|
||||
</template>
|
||||
<SupervisorTabBar v-if="loggedIn && !accessDenied" active="team" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeUnmount, ref } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import type { PracticeAssignment } from '@/types/api';
|
||||
import type { PracticeAlert, PracticeAssignment } from '@/types/api';
|
||||
import { clearAuth, isLoggedIn, rememberLoginRedirect } from '@/services/auth';
|
||||
import { resetPageScroll } from '@/services/navigation';
|
||||
import { createPracticeAssignment, getPracticeTeamSnapshot } from '@/services/practice';
|
||||
import { createPracticeAssignment, getPracticeAlerts, getPracticeTeamSnapshot } from '@/services/practice';
|
||||
import SupervisorTabBar from '@/components/SupervisorTabBar.vue';
|
||||
import {
|
||||
createAsyncGenerationGuard,
|
||||
inferSupervisorScenarioId,
|
||||
@@ -118,6 +139,7 @@ const targetName = ref('');
|
||||
const assignmentScenarioId = ref<SupervisorScenarioId>('fee-parking');
|
||||
const assignmentReason = ref('');
|
||||
const assignments = ref<PracticeAssignment[]>([]);
|
||||
const alerts = ref<PracticeAlert[]>([]);
|
||||
const loggedIn = ref(false);
|
||||
const accessDenied = ref(false);
|
||||
const assigning = ref(false);
|
||||
@@ -132,6 +154,15 @@ const selectedTargetLabel = computed(() => {
|
||||
return targetName.value.trim() ? `${targetName.value.trim()} · ${target}` : target;
|
||||
});
|
||||
const recentAssignments = computed(() => manualPracticeAssignments(assignments.value).slice(0, 10));
|
||||
const progressCounts = computed(() => {
|
||||
const items = recentAssignments.value;
|
||||
return {
|
||||
pending: items.filter((item) => item.status !== '已完成').length,
|
||||
completed: items.filter((item) => item.status === '已完成').length,
|
||||
retry: items.filter((item) => item.source === 'retry').length
|
||||
};
|
||||
});
|
||||
const progressSummary = computed(() => `${progressCounts.value.pending} 项未完成`);
|
||||
|
||||
const queryText = (value: unknown) => {
|
||||
if (typeof value !== 'string') return '';
|
||||
@@ -159,6 +190,7 @@ const resetDraft = () => {
|
||||
const clearPrivateState = () => {
|
||||
resetDraft();
|
||||
assignments.value = [];
|
||||
alerts.value = [];
|
||||
historyLoading.value = false;
|
||||
historyRequests.invalidate();
|
||||
};
|
||||
@@ -191,10 +223,11 @@ const loadAssignments = async (force = false) => {
|
||||
const generation = historyRequests.begin();
|
||||
historyLoading.value = true;
|
||||
try {
|
||||
const snapshot = await getPracticeTeamSnapshot();
|
||||
const [snapshot, nextAlerts] = await Promise.all([getPracticeTeamSnapshot(), getPracticeAlerts()]);
|
||||
if (historyRequests.isCurrent(generation)) {
|
||||
accessDenied.value = false;
|
||||
assignments.value = snapshot.assignments;
|
||||
alerts.value = nextAlerts;
|
||||
}
|
||||
} catch (error) {
|
||||
if (historyRequests.isCurrent(generation)) {
|
||||
@@ -306,8 +339,8 @@ onBeforeUnmount(() => {
|
||||
|
||||
<style scoped>
|
||||
.assign-page {
|
||||
padding-bottom: 42px;
|
||||
background: #f4f7fb;
|
||||
padding-bottom: 112px;
|
||||
background: linear-gradient(180deg, var(--employee-bg-soft) 0%, var(--employee-bg) 100%);
|
||||
}
|
||||
|
||||
.login-panel,
|
||||
@@ -368,8 +401,8 @@ onBeforeUnmount(() => {
|
||||
}
|
||||
|
||||
.scenario-chip.active {
|
||||
background: #fee2e2;
|
||||
color: #b91c1c;
|
||||
background: var(--employee-primary-soft);
|
||||
color: var(--employee-primary);
|
||||
}
|
||||
|
||||
.submit-button {
|
||||
@@ -429,4 +462,80 @@ onBeforeUnmount(() => {
|
||||
.compact-empty {
|
||||
padding: 18px 8px 4px;
|
||||
}
|
||||
|
||||
.progress-panel {
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
.progress-metrics {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 8px;
|
||||
margin-top: 14px;
|
||||
padding: 12px 8px;
|
||||
border-radius: 14px;
|
||||
background: var(--employee-primary-soft);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.progress-metrics view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.progress-metrics text {
|
||||
color: var(--employee-primary);
|
||||
font-size: 20px;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.progress-metrics label {
|
||||
color: var(--employee-muted);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.assignment-alert-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.assignment-alert {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
padding: 10px 12px;
|
||||
border-left: 3px solid #f59e0b;
|
||||
border-radius: 10px;
|
||||
background: #fff7e6;
|
||||
}
|
||||
|
||||
.assignment-alert.high {
|
||||
border-left-color: #ef4444;
|
||||
background: #fff1f2;
|
||||
}
|
||||
|
||||
.assignment-alert text:first-child {
|
||||
color: #a15c00;
|
||||
font-size: 13px;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.assignment-alert.high text:first-child {
|
||||
color: #c2410c;
|
||||
}
|
||||
|
||||
.assignment-alert text:last-child {
|
||||
color: var(--employee-muted);
|
||||
font-size: 12px;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.detail-empty {
|
||||
margin-top: 12px;
|
||||
color: var(--employee-muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user