2026-05-28 09:30:34 +08:00
|
|
|
|
<template>
|
2026-05-28 16:24:59 +08:00
|
|
|
|
<div
|
|
|
|
|
|
class="app"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
'sidebar-collapsed': sidebarCollapsed,
|
2026-06-18 22:12:24 +08:00
|
|
|
|
'workbench-ai-sidebar-active': isAiShellMode,
|
2026-06-20 14:42:04 +08:00
|
|
|
|
'mobile-sidebar-open': mobileSidebarOpen
|
2026-05-28 16:24:59 +08:00
|
|
|
|
}"
|
|
|
|
|
|
>
|
2026-05-28 12:09:49 +08:00
|
|
|
|
<div class="mobile-overlay" aria-hidden="true" @click="mobileSidebarOpen = false"></div>
|
2026-06-02 14:01:51 +08:00
|
|
|
|
<button
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
class="mobile-hamburger-btn"
|
|
|
|
|
|
aria-label="打开移动端导航"
|
|
|
|
|
|
:aria-expanded="mobileSidebarOpen ? 'true' : 'false'"
|
|
|
|
|
|
@click="mobileSidebarOpen = true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<i class="mdi mdi-menu" aria-hidden="true"></i>
|
|
|
|
|
|
</button>
|
2026-05-28 09:30:34 +08:00
|
|
|
|
<div class="app-sidebar">
|
2026-06-18 22:12:24 +08:00
|
|
|
|
<Transition name="sidebar-mode-fade" mode="out-in">
|
|
|
|
|
|
<AiSidebarRail
|
|
|
|
|
|
v-if="isAiShellMode"
|
|
|
|
|
|
key="ai-sidebar"
|
|
|
|
|
|
:nav-items="filteredNavItems"
|
|
|
|
|
|
:active-view="activeView"
|
|
|
|
|
|
:active-conversation-id="aiActiveConversationId"
|
|
|
|
|
|
:conversation-history="aiConversationHistory"
|
|
|
|
|
|
:current-user="currentUser"
|
|
|
|
|
|
:brand-name="PRODUCT_DISPLAY_NAME"
|
|
|
|
|
|
:brand-logo="companyProfile.logo"
|
|
|
|
|
|
:collapsed="sidebarCollapsed"
|
|
|
|
|
|
@navigate="handleNavigateWithMobileClose"
|
|
|
|
|
|
@new-chat="openAiSidebarNewChat"
|
|
|
|
|
|
@open-recent="openAiSidebarRecent"
|
|
|
|
|
|
@rename-conversation="handleAiConversationRename"
|
|
|
|
|
|
@logout="handleLogout"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<SidebarRail
|
|
|
|
|
|
v-else
|
|
|
|
|
|
key="standard-sidebar"
|
|
|
|
|
|
:nav-items="filteredNavItems"
|
|
|
|
|
|
:active-view="activeView"
|
|
|
|
|
|
:company-name="PRODUCT_DISPLAY_NAME"
|
|
|
|
|
|
:company-logo="companyProfile.logo"
|
|
|
|
|
|
:current-user="currentUser"
|
|
|
|
|
|
:collapsed="sidebarCollapsed"
|
|
|
|
|
|
@open-chat="openSmartEntry"
|
|
|
|
|
|
@logout="handleLogout"
|
|
|
|
|
|
@toggle-collapse="toggleSidebarCollapsed"
|
|
|
|
|
|
@navigate="handleNavigateWithMobileClose"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</Transition>
|
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',
|
2026-05-29 14:51:18 +08:00
|
|
|
|
'receipt-folder-main': activeView === 'receiptFolder',
|
2026-05-26 09:15:14 +08:00
|
|
|
|
'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',
|
|
|
|
|
|
'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"
|
|
|
|
|
|
:request-summary="requestSummary"
|
|
|
|
|
|
:document-summary="documentSummary"
|
2026-06-03 09:25:23 +08:00
|
|
|
|
:workbench-summary="workbenchSummary"
|
2026-06-18 22:12:24 +08:00
|
|
|
|
:workbench-mode="workbenchMode"
|
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"
|
|
|
|
|
|
:detail-alerts="resolvedDetailAlerts"
|
|
|
|
|
|
:detail-kpis="resolvedDetailKpis"
|
2026-05-28 09:30:34 +08:00
|
|
|
|
:custom-range="customRange"
|
2026-05-30 15:46:51 +08:00
|
|
|
|
:overview-dashboard="overviewDashboard"
|
2026-05-28 09:30:34 +08:00
|
|
|
|
@update:search="search = $event"
|
|
|
|
|
|
@update:active-range="activeRange = $event"
|
|
|
|
|
|
@update:custom-range="customRange = $event"
|
2026-05-30 15:46:51 +08:00
|
|
|
|
@update:overview-dashboard="overviewDashboard = $event"
|
2026-05-28 09:30:34 +08:00
|
|
|
|
@batch-approve="toast('已批量通过 23 条审批任务。')"
|
|
|
|
|
|
@new-application="openExpenseApplicationCreate"
|
2026-06-03 09:25:23 +08:00
|
|
|
|
@open-document="openWorkbenchDocument"
|
2026-06-03 17:05:34 +08:00
|
|
|
|
@navigate="handleNavigate"
|
2026-06-18 22:12:24 +08:00
|
|
|
|
@toggle-workbench-mode="toggleWorkbenchMode"
|
2026-05-28 09:30:34 +08:00
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
<FilterBar
|
2026-05-29 14:51:18 +08:00
|
|
|
|
v-if="activeView !== 'overview' && activeView !== 'workbench' && activeView !== 'documents' && activeView !== 'receiptFolder' && activeView !== 'budget' && activeView !== 'policies' && activeView !== 'audit' && activeView !== 'digitalEmployees' && activeView !== 'employees' && activeView !== 'settings'"
|
2026-05-28 09:30:34 +08:00
|
|
|
|
: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-29 14:51:18 +08:00
|
|
|
|
'receipt-folder-workarea': activeView === 'receiptFolder',
|
2026-05-28 09:30:34 +08:00
|
|
|
|
'workbench-workarea': activeView === 'workbench',
|
2026-06-18 22:12:24 +08:00
|
|
|
|
'workbench-workarea-ai-mode': isWorkbenchAiMode,
|
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',
|
|
|
|
|
|
'employees-workarea': activeView === 'employees',
|
|
|
|
|
|
'settings-workarea': activeView === 'settings'
|
|
|
|
|
|
}"
|
|
|
|
|
|
>
|
|
|
|
|
|
<OverviewView
|
|
|
|
|
|
v-if="activeView === 'overview'"
|
|
|
|
|
|
:filtered-requests="filteredRequests"
|
2026-05-30 15:46:51 +08:00
|
|
|
|
:dashboard="overviewDashboard"
|
|
|
|
|
|
:active-range="activeRange"
|
|
|
|
|
|
:custom-range="customRange"
|
2026-05-28 09:30:34 +08:00
|
|
|
|
@approve="handleApprove"
|
|
|
|
|
|
@reject="handleReject"
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
<PersonalWorkbenchView
|
|
|
|
|
|
v-else-if="activeView === 'workbench'"
|
|
|
|
|
|
:assistant-modal-open="smartEntryOpen"
|
|
|
|
|
|
:workbench-summary="workbenchSummary"
|
2026-06-18 22:12:24 +08:00
|
|
|
|
:workbench-mode="workbenchMode"
|
|
|
|
|
|
:ai-sidebar-command="aiSidebarCommand"
|
|
|
|
|
|
@ai-conversation-change="handleAiConversationChange"
|
|
|
|
|
|
@ai-conversation-history-change="handleAiConversationHistoryChange"
|
2026-05-28 09:30:34 +08:00
|
|
|
|
@open-assistant="openSmartEntry"
|
2026-06-03 09:25:23 +08:00
|
|
|
|
@open-document="openWorkbenchDocument"
|
2026-05-28 09:30:34 +08:00
|
|
|
|
/>
|
|
|
|
|
|
|
2026-05-26 09:15:14 +08:00
|
|
|
|
<TravelRequestDetailView
|
|
|
|
|
|
v-else-if="activeView === 'documents' && detailMode && selectedRequest"
|
|
|
|
|
|
:request="selectedRequest"
|
2026-06-03 15:14:44 +08:00
|
|
|
|
:back-label="detailBackLabel"
|
2026-05-26 09:15:14 +08:00
|
|
|
|
@back-to-requests="closeRequestDetail"
|
2026-05-28 09:30:34 +08:00
|
|
|
|
@open-assistant="openSmartEntry"
|
|
|
|
|
|
@request-updated="handleRequestUpdated"
|
2026-06-20 21:44:16 +08:00
|
|
|
|
@request-deleted="handleDetailRequestDeleted"
|
2026-05-28 09:30:34 +08:00
|
|
|
|
/>
|
|
|
|
|
|
|
2026-06-20 14:42:04 +08:00
|
|
|
|
<section
|
|
|
|
|
|
v-else-if="activeView === 'documents' && detailMode && !selectedRequest"
|
|
|
|
|
|
class="document-detail-loading panel"
|
|
|
|
|
|
aria-live="polite"
|
|
|
|
|
|
>
|
|
|
|
|
|
<i class="mdi mdi-loading mdi-spin" aria-hidden="true"></i>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<strong>正在加载完整单据详情</strong>
|
|
|
|
|
|
<p>正在读取申请表、审批进度和详情字段,加载完成后再展示详情表格。</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
2026-05-28 09:30:34 +08:00
|
|
|
|
<DocumentsCenterView
|
|
|
|
|
|
v-else-if="activeView === 'documents'"
|
2026-06-09 08:32:00 +00:00
|
|
|
|
:filtered-requests="requests"
|
2026-05-28 09:30:34 +08:00
|
|
|
|
:has-data="requests.length > 0"
|
|
|
|
|
|
:loading="requestsLoading"
|
|
|
|
|
|
:error="requestsError"
|
2026-06-03 09:25:23 +08:00
|
|
|
|
:refresh-token="documentCenterRefreshToken"
|
2026-05-28 09:30:34 +08:00
|
|
|
|
@open-document="openRequestDetail"
|
|
|
|
|
|
@create-request="openTravelCreate"
|
|
|
|
|
|
@create-application="openExpenseApplicationCreate"
|
|
|
|
|
|
@reload="reloadRequests"
|
|
|
|
|
|
@summary-change="documentSummary = $event"
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
2026-05-29 14:51:18 +08:00
|
|
|
|
<ReceiptFolderView
|
|
|
|
|
|
v-else-if="activeView === 'receiptFolder'"
|
|
|
|
|
|
@open-assistant="openSmartEntry"
|
2026-05-30 15:46:51 +08:00
|
|
|
|
@detail-open-change="receiptFolderDetailOpen = $event"
|
|
|
|
|
|
@detail-topbar-change="detailTopBarPayload = $event"
|
2026-05-29 14:51:18 +08:00
|
|
|
|
/>
|
|
|
|
|
|
|
2026-05-27 12:27:17 +08:00
|
|
|
|
<BudgetCenterView
|
|
|
|
|
|
v-else-if="activeView === 'budget'"
|
|
|
|
|
|
:current-user="currentUser"
|
|
|
|
|
|
@open-assistant="openSmartEntry"
|
2026-06-01 17:07:14 +08:00
|
|
|
|
@detail-open-change="budgetDetailOpen = $event"
|
|
|
|
|
|
@detail-topbar-change="detailTopBarPayload = $event"
|
2026-05-27 12:27:17 +08:00
|
|
|
|
/>
|
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
|
|
|
|
<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-30 15:46:51 +08:00
|
|
|
|
:initial-session-type="smartEntryContext.sessionType"
|
2026-06-02 14:01:51 +08:00
|
|
|
|
:initial-budget-context="smartEntryContext.budgetContext"
|
2026-06-03 09:25:23 +08:00
|
|
|
|
:initial-prompt-auto-submit="smartEntryContext.initialPromptAutoSubmit"
|
|
|
|
|
|
:initial-application-preview="smartEntryContext.initialApplicationPreview"
|
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-30 15:46:51 +08:00
|
|
|
|
@request-updated="handleRequestUpdated"
|
2026-05-28 09:30:34 +08:00
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2026-06-20 14:42:04 +08:00
|
|
|
|
import { computed, nextTick, ref, watch } from 'vue'
|
2026-05-28 09:30:34 +08:00
|
|
|
|
|
2026-06-18 22:12:24 +08:00
|
|
|
|
import AiSidebarRail from '../components/layout/AiSidebarRail.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'
|
2026-05-30 15:46:51 +08:00
|
|
|
|
import AuditView from './AuditView.vue'
|
|
|
|
|
|
import BudgetCenterView from './BudgetCenterView.vue'
|
|
|
|
|
|
import DigitalEmployeesView from './DigitalEmployeesView.vue'
|
|
|
|
|
|
import DocumentsCenterView from './DocumentsCenterView.vue'
|
|
|
|
|
|
import EmployeeManagementView from './EmployeeManagementView.vue'
|
|
|
|
|
|
import OverviewView from './OverviewView.vue'
|
|
|
|
|
|
import PersonalWorkbenchView from './PersonalWorkbenchView.vue'
|
|
|
|
|
|
import PoliciesView from './PoliciesView.vue'
|
|
|
|
|
|
import ReceiptFolderView from './ReceiptFolderView.vue'
|
|
|
|
|
|
import SettingsView from './SettingsView.vue'
|
|
|
|
|
|
import TravelReimbursementCreateView from './TravelReimbursementCreateView.vue'
|
|
|
|
|
|
import TravelRequestDetailView from './TravelRequestDetailView.vue'
|
2026-05-28 09:30:34 +08:00
|
|
|
|
|
|
|
|
|
|
import { useAppShell } from '../composables/useAppShell.js'
|
|
|
|
|
|
import { useSystemState } from '../composables/useSystemState.js'
|
2026-06-20 14:42:04 +08:00
|
|
|
|
import { filterNavItemsByAccess, isPlatformAdminUser } from '../utils/accessControl.js'
|
2026-06-18 22:12:24 +08:00
|
|
|
|
import { loadAiWorkbenchConversationHistory, saveAiWorkbenchConversation } from '../utils/aiWorkbenchConversationStore.js'
|
2026-05-28 09:30:34 +08:00
|
|
|
|
|
|
|
|
|
|
const employeeSummary = ref(null)
|
|
|
|
|
|
const knowledgeSummary = 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-30 15:46:51 +08:00
|
|
|
|
const receiptFolderDetailOpen = ref(false)
|
2026-06-01 17:07:14 +08:00
|
|
|
|
const budgetDetailOpen = ref(false)
|
2026-06-18 22:12:24 +08:00
|
|
|
|
const sidebarCollapsed = ref(false)
|
|
|
|
|
|
const sidebarCollapsedBeforeAiMode = ref(false)
|
2026-05-28 12:09:49 +08:00
|
|
|
|
const mobileSidebarOpen = ref(false)
|
2026-05-30 15:46:51 +08:00
|
|
|
|
const overviewDashboard = ref('finance')
|
2026-06-18 22:12:24 +08:00
|
|
|
|
const workbenchMode = ref('traditional')
|
|
|
|
|
|
const aiSidebarCommandSeq = ref(0)
|
|
|
|
|
|
const aiSidebarCommand = ref({ seq: 0, type: '', payload: null })
|
|
|
|
|
|
const aiActiveConversationId = ref('')
|
|
|
|
|
|
const aiConversationHistory = ref([])
|
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) {
|
2026-06-18 22:12:24 +08:00
|
|
|
|
void handleNavigate(viewId)
|
2026-05-28 12:09:49 +08:00
|
|
|
|
mobileSidebarOpen.value = false
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-06-18 22:12:24 +08:00
|
|
|
|
function toggleWorkbenchMode() {
|
|
|
|
|
|
const nextMode = workbenchMode.value === 'ai' ? 'traditional' : 'ai'
|
|
|
|
|
|
if (nextMode === 'ai') {
|
|
|
|
|
|
sidebarCollapsedBeforeAiMode.value = sidebarCollapsed.value
|
|
|
|
|
|
workbenchMode.value = nextMode
|
|
|
|
|
|
sidebarCollapsed.value = false
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
workbenchMode.value = nextMode
|
|
|
|
|
|
sidebarCollapsed.value = sidebarCollapsedBeforeAiMode.value
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-28 09:30:34 +08:00
|
|
|
|
const {
|
|
|
|
|
|
activeRange,
|
|
|
|
|
|
activeView,
|
|
|
|
|
|
closeRequestDetail,
|
|
|
|
|
|
closeSmartEntry,
|
|
|
|
|
|
customRange,
|
|
|
|
|
|
detailAlerts,
|
2026-06-03 15:14:44 +08:00
|
|
|
|
detailBackLabel,
|
2026-05-28 09:30:34 +08:00
|
|
|
|
detailMode,
|
2026-06-03 09:25:23 +08:00
|
|
|
|
documentCenterRefreshToken,
|
2026-05-28 09:30:34 +08:00
|
|
|
|
filteredRequests,
|
|
|
|
|
|
filters,
|
|
|
|
|
|
handleApprove,
|
|
|
|
|
|
handleDraftSaved,
|
|
|
|
|
|
handleNavigate,
|
|
|
|
|
|
handleReject,
|
|
|
|
|
|
handleRequestDeleted,
|
|
|
|
|
|
handleRequestUpdated,
|
|
|
|
|
|
navItems,
|
|
|
|
|
|
openExpenseApplicationCreate,
|
|
|
|
|
|
openRequestDetail,
|
|
|
|
|
|
openSmartEntry,
|
|
|
|
|
|
openTravelCreate,
|
|
|
|
|
|
ranges,
|
|
|
|
|
|
requestSummary,
|
|
|
|
|
|
workbenchSummary,
|
|
|
|
|
|
requestsError,
|
|
|
|
|
|
requestsLoading,
|
2026-06-03 09:25:23 +08:00
|
|
|
|
reloadDocumentCenterRequests,
|
2026-05-28 09:30:34 +08:00
|
|
|
|
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-06-18 22:12:24 +08:00
|
|
|
|
const isAiShellMode = computed(() => workbenchMode.value === 'ai')
|
|
|
|
|
|
const isWorkbenchAiMode = computed(() => activeView.value === 'workbench' && workbenchMode.value === 'ai')
|
2026-05-29 09:44:03 +08:00
|
|
|
|
const DETAIL_TOPBAR_FALLBACKS = {
|
|
|
|
|
|
audit: {
|
|
|
|
|
|
title: '规则中心详情',
|
|
|
|
|
|
desc: '查看规则配置、版本审核、测试结果与上线状态。'
|
|
|
|
|
|
},
|
|
|
|
|
|
digitalEmployees: {
|
|
|
|
|
|
title: '数字员工详情',
|
|
|
|
|
|
desc: '查看数字员工配置、执行计划、运行记录与源文件。'
|
2026-05-30 15:46:51 +08:00
|
|
|
|
},
|
|
|
|
|
|
receiptFolder: {
|
|
|
|
|
|
title: '票据详情',
|
|
|
|
|
|
desc: '查看票据源文件、OCR 识别信息与关联状态。'
|
2026-06-01 17:07:14 +08:00
|
|
|
|
},
|
|
|
|
|
|
budget: {
|
|
|
|
|
|
title: '预算详情',
|
|
|
|
|
|
desc: '查看预算周期、费用占比、审核信息与预算明细。'
|
2026-05-29 09:44:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
const customDetailTopBarActive = computed(() => (
|
|
|
|
|
|
(activeView.value === 'audit' && auditDetailOpen.value) ||
|
2026-05-30 15:46:51 +08:00
|
|
|
|
(activeView.value === 'digitalEmployees' && digitalEmployeeDetailOpen.value) ||
|
2026-06-01 17:07:14 +08:00
|
|
|
|
(activeView.value === 'receiptFolder' && receiptFolderDetailOpen.value) ||
|
|
|
|
|
|
(activeView.value === 'budget' && budgetDetailOpen.value)
|
2026-05-29 09:44:03 +08:00
|
|
|
|
))
|
|
|
|
|
|
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
|
|
|
|
|
2026-06-03 09:25:23 +08:00
|
|
|
|
function openWorkbenchDocument(payload = {}) {
|
2026-06-20 14:42:04 +08:00
|
|
|
|
const requestId = String(payload.claimId || payload.id || payload.claimNo || payload.documentNo || '').trim()
|
2026-06-03 09:25:23 +08:00
|
|
|
|
if (!requestId) {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const request = requests.value.find((item) => (
|
|
|
|
|
|
String(item.claimId || '').trim() === requestId
|
|
|
|
|
|
|| String(item.id || '').trim() === requestId
|
|
|
|
|
|
|| String(item.claimNo || '').trim() === requestId
|
2026-06-20 14:42:04 +08:00
|
|
|
|
|| String(item.documentNo || '').trim() === requestId
|
2026-06-03 09:25:23 +08:00
|
|
|
|
))
|
2026-06-03 15:14:44 +08:00
|
|
|
|
const returnTo = (
|
|
|
|
|
|
String(payload.returnTo || '').trim() === 'workbench'
|
|
|
|
|
|
|| String(payload.source || '').trim() === 'workbench'
|
|
|
|
|
|
|| activeView.value === 'workbench'
|
|
|
|
|
|
)
|
|
|
|
|
|
? 'workbench'
|
|
|
|
|
|
: ''
|
2026-06-20 14:42:04 +08:00
|
|
|
|
const detailPayload = request || {
|
|
|
|
|
|
...payload,
|
|
|
|
|
|
id: payload.id || requestId,
|
|
|
|
|
|
claimId: payload.claimId || requestId,
|
|
|
|
|
|
claimNo: payload.claimNo || payload.documentNo || requestId,
|
|
|
|
|
|
documentNo: payload.documentNo || requestId,
|
|
|
|
|
|
detailLookupOnly: true
|
|
|
|
|
|
}
|
|
|
|
|
|
openRequestDetail(detailPayload, { returnTo })
|
2026-06-03 09:25:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-06-18 22:12:24 +08:00
|
|
|
|
function dispatchAiSidebarCommand(type, payload = null) {
|
|
|
|
|
|
aiSidebarCommandSeq.value += 1
|
|
|
|
|
|
aiSidebarCommand.value = {
|
|
|
|
|
|
seq: aiSidebarCommandSeq.value,
|
|
|
|
|
|
type,
|
|
|
|
|
|
payload
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function openAiConversationWorkspace(type, payload = null) {
|
|
|
|
|
|
if (activeView.value !== 'workbench') {
|
|
|
|
|
|
const navigation = handleNavigate('workbench')
|
|
|
|
|
|
if (navigation && typeof navigation.then === 'function') {
|
|
|
|
|
|
await navigation
|
|
|
|
|
|
}
|
|
|
|
|
|
await nextTick()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
dispatchAiSidebarCommand(type, payload)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function openAiSidebarNewChat() {
|
|
|
|
|
|
aiActiveConversationId.value = ''
|
|
|
|
|
|
void openAiConversationWorkspace('new-chat')
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function openAiSidebarRecent(item = {}) {
|
|
|
|
|
|
aiActiveConversationId.value = String(item.id || '').trim()
|
|
|
|
|
|
void openAiConversationWorkspace('open-recent', item)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function handleAiConversationChange(payload = {}) {
|
|
|
|
|
|
aiActiveConversationId.value = String(payload.id || '').trim()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function handleAiConversationHistoryChange(payload = []) {
|
|
|
|
|
|
aiConversationHistory.value = Array.isArray(payload) ? payload : []
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-06-20 21:44:16 +08:00
|
|
|
|
async function handleDetailRequestDeleted(payload = {}) {
|
|
|
|
|
|
await handleRequestDeleted(payload)
|
|
|
|
|
|
aiConversationHistory.value = loadAiWorkbenchConversationHistory(currentUser.value || {})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-06-18 22:12:24 +08:00
|
|
|
|
function handleAiConversationRename(payload = {}) {
|
|
|
|
|
|
const conversationId = String(payload.id || '').trim()
|
|
|
|
|
|
const title = String(payload.title || '').trim()
|
|
|
|
|
|
if (!conversationId || !title) {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const target = aiConversationHistory.value.find((item) => String(item.id || '').trim() === conversationId)
|
|
|
|
|
|
if (!target) {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
aiConversationHistory.value = saveAiWorkbenchConversation(currentUser.value || {}, {
|
|
|
|
|
|
...target,
|
|
|
|
|
|
title
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
if (aiActiveConversationId.value === conversationId) {
|
|
|
|
|
|
dispatchAiSidebarCommand('open-recent', {
|
|
|
|
|
|
...target,
|
|
|
|
|
|
title
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-28 09:30:34 +08:00
|
|
|
|
function handleLogout() {
|
|
|
|
|
|
logout('manual')
|
|
|
|
|
|
}
|
2026-05-28 16:24:59 +08:00
|
|
|
|
|
2026-06-18 22:12:24 +08:00
|
|
|
|
watch(
|
|
|
|
|
|
() => currentUser.value,
|
|
|
|
|
|
(user) => {
|
|
|
|
|
|
aiConversationHistory.value = loadAiWorkbenchConversationHistory(user || {})
|
|
|
|
|
|
},
|
|
|
|
|
|
{ immediate: true }
|
|
|
|
|
|
)
|
2026-05-28 09:30:34 +08:00
|
|
|
|
</script>
|