From d5a8f84703464b2858b1bc2df199eb9336755ad8 Mon Sep 17 00:00:00 2001 From: caoxiaozhu Date: Fri, 26 Jun 2026 22:42:29 +0800 Subject: [PATCH] =?UTF-8?q?refactor(web):=20=E5=BA=94=E7=94=A8=E5=A4=96?= =?UTF-8?q?=E5=A3=B3/=E5=B7=AE=E6=97=85=E8=AF=A6=E6=83=85/=E6=8A=A5?= =?UTF-8?q?=E9=94=80=E5=88=9B=E5=BB=BA=E8=A7=86=E5=9B=BE=E9=80=82=E9=85=8D?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E4=B8=8E=E5=A4=9A=20task?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AppShellRouteView/useAppShell 适配主题皮肤与会话入口 - TravelRequestDetailView/travelRequestDetailSetup 差旅详情适配,travel-request-detail-view.css 调整 - TravelReimbursementCreateView/useTravelReimbursementCreateViewLifecycle 创建视图适配 - 更新 app-shell-financial-assistant-entry/travel-request-detail-risk-advice 测试 --- .../views/travel-request-detail-view.css | 80 ++++++- web/src/composables/useAppShell.js | 12 +- web/src/views/AppShellRouteView.vue | 1 + web/src/views/TravelRequestDetailView.vue | 88 ++++++- .../scripts/TravelReimbursementCreateView.js | 4 + .../views/scripts/travelRequestDetailSetup.js | 216 ++++++++++++++++-- ...eTravelReimbursementCreateViewLifecycle.js | 6 +- ...p-shell-financial-assistant-entry.test.mjs | 9 +- ...travel-request-detail-risk-advice.test.mjs | 38 +-- 9 files changed, 396 insertions(+), 58 deletions(-) diff --git a/web/src/assets/styles/views/travel-request-detail-view.css b/web/src/assets/styles/views/travel-request-detail-view.css index e8476a0..b09db59 100644 --- a/web/src/assets/styles/views/travel-request-detail-view.css +++ b/web/src/assets/styles/views/travel-request-detail-view.css @@ -616,8 +616,8 @@ border-left: 0; } -.application-detail-fact span, -.application-detail-fact strong { +.application-detail-fact > span, +.application-detail-fact > strong { display: flex; align-items: center; min-width: 0; @@ -625,7 +625,7 @@ line-height: 1.5; } -.application-detail-fact span { +.application-detail-fact > span { background: #f8fafc; color: #64748b; font-size: 12px; @@ -637,10 +637,11 @@ color: #0f172a; font-size: 13px; font-weight: 750; + gap: 8px; overflow-wrap: anywhere; } -.application-detail-fact.highlight span { +.application-detail-fact.highlight > span { background: var(--theme-primary-soft); color: var(--theme-primary-active); } @@ -654,6 +655,77 @@ font-weight: 850; } +.application-detail-fact-value { + min-width: 0; + flex: 1 1 auto; + overflow-wrap: anywhere; +} + +.application-detail-edit-btn, +.application-detail-edit-confirm, +.application-detail-edit-cancel { + flex: 0 0 auto; + width: 24px; + height: 24px; + display: inline-grid; + place-items: center; + border: 1px solid transparent; + border-radius: 4px; + background: transparent; + color: #64748b; + cursor: pointer; +} + +.application-detail-edit-btn { + opacity: 0; + transition: + opacity 0.16s ease, + background 0.16s ease, + color 0.16s ease; +} + +.application-detail-fact.editable:hover .application-detail-edit-btn, +.application-detail-edit-btn:focus-visible { + opacity: 1; +} + +.application-detail-edit-btn:hover:not(:disabled), +.application-detail-edit-btn:focus-visible, +.application-detail-edit-confirm:hover:not(:disabled), +.application-detail-edit-cancel:hover:not(:disabled) { + background: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.1); + color: var(--theme-primary-active); +} + +.application-detail-edit-confirm { + background: rgba(22, 163, 74, 0.1); + color: #15803d; +} + +.application-detail-edit-cancel { + background: #f1f5f9; +} + +.application-detail-edit-btn:disabled, +.application-detail-edit-confirm:disabled, +.application-detail-edit-cancel:disabled { + cursor: not-allowed; + opacity: 0.45; +} + +.application-detail-fact.editing strong { + align-items: center; +} + +.application-detail-editor-control { + flex: 1 1 auto; + min-width: 0; +} + +.application-detail-editor-select { + width: 100%; +} + .related-application-facts { margin-top: 0; } diff --git a/web/src/composables/useAppShell.js b/web/src/composables/useAppShell.js index 0c28770..cf17120 100644 --- a/web/src/composables/useAppShell.js +++ b/web/src/composables/useAppShell.js @@ -56,7 +56,8 @@ export function useAppShell() { sessionType: '', budgetContext: null, initialPromptAutoSubmit: true, - initialApplicationPreview: null + initialApplicationPreview: null, + initialDraftPayload: null }) const smartEntrySessionId = ref(0) const smartEntryRevealToken = ref(0) @@ -337,7 +338,8 @@ export function useAppShell() { sessionType: '', budgetContext: null, initialPromptAutoSubmit: true, - initialApplicationPreview: null + initialApplicationPreview: null, + initialDraftPayload: null } smartEntrySessionId.value += 1 } @@ -504,7 +506,8 @@ export function useAppShell() { ? payload.budgetContext : null, initialPromptAutoSubmit: false, - initialApplicationPreview: null + initialApplicationPreview: null, + initialDraftPayload: null } smartEntrySessionId.value += 1 return @@ -531,6 +534,9 @@ export function useAppShell() { initialPromptAutoSubmit: payload.initialPromptAutoSubmit !== false, initialApplicationPreview: payload.applicationPreview && typeof payload.applicationPreview === 'object' ? payload.applicationPreview + : null, + initialDraftPayload: payload.draftPayload && typeof payload.draftPayload === 'object' + ? payload.draftPayload : null } smartEntrySessionId.value += 1 diff --git a/web/src/views/AppShellRouteView.vue b/web/src/views/AppShellRouteView.vue index 6076694..65e3768 100644 --- a/web/src/views/AppShellRouteView.vue +++ b/web/src/views/AppShellRouteView.vue @@ -227,6 +227,7 @@ :initial-budget-context="smartEntryContext.budgetContext" :initial-prompt-auto-submit="smartEntryContext.initialPromptAutoSubmit" :initial-application-preview="smartEntryContext.initialApplicationPreview" + :initial-draft-payload="smartEntryContext.initialDraftPayload" :entry-source="smartEntryContext.source" :request-context="smartEntryContext.request" :invalidated-draft-claim-id="smartEntryInvalidatedDraftClaimId" diff --git a/web/src/views/TravelRequestDetailView.vue b/web/src/views/TravelRequestDetailView.vue index 675fa8c..9f34626 100644 --- a/web/src/views/TravelRequestDetailView.vue +++ b/web/src/views/TravelRequestDetailView.vue @@ -43,10 +43,84 @@ v-for="item in applicationDetailFactItems" :key="item.key" class="application-detail-fact" - :class="{ highlight: item.highlight, emphasis: item.emphasis }" + :class="{ + highlight: item.highlight, + emphasis: item.emphasis, + editable: canEditApplicationDetailItem(item), + editing: isApplicationDetailEditing(item) + }" > {{ item.label }} - {{ item.value }} + + + + {{ deleteBusy ? '删除中' : deleteActionLabel }} -