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:
@@ -1,21 +1,6 @@
|
||||
<template>
|
||||
<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">
|
||||
<header class="list-head">
|
||||
<h2>待审批列表</h2>
|
||||
</header>
|
||||
|
||||
<nav class="status-tabs" aria-label="审批状态">
|
||||
<button
|
||||
v-for="tab in tabs"
|
||||
@@ -35,32 +20,15 @@
|
||||
<i class="mdi mdi-chevron-down"></i>
|
||||
</button>
|
||||
</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>
|
||||
|
||||
<p class="hint"><i class="mdi mdi-information-outline"></i> 点击单据行查看审批详情</p>
|
||||
|
||||
<div class="table-wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col><col><col><col><col><col><col><col><col><col><col>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>单号</th>
|
||||
@@ -129,13 +97,6 @@ const activeTab = ref('全部待审')
|
||||
const tabs = ['全部待审', '高风险', '即将超时', '已处理']
|
||||
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 = [
|
||||
{ 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' },
|
||||
@@ -160,90 +121,20 @@ const visibleRows = computed(() => {
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
display: grid;
|
||||
grid-template-rows: auto minmax(0, 1fr);
|
||||
grid-template-rows: minmax(0, 1fr);
|
||||
gap: 14px;
|
||||
overflow: hidden;
|
||||
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 {
|
||||
min-height: 0;
|
||||
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;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.list-head h2 {
|
||||
color: #0f172a;
|
||||
font-size: 19px;
|
||||
font-weight: 850;
|
||||
}
|
||||
|
||||
.status-tabs {
|
||||
display: flex;
|
||||
gap: 28px;
|
||||
@@ -284,8 +175,7 @@ const visibleRows = computed(() => {
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
.filter-set,
|
||||
.toolbar-actions {
|
||||
.filter-set {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
@@ -293,10 +183,6 @@ const visibleRows = computed(() => {
|
||||
}
|
||||
|
||||
.filter-btn,
|
||||
.sort-btn,
|
||||
.export-btn,
|
||||
.return-btn,
|
||||
.approve-btn,
|
||||
.page-size {
|
||||
min-height: 38px;
|
||||
display: inline-flex;
|
||||
@@ -308,13 +194,6 @@ const visibleRows = computed(() => {
|
||||
font-size: 14px;
|
||||
font-weight: 750;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.filter-btn,
|
||||
.sort-btn,
|
||||
.export-btn,
|
||||
.return-btn,
|
||||
.page-size {
|
||||
border: 1px solid #d7e0ea;
|
||||
background: #fff;
|
||||
color: #334155;
|
||||
@@ -325,25 +204,7 @@ const visibleRows = computed(() => {
|
||||
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,
|
||||
.sort-btn:hover,
|
||||
.export-btn:hover,
|
||||
.return-btn:hover,
|
||||
.page-size:hover {
|
||||
border-color: rgba(16, 185, 129, .32);
|
||||
color: #0f9f78;
|
||||
@@ -371,6 +232,7 @@ table {
|
||||
width: 100%;
|
||||
min-width: 1180px;
|
||||
border-collapse: collapse;
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
th,
|
||||
@@ -380,11 +242,17 @@ td {
|
||||
color: #24324a;
|
||||
font-size: 14px;
|
||||
line-height: 1.35;
|
||||
text-align: left;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
th {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
background: #f7fafc;
|
||||
color: #64748b;
|
||||
font-size: 13px;
|
||||
@@ -567,10 +435,6 @@ tbody tr:last-child td {
|
||||
}
|
||||
|
||||
@media (max-width: 1320px) {
|
||||
.approval-kpis {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.list-toolbar,
|
||||
.list-foot {
|
||||
grid-template-columns: 1fr;
|
||||
@@ -578,12 +442,7 @@ tbody tr:last-child td {
|
||||
}
|
||||
|
||||
@media (max-width: 760px) {
|
||||
.approval-kpis {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.approval-list,
|
||||
.approval-kpi {
|
||||
.approval-list {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
@@ -592,16 +451,11 @@ tbody tr:last-child td {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.filter-set,
|
||||
.toolbar-actions {
|
||||
.filter-set {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.filter-btn,
|
||||
.sort-btn,
|
||||
.export-btn,
|
||||
.return-btn,
|
||||
.approve-btn,
|
||||
.page-size {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user