system-architecture.html 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>清道夫系统 - 系统架构汇报</title>
  7. <script src="https://cdn.tailwindcss.com"></script>
  8. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" />
  9. <script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
  10. <script src="https://cdn.jsdelivr.net/npm/svg-pan-zoom@3.6.1/dist/svg-pan-zoom.min.js"></script>
  11. <style>
  12. @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');
  13. body {
  14. font-family: 'Noto Sans SC', sans-serif;
  15. }
  16. .glass {
  17. background: rgba(15, 23, 42, 0.75);
  18. backdrop-filter: blur(12px);
  19. border: 1px solid rgba(56, 189, 248, 0.15);
  20. }
  21. .glow-text {
  22. text-shadow: 0 0 20px rgba(56, 189, 248, 0.5), 0 0 40px rgba(56, 189, 248, 0.2);
  23. }
  24. .gradient-border {
  25. position: relative;
  26. }
  27. .gradient-border::before {
  28. content: "";
  29. position: absolute;
  30. inset: 0;
  31. border-radius: inherit;
  32. padding: 1px;
  33. background: linear-gradient(135deg, rgba(56,189,248,0.8), rgba(168,85,247,0.4), rgba(56,189,248,0.1));
  34. -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  35. -webkit-mask-composite: xor;
  36. mask-composite: exclude;
  37. pointer-events: none;
  38. }
  39. #bg-canvas {
  40. position: fixed;
  41. top: 0;
  42. left: 0;
  43. width: 100%;
  44. height: 100%;
  45. z-index: -1;
  46. background: radial-gradient(ellipse at center, #0f172a 0%, #020617 100%);
  47. }
  48. .tech-card:hover {
  49. transform: translateY(-4px);
  50. box-shadow: 0 10px 40px -10px rgba(56, 189, 248, 0.3);
  51. }
  52. .mermaid-wrapper {
  53. background: rgba(15, 23, 42, 0.7);
  54. border: 1px solid rgba(56, 189, 248, 0.1);
  55. border-radius: 0.75rem;
  56. padding: 1.5rem;
  57. min-height: 500px;
  58. }
  59. .mermaid {
  60. display: flex;
  61. justify-content: center;
  62. font-family: 'Noto Sans SC', 'Microsoft YaHei', Arial, sans-serif !important;
  63. }
  64. .mermaid svg {
  65. cursor: grab;
  66. max-width: none !important;
  67. filter: drop-shadow(0 0 8px rgba(15, 23, 42, 0.1));
  68. }
  69. .mermaid svg:active {
  70. cursor: grabbing;
  71. }
  72. .diagram-hint {
  73. text-align: center;
  74. color: #94a3b8;
  75. font-size: 14px;
  76. margin-top: 12px;
  77. }
  78. .zoom-controls {
  79. display: flex;
  80. justify-content: flex-end;
  81. gap: 8px;
  82. margin-bottom: 12px;
  83. }
  84. .zoom-btn {
  85. width: 36px;
  86. height: 36px;
  87. border-radius: 8px;
  88. border: 1px solid rgba(56, 189, 248, 0.3);
  89. background: rgba(15, 23, 42, 0.6);
  90. color: #38bdf8;
  91. cursor: pointer;
  92. transition: all 0.2s;
  93. display: flex;
  94. align-items: center;
  95. justify-content: center;
  96. }
  97. .zoom-btn:hover {
  98. background: rgba(56, 189, 248, 0.2);
  99. border-color: rgba(56, 189, 248, 0.6);
  100. }
  101. .zoom-btn.reset {
  102. width: auto;
  103. padding: 0 14px;
  104. font-size: 13px;
  105. }
  106. </style>
  107. </head>
  108. <body class="text-slate-200 antialiased overflow-x-hidden">
  109. <canvas id="bg-canvas"></canvas>
  110. <!-- Hero -->
  111. <header class="relative min-h-[70vh] flex flex-col justify-center items-center px-6 text-center">
  112. <div class="absolute inset-0 bg-gradient-to-b from-cyan-500/5 via-transparent to-transparent pointer-events-none"></div>
  113. <div class="glass rounded-2xl px-8 py-12 max-w-4xl w-full gradient-border">
  114. <div class="mb-4 text-cyan-400 text-sm tracking-[0.3em] uppercase">System Architecture Report</div>
  115. <h1 class="text-5xl md:text-7xl font-bold mb-6 bg-gradient-to-r from-cyan-300 via-blue-400 to-purple-400 bg-clip-text text-transparent glow-text">
  116. 清道夫系统
  117. </h1>
  118. <p class="text-xl md:text-2xl text-slate-300 mb-8">环境服务管理平台 · 系统架构汇报</p>
  119. <div class="flex flex-wrap justify-center gap-4 text-sm">
  120. <span class="px-4 py-2 rounded-full glass text-cyan-300"><i class="fa fa-mobile mr-2"></i>uni-app + Vue3 + TypeScript</span>
  121. <span class="px-4 py-2 rounded-full glass text-purple-300"><i class="fa fa-users mr-2"></i>销售 / 调度 / 施工 三端协同</span>
  122. <span class="px-4 py-2 rounded-full glass text-emerald-300"><i class="fa fa-sitemap mr-2"></i>54 个页面 · 4 个分包</span>
  123. </div>
  124. </div>
  125. <div class="absolute bottom-10 animate-bounce text-cyan-400/60">
  126. <i class="fa fa-chevron-down text-2xl"></i>
  127. </div>
  128. </header>
  129. <!-- Overview -->
  130. <section class="py-20 px-6">
  131. <div class="max-w-6xl mx-auto">
  132. <div class="text-center mb-16">
  133. <h2 class="text-3xl md:text-4xl font-bold mb-4 text-cyan-300">项目概况</h2>
  134. <p class="text-slate-400 max-w-3xl mx-auto text-lg">清道夫系统面向环境服务行业,覆盖销售、调度、施工三大角色,实现从项目立项、任务发布、调度派单、SOP 施工到验收结算的全流程数字化管理。</p>
  135. </div>
  136. <div class="grid md:grid-cols-3 gap-6">
  137. <div class="glass rounded-xl p-6 tech-card transition duration-300 gradient-border">
  138. <div class="w-12 h-12 rounded-lg bg-cyan-500/20 flex items-center justify-center mb-4">
  139. <i class="fa fa-handshake-o text-cyan-300 text-xl"></i>
  140. </div>
  141. <h3 class="text-xl font-bold mb-2">销售端</h3>
  142. <p class="text-slate-400 text-sm">项目库管理、任务发布、进度跟踪、消息通知、知识库查询,支撑一线销售快速响应客户需求。</p>
  143. </div>
  144. <div class="glass rounded-xl p-6 tech-card transition duration-300 gradient-border">
  145. <div class="w-12 h-12 rounded-lg bg-purple-500/20 flex items-center justify-center mb-4">
  146. <i class="fa fa-calendar-check-o text-purple-300 text-xl"></i>
  147. </div>
  148. <h3 class="text-xl font-bold mb-2">调度端</h3>
  149. <p class="text-slate-400 text-sm">任务审核、排班派车、人员/车辆/班组管理、可视化大屏,实现资源高效调配。</p>
  150. </div>
  151. <div class="glass rounded-xl p-6 tech-card transition duration-300 gradient-border">
  152. <div class="w-12 h-12 rounded-lg bg-emerald-500/20 flex items-center justify-center mb-4">
  153. <i class="fa fa-wrench text-emerald-300 text-xl"></i>
  154. </div>
  155. <h3 class="text-xl font-bold mb-2">施工端</h3>
  156. <p class="text-slate-400 text-sm">uni-app 微信小程序,支持每日检查、SOP 施工流程、照片分组上传、电子签名验收。</p>
  157. </div>
  158. </div>
  159. </div>
  160. </section>
  161. <!-- Overall Architecture -->
  162. <section class="py-20 px-6">
  163. <div class="max-w-7xl mx-auto">
  164. <div class="text-center mb-12">
  165. <h2 class="text-3xl md:text-4xl font-bold mb-4 text-cyan-300">总体系统架构</h2>
  166. <p class="text-slate-400">基于 Mermaid.js 渲染,支持拖拽与缩放查看</p>
  167. </div>
  168. <div class="glass rounded-2xl p-4 md:p-8 gradient-border">
  169. <div class="zoom-controls">
  170. <button class="zoom-btn" onclick="zoomOut('diagram-overall')" title="缩小"><i class="fa fa-minus"></i></button>
  171. <button class="zoom-btn" onclick="zoomIn('diagram-overall')" title="放大"><i class="fa fa-plus"></i></button>
  172. <button class="zoom-btn reset" onclick="resetZoom('diagram-overall')" title="重置"><i class="fa fa-compress mr-1"></i> 重置</button>
  173. </div>
  174. <div class="overflow-x-auto mermaid-wrapper">
  175. <div id="diagram-overall" class="mermaid interactive-diagram" style="min-width: 1300px;">
  176. graph LR
  177. subgraph 用户层["用户层"]
  178. U1[销售人员]
  179. U2[调度管理员]
  180. U3[施工人员]
  181. end
  182. WX[微信客户端]
  183. MP[清道夫小程序
  184. <span style='font-size:15px'>uni-app + Vue3 + TypeScript</span>]
  185. subgraph 后端服务["后端服务"]
  186. API[API 网关]
  187. Auth[认证中心]
  188. BS[业务服务层
  189. <span style='font-size:15px'>项目 / 任务 / 排班 / 车辆 / 人员 / 通知 / 统计</span>]
  190. end
  191. subgraph 数据层["数据层"]
  192. DB[(关系型数据库)]
  193. OSS[文件存储]
  194. Cache[(Redis 缓存)]
  195. end
  196. subgraph 第三方服务["第三方服务"]
  197. MAP[腾讯地图]
  198. PUSH[微信推送]
  199. end
  200. U1 --> WX
  201. U2 --> WX
  202. U3 --> WX
  203. WX --> MP
  204. MP --> API
  205. API --> Auth
  206. API --> BS
  207. BS --> DB
  208. BS --> OSS
  209. BS --> Cache
  210. MP --> MAP
  211. BS --> PUSH
  212. style 用户层 fill:#f1f5f9,stroke:#38bdf8,stroke-width:2px
  213. style 后端服务 fill:#f1f5f9,stroke:#a855f7,stroke-width:2px
  214. style 数据层 fill:#f1f5f9,stroke:#34d399,stroke-width:2px
  215. style 第三方服务 fill:#f1f5f9,stroke:#f472b6,stroke-width:2px
  216. </div>
  217. </div>
  218. <p class="diagram-hint">💡 提示:可按住鼠标拖动,使用滚轮缩放,或使用右上角按钮控制</p>
  219. </div>
  220. <div class="mt-6 grid md:grid-cols-2 gap-4 text-sm text-slate-400">
  221. <div class="glass rounded-lg p-4">
  222. <strong class="text-cyan-300">交互说明:</strong>鼠标拖拽可平移图表,滚轮可缩放查看细节,点击“重置”恢复初始视图。
  223. </div>
  224. <div class="glass rounded-lg p-4">
  225. <strong class="text-cyan-300">架构特点:</strong>前后端分离、多角色终端、RESTful 接口、JWT 认证、数据与文件分离存储。
  226. </div>
  227. </div>
  228. </div>
  229. </section>
  230. <!-- Frontend Page Structure -->
  231. <section class="py-20 px-6">
  232. <div class="max-w-7xl mx-auto">
  233. <div class="text-center mb-12">
  234. <h2 class="text-3xl md:text-4xl font-bold mb-4 text-cyan-300">前端页面与分包结构</h2>
  235. <p class="text-slate-400">主包 + 分包策略,实现按需加载与三端隔离</p>
  236. </div>
  237. <div class="glass rounded-2xl p-4 md:p-8 gradient-border">
  238. <div class="zoom-controls">
  239. <button class="zoom-btn" onclick="zoomOut('diagram-pages')" title="缩小"><i class="fa fa-minus"></i></button>
  240. <button class="zoom-btn" onclick="zoomIn('diagram-pages')" title="放大"><i class="fa fa-plus"></i></button>
  241. <button class="zoom-btn reset" onclick="resetZoom('diagram-pages')" title="重置"><i class="fa fa-compress mr-1"></i> 重置</button>
  242. </div>
  243. <div class="overflow-x-auto mermaid-wrapper">
  244. <div id="diagram-pages" class="mermaid interactive-diagram" style="min-width: 1100px;">
  245. graph TB
  246. Root[小程序页面结构
  247. <span style='font-size:15px'>主包 + 分包</span>]
  248. Root --> Main[主包 pages/]
  249. Root --> Sub[分包 subPackages/]
  250. Main --> P1[首页 home]
  251. Main --> P2[任务 task]
  252. Main --> P3[排班 schedule]
  253. Main --> P4[我的 my]
  254. Main --> P5[登录 login]
  255. Sub --> Common[pages-common
  256. <span style='font-size:15px'>通用分包</span>]
  257. Sub --> Sales[pages-sales
  258. <span style='font-size:15px'>销售分包</span>]
  259. Sub --> Dispatch[pages-dispatch
  260. <span style='font-size:15px'>调度分包</span>]
  261. Sub --> Construction[pages-construction
  262. <span style='font-size:15px'>施工分包</span>]
  263. Common --> C1[项目库]
  264. Common --> C2[任务详情]
  265. Common --> C3[通知公告]
  266. Common --> C4[帮助中心]
  267. Sales --> S1[任务提醒]
  268. Sales --> S2[消息通知]
  269. Sales --> S3[知识库]
  270. Dispatch --> D1[排班管理]
  271. Dispatch --> D2[车辆人员]
  272. Dispatch --> D3[应急班组]
  273. Dispatch --> D4[可视化大屏]
  274. Construction --> CO1[每日任务]
  275. Construction --> CO2[历史任务]
  276. Construction --> CO3[明日任务]
  277. </div>
  278. </div>
  279. <p class="diagram-hint">💡 提示:可按住鼠标拖动,使用滚轮缩放,或使用右上角按钮控制</p>
  280. </div>
  281. <div class="mt-6 glass rounded-lg p-4 text-sm text-slate-400">
  282. <strong class="text-cyan-300">分包说明:</strong>主包包含 5 个 Tab/入口页面;subPackages 下按业务维度划分为 pages-common(通用页面)、pages-sales(销售端)、pages-dispatch(调度端)、pages-construction(施工端)四个分包,实现按需加载。
  283. </div>
  284. </div>
  285. </section>
  286. <!-- Frontend Technical Architecture -->
  287. <section class="py-20 px-6">
  288. <div class="max-w-7xl mx-auto">
  289. <div class="text-center mb-12">
  290. <h2 class="text-3xl md:text-4xl font-bold mb-4 text-cyan-300">前端技术架构</h2>
  291. <p class="text-slate-400">视图层 → 状态层 → 接口层的分层设计</p>
  292. </div>
  293. <div class="glass rounded-2xl p-4 md:p-8 gradient-border">
  294. <div class="zoom-controls">
  295. <button class="zoom-btn" onclick="zoomOut('diagram-tech')" title="缩小"><i class="fa fa-minus"></i></button>
  296. <button class="zoom-btn" onclick="zoomIn('diagram-tech')" title="放大"><i class="fa fa-plus"></i></button>
  297. <button class="zoom-btn reset" onclick="resetZoom('diagram-tech')" title="重置"><i class="fa fa-compress mr-1"></i> 重置</button>
  298. </div>
  299. <div class="overflow-x-auto mermaid-wrapper">
  300. <div id="diagram-tech" class="mermaid interactive-diagram" style="min-width: 1100px;">
  301. graph LR
  302. subgraph 视图层["视图层"]
  303. V1[pages 页面]
  304. V2[components 组件]
  305. V3[高级组件
  306. <span style='font-size:15px'>图片上传 / 地图 / 签名 / 图表</span>]
  307. end
  308. S1[Pinia Store]
  309. subgraph 接口层["接口层"]
  310. A1[request.ts 请求封装]
  311. A2[业务 API 模块]
  312. end
  313. B1[后端 RESTful API]
  314. V1 --> V2
  315. V2 --> V3
  316. V1 --> S1
  317. V2 --> S1
  318. V3 --> S1
  319. S1 --> A1
  320. A1 --> A2
  321. A2 --> B1
  322. style 视图层 fill:#f1f5f9,stroke:#38bdf8,stroke-width:2px
  323. style 接口层 fill:#f1f5f9,stroke:#a855f7,stroke-width:2px
  324. </div>
  325. </div>
  326. <p class="diagram-hint">💡 提示:可按住鼠标拖动,使用滚轮缩放,或使用右上角按钮控制</p>
  327. </div>
  328. <div class="mt-6 glass rounded-lg p-4 text-sm text-slate-400">
  329. <strong class="text-cyan-300">前端说明:</strong>视图层由页面和组件构成,通用组件与业务组件分离;状态管理使用 Pinia,按业务领域拆分 Store;API 层统一封装 HTTP 请求并按模块组织接口函数,最终调用后端 RESTful API。
  330. </div>
  331. </div>
  332. </section>
  333. <!-- Data Flow -->
  334. <section class="py-20 px-6">
  335. <div class="max-w-7xl mx-auto">
  336. <div class="text-center mb-12">
  337. <h2 class="text-3xl md:text-4xl font-bold mb-4 text-cyan-300">核心业务流程</h2>
  338. <p class="text-slate-400">任务全生命周期数据流转</p>
  339. </div>
  340. <div class="glass rounded-2xl p-4 md:p-8 gradient-border">
  341. <div class="zoom-controls">
  342. <button class="zoom-btn" onclick="zoomOut('diagram-flow')" title="缩小"><i class="fa fa-minus"></i></button>
  343. <button class="zoom-btn" onclick="zoomIn('diagram-flow')" title="放大"><i class="fa fa-plus"></i></button>
  344. <button class="zoom-btn reset" onclick="resetZoom('diagram-flow')" title="重置"><i class="fa fa-compress mr-1"></i> 重置</button>
  345. </div>
  346. <div class="overflow-x-auto mermaid-wrapper">
  347. <div id="diagram-flow" class="mermaid interactive-diagram" style="min-width: 1100px;">
  348. flowchart TB
  349. subgraph 调度阶段["调度阶段"]
  350. A[销售端
  351. <span style='font-size:16px'>发布任务</span>] --> B[调度端
  352. <span style='font-size:16px'>审核任务</span>]
  353. B --> C[调度端
  354. <span style='font-size:16px'>安排排班</span>]
  355. C --> D[分配车辆
  356. <span style='font-size:16px'>与人员</span>]
  357. D --> E[施工端
  358. <span style='font-size:16px'>接收任务</span>]
  359. end
  360. subgraph 施工阶段["施工阶段"]
  361. F[施工端
  362. <span style='font-size:16px'>出车</span>] --> G[到达现场
  363. <span style='font-size:16px'>签到</span>]
  364. G --> H[现场勘验]
  365. H --> I[施工作业]
  366. I --> J[上传照片
  367. <span style='font-size:16px'>电子签名</span>]
  368. J --> K[任务完成
  369. <span style='font-size:16px'>待验收</span>]
  370. end
  371. E --> F
  372. K --> L[调度端
  373. <span style='font-size:16px'>确认验收</span>]
  374. style A fill:#dbeafe,stroke:#2563eb,stroke-width:3px
  375. style B fill:#fef3c7,stroke:#d97706,stroke-width:3px
  376. style E fill:#dcfce7,stroke:#16a34a,stroke-width:3px
  377. style K fill:#fce7f3,stroke:#db2777,stroke-width:3px
  378. style L fill:#f3e8ff,stroke:#9333ea,stroke-width:3px
  379. style 调度阶段 fill:#f8fafc,stroke:#38bdf8,stroke-width:2px
  380. style 施工阶段 fill:#f8fafc,stroke:#16a34a,stroke-width:2px
  381. </div>
  382. </div>
  383. <p class="diagram-hint">💡 提示:可按住鼠标拖动,使用滚轮缩放,或使用右上角按钮控制</p>
  384. </div>
  385. <div class="mt-6 glass rounded-lg p-4 text-sm text-slate-400">
  386. <strong class="text-cyan-300">流程说明:</strong>销售人员在项目基础上发布服务任务;调度管理员审核任务并安排排班,分配车辆和施工人员;施工人员通过小程序接收任务,按 SOP 流程执行出车、到场、勘验、施工、拍照签字等步骤;最终由调度端确认验收,形成业务闭环。
  387. </div>
  388. </div>
  389. </section>
  390. <!-- Tech Stack -->
  391. <section class="py-20 px-6">
  392. <div class="max-w-6xl mx-auto">
  393. <h2 class="text-3xl md:text-4xl font-bold mb-12 text-center text-cyan-300">核心技术栈</h2>
  394. <div class="grid grid-cols-2 md:grid-cols-4 gap-4">
  395. <div class="glass rounded-lg p-4 text-center tech-card transition duration-300 gradient-border">
  396. <div class="text-cyan-400 font-bold text-lg">uni-app</div>
  397. <div class="text-slate-500 text-xs mt-1">小程序框架</div>
  398. </div>
  399. <div class="glass rounded-lg p-4 text-center tech-card transition duration-300 gradient-border">
  400. <div class="text-cyan-400 font-bold text-lg">Vue 3</div>
  401. <div class="text-slate-500 text-xs mt-1">前端视图层</div>
  402. </div>
  403. <div class="glass rounded-lg p-4 text-center tech-card transition duration-300 gradient-border">
  404. <div class="text-cyan-400 font-bold text-lg">TypeScript</div>
  405. <div class="text-slate-500 text-xs mt-1">类型安全开发</div>
  406. </div>
  407. <div class="glass rounded-lg p-4 text-center tech-card transition duration-300 gradient-border">
  408. <div class="text-cyan-400 font-bold text-lg">Vite</div>
  409. <div class="text-slate-500 text-xs mt-1">构建工具</div>
  410. </div>
  411. <div class="glass rounded-lg p-4 text-center tech-card transition duration-300 gradient-border">
  412. <div class="text-purple-400 font-bold text-lg">Pinia</div>
  413. <div class="text-slate-500 text-xs mt-1">状态管理</div>
  414. </div>
  415. <div class="glass rounded-lg p-4 text-center tech-card transition duration-300 gradient-border">
  416. <div class="text-purple-400 font-bold text-lg">Tailwind CSS</div>
  417. <div class="text-slate-500 text-xs mt-1">样式方案</div>
  418. </div>
  419. <div class="glass rounded-lg p-4 text-center tech-card transition duration-300 gradient-border">
  420. <div class="text-emerald-400 font-bold text-lg">RESTful API</div>
  421. <div class="text-slate-500 text-xs mt-1">后端接口</div>
  422. </div>
  423. <div class="glass rounded-lg p-4 text-center tech-card transition duration-300 gradient-border">
  424. <div class="text-emerald-400 font-bold text-lg">JWT Token</div>
  425. <div class="text-slate-500 text-xs mt-1">身份认证</div>
  426. </div>
  427. </div>
  428. </div>
  429. </section>
  430. <!-- Layer Details -->
  431. <section class="py-20 px-6">
  432. <div class="max-w-6xl mx-auto">
  433. <h2 class="text-3xl md:text-4xl font-bold mb-12 text-center text-cyan-300">架构分层说明</h2>
  434. <div class="space-y-6">
  435. <div class="glass rounded-xl p-6 md:flex items-start gap-6 gradient-border">
  436. <div class="w-14 h-14 rounded-xl bg-cyan-500/20 flex items-center justify-center shrink-0 mb-4 md:mb-0">
  437. <i class="fa fa-desktop text-cyan-300 text-2xl"></i>
  438. </div>
  439. <div>
  440. <h3 class="text-xl font-bold mb-2 text-cyan-200">接入层</h3>
  441. <p class="text-slate-400 text-sm leading-relaxed">面向三类终端用户提供交互界面。销售端、调度端、施工端均为微信小程序,基于 uni-app + Vue3 + TypeScript + Tailwind CSS 开发;统一使用 uni-ui 及自定义组件,适配移动端操作习惯。</p>
  442. </div>
  443. </div>
  444. <div class="glass rounded-xl p-6 md:flex items-start gap-6 gradient-border">
  445. <div class="w-14 h-14 rounded-xl bg-purple-500/20 flex items-center justify-center shrink-0 mb-4 md:mb-0">
  446. <i class="fa fa-server text-purple-300 text-2xl"></i>
  447. </div>
  448. <div>
  449. <h3 class="text-xl font-bold mb-2 text-purple-200">网关层</h3>
  450. <p class="text-slate-400 text-sm leading-relaxed">后端通过 RESTful API 提供统一服务入口,Base URL 为 http://localhost:8080/api。前端 request.ts 统一封装 HTTP 请求,自动注入 Bearer Token,处理 401 过期跳转。</p>
  451. </div>
  452. </div>
  453. <div class="glass rounded-xl p-6 md:flex items-start gap-6 gradient-border">
  454. <div class="w-14 h-14 rounded-xl bg-blue-500/20 flex items-center justify-center shrink-0 mb-4 md:mb-0">
  455. <i class="fa fa-cogs text-blue-300 text-2xl"></i>
  456. </div>
  457. <div>
  458. <h3 class="text-xl font-bold mb-2 text-blue-200">服务层</h3>
  459. <p class="text-slate-400 text-sm leading-relaxed">按业务领域划分为认证、项目、任务、排班、车辆、人员、通知、统计等模块。任务服务支持状态流转、催单、取消、日志等核心能力;排班服务支持按日期查询与班组资源分配。</p>
  460. </div>
  461. </div>
  462. <div class="glass rounded-xl p-6 md:flex items-start gap-6 gradient-border">
  463. <div class="w-14 h-14 rounded-xl bg-emerald-500/20 flex items-center justify-center shrink-0 mb-4 md:mb-0">
  464. <i class="fa fa-database text-emerald-300 text-2xl"></i>
  465. </div>
  466. <div>
  467. <h3 class="text-xl font-bold mb-2 text-emerald-200">数据层</h3>
  468. <p class="text-slate-400 text-sm leading-relaxed">关系型数据库存储业务数据,Redis 缓存热点数据,对象存储承载施工照片、视频、电子签名等多媒体文件。核心实体包括用户、项目、任务、排班、车辆、人员、通知等。</p>
  469. </div>
  470. </div>
  471. </div>
  472. </div>
  473. </section>
  474. <!-- Footer -->
  475. <footer class="py-12 text-center text-slate-500 text-sm">
  476. <p>清道夫系统项目组 · 2026</p>
  477. <p class="mt-2">基于 uni-app + Vue3 + TypeScript 构建</p>
  478. </footer>
  479. <script>
  480. // Canvas particle background
  481. const canvas = document.getElementById('bg-canvas');
  482. const ctx = canvas.getContext('2d');
  483. let width, height, particles = [];
  484. function resize() {
  485. width = canvas.width = window.innerWidth;
  486. height = canvas.height = window.innerHeight;
  487. }
  488. window.addEventListener('resize', resize);
  489. resize();
  490. class Particle {
  491. constructor() {
  492. this.x = Math.random() * width;
  493. this.y = Math.random() * height;
  494. this.vx = (Math.random() - 0.5) * 0.3;
  495. this.vy = (Math.random() - 0.5) * 0.3;
  496. this.size = Math.random() * 2 + 0.5;
  497. this.alpha = Math.random() * 0.5 + 0.2;
  498. }
  499. update() {
  500. this.x += this.vx;
  501. this.y += this.vy;
  502. if (this.x < 0) this.x = width;
  503. if (this.x > width) this.x = 0;
  504. if (this.y < 0) this.y = height;
  505. if (this.y > height) this.y = 0;
  506. }
  507. draw() {
  508. ctx.beginPath();
  509. ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
  510. ctx.fillStyle = `rgba(56, 189, 248, ${this.alpha})`;
  511. ctx.fill();
  512. }
  513. }
  514. for (let i = 0; i < 80; i++) particles.push(new Particle());
  515. function animate() {
  516. ctx.clearRect(0, 0, width, height);
  517. particles.forEach(p => { p.update(); p.draw(); });
  518. for (let i = 0; i < particles.length; i++) {
  519. for (let j = i + 1; j < particles.length; j++) {
  520. const dx = particles[i].x - particles[j].x;
  521. const dy = particles[i].y - particles[j].y;
  522. const dist = Math.sqrt(dx * dx + dy * dy);
  523. if (dist < 120) {
  524. ctx.beginPath();
  525. ctx.strokeStyle = `rgba(56, 189, 248, ${0.12 * (1 - dist / 120)})`;
  526. ctx.lineWidth = 0.6;
  527. ctx.moveTo(particles[i].x, particles[i].y);
  528. ctx.lineTo(particles[j].x, particles[j].y);
  529. ctx.stroke();
  530. }
  531. }
  532. }
  533. requestAnimationFrame(animate);
  534. }
  535. animate();
  536. // Pan / Zoom instances storage
  537. const panZoomInstances = {};
  538. // Mermaid init
  539. mermaid.initialize({
  540. startOnLoad: false,
  541. theme: 'dark',
  542. themeCSS: `
  543. .node rect, .node circle, .node polygon, .node path {
  544. stroke-width: 2.5px !important;
  545. }
  546. .node .label, .nodeLabel {
  547. font-size: 20px !important;
  548. font-family: 'Noto Sans SC', 'Microsoft YaHei', Arial, sans-serif !important;
  549. font-weight: 500 !important;
  550. fill: #e2e8f0 !important;
  551. }
  552. .edgeLabel {
  553. font-size: 18px !important;
  554. font-family: 'Noto Sans SC', 'Microsoft YaHei', Arial, sans-serif !important;
  555. background-color: rgba(15, 23, 42, 0.9) !important;
  556. color: #e2e8f0 !important;
  557. padding: 3px 8px !important;
  558. border-radius: 4px !important;
  559. }
  560. .cluster rect {
  561. stroke-width: 2.5px !important;
  562. fill: rgba(30, 41, 59, 0.6) !important;
  563. }
  564. .cluster .label {
  565. font-size: 22px !important;
  566. font-weight: bold !important;
  567. font-family: 'Noto Sans SC', 'Microsoft YaHei', Arial, sans-serif !important;
  568. fill: #38bdf8 !important;
  569. }
  570. `,
  571. flowchart: {
  572. useMaxWidth: false,
  573. htmlLabels: true,
  574. curve: 'basis',
  575. padding: 24,
  576. nodeSpacing: 100,
  577. rankSpacing: 120,
  578. diagramPadding: 24
  579. },
  580. graph: {
  581. useMaxWidth: false,
  582. diagramPadding: 24
  583. }
  584. });
  585. document.addEventListener('DOMContentLoaded', async function() {
  586. try {
  587. await mermaid.run({
  588. querySelector: '.mermaid'
  589. });
  590. document.querySelectorAll('.interactive-diagram svg').forEach(function(svg) {
  591. const container = svg.closest('.interactive-diagram');
  592. const id = container ? container.id : null;
  593. if (!id) return;
  594. panZoomInstances[id] = svgPanZoom(svg, {
  595. zoomEnabled: true,
  596. controlIconsEnabled: false,
  597. fit: true,
  598. center: true,
  599. minZoom: 0.3,
  600. maxZoom: 5,
  601. dblClickZoomEnabled: false
  602. });
  603. });
  604. } catch (err) {
  605. console.error('Mermaid 渲染失败:', err);
  606. }
  607. });
  608. function zoomIn(id) {
  609. if (panZoomInstances[id]) {
  610. panZoomInstances[id].zoomIn();
  611. }
  612. }
  613. function zoomOut(id) {
  614. if (panZoomInstances[id]) {
  615. panZoomInstances[id].zoomOut();
  616. }
  617. }
  618. function resetZoom(id) {
  619. if (panZoomInstances[id]) {
  620. panZoomInstances[id].reset();
  621. panZoomInstances[id].center();
  622. }
  623. }
  624. </script>
  625. </body>
  626. </html>