feat: enhance layout components, data layer and global styles

- SidebarRail, TopBar, FilterBar: improved navigation and filtering UX

- metrics.js, requests.js: expanded data with multi-range trend series

- composables: enhanced useChat, useNavigation, useRequests

- global.css: refined design tokens and utility classes

- Add DocFilterBar component and LoginView page

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-04-29 23:35:56 +08:00
parent 7141e1d11a
commit e54ebd072a
15 changed files with 845 additions and 199 deletions

View File

@@ -1,56 +1,163 @@
<template>
<header class="topbar">
<div>
<div class="eyebrow">Global finance operations</div>
<div class="title-group">
<div class="eyebrow">Smart Expense Operations</div>
<h1>{{ currentView.title }}</h1>
<p>{{ currentView.desc }}</p>
</div>
<div class="top-actions">
<label class="search">
<span v-html="searchIcon"></span>
<input :value="search" type="search" placeholder="搜索申请人、单号、费用类型" @input="emit('update:search', $event.target.value)" />
</label>
<button class="btn" type="button" @click="emit('batchApprove')">
<span v-html="checkIcon"></span>
批量通过
</button>
<button class="btn primary" type="button" @click="emit('openChat')">
<span v-html="messageIcon"></span>
合规对话
</button>
<span class="search-wrap">
<i class="pi pi-search search-icon"></i>
<input :value="search" type="search" :placeholder="isChat ? '搜索单号、申请人、目的地' : '搜索申请人、单号、费用类型'" @input="emit('update:search', $event.target.value)" />
</span>
<div v-if="!isChat" class="date-chip">
<i class="pi pi-calendar"></i>
<span>2024-07-06 ~ 2024-07-12</span>
</div>
<template v-if="isChat">
<button class="top-btn primary" type="button" @click="emit('newApplication')">
<i class="pi pi-plus"></i>
<span>新建出差申请</span>
</button>
</template>
<template v-else>
<button class="top-btn primary" type="button" @click="emit('openChat')">
<i class="pi pi-sparkles"></i>
<span>AI 助手</span>
</button>
</template>
</div>
</header>
</template>
<script setup>
import { icons } from '../../data/icons.js'
import { computed } from 'vue'
defineProps({
const props = defineProps({
currentView: { type: Object, required: true },
search: { type: String, default: '' }
search: { type: String, default: '' },
activeView: { type: String, default: '' }
})
const emit = defineEmits(['update:search', 'batchApprove', 'openChat'])
const emit = defineEmits(['update:search', 'batchApprove', 'openChat', 'newApplication'])
const searchIcon = icons.search
const checkIcon = icons.check
const messageIcon = icons.message
const isChat = computed(() => props.activeView === 'chat')
</script>
<style scoped>
.topbar {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 24px;
padding: 22px 28px;
border-bottom: 1px solid var(--line);
background: rgba(255,255,255,.9);
backdrop-filter: blur(14px);
padding: 16px;
background: #fff;
}
.title-group {
min-width: 0;
}
.topbar p {
margin-top: 4px;
max-width: 720px;
color: var(--muted);
font-size: 14px;
line-height: 1.45;
}
.top-actions {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 16px;
flex-wrap: wrap;
}
.search-wrap {
position: relative;
width: 256px;
}
.search-icon {
position: absolute;
left: 13px;
top: 50%;
transform: translateY(-50%);
color: var(--muted);
font-size: 14px;
}
.search-wrap input {
width: 100%;
height: 40px;
padding: 0 14px 0 38px;
border: 1px solid #cbd5e1;
border-radius: 6px;
font-size: 14px;
transition: border-color 160ms ease, box-shadow 160ms ease;
}
.search-wrap input:focus {
border-color: #10b981;
box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.16);
outline: none;
}
.date-chip {
height: 40px;
display: inline-flex;
align-items: center;
gap: 8px;
padding: 0 32px 0 12px;
border: 1px solid #cbd5e1;
border-radius: 6px;
background: #fff;
color: var(--text);
font-size: 14px;
font-weight: 400;
}
.date-chip .pi {
color: #94a3b8;
}
.top-btn {
height: 40px;
display: inline-flex;
align-items: center;
gap: 8px;
padding: 0 16px;
border: 0;
border-radius: 6px;
font-size: 14px;
font-weight: 500;
transition: background 160ms ease;
}
.top-btn.primary {
background: var(--primary);
color: #fff;
}
.top-btn.primary:hover {
background: #0ea672;
}
@media (max-width: 760px) {
.topbar {
flex-direction: column;
align-items: stretch;
padding: 18px 16px;
}
.top-actions,
.search-wrap,
.date-chip {
width: 100%;
}
}
.topbar p { margin-top: 6px; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.search { position: relative; min-width: 300px; }
.search span { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); }
.search span svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.search input { width: 100%; height: 42px; padding: 0 14px 0 40px; border: 1px solid var(--line); border-radius: var(--radius); }
</style>