Files
37duAutomation/tests/样式/总览.html
T

338 lines
22 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>37du 自动化工作台 - 总览 (统一版)</title>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script src="https://cdn.tailwindcss.com"></script>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #d1d5db; }
.progress-gradient { background: linear-gradient(90deg, #3b82f6 0%, #6366f1 100%); }
.table-row-hover:hover { background-color: #f8fafc; }
</style>
</head>
<body class="bg-[#f5f6f8] text-gray-800 h-screen overflow-hidden text-sm">
<div id="app" class="flex h-full w-full p-2 gap-2">
<!-- ================= 左侧导航栏 ================= -->
<aside class="w-[220px] bg-white rounded-xl flex flex-col shadow-sm border border-gray-100 overflow-y-auto flex-shrink-0">
<div class="p-4 flex items-center gap-2 border-b border-gray-50">
<div class="w-6 h-6 bg-blue-600 rounded flex items-center justify-center text-white text-xs font-bold">37</div>
<span class="font-bold text-gray-700">37du 自动化工作台</span>
</div>
<div class="p-3 space-y-1">
<a href="#" class="flex items-center justify-between px-3 py-2 bg-blue-50 text-blue-600 rounded-lg">
<div class="flex items-center gap-2">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"></path></svg>
<span>总览</span>
</div>
<span class="text-xs bg-blue-100 text-blue-600 px-2 py-0.5 rounded-full">12</span>
</a>
<a href="#" class="flex items-center justify-between px-3 py-2 text-gray-600 hover:bg-gray-50 rounded-lg">
<div class="flex items-center gap-2">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"></path></svg>
<span>场景库</span>
</div>
<span class="text-xs text-gray-400">18</span>
</a>
<a href="#" class="flex items-center justify-between px-3 py-2 text-gray-600 hover:bg-gray-50 rounded-lg">
<div class="flex items-center gap-2">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg>
<span>计划</span>
</div>
<span class="text-xs text-gray-400">7</span>
</a>
<a href="#" class="flex items-center justify-between px-3 py-2 text-gray-600 hover:bg-gray-50 rounded-lg">
<div class="flex items-center gap-2">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"></path></svg>
<span>平台账号</span>
</div>
<span class="text-xs bg-green-100 text-green-600 px-2 py-0.5 rounded-full">2/3</span>
</a>
</div>
<div class="px-3 pb-2 mt-2">
<div class="relative">
<svg class="w-3.5 h-3.5 absolute left-2.5 top-2.5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path></svg>
<input type="text" placeholder="搜索场景" class="w-full bg-gray-50 border border-gray-100 rounded-md py-1.5 pl-8 pr-3 text-xs focus:outline-none focus:ring-1 focus:ring-blue-500">
</div>
</div>
<div class="p-3 mt-1 flex-1">
<div class="text-xs text-gray-400 mb-2 px-1">最近使用</div>
<ul class="space-y-0.5">
<li v-for="item in recentUses" :key="item.name" class="flex items-center justify-between px-2 py-2 hover:bg-gray-50 rounded-md cursor-pointer group">
<div class="flex items-center gap-2 truncate">
<span class="w-1.5 h-1.5 rounded-full shrink-0" :class="item.color"></span>
<span class="text-gray-700 text-xs truncate">{{ item.name }}</span>
</div>
<span class="text-gray-400 text-[10px] shrink-0">{{ item.time }}</span>
</li>
</ul>
</div>
<div class="p-3 border-t border-gray-100">
<div class="flex items-center justify-between bg-gray-50 rounded-lg p-2">
<div class="flex items-center gap-2">
<div class="w-6 h-6 bg-blue-100 rounded-full flex items-center justify-center text-blue-600 text-xs font-bold">李</div>
<div>
<div class="text-xs font-medium text-gray-700">李骁柠</div>
<div class="text-[10px] text-gray-400">本机操作员</div>
</div>
</div>
<button class="text-[10px] text-gray-500 hover:text-gray-700">退出</button>
</div>
</div>
</aside>
<!-- ================= 中间主内容区 (统一的大白卡包裹) ================= -->
<main class="flex-1 flex flex-col min-w-0 bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
<!-- 1. 头部区域 (去除了灰底,融为一体) -->
<header class="px-6 py-5 border-b border-gray-100 flex justify-between items-end flex-shrink-0">
<div>
<div class="flex items-center gap-2 text-xs text-gray-400 mb-2">
<span>总览</span>
</div>
<h1 class="text-2xl font-bold text-gray-800 mb-1">今日运行简报</h1>
<p class="text-xs text-gray-500">2026.10.23 周五 · 3 个计划待执行 · 每 30 秒自动刷新</p>
</div>
<div class="flex gap-2 mb-1">
<button class="px-4 py-1.5 bg-white border border-gray-200 text-gray-600 rounded-lg hover:bg-gray-50 text-xs font-medium shadow-sm">
全部场景
</button>
<button class="px-4 py-1.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 text-xs font-medium shadow-sm">
新建场景
</button>
</div>
</header>
<!-- 内部滚动区 (包含 KPI、图表、表格) -->
<div class="flex-1 overflow-y-auto p-6 flex flex-col gap-6 bg-white">
<!-- 2. KPI 数据卡片区 -->
<!-- 注意:因为在白卡里,为了体现层级,给这些指标卡加了浅灰色的背景框 -->
<section class="grid grid-cols-4 gap-4 flex-shrink-0">
<div class="bg-gray-50 rounded-xl p-4 border border-gray-100 flex flex-col justify-center">
<div class="text-xs text-gray-500 mb-1">可用场景</div>
<div class="text-2xl font-bold text-gray-800 mb-1 flex items-baseline gap-1">1.8 <span class="text-xs font-normal text-gray-400">百</span></div>
<div class="text-[10px] text-gray-400">其中 6 个常用场景</div>
</div>
<div class="bg-gray-50 rounded-xl p-4 border border-gray-100 flex flex-col justify-center">
<div class="text-xs text-gray-500 mb-1">定时任务</div>
<div class="text-2xl font-bold text-gray-800 mb-1">3 <span class="text-xs font-normal text-gray-400">个</span></div>
<div class="text-[10px] text-gray-400">下次执行 明天 08:30</div>
</div>
<div class="bg-gray-50 rounded-xl p-4 border border-gray-100 flex flex-col justify-center">
<div class="text-xs text-gray-500 mb-1">平台在线</div>
<div class="text-2xl font-bold text-gray-800 mb-1">2<span class="text-lg text-gray-400">/3</span></div>
<div class="text-[10px] text-orange-500">OA 办公待登录</div>
</div>
<div class="bg-gray-50 rounded-xl p-4 border border-gray-100 flex flex-col justify-center relative overflow-hidden">
<div class="text-xs text-gray-500 mb-1">近 7 日成功率</div>
<div class="text-2xl font-bold text-gray-800 mb-1">96.2<span class="text-lg">%</span></div>
<div class="text-[10px] text-gray-400">共 41 次运行 · 2 次跳过</div>
<svg class="absolute right-0 bottom-0 w-24 h-12 text-green-100 opacity-60 pointer-events-none" viewBox="0 0 100 50" fill="none" stroke="currentColor" stroke-width="2">
<path d="M0 40 Q 20 20, 40 30 T 80 10 T 100 20" />
</svg>
</div>
</section>
<!-- 3. 运行状态 & 迷你图表 -->
<section class="grid grid-cols-4 gap-4 flex-shrink-0">
<!-- 大进度卡片 -->
<div class="col-span-3 bg-gray-50 rounded-xl p-5 border border-gray-100 flex flex-col justify-center relative">
<div class="flex justify-between items-start mb-5">
<div class="flex items-center gap-2">
<span class="w-2 h-2 rounded-full bg-red-500 animate-pulse"></span>
<span class="text-xs font-medium text-gray-600 border border-gray-200 px-1.5 py-0.5 rounded bg-white">运行中</span>
<span class="text-sm font-bold text-gray-800 ml-2">考勤数据采集</span>
</div>
<div class="text-sm font-bold text-blue-600">68% <span class="text-xs text-gray-400 font-normal ml-1">3 / 12 页</span></div>
</div>
<div class="w-full bg-gray-200 rounded-full h-2.5 mb-3 overflow-hidden">
<div class="progress-gradient h-2.5 rounded-full relative" style="width: 68%"></div>
</div>
<div class="flex justify-between text-[11px] text-gray-400 mt-1">
<span>14:31:24 · 已采 246 条 · 正在解析部门维度</span>
<span>剩余约 40s</span>
</div>
</div>
<!-- 迷你柱状图 -->
<div class="col-span-1 bg-gray-50 rounded-xl p-4 border border-gray-100 flex flex-col justify-between">
<div class="flex justify-between items-center mb-2">
<span class="text-xs text-gray-500">近 7 日运行</span>
<span class="text-[10px] text-gray-400">41次</span>
</div>
<div class="flex items-end justify-between h-10 gap-1 mt-2">
<div v-for="(bar, i) in miniChart" :key="i" class="w-full rounded-sm transition-all group relative cursor-pointer"
:class="bar.isToday ? 'bg-blue-600' : 'bg-gray-200 hover:bg-gray-300'"
:style="{ height: bar.height + '%' }">
</div>
</div>
<div class="flex justify-between text-[9px] text-gray-400 mt-2 px-0.5">
<span>六</span><span>日</span><span>一</span><span>二</span><span>三</span><span>四</span><span class="text-blue-600 font-bold">五</span>
</div>
</div>
</section>
<!-- 4. 最近运行场景表格 (去掉外边框,直接贴合在主卡片内) -->
<section class="border border-gray-100 rounded-xl overflow-hidden flex-1 flex flex-col min-h-[300px]">
<div class="px-5 py-4 flex justify-between items-center border-b border-gray-100 bg-gray-50/50 flex-shrink-0">
<h2 class="font-bold text-gray-800 text-sm">最近运行场景</h2>
<a href="#" class="text-xs text-blue-600 hover:underline">全部 18 个场景 →</a>
</div>
<div class="overflow-x-auto flex-1">
<table class="w-full text-left border-collapse">
<thead class="bg-white text-[11px] text-gray-500 sticky top-0 border-b border-gray-100">
<tr>
<th class="px-5 py-3 font-medium w-12 text-center">#</th>
<th class="px-5 py-3 font-medium">场景名称</th>
<th class="px-5 py-3 font-medium">平台 / 分类</th>
<th class="px-5 py-3 font-medium">最近运行</th>
<th class="px-5 py-3 font-medium text-right pr-6">状态</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-50">
<tr v-for="(task, index) in recentTasks" :key="task.id" class="table-row-hover transition-colors">
<td class="px-5 py-3 text-xs text-gray-400 font-mono text-center">{{ String(index + 1).padStart(2, '0') }}</td>
<td class="px-5 py-3 text-xs text-gray-800 font-medium">{{ task.name }}</td>
<td class="px-5 py-3 text-xs text-gray-500">{{ task.platform }}</td>
<td class="px-5 py-3 text-xs text-gray-500">{{ task.time }}</td>
<td class="px-5 py-3 text-right pr-6">
<span v-if="task.status === 'success'" class="inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-green-50 text-green-600 text-xs font-medium border border-green-100">
<span class="w-1.5 h-1.5 rounded-full bg-green-500"></span> 成功
</span>
<span v-else-if="task.status === 'pending'" class="inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-orange-50 text-orange-500 text-xs font-medium border border-orange-100">
<span class="w-1.5 h-1.5 rounded-full bg-orange-400"></span> 待登录
</span>
</td>
</tr>
</tbody>
</table>
</div>
<div class="px-5 py-3 border-t border-gray-100 flex justify-between items-center text-xs text-gray-400 bg-white flex-shrink-0">
<span>显示 7 / 18 项 · 按最近运行排序</span>
<button class="text-blue-600 hover:text-blue-700 font-medium">加载更多 →</button>
</div>
</section>
</div>
</main>
<!-- ================= 右侧活动面板 ================= -->
<aside class="w-[280px] bg-white rounded-xl shadow-sm border border-gray-100 flex flex-col flex-shrink-0 overflow-y-auto hidden lg:flex">
<div class="p-4">
<div class="flex justify-between items-center mb-4">
<h2 class="font-bold text-gray-800 text-sm">活动</h2>
<span class="text-[10px] text-red-500 bg-red-50 px-2 py-0.5 rounded border border-red-100 flex items-center gap-1">
<span class="w-1.5 h-1.5 rounded-full bg-red-500 animate-pulse"></span> 2 进行中
</span>
</div>
<div class="bg-blue-50/50 border border-blue-100 rounded-lg p-3 mb-6">
<div class="flex justify-between text-xs mb-2">
<span class="font-medium text-gray-700 flex items-center gap-1">
<span class="w-1.5 h-1.5 rounded-full bg-blue-500"></span> 考勤数据采集
</span>
<span class="text-blue-600 font-mono">68%</span>
</div>
<div class="w-full bg-gray-200/60 rounded-full h-1.5 mb-2 overflow-hidden">
<div class="bg-blue-500 h-1.5 rounded-full transition-all duration-500" style="width: 68%"></div>
</div>
<p class="text-[10px] text-gray-500">抽取第 3/12 页 · 已采 246 条</p>
</div>
<div class="mb-6">
<div class="text-[11px] text-gray-400 mb-3">最近运行</div>
<ul class="space-y-3">
<li class="flex items-center justify-between text-xs">
<div class="flex items-center gap-2">
<span class="w-1.5 h-1.5 rounded-full bg-green-500"></span>
<span class="text-gray-700">考勤数据采集</span>
</div>
<span class="text-gray-400 text-[10px]">14:32 成功</span>
</li>
<li class="flex items-center justify-between text-xs">
<div class="flex items-center gap-2">
<span class="w-1.5 h-1.5 rounded-full bg-green-500"></span>
<span class="text-gray-700">销售订单同步</span>
</div>
<span class="text-gray-400 text-[10px]">11:08 成功</span>
</li>
<li class="flex items-center justify-between text-xs">
<div class="flex items-center gap-2">
<span class="w-1.5 h-1.5 rounded-full bg-orange-400"></span>
<span class="text-gray-700">OA流程自动化</span>
</div>
<span class="text-gray-400 text-[10px]">09:45 跳过</span>
</li>
</ul>
</div>
<div>
<div class="flex justify-between text-[11px] text-gray-400 mb-3">
<span>平台账号</span>
<span class="text-green-600">2 / 3</span>
</div>
<ul class="space-y-2">
<li class="flex items-center justify-between bg-gray-50 p-2 rounded-md border border-gray-100">
<div class="flex items-center gap-2">
<span class="w-1.5 h-1.5 rounded-full bg-blue-500"></span>
<span class="text-xs text-gray-700">HR 人力资源</span>
</div>
<span class="text-[10px] text-gray-500">已登录</span>
</li>
<li class="flex items-center justify-between bg-gray-50 p-2 rounded-md border border-gray-100">
<div class="flex items-center gap-2">
<span class="w-1.5 h-1.5 rounded-full bg-orange-400"></span>
<span class="text-xs text-gray-700">OA办公</span>
</div>
<span class="text-[10px] text-orange-500">待登录</span>
</li>
</ul>
</div>
</div>
</aside>
</div>
<script>
const { createApp, ref } = Vue;
createApp({
setup() {
const recentUses = ref([
{ name: '考勤数据采集', time: '12m', color: 'bg-blue-500' },
{ name: 'OA流程自动化', time: '1h', color: 'bg-orange-400' },
{ name: '钉钉通知推送', time: '3h', color: 'bg-purple-500' },
{ name: '销售订单同步', time: '昨天', color: 'bg-green-500' },
]);
const miniChart = ref([
{ height: 30 }, { height: 50 }, { height: 20 },
{ height: 40 }, { height: 60 }, { height: 45 },
{ height: 90, isToday: true }
]);
const recentTasks = ref([
{ id: 1, name: '考勤数据采集', platform: 'HR · 数据采集', time: '今天 14:32', status: 'success' },
{ id: 2, name: '销售订单同步', platform: 'CRM · 同步', time: '今天 11:08', status: 'success' },
{ id: 3, name: '仓库库存盘点', platform: 'WMS · 采集', time: '昨天 18:20', status: 'success' },
{ id: 4, name: '钉钉通知推送', platform: '钉钉 · 通知', time: '周一 09:00', status: 'success' },
{ id: 5, name: 'OA流程自动化', platform: 'OA · 流程', time: '今天 09:45', status: 'pending' },
{ id: 6, name: '财务对账单导出', platform: '金蝶 · 财务', time: '10-01 08:00', status: 'success' },
{ id: 7, name: '合同归档同步', platform: '法务盘 · 归档', time: '周一 15:20', status: 'success' },
]);
return {
recentUses,
miniChart,
recentTasks
};
}
}).mount('#app');
</script>
</body>
</html>