feat(web): 工作台 AI 模式与差旅/风险建议交互优化

- 新增 PersonalWorkbenchAiMode 组件、AI 侧边栏与 orb 机器人视觉资源
- 新增 aiApplicationDraftModel / aiExpenseDraftModel / aiWorkbenchConversationStore
  及业务准入 aiSidebarBusinessAccess,支撑 AI 模式下的申请与报销草稿
- 顶栏、侧边栏、工作台样式重构,适配 AI 模式切换与响应式布局
- 同步 steward plan/off_topic、差旅报销引导流、风险建议卡片等测试
This commit is contained in:
caoxiaozhu
2026-06-18 22:12:24 +08:00
parent a6674a1e76
commit 0cde1f8990
65 changed files with 8011 additions and 1608 deletions

View File

@@ -1,14 +1,11 @@
.workbench {
--hero-padding-top: 26px;
--hero-padding-bottom: 26px;
--hero-title-size: 30px;
--hero-title-size: 34px;
--hero-copy-gap: 6px;
--hero-title-bottom-gap: 18px;
--composer-min-height: 122px;
--composer-textarea-height: 54px;
--composer-padding-block: 12px;
--quick-prompts-gap-top: 10px;
--capability-row-height: 104px;
--trend-card-min-height: 260px;
--capability-row-height: 116px;
--workbench-ink: var(--ink, #1e293b);
--workbench-text: var(--text, #334155);
--workbench-muted: var(--muted, #64748b);
@@ -30,8 +27,8 @@
margin: 0 auto;
height: 100%;
min-width: 0;
display: grid;
grid-template-rows: auto var(--capability-row-height) minmax(0, 1fr);
display: flex;
flex-direction: column;
gap: 10px;
overflow: visible;
color: var(--workbench-ink);
@@ -41,7 +38,7 @@
background-color: var(--workbench-surface-soft);
}
.workbench :where(button, textarea) {
.workbench :where(button) {
font: inherit;
}
@@ -58,338 +55,139 @@
.workbench :where(button:disabled) { cursor: not-allowed; opacity: 0.7; }
.assistant-hero {
--assistant-bg-position: right center;
--assistant-decor-width: clamp(860px, 62vw, 1180px);
--assistant-decor-opacity: 0.92;
--assistant-readability-mask:
linear-gradient(90deg, rgba(255, 255, 255, 0.74) 0%, rgba(255, 255, 255, 0.34) 46%, rgba(255, 255, 255, 0) 100%);
--assistant-theme-tint:
linear-gradient(135deg, rgba(var(--theme-primary-rgb, 58, 124, 165), 0.11), rgba(var(--theme-primary-rgb, 58, 124, 165), 0.025) 54%, rgba(var(--theme-primary-rgb, 58, 124, 165), 0.075));
.workbench-trend-hero {
position: relative;
z-index: 2;
flex: 0 0 var(--trend-card-min-height);
height: var(--trend-card-min-height);
min-height: 0;
display: flex;
flex-direction: column;
justify-content: center;
overflow: visible;
padding: var(--hero-padding-top) 20px var(--hero-padding-bottom) 52px;
border: 1px solid rgba(var(--theme-primary-rgb, 58, 124, 165), 0.18);
border-radius: 4px;
padding: 24px 28px;
overflow: hidden;
border: 1px solid rgba(var(--theme-primary-rgb, 58, 124, 165), 0.16);
border-radius: 12px;
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.54)),
var(--assistant-theme-tint);
background-color: rgba(247, 252, 255, 0.72);
backdrop-filter: blur(14px) saturate(1.18);
-webkit-backdrop-filter: blur(14px) saturate(1.18);
linear-gradient(120deg, rgba(255, 255, 255, 0.85), rgba(249, 252, 255, 0.7)),
linear-gradient(135deg, rgba(var(--theme-primary-rgb, 58, 124, 165), 0.08), transparent 68%);
backdrop-filter: blur(12px) saturate(140%);
-webkit-backdrop-filter: blur(12px) saturate(140%);
box-shadow:
0 12px 28px rgba(15, 23, 42, 0.045),
inset 0 1px 0 rgba(255, 255, 255, 0.86),
inset 0 -1px 0 rgba(var(--theme-primary-rgb, 58, 124, 165), 0.07);
isolation: isolate;
animation: workbenchItemIn 560ms var(--ease, cubic-bezier(0.2, 0.8, 0.2, 1)) both;
0 16px 32px rgba(15, 23, 42, 0.04),
inset 0 1px 0 rgba(255, 255, 255, 0.94);
animation: workbenchItemIn 520ms var(--ease, cubic-bezier(0.2, 0.8, 0.2, 1)) both;
animation-delay: 0ms;
}
.assistant-hero::after {
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 82%;
min-width: 760px;
background: url("../../images/workbench-hero-right-bg.png") var(--assistant-bg-position) / var(--assistant-decor-width) auto no-repeat;
opacity: var(--assistant-decor-opacity);
pointer-events: none;
z-index: 0;
}
.assistant-hero::before {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
background:
var(--assistant-readability-mask),
linear-gradient(120deg, rgba(255, 255, 255, 0.36), transparent 22%, transparent 72%, rgba(255, 255, 255, 0.18)),
linear-gradient(135deg, rgba(var(--theme-primary-rgb, 58, 124, 165), 0.05), transparent 58%);
pointer-events: none;
z-index: 1;
}
.assistant-copy {
.workbench-trend-card {
position: relative;
z-index: 3;
width: min(980px, 94%);
z-index: 1;
display: grid;
gap: var(--hero-copy-gap);
grid-template-columns: minmax(200px, 0.28fr) minmax(0, 1fr);
align-items: stretch;
gap: 16px;
width: 100%;
height: 100%;
min-height: 0;
padding: 0;
overflow: hidden;
border: 0;
border-radius: 0;
background: transparent;
box-shadow: none;
}
.assistant-copy h1 {
margin: 0 0 var(--hero-title-bottom-gap);
.trend-summary-panel {
display: flex;
flex-direction: column;
gap: 8px;
min-width: 0;
}
.trend-summary-panel h1 {
margin: 0 0 44px 0;
color: var(--workbench-ink);
font-size: var(--hero-title-size);
line-height: 1.18;
line-height: 1.16;
font-weight: 880;
}
.trend-summary-panel p {
margin: 0 0 4px;
color: var(--workbench-muted);
font-size: 14px;
font-weight: 650;
}
.trend-total {
background: linear-gradient(110deg, var(--workbench-ink) 20%, var(--workbench-primary-active) 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
color: var(--workbench-ink);
font-size: clamp(38px, 3.3vw, 54px);
line-height: 1;
font-weight: 860;
letter-spacing: -0.5px;
filter: drop-shadow(0 2px 8px rgba(var(--theme-primary-rgb, 58, 124, 165), 0.12));
}
.trend-change {
display: inline-flex;
align-items: center;
gap: 5px;
min-height: 26px;
color: var(--workbench-primary-active);
font-size: 13px;
font-weight: 800;
}
.trend-change.is-down {
color: #b45309;
}
.trend-summary-panel small {
color: color-mix(in srgb, var(--workbench-muted) 80%, #ffffff);
font-size: 12px;
font-weight: 650;
}
.trend-chart-panel {
display: grid;
grid-template-rows: auto minmax(0, 1fr);
align-content: stretch;
gap: 8px;
min-width: 0;
min-height: 0;
}
.trend-chart-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 14px;
min-width: 0;
color: var(--workbench-ink);
}
.trend-chart-head strong {
font-size: 15px;
font-weight: 850;
}
.assistant-copy h1 span:not(.typing-cursor) {
color: var(--workbench-primary-active);
display: inline-block;
animation: workbenchItemIn 400ms var(--ease, cubic-bezier(0.2, 0.8, 0.2, 1)) both;
}
.typing-cursor {
display: inline-block;
color: var(--workbench-primary-active);
font-weight: 400;
margin-left: 2px;
animation: cursorBlink 0.9s step-end infinite;
}
@keyframes cursorBlink {
0%, 100% { opacity: 1; }
50% { opacity: 0; }
}
.assistant-copy p {
max-width: 680px;
margin: 0 0 2px;
.trend-chart-source {
color: var(--workbench-muted);
font-size: 15px;
line-height: 1.6;
font-weight: 600;
}
.assistant-copy > * {
animation: workbenchItemIn 480ms var(--ease, cubic-bezier(0.2, 0.8, 0.2, 1)) both;
}
.assistant-copy > h1 { animation-delay: 80ms; }
.assistant-copy > p { animation-delay: 160ms; }
.assistant-copy > .assistant-composer { animation-delay: 240ms; }
.assistant-copy > .assistant-file-strip { animation-delay: 320ms; }
.assistant-copy > .quick-prompts { animation-delay: 320ms; }
.assistant-file-input { display: none; }
.assistant-composer {
position: relative;
z-index: 20;
display: grid;
gap: 6px;
max-width: 920px;
min-height: var(--composer-min-height);
padding: var(--composer-padding-block) 18px 10px;
border: 1px solid rgba(var(--theme-primary-rgb, 58, 124, 165), 0.24);
border-radius: 4px;
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.74)),
linear-gradient(135deg, rgba(var(--theme-primary-rgb, 58, 124, 165), 0.045), rgba(255, 255, 255, 0.18));
box-shadow:
0 10px 24px rgba(15, 23, 42, 0.045),
inset 0 1px 0 rgba(255, 255, 255, 0.9),
inset 0 -1px 0 rgba(var(--theme-primary-rgb, 58, 124, 165), 0.06);
backdrop-filter: blur(10px) saturate(1.14);
-webkit-backdrop-filter: blur(10px) saturate(1.14);
transition:
border-color 180ms var(--ease),
background 180ms var(--ease),
box-shadow 180ms var(--ease);
}
.assistant-composer::before {
content: "";
position: absolute;
inset: 0;
z-index: 0;
border-radius: inherit;
background:
linear-gradient(110deg, rgba(255, 255, 255, 0.32), transparent 32%),
linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 42%);
pointer-events: none;
}
.assistant-composer > * {
position: relative;
z-index: 1;
}
.assistant-composer:focus-within {
border-color: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.58);
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78)),
linear-gradient(135deg, rgba(var(--theme-primary-rgb, 58, 124, 165), 0.06), rgba(255, 255, 255, 0.22));
box-shadow:
0 0 0 3px rgba(var(--theme-primary-rgb, 58, 124, 165), 0.11),
0 14px 30px rgba(15, 23, 42, 0.055),
inset 0 1px 0 rgba(255, 255, 255, 0.94),
inset 0 -1px 0 rgba(var(--theme-primary-rgb, 58, 124, 165), 0.08);
}
.assistant-composer textarea {
width: 100%;
min-width: 0;
height: var(--composer-textarea-height);
min-height: var(--composer-textarea-height);
max-height: var(--composer-textarea-height);
resize: none;
border: 0;
padding: 0;
background: transparent;
color: var(--workbench-ink);
font-size: 16px;
line-height: 1.55;
overflow: hidden;
}
.assistant-composer textarea::placeholder {
color: color-mix(in srgb, var(--workbench-muted) 70%, #ffffff);
}
.assistant-composer textarea:focus { outline: none; }
.assistant-composer textarea[readonly] {
color: color-mix(in srgb, var(--workbench-ink) 72%, #ffffff);
cursor: progress;
}
.assistant-intent-status {
display: inline-flex;
align-items: center;
width: fit-content;
max-width: 100%;
min-height: 28px;
gap: 8px;
padding: 0 10px;
border: 1px solid rgba(var(--theme-primary-rgb, 58, 124, 165), 0.22);
border-radius: 4px;
background: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.08);
color: var(--workbench-primary-active);
font-size: 12px;
font-weight: 750;
line-height: 1.35;
}
.assistant-intent-status i {
font-size: 15px;
}
.composer-toolbar {
display: flex;
align-items: center;
gap: 12px;
}
.composer-icon-button,
.composer-send-button {
display: inline-flex;
align-items: center;
justify-content: center;
height: 36px;
border-radius: 4px;
white-space: nowrap;
}
.composer-icon-button {
width: 36px;
border: 1px solid var(--workbench-line);
background: var(--workbench-surface);
color: var(--workbench-text);
font-size: 19px;
}
.composer-count {
margin-left: auto;
color: color-mix(in srgb, var(--workbench-muted) 75%, #ffffff);
font-size: 13px;
font-weight: 650;
}
.composer-send-button {
width: 56px;
background: var(--workbench-primary-active);
color: #fff;
font-size: 18px;
box-shadow: 0 6px 14px rgba(var(--theme-primary-rgb, 58, 124, 165), 0.16);
}
.assistant-file-strip {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}
.assistant-file-note,
.assistant-file-chip {
display: inline-flex;
align-items: center;
max-width: 220px;
min-height: 28px;
padding: 0 10px;
border-radius: 4px;
font-size: 12px;
font-weight: 750;
}
.assistant-file-note {
background: var(--workbench-primary-soft);
color: var(--workbench-primary-active);
}
.assistant-file-chip {
overflow: hidden;
border: 1px solid var(--workbench-line);
background: var(--workbench-surface);
color: var(--workbench-text);
text-overflow: ellipsis;
white-space: nowrap;
}
.assistant-file-clear {
color: var(--workbench-muted);
font-size: 12px;
font-weight: 750;
}
.quick-prompts {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
margin-top: var(--quick-prompts-gap-top);
margin-bottom: 0;
color: var(--workbench-text);
font-size: 14px;
font-weight: 700;
white-space: nowrap;
}
.quick-prompts button {
min-height: 28px;
padding: 0 14px;
border: 1px solid var(--workbench-line);
border-radius: 4px;
background: rgba(255, 255, 255, 0.86);
color: var(--workbench-text);
font-size: 13px;
font-weight: 650;
}
.quick-prompts .quick-more {
display: inline-flex;
align-items: center;
gap: 4px;
border-color: transparent;
background: transparent;
color: var(--workbench-primary-active);
font-weight: 800;
.workbench-trend-chart {
min-height: 0;
}
.capability-grid {
position: relative;
z-index: 1;
flex: 0 0 var(--capability-row-height);
display: grid;
gap: 16px;
min-height: 0;
@@ -407,11 +205,11 @@
position: relative;
isolation: isolate;
display: grid;
grid-template-columns: 40px minmax(0, 1fr) 18px;
grid-template-columns: 44px minmax(0, 1fr) 18px;
align-items: center;
gap: 14px;
gap: 16px;
min-height: 0;
padding: 16px 18px 16px 22px;
padding: 18px 20px 18px 24px;
overflow: visible;
text-align: left;
border: 1px solid rgba(255, 255, 255, 0.9);
@@ -450,10 +248,10 @@
}
.capability-icon {
--workbench-list-icon-size: 40px;
--workbench-list-icon-art-size: 24px;
width: 40px;
height: 40px;
--workbench-list-icon-size: 44px;
--workbench-list-icon-art-size: 26px;
width: 44px;
height: 44px;
color: var(--capability-color);
}
@@ -467,7 +265,7 @@
.capability-copy strong {
color: var(--workbench-ink);
font-size: 14px;
font-size: 15px;
font-weight: 850;
line-height: 1.25;
overflow: hidden;
@@ -479,7 +277,7 @@
.capability-copy small {
overflow: hidden;
color: var(--workbench-muted);
font-size: 12px;
font-size: 12.5px;
line-height: 1.35;
text-overflow: ellipsis;
white-space: nowrap;
@@ -529,6 +327,7 @@
}
.workbench-content-grid {
flex: 1 1 auto;
display: grid;
grid-template-columns: minmax(640px, 1.8fr) minmax(260px, 0.55fr);
gap: 14px;
@@ -1034,9 +833,7 @@
}
.capability-card:hover,
.progress-row:hover,
.quick-prompts button:hover,
.composer-icon-button:hover {
.progress-row:hover {
border-color: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.24);
color: var(--workbench-primary-active);
}
@@ -1053,9 +850,10 @@
}
@media (prefers-reduced-motion: reduce) {
.assistant-hero,
.workbench-trend-hero,
.capability-card,
.workbench-card {
animation: none !important;
}
}