2026-05-28 09:30:34 +08:00
|
|
|
<template>
|
2026-05-28 16:24:59 +08:00
|
|
|
<div
|
|
|
|
|
class="app"
|
|
|
|
|
:class="{
|
|
|
|
|
'sidebar-collapsed': sidebarCollapsed,
|
|
|
|
|
'mobile-sidebar-open': mobileSidebarOpen,
|
|
|
|
|
'login-entry-active': loginEntryAnimating
|
|
|
|
|
}"
|
|
|
|
|
>
|
2026-05-28 12:09:49 +08:00
|
|
|
<div class="mobile-overlay" aria-hidden="true" @click="mobileSidebarOpen = false"></div>
|
2026-05-28 16:24:59 +08:00
|
|
|
<Transition name="login-entry-veil">
|
|
|
|
|
<div v-if="loginEntryAnimating" class="login-entry-veil" aria-live="polite" aria-label="登录成功,正在进入工作台">
|
|
|
|
|
<div class="login-entry-card">
|
|
|
|
|
<span class="login-entry-mark" aria-hidden="true">
|
|
|
|
|
<i class="mdi mdi-shield-check-outline"></i>
|
|
|
|
|
</span>
|
|
|
|
|
<div class="login-entry-copy">
|
|
|
|
|
<strong>登录成功</strong>
|
|
|
|
|
<span>正在进入工作台</span>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="login-entry-progress" aria-hidden="true"></span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Transition>
|
2026-05-28 09:30:34 +08:00
|
|
|
<div class="app-sidebar">
|
|
|
|
|
<SidebarRail
|
|
|
|
|
:nav-items="filteredNavItems"
|
|
|
|
|
:active-view="activeView"
|
2026-05-28 12:09:49 +08:00
|
|
|
:company-name="PRODUCT_DISPLAY_NAME"
|
2026-05-28 09:30:34 +08:00
|
|
|
:company-logo="companyProfile.logo"
|
|
|
|
|
:current-user="currentUser"
|
|
|
|
|
:collapsed="sidebarCollapsed"
|
|
|
|
|
@open-chat="openSmartEntry"
|
|
|
|
|
@logout="handleLogout"
|
|
|
|
|
@toggle-collapse="toggleSidebarCollapsed"
|
2026-05-28 12:09:49 +08:00
|
|
|
@navigate="handleNavigateWithMobileClose"
|
2026-05-28 09:30:34 +08:00
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<main
|
|
|
|
|
class="main"
|
|
|
|
|
:class="{
|
2026-05-26 09:15:14 +08:00
|
|
|
'overview-main': activeView === 'overview',
|
|
|
|
|
'workbench-main': activeView === 'workbench',
|
|
|
|
|
'documents-main': activeView === 'documents',
|
|
|
|
|
'budget-main': activeView === 'budget',
|
|
|
|
|
'policies-main': activeView === 'policies',
|
2026-05-28 09:30:34 +08:00
|
|
|
'audit-main': activeView === 'audit',
|
|
|
|
|
'audit-detail-main': activeView === 'audit' && auditDetailOpen,
|
2026-05-28 22:33:53 +08:00
|
|
|
'digital-employees-detail-main': activeView === 'digitalEmployees' && digitalEmployeeDetailOpen,
|
2026-05-28 09:30:34 +08:00
|
|
|
'digital-employees-main': activeView === 'digitalEmployees',
|
|
|
|
|
'logs-main': activeView === 'logs',
|
|
|
|
|
'employees-main': activeView === 'employees',
|
|
|
|
|
'settings-main': activeView === 'settings'
|
|
|
|
|
}"
|
|
|
|
|
>
|
|
|
|
|
<TopBar
|
2026-05-29 09:44:03 +08:00
|
|
|
v-if="activeView !== 'settings'"
|
|
|
|
|
:current-view="resolvedTopBarView"
|
2026-05-28 09:30:34 +08:00
|
|
|
:search="search"
|
|
|
|
|
:active-view="activeView"
|
|
|
|
|
:ranges="ranges"
|
|
|
|
|
:active-range="activeRange"
|
|
|
|
|
:employee-summary="employeeSummary"
|
|
|
|
|
:knowledge-summary="knowledgeSummary"
|
|
|
|
|
:logs-summary="logsSummary"
|
|
|
|
|
:request-summary="requestSummary"
|
|
|
|
|
:document-summary="documentSummary"
|
2026-05-28 22:33:53 +08:00
|
|
|
:digital-employee-summary="digitalEmployeeSummary"
|
2026-05-28 12:09:49 +08:00
|
|
|
:company-name="ENTERPRISE_DISPLAY_NAME"
|
2026-05-29 09:44:03 +08:00
|
|
|
:detail-mode="resolvedDetailMode"
|
2026-05-28 09:30:34 +08:00
|
|
|
:log-detail-mode="logDetailMode"
|
2026-05-29 09:44:03 +08:00
|
|
|
:detail-alerts="resolvedDetailAlerts"
|
|
|
|
|
:detail-kpis="resolvedDetailKpis"
|
2026-05-28 09:30:34 +08:00
|
|
|
:custom-range="customRange"
|
|
|
|
|
@update:search="search = $event"
|
|
|
|
|
@update:active-range="activeRange = $event"
|
|
|
|
|
@update:custom-range="customRange = $event"
|
|
|
|
|
@batch-approve="toast('已批量通过 23 条审批任务。')"
|
|
|
|
|
@new-application="openExpenseApplicationCreate"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<FilterBar
|
|
|
|
|
v-if="activeView !== 'overview' && activeView !== 'workbench' && activeView !== 'documents' && activeView !== 'budget' && activeView !== 'policies' && activeView !== 'audit' && activeView !== 'digitalEmployees' && activeView !== 'logs' && activeView !== 'employees' && activeView !== 'settings'"
|
|
|
|
|
:compact="activeView === 'overview'"
|
|
|
|
|
:filters="filters"
|
|
|
|
|
:ranges="ranges"
|
|
|
|
|
:active-range="activeRange"
|
|
|
|
|
@update:active-range="activeRange = $event"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<section
|
|
|
|
|
class="workarea"
|
|
|
|
|
:class="{
|
2026-05-26 09:15:14 +08:00
|
|
|
'documents-workarea': activeView === 'documents',
|
2026-05-28 09:30:34 +08:00
|
|
|
'workbench-workarea': activeView === 'workbench',
|
2026-05-26 09:15:14 +08:00
|
|
|
'budget-workarea': activeView === 'budget',
|
|
|
|
|
'policies-workarea': activeView === 'policies',
|
2026-05-28 09:30:34 +08:00
|
|
|
'audit-workarea': activeView === 'audit',
|
|
|
|
|
'digital-employees-workarea': activeView === 'digitalEmployees',
|
|
|
|
|
'logs-workarea': activeView === 'logs',
|
|
|
|
|
'employees-workarea': activeView === 'employees',
|
|
|
|
|
'settings-workarea': activeView === 'settings'
|
|
|
|
|
}"
|
|
|
|
|
>
|
|
|
|
|
<OverviewView
|
|
|
|
|
v-if="activeView === 'overview'"
|
|
|
|
|
:filtered-requests="filteredRequests"
|
|
|
|
|
@approve="handleApprove"
|
|
|
|
|
@reject="handleReject"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<PersonalWorkbenchView
|
|
|
|
|
v-else-if="activeView === 'workbench'"
|
|
|
|
|
:assistant-modal-open="smartEntryOpen"
|
|
|
|
|
:workbench-summary="workbenchSummary"
|
|
|
|
|
@open-assistant="openSmartEntry"
|
|
|
|
|
/>
|
|
|
|
|
|
2026-05-26 09:15:14 +08:00
|
|
|
<TravelRequestDetailView
|
|
|
|
|
v-else-if="activeView === 'documents' && detailMode && selectedRequest"
|
|
|
|
|
:request="selectedRequest"
|
|
|
|
|
back-label="返回单据中心"
|
|
|
|
|
@back-to-requests="closeRequestDetail"
|
2026-05-28 09:30:34 +08:00
|
|
|
@open-assistant="openSmartEntry"
|
|
|
|
|
@request-updated="handleRequestUpdated"
|
|
|
|
|
@request-deleted="handleRequestDeleted"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<DocumentsCenterView
|
|
|
|
|
v-else-if="activeView === 'documents'"
|
|
|
|
|
:filtered-requests="filteredRequests"
|
|
|
|
|
:has-data="requests.length > 0"
|
|
|
|
|
:loading="requestsLoading"
|
|
|
|
|
:error="requestsError"
|
|
|
|
|
@open-document="openRequestDetail"
|
|
|
|
|
@create-request="openTravelCreate"
|
|
|
|
|
@create-application="openExpenseApplicationCreate"
|
|
|
|
|
@reload="reloadRequests"
|
|
|
|
|
@summary-change="documentSummary = $event"
|
|
|
|
|
/>
|
|
|
|
|
|
2026-05-27 12:27:17 +08:00
|
|
|
<BudgetCenterView
|
|
|
|
|
v-else-if="activeView === 'budget'"
|
|
|
|
|
:current-user="currentUser"
|
|
|
|
|
@open-assistant="openSmartEntry"
|
|
|
|
|
/>
|
2026-05-26 09:15:14 +08:00
|
|
|
<PoliciesView v-else-if="activeView === 'policies'" @summary-change="knowledgeSummary = $event" />
|
2026-05-29 09:44:03 +08:00
|
|
|
<AuditView
|
|
|
|
|
v-else-if="activeView === 'audit'"
|
|
|
|
|
@detail-open-change="auditDetailOpen = $event"
|
|
|
|
|
@detail-topbar-change="detailTopBarPayload = $event"
|
|
|
|
|
/>
|
2026-05-28 22:33:53 +08:00
|
|
|
<DigitalEmployeesView
|
|
|
|
|
v-else-if="activeView === 'digitalEmployees'"
|
|
|
|
|
@summary-change="digitalEmployeeSummary = $event"
|
|
|
|
|
@detail-open-change="digitalEmployeeDetailOpen = $event"
|
2026-05-29 09:44:03 +08:00
|
|
|
@detail-topbar-change="detailTopBarPayload = $event"
|
2026-05-28 22:33:53 +08:00
|
|
|
/>
|
2026-05-28 09:30:34 +08:00
|
|
|
<LogDetailView v-else-if="activeView === 'logs' && logDetailMode" />
|
|
|
|
|
<LogsView v-else-if="activeView === 'logs'" @summary-change="logsSummary = $event" />
|
|
|
|
|
<EmployeeManagementView v-else-if="activeView === 'employees'" @overview-change="employeeSummary = $event" />
|
|
|
|
|
<SettingsView v-else />
|
|
|
|
|
</section>
|
|
|
|
|
</main>
|
|
|
|
|
|
|
|
|
|
<TravelReimbursementCreateView
|
|
|
|
|
v-if="smartEntryOpen"
|
|
|
|
|
:key="smartEntrySessionId"
|
|
|
|
|
:initial-prompt="smartEntryContext.prompt"
|
|
|
|
|
:initial-files="smartEntryContext.files"
|
|
|
|
|
:initial-conversation="smartEntryContext.conversation"
|
2026-05-26 09:15:14 +08:00
|
|
|
:entry-source="smartEntryContext.source"
|
|
|
|
|
:request-context="smartEntryContext.request"
|
|
|
|
|
:invalidated-draft-claim-id="smartEntryInvalidatedDraftClaimId"
|
|
|
|
|
:reopen-token="smartEntryRevealToken"
|
|
|
|
|
@close="closeSmartEntry"
|
|
|
|
|
@draft-saved="handleDraftSaved"
|
2026-05-28 09:30:34 +08:00
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2026-05-29 09:44:03 +08:00
|
|
|
import { computed, defineAsyncComponent, onBeforeUnmount, onMounted, ref } from 'vue'
|
2026-05-28 09:30:34 +08:00
|
|
|
|
|
|
|
|
import SidebarRail from '../components/layout/SidebarRail.vue'
|
|
|
|
|
import TopBar from '../components/layout/TopBar.vue'
|
|
|
|
|
import FilterBar from '../components/layout/FilterBar.vue'
|
|
|
|
|
|
|
|
|
|
import { useAppShell } from '../composables/useAppShell.js'
|
|
|
|
|
import { useSystemState } from '../composables/useSystemState.js'
|
|
|
|
|
import { filterNavItemsByAccess } from '../utils/accessControl.js'
|
2026-05-28 16:24:59 +08:00
|
|
|
import { consumeLoginEntryTransition } from '../utils/loginEntryTransition.js'
|
2026-05-28 09:30:34 +08:00
|
|
|
|
2026-05-29 09:44:03 +08:00
|
|
|
const OverviewView = defineAsyncComponent(() => import('./OverviewView.vue'))
|
|
|
|
|
const PersonalWorkbenchView = defineAsyncComponent(() => import('./PersonalWorkbenchView.vue'))
|
|
|
|
|
const TravelReimbursementCreateView = defineAsyncComponent(() => import('./TravelReimbursementCreateView.vue'))
|
|
|
|
|
const TravelRequestDetailView = defineAsyncComponent(() => import('./TravelRequestDetailView.vue'))
|
|
|
|
|
const DocumentsCenterView = defineAsyncComponent(() => import('./DocumentsCenterView.vue'))
|
|
|
|
|
const BudgetCenterView = defineAsyncComponent(() => import('./BudgetCenterView.vue'))
|
|
|
|
|
const PoliciesView = defineAsyncComponent(() => import('./PoliciesView.vue'))
|
|
|
|
|
const AuditView = defineAsyncComponent(() => import('./AuditView.vue'))
|
|
|
|
|
const DigitalEmployeesView = defineAsyncComponent(() => import('./DigitalEmployeesView.vue'))
|
|
|
|
|
const LogsView = defineAsyncComponent(() => import('./LogsView.vue'))
|
|
|
|
|
const LogDetailView = defineAsyncComponent(() => import('./LogDetailView.vue'))
|
|
|
|
|
const EmployeeManagementView = defineAsyncComponent(() => import('./EmployeeManagementView.vue'))
|
|
|
|
|
const SettingsView = defineAsyncComponent(() => import('./SettingsView.vue'))
|
|
|
|
|
|
2026-05-28 09:30:34 +08:00
|
|
|
const employeeSummary = ref(null)
|
|
|
|
|
const knowledgeSummary = ref(null)
|
|
|
|
|
const logsSummary = ref(null)
|
|
|
|
|
const documentSummary = ref(null)
|
2026-05-28 22:33:53 +08:00
|
|
|
const digitalEmployeeSummary = ref(null)
|
2026-05-29 09:44:03 +08:00
|
|
|
const detailTopBarPayload = ref(null)
|
2026-05-28 09:30:34 +08:00
|
|
|
const auditDetailOpen = ref(false)
|
2026-05-28 22:33:53 +08:00
|
|
|
const digitalEmployeeDetailOpen = ref(false)
|
2026-05-28 16:24:59 +08:00
|
|
|
const loginEntryAnimating = ref(false)
|
2026-05-28 09:30:34 +08:00
|
|
|
const sidebarCollapsed = ref(false)
|
2026-05-28 12:09:49 +08:00
|
|
|
const mobileSidebarOpen = ref(false)
|
2026-05-28 16:24:59 +08:00
|
|
|
let loginEntryTimer = null
|
|
|
|
|
|
|
|
|
|
function stopLoginEntryAnimation() {
|
|
|
|
|
if (loginEntryTimer) {
|
|
|
|
|
window.clearTimeout(loginEntryTimer)
|
|
|
|
|
loginEntryTimer = null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
loginEntryAnimating.value = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function playLoginEntryAnimation() {
|
|
|
|
|
if (!consumeLoginEntryTransition()) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
loginEntryAnimating.value = true
|
|
|
|
|
loginEntryTimer = window.setTimeout(stopLoginEntryAnimation, 920)
|
|
|
|
|
}
|
2026-05-28 09:30:34 +08:00
|
|
|
|
|
|
|
|
function toggleSidebarCollapsed() {
|
|
|
|
|
sidebarCollapsed.value = !sidebarCollapsed.value
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-28 12:09:49 +08:00
|
|
|
function handleNavigateWithMobileClose(viewId) {
|
|
|
|
|
handleNavigate(viewId)
|
|
|
|
|
mobileSidebarOpen.value = false
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-28 09:30:34 +08:00
|
|
|
const {
|
|
|
|
|
activeRange,
|
|
|
|
|
activeView,
|
|
|
|
|
closeRequestDetail,
|
|
|
|
|
closeSmartEntry,
|
|
|
|
|
customRange,
|
|
|
|
|
detailAlerts,
|
|
|
|
|
detailMode,
|
|
|
|
|
logDetailMode,
|
|
|
|
|
filteredRequests,
|
|
|
|
|
filters,
|
|
|
|
|
handleApprove,
|
|
|
|
|
handleDraftSaved,
|
|
|
|
|
handleNavigate,
|
|
|
|
|
handleReject,
|
|
|
|
|
handleRequestDeleted,
|
|
|
|
|
handleRequestUpdated,
|
|
|
|
|
navItems,
|
|
|
|
|
openExpenseApplicationCreate,
|
|
|
|
|
openRequestDetail,
|
|
|
|
|
openSmartEntry,
|
|
|
|
|
openTravelCreate,
|
|
|
|
|
ranges,
|
|
|
|
|
requestSummary,
|
|
|
|
|
workbenchSummary,
|
|
|
|
|
requestsError,
|
|
|
|
|
requestsLoading,
|
|
|
|
|
reloadRequests,
|
|
|
|
|
requests,
|
|
|
|
|
search,
|
|
|
|
|
selectedRequest,
|
|
|
|
|
smartEntryContext,
|
2026-05-26 09:15:14 +08:00
|
|
|
smartEntryInvalidatedDraftClaimId,
|
|
|
|
|
smartEntryOpen,
|
|
|
|
|
smartEntryRevealToken,
|
|
|
|
|
smartEntrySessionId,
|
2026-05-28 09:30:34 +08:00
|
|
|
toast,
|
|
|
|
|
topBarView
|
|
|
|
|
} = useAppShell()
|
|
|
|
|
|
|
|
|
|
const { companyProfile, currentUser, logout } = useSystemState()
|
2026-05-28 12:09:49 +08:00
|
|
|
const PRODUCT_DISPLAY_NAME = '易财费控'
|
|
|
|
|
const ENTERPRISE_DISPLAY_NAME = '远光软件股份有限公司'
|
2026-05-28 09:30:34 +08:00
|
|
|
const filteredNavItems = computed(() => filterNavItemsByAccess(navItems, currentUser.value))
|
2026-05-29 09:44:03 +08:00
|
|
|
const DETAIL_TOPBAR_FALLBACKS = {
|
|
|
|
|
audit: {
|
|
|
|
|
title: '规则中心详情',
|
|
|
|
|
desc: '查看规则配置、版本审核、测试结果与上线状态。'
|
|
|
|
|
},
|
|
|
|
|
digitalEmployees: {
|
|
|
|
|
title: '数字员工详情',
|
|
|
|
|
desc: '查看数字员工配置、执行计划、运行记录与源文件。'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const customDetailTopBarActive = computed(() => (
|
|
|
|
|
(activeView.value === 'audit' && auditDetailOpen.value) ||
|
|
|
|
|
(activeView.value === 'digitalEmployees' && digitalEmployeeDetailOpen.value)
|
|
|
|
|
))
|
|
|
|
|
const resolvedTopBarView = computed(() => (
|
|
|
|
|
customDetailTopBarActive.value
|
|
|
|
|
? detailTopBarPayload.value?.view || DETAIL_TOPBAR_FALLBACKS[activeView.value] || topBarView.value
|
|
|
|
|
: topBarView.value
|
|
|
|
|
))
|
|
|
|
|
const resolvedDetailMode = computed(() => (
|
|
|
|
|
detailMode.value ||
|
|
|
|
|
customDetailTopBarActive.value
|
|
|
|
|
))
|
|
|
|
|
const resolvedDetailAlerts = computed(() => (
|
|
|
|
|
customDetailTopBarActive.value
|
|
|
|
|
? detailTopBarPayload.value?.alerts || []
|
|
|
|
|
: detailAlerts.value
|
|
|
|
|
))
|
|
|
|
|
const resolvedDetailKpis = computed(() => (
|
|
|
|
|
customDetailTopBarActive.value ? detailTopBarPayload.value?.kpis || [] : []
|
|
|
|
|
))
|
2026-05-28 09:30:34 +08:00
|
|
|
|
|
|
|
|
function handleLogout() {
|
|
|
|
|
logout('manual')
|
|
|
|
|
}
|
2026-05-28 16:24:59 +08:00
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
playLoginEntryAnimation()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
onBeforeUnmount(() => {
|
|
|
|
|
stopLoginEntryAnimation()
|
|
|
|
|
})
|
2026-05-28 09:30:34 +08:00
|
|
|
</script>
|