refactor: simplify ChatView and ApprovalCenterView layout structure

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-05-02 11:30:43 +08:00
parent c0720d4b23
commit e356a842ff
2 changed files with 272 additions and 822 deletions

View File

@@ -1,21 +1,6 @@
<template> <template>
<section class="approval-page"> <section class="approval-page">
<div class="approval-kpis">
<article v-for="item in kpis" :key="item.label" class="approval-kpi panel" :style="{ '--accent': item.accent }">
<span class="kpi-icon"><i :class="item.icon"></i></span>
<div>
<p>{{ item.label }}</p>
<strong>{{ item.value }} <small>{{ item.unit }}</small></strong>
<span :class="item.tone">{{ item.meta }} <i v-if="item.trendIcon" :class="item.trendIcon"></i></span>
</div>
</article>
</div>
<article class="approval-list panel"> <article class="approval-list panel">
<header class="list-head">
<h2>待审批列表</h2>
</header>
<nav class="status-tabs" aria-label="审批状态"> <nav class="status-tabs" aria-label="审批状态">
<button <button
v-for="tab in tabs" v-for="tab in tabs"
@@ -35,32 +20,15 @@
<i class="mdi mdi-chevron-down"></i> <i class="mdi mdi-chevron-down"></i>
</button> </button>
</div> </div>
<div class="toolbar-actions">
<button class="sort-btn" type="button">
<i class="mdi mdi-sort"></i>
<span>按提交时间</span>
<i class="mdi mdi-chevron-down"></i>
</button>
<button class="export-btn" type="button">
<i class="mdi mdi-download"></i>
<span>导出</span>
</button>
<button class="return-btn" type="button">
<i class="mdi mdi-undo"></i>
<span>批量退回</span>
</button>
<button class="approve-btn" type="button">
<i class="mdi mdi-check-circle"></i>
<span>批量通过</span>
</button>
</div>
</div> </div>
<p class="hint"><i class="mdi mdi-information-outline"></i> 点击单据行查看审批详情</p> <p class="hint"><i class="mdi mdi-information-outline"></i> 点击单据行查看审批详情</p>
<div class="table-wrap"> <div class="table-wrap">
<table> <table>
<colgroup>
<col><col><col><col><col><col><col><col><col><col><col>
</colgroup>
<thead> <thead>
<tr> <tr>
<th>单号</th> <th>单号</th>
@@ -129,13 +97,6 @@ const activeTab = ref('全部待审')
const tabs = ['全部待审', '高风险', '即将超时', '已处理'] const tabs = ['全部待审', '高风险', '即将超时', '已处理']
const filters = ['法人主体', '费用类型', '风险等级', '金额区间', '所属部门'] const filters = ['法人主体', '费用类型', '风险等级', '金额区间', '所属部门']
const kpis = [
{ label: '待审批单据', value: 12, unit: '单', meta: '较昨日 +3', tone: 'up bad', trendIcon: 'mdi mdi-arrow-up', icon: 'mdi mdi-clipboard-text-outline', accent: '#059669' },
{ label: '高风险单据', value: 4, unit: '单', meta: '较昨日 +1', tone: 'up bad', trendIcon: 'mdi mdi-arrow-up', icon: 'mdi mdi-alert', accent: '#ef4444' },
{ label: '即将超时', value: 3, unit: '单', meta: '30 分钟内', tone: 'neutral', icon: 'mdi mdi-clock-outline', accent: '#f59e0b' },
{ label: '今日已处理', value: 28, unit: '单', meta: '通过率 86%', tone: 'good', icon: 'mdi mdi-check', accent: '#10b981' }
]
const rows = [ const rows = [
{ id: 'RE240712001', applicant: '李文静', avatar: '李', department: '市场部', type: '差旅报销', amount: '¥3,680', time: '07-12 09:20', risk: '中风险', riskTone: 'medium', sla: '4.2h', slaTone: 'safe', node: '财务审批', status: '待审批', statusTone: 'pending' }, { id: 'RE240712001', applicant: '李文静', avatar: '李', department: '市场部', type: '差旅报销', amount: '¥3,680', time: '07-12 09:20', risk: '中风险', riskTone: 'medium', sla: '4.2h', slaTone: 'safe', node: '财务审批', status: '待审批', statusTone: 'pending' },
{ id: 'RE240712002', applicant: '王志强', avatar: '王', department: '销售部', type: '招待费', amount: '¥1,280', time: '07-12 08:15', risk: '低风险', riskTone: 'low', sla: '8.5h', slaTone: 'safe', node: '部门负责人', status: '待审批', statusTone: 'pending' }, { id: 'RE240712002', applicant: '王志强', avatar: '王', department: '销售部', type: '招待费', amount: '¥1,280', time: '07-12 08:15', risk: '低风险', riskTone: 'low', sla: '8.5h', slaTone: 'safe', node: '部门负责人', status: '待审批', statusTone: 'pending' },
@@ -160,90 +121,20 @@ const visibleRows = computed(() => {
height: 100%; height: 100%;
min-height: 0; min-height: 0;
display: grid; display: grid;
grid-template-rows: auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
gap: 14px; gap: 14px;
overflow: hidden; overflow: hidden;
animation: fadeUp 220ms var(--ease) both; animation: fadeUp 220ms var(--ease) both;
} }
.approval-kpis {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 16px;
}
.approval-kpi {
min-height: 96px;
display: grid;
grid-template-columns: 54px minmax(0, 1fr);
align-items: center;
gap: 14px;
padding: 16px 20px;
}
.kpi-icon {
width: 48px;
height: 48px;
display: grid;
place-items: center;
border-radius: 999px;
background: color-mix(in srgb, var(--accent) 14%, white);
color: var(--accent);
font-size: 22px;
}
.approval-kpi p {
color: #334155;
font-size: 14px;
font-weight: 650;
}
.approval-kpi strong {
display: block;
margin-top: 5px;
color: #0f172a;
font-size: 26px;
font-weight: 850;
line-height: 1;
}
.approval-kpi small {
color: #0f172a;
font-size: 15px;
font-weight: 700;
}
.approval-kpi span:not(.kpi-icon) {
display: inline-flex;
align-items: center;
gap: 6px;
margin-top: 7px;
color: #64748b;
font-size: 14px;
}
.approval-kpi .bad i {
color: #ef4444;
}
.approval-kpi .good {
color: #059669 !important;
}
.approval-list { .approval-list {
min-height: 0; min-height: 0;
display: grid; display: grid;
grid-template-rows: auto auto auto auto minmax(0, 1fr) auto; grid-template-rows: auto auto auto minmax(0, 1fr) auto;
padding: 16px 18px; padding: 16px 18px;
overflow: hidden; overflow: hidden;
} }
.list-head h2 {
color: #0f172a;
font-size: 19px;
font-weight: 850;
}
.status-tabs { .status-tabs {
display: flex; display: flex;
gap: 28px; gap: 28px;
@@ -284,8 +175,7 @@ const visibleRows = computed(() => {
margin-top: 14px; margin-top: 14px;
} }
.filter-set, .filter-set {
.toolbar-actions {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 12px; gap: 12px;
@@ -293,10 +183,6 @@ const visibleRows = computed(() => {
} }
.filter-btn, .filter-btn,
.sort-btn,
.export-btn,
.return-btn,
.approve-btn,
.page-size { .page-size {
min-height: 38px; min-height: 38px;
display: inline-flex; display: inline-flex;
@@ -308,13 +194,6 @@ const visibleRows = computed(() => {
font-size: 14px; font-size: 14px;
font-weight: 750; font-weight: 750;
white-space: nowrap; white-space: nowrap;
}
.filter-btn,
.sort-btn,
.export-btn,
.return-btn,
.page-size {
border: 1px solid #d7e0ea; border: 1px solid #d7e0ea;
background: #fff; background: #fff;
color: #334155; color: #334155;
@@ -325,25 +204,7 @@ const visibleRows = computed(() => {
justify-content: space-between; justify-content: space-between;
} }
.sort-btn {
min-width: 138px;
}
.approve-btn {
border: 0;
background: #059669;
color: #fff;
box-shadow: 0 8px 18px rgba(5, 150, 105, .18);
}
.approve-btn:hover {
background: #047857;
}
.filter-btn:hover, .filter-btn:hover,
.sort-btn:hover,
.export-btn:hover,
.return-btn:hover,
.page-size:hover { .page-size:hover {
border-color: rgba(16, 185, 129, .32); border-color: rgba(16, 185, 129, .32);
color: #0f9f78; color: #0f9f78;
@@ -371,6 +232,7 @@ table {
width: 100%; width: 100%;
min-width: 1180px; min-width: 1180px;
border-collapse: collapse; border-collapse: collapse;
table-layout: fixed;
} }
th, th,
@@ -380,11 +242,17 @@ td {
color: #24324a; color: #24324a;
font-size: 14px; font-size: 14px;
line-height: 1.35; line-height: 1.35;
text-align: left; text-align: center;
vertical-align: middle; vertical-align: middle;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
th { th {
position: sticky;
top: 0;
z-index: 1;
background: #f7fafc; background: #f7fafc;
color: #64748b; color: #64748b;
font-size: 13px; font-size: 13px;
@@ -567,10 +435,6 @@ tbody tr:last-child td {
} }
@media (max-width: 1320px) { @media (max-width: 1320px) {
.approval-kpis {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.list-toolbar, .list-toolbar,
.list-foot { .list-foot {
grid-template-columns: 1fr; grid-template-columns: 1fr;
@@ -578,12 +442,7 @@ tbody tr:last-child td {
} }
@media (max-width: 760px) { @media (max-width: 760px) {
.approval-kpis { .approval-list {
grid-template-columns: 1fr;
}
.approval-list,
.approval-kpi {
padding: 16px; padding: 16px;
} }
@@ -592,16 +451,11 @@ tbody tr:last-child td {
overflow-x: auto; overflow-x: auto;
} }
.filter-set, .filter-set {
.toolbar-actions {
width: 100%; width: 100%;
} }
.filter-btn, .filter-btn,
.sort-btn,
.export-btn,
.return-btn,
.approve-btn,
.page-size { .page-size {
width: 100%; width: 100%;
} }

View File

@@ -1,155 +1,173 @@
<template> <template>
<section class="assistant-view"> <section class="qa-view">
<div class="assistant-grid"> <div class="qa-layout">
<article class="conversation-panel panel"> <aside class="left-column">
<header class="panel-head"> <article class="panel side-panel conversation-list">
<h2>今日你可以这样问我</h2> <header>
<button class="text-action" type="button" @click="rotatePrompts"> <h3>问答会话</h3>
<i class="mdi mdi-refresh"></i> <button class="outline-action" type="button" @click="emit('draft', '')">
<span>换一换</span> <i class="mdi mdi-plus"></i>
</button> <span>新建会话</span>
</header> </button>
</header>
<div class="prompt-grid"> <div class="session-scroll">
<button <button
v-for="prompt in visiblePrompts" v-for="item in sessions"
:key="prompt.text" :key="item.title"
class="prompt-card" class="session-row"
type="button" :class="{ active: item.active }"
@click="applyPrompt(prompt.text)" type="button"
> @click="applyPrompt(item.title)"
<i :class="prompt.icon"></i> >
<span>{{ prompt.text }}</span> <span><i class="mdi mdi-message-processing-outline"></i></span>
</button> <strong>{{ item.title }}</strong>
</div> <time>{{ item.time }}</time>
</button>
</div>
</article>
</aside>
<article class="panel chat-panel">
<div ref="localMessageList" class="message-stream" aria-live="polite"> <div ref="localMessageList" class="message-stream" aria-live="polite">
<div class="message-row user"> <div class="talk-row user">
<div class="message-bubble"> <span class="avatar user-avatar"></span>
<p>今天我最应该关注哪些问题</p> <div class="talk-content">
<time>09:41</time> <header><strong>张明</strong><time>10:32</time></header>
</div> <p class="user-question">北京出差酒店超标报销怎么处理</p>
<span class="chat-avatar user-avatar"><i class="mdi mdi-account-outline"></i></span>
</div>
<div class="message-row assistant">
<span class="chat-avatar assistant-avatar"><i class="mdi mdi-sparkles"></i></span>
<div class="message-bubble">
<p>基于当前数据你优先关注以下 3 </p>
<ol>
<li>3 笔单据将在 30 分钟内超时</li>
<li>市场部有 2 笔高风险差旅报销</li>
<li>1 笔报销缺少酒店入住清单建议优先补充</li>
</ol>
<time>09:41</time>
</div> </div>
</div> </div>
<div class="message-row assistant"> <div class="talk-row assistant">
<span class="chat-avatar assistant-avatar"><i class="mdi mdi-sparkles"></i></span> <span class="avatar assistant-avatar"><i class="mdi mdi-robot-outline"></i></span>
<div class="message-bubble"> <div class="talk-content">
<p>为你生成行动建议</p> <header><strong>财务AI助手</strong><time>10:32</time></header>
<ul class="action-list"> <div class="answer-card">
<li><i class="mdi mdi-alert-circle danger"></i><strong>紧急处理</strong>处理即将超时的 3 笔单据避免 SLA 逾期</li> <section>
<li><i class="mdi mdi-information-outline warning"></i><strong>风险关注</strong>审核市场部高风险差旅报销重点关注差旅与超标费用</li> <h4>结论</h4>
<li><i class="mdi mdi-arrow-up-circle info"></i><strong>信息补齐</strong>提醒申请人补齐酒店入住清单加快审批进度</li> <p>酒店费用超过标准的部分原则上不予报销特殊情况可申请例外报销</p>
<li><i class="mdi mdi-check-circle success"></i><strong>效率优化</strong>当前审批瓶颈在财务审批建议分配或优先处理</li> </section>
</ul> <section>
<time>09:42</time> <h4>处理建议</h4>
<ul>
<li>超标部分由个人自理或按制度退回保留超标说明和相关凭证</li>
<li>符合公司相关政策的可提交佐证材料申请例外报销</li>
</ul>
</section>
<section>
<h4>适用规则</h4>
<ul>
<li>差旅报销管理办法2024第十二条住宿标准及超标处理</li>
<li>费用报销审批流程附件1国内差旅住宿标准</li>
</ul>
</section>
<footer>
<span>是否有帮助</span>
<button type="button" aria-label="有帮助"><i class="mdi mdi-thumb-up-outline"></i></button>
<button type="button" aria-label="无帮助"><i class="mdi mdi-thumb-down-outline"></i></button>
</footer>
</div>
</div> </div>
</div> </div>
<div v-for="message in messages" :key="message.id" class="message-row" :class="message.role === 'user' ? 'user' : 'assistant'"> <div class="talk-row user">
<span v-if="message.role !== 'user'" class="chat-avatar assistant-avatar"><i class="mdi mdi-sparkles"></i></span> <span class="avatar user-avatar"></span>
<div class="message-bubble"> <div class="talk-content">
<p>{{ message.text }}</p> <header><strong>张明</strong><time>10:35</time></header>
<p class="user-question">如果出差地公司名称不一致还能报销吗</p>
</div>
</div>
<div class="talk-row assistant">
<span class="avatar assistant-avatar"><i class="mdi mdi-robot-outline"></i></span>
<div class="talk-content">
<header><strong>财务AI助手</strong><time>10:35</time></header>
<div class="answer-card compact">
<section>
<h4>结论</h4>
<p>一般情况下差旅地与参会公司名称不一致需按异常处理建议提供情况说明并加盖公章或补充邀请材料</p>
</section>
<section>
<h4>适用规则</h4>
<ul>
<li>发票管理规定及失误销细则第二章发票基本要求</li>
<li>差旅报销管理办法附件1报销凭证要求</li>
</ul>
</section>
</div>
</div>
</div>
<div v-for="message in messages" :key="message.id" class="talk-row" :class="message.role === 'user' ? 'user' : 'assistant'">
<span class="avatar" :class="message.role === 'user' ? 'user-avatar' : 'assistant-avatar'">
<template v-if="message.role === 'user'"></template>
<i v-else class="mdi mdi-robot-outline"></i>
</span>
<div class="talk-content">
<header>
<strong>{{ message.role === 'user' ? '我' : '财务AI助手' }}</strong>
<time>刚刚</time>
</header>
<p :class="message.role === 'user' ? 'user-question' : 'agent-answer'">{{ message.text }}</p>
</div> </div>
<span v-if="message.role === 'user'" class="chat-avatar user-avatar"><i class="mdi mdi-account-outline"></i></span>
</div> </div>
</div> </div>
<div class="composer"> <div class="composer-wrap">
<textarea <div class="prompt-toolbar">
:value="draft" <span>猜你想问</span>
rows="3" <button v-for="prompt in visiblePrompts" :key="prompt.text" type="button" @click="applyPrompt(prompt.text)">
placeholder="输入问题,例如:今天的异常报销主要原因是什么?" <i :class="prompt.icon"></i>
@input="emit('draft', $event.target.value)" {{ prompt.short }}
@keydown.ctrl.enter.prevent="emit('send')" </button>
></textarea> <button class="icon-refresh" type="button" aria-label="换一批问题" @click="rotatePrompts">
<div class="composer-actions"> <i class="mdi mdi-refresh"></i>
<div class="input-tools"> </button>
<button type="button" aria-label="上传附件" @click="uploadInput?.click()"> </div>
<i class="mdi mdi-paperclip"></i>
</button> <div class="composer">
<button type="button" aria-label="上传图片" @click="uploadInput?.click()"> <textarea
<i class="mdi mdi-image-outline"></i> :value="draft"
</button> rows="2"
<button type="button" aria-label="语音输入"> placeholder="请输入你的问题,例如:差旅报销特殊标准是什么?"
<i class="mdi mdi-microphone"></i> @input="emit('draft', $event.target.value)"
</button> @keydown.ctrl.enter.prevent="emit('send')"
<input ref="uploadInput" class="sr-only" type="file" multiple @change="emit('upload', $event)" /> ></textarea>
</div> <button class="send-button" type="button" aria-label="发送问题" @click="emit('send')">
<span class="counter">{{ draft.length }}/2000</span>
<button class="send-btn" type="button" aria-label="发送消息" @click="emit('send')">
<i class="mdi mdi-send"></i> <i class="mdi mdi-send"></i>
</button> </button>
</div> </div>
</div> </div>
</article> </article>
<aside class="insight-column"> <aside class="right-column">
<article class="insight-card panel"> <article class="panel info-panel hot-top-panel">
<header> <header>
<h3>A. AI 重点关注</h3> <h3><i class="mdi mdi-fire"></i> 热门问题 Top10</h3>
<button type="button">查看全部</button> <button type="button" @click="rotatePrompts">换一批 <i class="mdi mdi-refresh"></i></button>
</header> </header>
<div class="focus-list"> <div class="top-question-list">
<div v-for="item in focusItems" :key="item.label" class="focus-row"> <button v-for="(item, index) in hotQuestions" :key="item" type="button" @click="applyPrompt(item)">
<span :class="['dot-icon', item.tone]"><i :class="item.icon"></i></span> <strong>{{ String(index + 1).padStart(2, '0') }}</strong>
<strong>{{ item.label }}</strong> <span>{{ item }}</span>
<span :class="item.tone">{{ item.value }}</span>
</div>
</div>
</article>
<article class="insight-card panel">
<header>
<h3>B. 场景建议</h3>
<button type="button">查看全部 <i class="mdi mdi-chevron-right"></i></button>
</header>
<div class="suggestion-list">
<button v-for="item in suggestions" :key="item.text" type="button" @click="applyPrompt(item.text)">
<i :class="item.icon"></i>
<span>{{ item.text }}</span>
<i class="mdi mdi-chevron-right"></i> <i class="mdi mdi-chevron-right"></i>
</button> </button>
</div> </div>
</article> </article>
<article class="insight-card panel"> <article class="panel info-panel similar-panel">
<header> <header>
<h3>C. 快捷分析</h3> <h3>相似历史问题</h3>
<button type="button">查看全部 <i class="mdi mdi-chevron-right"></i></button>
</header> </header>
<div class="analysis-grid"> <div class="similar-scroll">
<button v-for="item in analysisActions" :key="item.text" type="button" @click="applyPrompt(item.text)"> <button v-for="item in similarQuestions" :key="item.text" class="similar-row" type="button" @click="applyPrompt(item.text)">
<i :class="item.icon"></i> <span><i class="mdi mdi-file-question-outline"></i>{{ item.text }}</span>
<span>{{ item.text }}</span> <strong>{{ item.score }}</strong>
<i class="mdi mdi-chevron-right"></i>
</button> </button>
</div> </div>
</article> </article>
<article class="insight-card panel">
<header>
<h3>D. 最近提问 / 常用问题</h3>
<button type="button" @click="rotatePrompts">
<i class="mdi mdi-refresh"></i>
<span>换一换</span>
</button>
</header>
<ul class="recent-list">
<li v-for="item in recentQuestions" :key="item">{{ item }}</li>
</ul>
</article>
</aside> </aside>
</div> </div>
</section> </section>
@@ -172,50 +190,58 @@ const props = defineProps({
const emit = defineEmits(['send', 'upload', 'draft', 'approveCase', 'rejectCase', 'selectCase']) const emit = defineEmits(['send', 'upload', 'draft', 'approveCase', 'rejectCase', 'selectCase'])
const localMessageList = ref(null) const localMessageList = ref(null)
const uploadInput = ref(null)
const promptPage = ref(0) const promptPage = ref(0)
const sessions = [
{ title: '北京出差,酒店超标报销怎么处理?', time: '10:32', active: true },
{ title: '发票抬头不一致怎么办', time: '09:48' },
{ title: '借款冲销流程', time: '昨天' },
{ title: '预算占用失败处理', time: '昨天' },
{ title: '招待费报销范围', time: '05-11' },
{ title: '差旅住宿标准如何匹配城市级别?', time: '05-10' },
{ title: '电子发票验真失败如何处理?', time: '05-09' },
{ title: '跨部门项目费用怎么归集?', time: '05-08' },
{ title: '会议费和招待费如何区分?', time: '05-07' },
{ title: '超预算申请需要哪些审批节点?', time: '05-06' },
{ title: '海外差旅汇率按哪天计算?', time: '05-05' },
{ title: '员工退票手续费是否可报销?', time: '05-04' }
]
const prompts = [ const prompts = [
{ icon: 'mdi mdi-chart-line', text: '今天有哪些关键指标异常' }, { icon: 'mdi mdi-bed-outline', short: '差旅标准', text: '差旅报销特殊标准是什么' },
{ icon: 'mdi mdi-file-document-outline-check', text: '哪些单据最需要优先处理?' }, { icon: 'mdi mdi-receipt-text-outline', short: '发票规范', text: '发票丢失如何处理?' },
{ icon: 'mdi mdi-shield-outline', text: '高风险报销主要集中在哪些部门' }, { icon: 'mdi mdi-cash-refund', short: '借款冲销', text: '借款多久内需要冲销' },
{ icon: 'mdi mdi-clock-outline', text: '本周审批效率相比昨天如何' }, { icon: 'mdi mdi-file-chart-outline', short: '预算冲突', text: '预算不足如何申请' },
{ icon: 'mdi mdi-lightbulb-outline', text: '给我当前报销场景的处理建议' }, { icon: 'mdi mdi-shield-check-outline', short: '审批要求', text: '酒店超标后如何申请例外报销?' },
{ icon: 'mdi mdi-office-building', text: '生成一份运营简报' }, { icon: 'mdi mdi-office-building-marker', short: '住宿标准', text: '差旅住宿标准按什么规则执行?' },
{ icon: 'mdi mdi-filter-outline', text: '找出即将超时的单据' }, { icon: 'mdi mdi-file-question-outline', short: '材料补齐', text: '报销附件缺失怎么补交?' },
{ icon: 'mdi mdi-wallet', text: '分析本月预算执行压力' } { icon: 'mdi mdi-alert-circle-outline', short: '风险等级', text: '哪些情况会触发中风险?' }
] ]
const visiblePrompts = computed(() => { const visiblePrompts = computed(() => prompts.slice((promptPage.value % 2) * 4, (promptPage.value % 2) * 4 + 4))
const start = (promptPage.value % 2) * 6
return prompts.slice(start, start + 6).length === 6 ? prompts.slice(start, start + 6) : prompts.slice(0, 6)
})
const focusItems = [ const hotQuestions = [
{ icon: 'mdi mdi-star', tone: 'danger', label: '3 单即将超时', value: '30 分钟内超时' }, '差旅报销标准是什么?',
{ icon: 'mdi mdi-alert', tone: 'warning', label: '市场部高风险占比最高', value: '高风险 2 单' }, '酒店超标后如何申请例外报销?',
{ icon: 'mdi mdi-swap-horizontal', tone: 'info', label: '重复报销风险 1 笔', value: '待核查' }, '发票丢失如何处理?',
{ icon: 'mdi mdi-check-circle', tone: 'success', label: '1 笔缺失附件', value: '待补充' } '借款多久内需要冲销?',
'预算超支如何申请?',
'招待费报销需要哪些凭证?',
'发票抬头不一致是否允许报销?',
'报销附件缺失怎么补交?',
'差旅住宿标准按什么规则执行?',
'电子发票验真失败如何处理?'
] ]
const suggestions = [ const similarQuestions = [
{ icon: 'mdi mdi-send', text: '优先处理差旅报销(占待审 62%' }, { text: '酒店超标后如何申请例外报销?', score: '96%' },
{ icon: 'mdi mdi-file-document-outline-plus', text: '先补齐缺失附件再提交审批' }, { text: '发票抬头不一致是否允许报销?', score: '92%' },
{ icon: 'mdi mdi-car', text: '对超标出租车费用要求补充说明' } { text: '差旅住宿标准按什么规则执行?', score: '89%' },
] { text: '预算不足时能否先提交报销?', score: '86%' },
{ text: '电子发票验真失败是否可以先报销?', score: '84%' },
const analysisActions = [ { text: '跨部门项目费用如何归集?', score: '81%' },
{ icon: 'mdi mdi-waveform', text: '异常原因分析' }, { text: '招待费报销需要哪些凭证?', score: '78%' },
{ icon: 'mdi mdi-office-building', text: '部门对比' }, { text: '借款冲销逾期会影响报销吗?', score: '76%' }
{ icon: 'mdi mdi-shield-outline', text: '风险趋势' },
{ icon: 'mdi mdi-filter-outline', text: '审批瓶颈' }
]
const recentQuestions = [
'最近 7 天哪些部门的审批时长最长?',
'本月报销金额环比增长最快的是哪个部门?',
'有哪些报销类型的超标率最高?',
'SLA 未达成的主要原因是什么?'
] ]
function rotatePrompts() { function rotatePrompts() {
@@ -229,517 +255,87 @@ function applyPrompt(text) {
watch( watch(
() => props.messages.length, () => props.messages.length,
() => { () => {
nextTick(() => { nextTick(() => localMessageList.value?.scrollTo({ top: localMessageList.value.scrollHeight, behavior: 'smooth' }))
localMessageList.value?.scrollTo({ top: localMessageList.value.scrollHeight, behavior: 'smooth' })
})
} }
) )
</script> </script>
<style scoped> <style scoped>
.assistant-view { .qa-view { height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); gap: 0; overflow: hidden; animation: fadeUp 240ms var(--ease) both; }
height: 100%; .qa-layout { height: 100%; min-height: 0; display: grid; grid-template-columns: 330px minmax(0, 1fr) 395px; gap: 14px; overflow: hidden; }
min-height: 0; .left-column, .right-column { height: 100%; min-height: 0; overflow: hidden; }
display: grid; .left-column { display: grid; grid-template-rows: minmax(0, 1fr); }
animation: fadeUp 240ms var(--ease) both; .right-column { display: grid; grid-template-rows: minmax(0, 1.06fr) minmax(0, .94fr); gap: 12px; }
} .side-panel, .info-panel { min-height: 0; padding: 16px 20px; overflow: hidden; }
.conversation-list, .info-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.assistant-grid { .side-panel header, .info-panel header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
min-height: 0; .side-panel h3, .info-panel h3 { display: inline-flex; align-items: center; gap: 8px; color: #0f172a; font-size: 17px; font-weight: 850; }
display: grid; .outline-action, .info-panel header button { height: 34px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d8e3ed; border-radius: 8px; background: #fff; color: #0f9f78; font-size: 13px; font-weight: 750; white-space: nowrap; }
grid-template-columns: minmax(0, 1.5fr) minmax(360px, .95fr); .outline-action { padding: 0 12px; }
gap: 16px; .info-panel header button { border: 0; color: #64748b; }
align-items: stretch; .session-scroll, .top-question-list, .similar-scroll { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
} .session-scroll { display: grid; align-content: start; gap: 4px; padding-right: 4px; }
.session-row { width: 100%; min-height: 48px; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: #334155; text-align: left; }
.conversation-panel { .session-row.active, .session-row:hover { background: #eaf8f1; color: #0f8f68; }
min-height: 0; .session-row span { color: #10b981; }
display: grid; .session-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 700; }
grid-template-rows: auto auto minmax(0, 1fr) auto; .session-row time { color: #94a3b8; font-size: 12px; }
padding: 20px; .chat-panel { height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; }
overflow: hidden; .message-stream { min-height: 0; display: grid; align-content: start; gap: 16px; padding: 16px 18px 8px; overflow-y: auto; scrollbar-width: thin; }
} .talk-row { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: start; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 999px; color: #fff; font-size: 15px; font-weight: 850; }
.panel-head, .user-avatar { background: linear-gradient(135deg, #26364d, #61748a); }
.insight-card header { .assistant-avatar { background: #10b981; font-size: 20px; }
display: flex; .talk-content header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
align-items: center; .talk-content header strong { color: #334155; font-size: 14px; font-weight: 800; }
justify-content: space-between; .talk-content header time { color: #94a3b8; font-size: 12px; }
gap: 12px; .user-question { display: inline-block; margin: 0; padding: 9px 16px; border-radius: 8px; background: #e8f5ef; color: #334155; font-size: 14px; line-height: 1.5; }
} .answer-card, .agent-answer { max-width: 760px; border: 1px solid #dce5ef; border-radius: 10px; background: #fff; color: #334155; box-shadow: 0 8px 24px rgba(15, 23, 42, .04); }
.answer-card { display: grid; gap: 10px; padding: 13px 18px; }
.panel-head h2, .answer-card.compact { gap: 10px; }
.insight-card h3 { .answer-card h4 { margin: 0 0 5px; color: #10a272; font-size: 13px; font-weight: 850; }
color: #0f172a; .answer-card p, .answer-card ul { margin: 0; font-size: 14px; line-height: 1.58; }
font-size: 17px; .answer-card ul { padding-left: 18px; }
font-weight: 800; .answer-card footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; color: #64748b; font-size: 12px; }
} .answer-card footer button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: #64748b; }
.answer-card footer button:hover { background: #f1f5f9; color: #0f9f78; }
.text-action, .agent-answer { margin: 0; padding: 12px 16px; font-size: 14px; line-height: 1.65; }
.insight-card header button { .composer-wrap { border-top: 1px solid #eef2f7; padding: 10px 14px 12px; background: #fff; }
display: inline-flex; .prompt-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; overflow-x: auto; }
align-items: center; .prompt-toolbar span { flex: 0 0 auto; color: #64748b; font-size: 13px; font-weight: 800; }
gap: 6px; .prompt-toolbar button { height: 34px; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; border: 1px solid #dce5ef; border-radius: 8px; background: #fff; color: #334155; font-size: 13px; font-weight: 750; }
border: 0; .prompt-toolbar button i { color: #10b981; }
background: transparent; .prompt-toolbar .icon-refresh { width: 34px; padding: 0; justify-content: center; }
color: #64748b; .composer { min-height: 64px; display: grid; grid-template-columns: minmax(0, 1fr) 48px; align-items: center; gap: 10px; padding: 8px; border: 1px solid #cbd8e5; border-radius: 8px; background: linear-gradient(180deg, #fff, #fbfdff); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease; }
font-size: 13px; .composer:focus-within { border-color: rgba(16, 185, 129, .58); background: #fff; box-shadow: 0 0 0 3px rgba(16, 185, 129, .11), 0 10px 24px rgba(15, 23, 42, .06); }
} .composer textarea { height: 48px; min-height: 48px; resize: none; border: 0; padding: 5px 8px; background: transparent; color: #0f172a; font-size: 14px; line-height: 1.55; }
.composer textarea::placeholder { color: #94a3b8; }
.text-action:hover, .composer textarea:focus { outline: none; }
.insight-card header button:hover { .send-button { width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 8px; background: #10b981; color: #fff; font-size: 20px; box-shadow: 0 8px 18px rgba(16, 185, 129, .20); transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
color: #10b981; .send-button:hover { background: #0ea672; box-shadow: 0 10px 22px rgba(16, 185, 129, .24); }
} .send-button:active { transform: scale(.96); }
.hot-top-panel h3 i { color: #ef4444; }
.prompt-grid { .top-question-list { display: grid; align-content: start; gap: 8px; padding-right: 4px; }
display: grid; .top-question-list button { min-height: 42px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 14px; align-items: center; gap: 10px; padding: 0 8px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #334155; text-align: left; }
grid-template-columns: repeat(3, minmax(0, 1fr)); .top-question-list button:hover { border-color: rgba(16, 185, 129, .32); color: #0f9f78; }
gap: 12px; .top-question-list strong { color: #10b981; font-size: 13px; font-weight: 850; font-variant-numeric: tabular-nums; }
margin-top: 16px; .top-question-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 750; }
} .top-question-list i { color: #94a3b8; }
.similar-panel { display: grid; }
.prompt-card { .similar-scroll { display: grid; align-content: start; padding-right: 4px; }
min-height: 52px; .similar-row { min-height: 46px; display: grid; grid-template-columns: minmax(0, 1fr) 48px 14px; align-items: center; gap: 10px; border: 0; border-top: 1px solid #eef2f7; background: transparent; color: #334155; text-align: left; }
display: grid; .similar-row:first-child { border-top: 0; }
grid-template-columns: 24px minmax(0, 1fr); .similar-row span { min-width: 0; display: inline-flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 700; }
align-items: center; .similar-row span i { color: #64748b; font-size: 17px; }
gap: 10px; .similar-row strong { height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: #e8f8f0; color: #15945f; font-size: 13px; font-weight: 850; }
padding: 8px 14px; .similar-row > i { color: #94a3b8; }
border: 1px solid #dce5ef; @media (max-width: 1480px) { .qa-layout { grid-template-columns: 300px minmax(0, 1fr) 360px; } }
border-radius: 8px;
background: #fff;
color: #334155;
text-align: left;
transition: border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}
.prompt-card:hover {
border-color: rgba(16,185,129,.36);
box-shadow: 0 8px 20px rgba(15,23,42,.06);
color: #0f9f78;
}
.prompt-card i {
color: #10b981;
font-size: 19px;
}
.prompt-card:nth-child(4n) i,
.prompt-card:nth-child(5n) i {
color: #f59e0b;
}
.prompt-card:nth-child(3n) i {
color: #3b82f6;
}
.prompt-card span {
min-width: 0;
font-size: 14px;
font-weight: 650;
line-height: 1.35;
}
.message-stream {
min-height: 0;
display: grid;
align-content: start;
gap: 14px;
margin-top: 18px;
padding: 2px 8px 12px 0;
overflow-y: auto;
overscroll-behavior: contain;
scrollbar-gutter: stable;
scrollbar-width: thin;
scrollbar-color: #b6c4d5 #f1f5f9;
}
.message-stream::-webkit-scrollbar,
.insight-column::-webkit-scrollbar {
width: 8px;
}
.message-stream::-webkit-scrollbar-track,
.insight-column::-webkit-scrollbar-track {
border-radius: 999px;
background: #f1f5f9;
}
.message-stream::-webkit-scrollbar-thumb,
.insight-column::-webkit-scrollbar-thumb {
border-radius: 999px;
background: #b6c4d5;
}
.message-row {
display: grid;
gap: 10px;
align-items: start;
}
.message-row.assistant {
grid-template-columns: 38px minmax(0, .74fr);
}
.message-row.user {
grid-template-columns: minmax(0, .4fr) 38px;
justify-content: end;
}
.chat-avatar {
width: 34px;
height: 34px;
display: grid;
place-items: center;
border-radius: 999px;
font-size: 17px;
}
.assistant-avatar {
background: #dff7ee;
color: #0f9f78;
}
.user-avatar {
background: #dff7ee;
color: #0f9f78;
}
.message-bubble {
position: relative;
padding: 14px 16px;
border: 1px solid #dce5ef;
border-radius: 10px;
background: #fff;
color: #334155;
font-size: 14px;
line-height: 1.65;
}
.message-row.user .message-bubble {
background: linear-gradient(135deg, rgba(16,185,129,.14), rgba(16,185,129,.07));
border-color: rgba(16,185,129,.22);
}
.message-bubble p,
.message-bubble ol,
.message-bubble ul {
margin: 0;
}
.message-bubble ol {
padding-left: 18px;
color: #0f9f78;
}
.action-list {
display: grid;
gap: 4px;
padding-left: 0;
list-style: none;
}
.action-list li {
display: flex;
gap: 8px;
}
.action-list i {
margin-top: 4px;
}
.danger { color: #ef4444; }
.warning { color: #f59e0b; }
.info { color: #3b82f6; }
.success { color: #10b981; }
.message-bubble time {
float: right;
margin-left: 14px;
color: #64748b;
font-size: 12px;
}
.composer {
min-height: 94px;
display: grid;
grid-template-rows: minmax(48px, 1fr) auto;
border: 1px solid #d7e0ea;
border-radius: 10px;
background: #fff;
overflow: hidden;
}
.composer textarea {
width: 100%;
min-height: 52px;
resize: none;
border: 0;
padding: 14px 16px 6px;
color: #0f172a;
font-size: 14px;
line-height: 1.5;
}
.composer textarea::placeholder {
color: #91a2b5;
}
.composer textarea:focus {
outline: none;
}
.composer-actions {
display: grid;
grid-template-columns: 1fr auto auto;
align-items: center;
gap: 12px;
padding: 0 10px 10px 12px;
}
.input-tools {
display: flex;
gap: 8px;
}
.input-tools button,
.send-btn {
width: 34px;
height: 34px;
display: grid;
place-items: center;
border: 0;
border-radius: 8px;
}
.input-tools button {
background: transparent;
color: #42526b;
font-size: 18px;
}
.input-tools button:hover {
background: #f1f5f9;
color: #0f9f78;
}
.counter {
color: #64748b;
font-size: 13px;
}
.send-btn {
background: #10b981;
color: #fff;
font-size: 17px;
}
.send-btn:hover {
background: #0ea672;
}
.insight-column {
min-height: 0;
max-height: 100%;
display: grid;
align-content: start;
gap: 12px;
overflow-y: auto;
overscroll-behavior: contain;
padding-right: 4px;
scrollbar-gutter: stable;
scrollbar-width: thin;
scrollbar-color: #b6c4d5 #f1f5f9;
}
.insight-card {
padding: 18px 20px;
}
.focus-list {
display: grid;
margin-top: 12px;
}
.focus-row {
min-height: 34px;
display: grid;
grid-template-columns: 24px minmax(0, 1fr) auto;
align-items: center;
gap: 10px;
border-bottom: 1px solid #eef2f7;
color: #334155;
font-size: 14px;
}
.focus-row:last-child {
border-bottom: 0;
}
.dot-icon {
width: 18px;
height: 18px;
display: grid;
place-items: center;
border-radius: 999px;
color: #fff;
font-size: 10px;
}
.dot-icon.danger { background: #ef4444; color: #fff; }
.dot-icon.warning { background: #f59e0b; color: #fff; }
.dot-icon.info { background: #3b82f6; color: #fff; }
.dot-icon.success { background: #10b981; color: #fff; }
.focus-row strong {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: 600;
}
.focus-row > span:last-child {
font-size: 13px;
font-weight: 700;
}
.suggestion-list {
display: grid;
gap: 8px;
margin-top: 12px;
}
.suggestion-list button {
min-height: 42px;
display: grid;
grid-template-columns: 22px minmax(0, 1fr) 16px;
align-items: center;
gap: 10px;
padding: 0 10px;
border: 1px solid #e2e8f0;
border-radius: 8px;
background: #fff;
color: #334155;
text-align: left;
}
.suggestion-list button:hover,
.analysis-grid button:hover {
border-color: rgba(16,185,129,.32);
color: #0f9f78;
}
.suggestion-list i:first-child {
color: #3b82f6;
}
.suggestion-list button:nth-child(2) i:first-child {
color: #10b981;
}
.suggestion-list button:nth-child(3) i:first-child {
color: #f59e0b;
}
.analysis-grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 10px;
margin-top: 14px;
}
.analysis-grid button {
min-height: 44px;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 0 10px;
border: 1px solid #e2e8f0;
border-radius: 8px;
background: #fff;
color: #334155;
font-size: 13px;
font-weight: 650;
white-space: nowrap;
}
.analysis-grid i {
color: #10b981;
font-size: 18px;
}
.recent-list {
display: grid;
gap: 10px;
margin: 14px 0 0;
padding: 0;
list-style: none;
}
.recent-list li {
position: relative;
padding-left: 16px;
color: #334155;
font-size: 14px;
}
.recent-list li::before {
content: "";
position: absolute;
left: 0;
top: .62em;
width: 7px;
height: 7px;
border-radius: 999px;
background: #10b981;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
@media (max-width: 1280px) { @media (max-width: 1280px) {
.assistant-grid { .qa-layout { grid-template-columns: 1fr; overflow-y: auto; }
grid-template-columns: 1fr; .left-column, .right-column { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
overflow-y: auto;
}
.insight-column {
grid-template-columns: repeat(2, minmax(0, 1fr));
max-height: none;
overflow: visible;
}
} }
@media (max-width: 760px) { @media (max-width: 760px) {
.prompt-grid, .left-column, .right-column { grid-template-columns: 1fr; }
.insight-column, .composer { grid-template-columns: minmax(0, 1fr) 48px; }
.analysis-grid {
grid-template-columns: 1fr;
}
.conversation-panel,
.insight-card {
padding: 16px;
}
.message-row.assistant,
.message-row.user {
grid-template-columns: 34px minmax(0, 1fr);
}
.message-row.user {
grid-template-columns: minmax(0, 1fr) 34px;
}
} }
</style> </style>