zkxw-mobile-oa-list-circle-index-demo.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  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, maximum-scale=1" />
  6. <title>OA 五列表 · 序号圆圈背景 Demo</title>
  7. <style>
  8. :root {
  9. --brand: #0a9f6d;
  10. --brand-dark: #087f57;
  11. --brand-soft: #e9f9f2;
  12. --warn: #d97706;
  13. --danger: #ef4444;
  14. --nav-bg: #ecfdf5;
  15. --page-bg: #f5f6f8;
  16. --text: #1f2329;
  17. --text-muted: #8f959e;
  18. --border: #e8eaed;
  19. }
  20. * { box-sizing: border-box; }
  21. body {
  22. margin: 0;
  23. font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", -apple-system, system-ui, sans-serif;
  24. color: var(--text);
  25. background:
  26. radial-gradient(900px 420px at 8% -8%, rgba(10, 159, 109, 0.12), transparent 55%),
  27. linear-gradient(180deg, #f8fffc 0%, #f4f7fb 50%, #f7f8fa 100%);
  28. line-height: 1.45;
  29. }
  30. .stage { max-width: 1180px; margin: 0 auto; padding: 28px 16px 64px; }
  31. .hero h1 { margin: 0 0 8px; font-size: 22px; font-weight: 720; }
  32. .hero p { margin: 0; color: #64748b; font-size: 14px; max-width: 920px; }
  33. .rec {
  34. margin: 16px 0 0;
  35. padding: 14px 16px;
  36. border-radius: 14px;
  37. background: var(--brand-soft);
  38. border: 1px solid #b7ebd4;
  39. font-size: 13px;
  40. color: #166534;
  41. line-height: 1.55;
  42. }
  43. .rec b { color: var(--brand-dark); }
  44. .tabs {
  45. display: flex; flex-wrap: wrap; gap: 10px;
  46. margin: 20px 0 18px;
  47. }
  48. .tab {
  49. appearance: none; border: 1px solid #e2e8f0; background: #fff;
  50. border-radius: 999px; padding: 10px 16px; font-size: 13px;
  51. font-weight: 600; color: #475569; cursor: pointer;
  52. }
  53. .tab.is-active {
  54. color: var(--brand-dark); border-color: var(--brand);
  55. background: var(--brand-soft);
  56. box-shadow: 0 0 0 3px rgba(10, 159, 109, 0.16);
  57. }
  58. .tab .badge {
  59. display: inline-block; margin-left: 6px;
  60. padding: 1px 7px; border-radius: 999px;
  61. font-size: 11px; font-weight: 700;
  62. background: #fef3c7; color: #b45309;
  63. }
  64. .tab.is-active .badge {
  65. background: #fff; color: var(--brand-dark);
  66. }
  67. .layout {
  68. display: grid;
  69. grid-template-columns: minmax(240px, 300px) 1fr;
  70. gap: 20px; align-items: start;
  71. }
  72. @media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
  73. .panel {
  74. background: rgba(255,255,255,.94);
  75. border: 1px solid #e2e8f0; border-radius: 16px; padding: 16px;
  76. box-shadow: 0 10px 28px rgba(15,23,42,.05);
  77. }
  78. .panel h2 { margin: 0 0 4px; font-size: 15px; }
  79. .panel .sub { margin: 0 0 10px; font-size: 12px; color: #64748b; }
  80. .panel ul { margin: 0; padding-left: 18px; font-size: 13px; color: #475569; }
  81. .panel li { margin: 6px 0; }
  82. .panel .ok {
  83. margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  84. background: #ecfdf5; border: 1px solid #a7f3d0;
  85. font-size: 12px; color: #047857;
  86. }
  87. .panel .pick {
  88. margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  89. background: #fff7e8; border: 1px solid #fde68a;
  90. font-size: 12px; color: #92400e;
  91. }
  92. .phones { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
  93. .phone {
  94. width: 375px; background: #fff; border-radius: 28px; overflow: hidden;
  95. box-shadow: 0 0 0 1px rgb(15 23 42 / 6%), 0 18px 40px rgb(15 23 42 / 12%);
  96. }
  97. .cap {
  98. text-align: center; font-size: 11px; font-weight: 650; color: #64748b;
  99. padding: 8px; background: #f8fafc; border-bottom: 1px solid #eef2f0;
  100. }
  101. .nav {
  102. height: 44px; display: flex; align-items: center; padding: 0 8px 0 4px;
  103. background: var(--nav-bg); border-bottom: 1px solid #d8f3e5;
  104. position: relative;
  105. }
  106. .nav-back {
  107. width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  108. color: #0f291e; flex-shrink: 0;
  109. }
  110. .nav-back::before {
  111. content: ""; width: 10px; height: 10px;
  112. border-left: 2px solid #0f291e; border-bottom: 2px solid #0f291e;
  113. transform: rotate(45deg); margin-left: 4px;
  114. }
  115. .nav-title {
  116. position: absolute; left: 50%; transform: translateX(-50%);
  117. font-size: 16px; font-weight: 650; color: #0f291e;
  118. }
  119. .page {
  120. min-height: 640px;
  121. background: var(--page-bg);
  122. padding-bottom: 24px;
  123. }
  124. .toolbar {
  125. padding: 8px 12px;
  126. background: #fff;
  127. border-bottom: 1px solid #f1f5f9;
  128. }
  129. .search-box {
  130. height: 36px;
  131. display: flex; align-items: center; gap: 8px;
  132. padding: 0 12px; border-radius: 10px;
  133. background: #fafafa; border: 1px solid #e8eaed;
  134. }
  135. .search-ico {
  136. width: 13px; height: 13px; border: 1.5px solid #94a3b8; border-radius: 50%;
  137. position: relative; flex-shrink: 0;
  138. }
  139. .search-ico::after {
  140. content: ""; position: absolute; width: 6px; height: 1.5px;
  141. right: -4px; bottom: -2px; background: #94a3b8; border-radius: 2px;
  142. transform: rotate(45deg);
  143. }
  144. .search-ph { font-size: 13px; color: #b0b7c3; }
  145. .list {
  146. padding: 10px 12px 0;
  147. display: flex; flex-direction: column; gap: 10px;
  148. }
  149. .dd-card {
  150. position: relative;
  151. width: 100%;
  152. background: #fff;
  153. border-radius: 14px;
  154. padding: 14px 14px 12px;
  155. box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  156. overflow: hidden;
  157. }
  158. .dd-card__head {
  159. display: flex; align-items: flex-start; gap: 8px;
  160. }
  161. .dd-card__title {
  162. flex: 1; min-width: 0;
  163. font-size: 15px; font-weight: 700; line-height: 1.4; color: #1f2329;
  164. }
  165. .dd-card__time {
  166. flex-shrink: 0; font-size: 12px; line-height: 1.4; color: #8f959e; padding-top: 2px;
  167. }
  168. .dd-card__meta { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
  169. .dd-card__meta-line {
  170. font-size: 13px; line-height: 1.45; color: #8f959e;
  171. overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  172. }
  173. .dd-card__foot {
  174. margin-top: 12px; display: flex; align-items: center;
  175. justify-content: space-between; gap: 8px;
  176. }
  177. .dd-card__hint-tag {
  178. max-width: 70%;
  179. font-size: 11px; font-weight: 650; line-height: 1.2;
  180. padding: 4px 9px; border-radius: 999px;
  181. background: rgba(217, 119, 6, 0.12); color: #d97706;
  182. overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  183. }
  184. .dd-card__hint-tag.is-success {
  185. background: rgba(10, 159, 109, 0.12); color: #0a9f6d;
  186. }
  187. .dd-card__hint-tag.is-danger {
  188. background: rgba(239, 68, 68, 0.12); color: #ef4444;
  189. }
  190. .dd-card__status {
  191. flex-shrink: 0; font-size: 12px; font-weight: 600; color: #d97706;
  192. }
  193. .dd-card__status.is-success { color: #0a9f6d; }
  194. .dd-card__status.is-danger { color: #ef4444; }
  195. /* ---------- 0:现状折角 ---------- */
  196. .style-0 .idx {
  197. position: absolute; top: 0; left: 0;
  198. width: 0; height: 0;
  199. border-style: solid;
  200. border-width: 34px 34px 0 0;
  201. border-color: var(--brand) transparent transparent transparent;
  202. pointer-events: none;
  203. }
  204. .style-0 .idx span {
  205. position: absolute; top: -30px; left: 4px;
  206. font-size: 10px; font-weight: 800; color: #fff;
  207. line-height: 1; letter-spacing: -0.02em;
  208. }
  209. /* 圆圈共用:左上绝对定位 */
  210. .circle-idx {
  211. position: absolute;
  212. top: 10px;
  213. left: 10px;
  214. width: 24px;
  215. height: 24px;
  216. border-radius: 50%;
  217. display: inline-flex;
  218. align-items: center;
  219. justify-content: center;
  220. font-size: 10px;
  221. font-weight: 800;
  222. line-height: 1;
  223. letter-spacing: -0.02em;
  224. font-variant-numeric: tabular-nums;
  225. pointer-events: none;
  226. z-index: 1;
  227. }
  228. .style-a .dd-card,
  229. .style-b .dd-card,
  230. .style-c .dd-card,
  231. .style-d .dd-card {
  232. padding-left: 42px;
  233. }
  234. /* A:实心品牌绿圆(推荐) */
  235. .style-a .circle-idx {
  236. color: #fff;
  237. background: var(--brand);
  238. box-shadow: 0 2px 6px rgba(10, 159, 109, 0.28);
  239. }
  240. /* B:浅绿底 + 深绿字 */
  241. .style-b .circle-idx {
  242. color: var(--brand-dark);
  243. background: var(--brand-soft);
  244. border: 1px solid #b7ebd4;
  245. }
  246. /* C:描边空心圆 */
  247. .style-c .circle-idx {
  248. color: var(--brand-dark);
  249. background: #fff;
  250. border: 1.5px solid var(--brand);
  251. }
  252. /* D:贴角半出入圆(更像「角标」) */
  253. .style-d .dd-card { overflow: visible; }
  254. .style-d .circle-idx {
  255. top: -6px;
  256. left: -6px;
  257. width: 28px;
  258. height: 28px;
  259. font-size: 11px;
  260. color: #fff;
  261. background: linear-gradient(145deg, #12b981 0%, #0a9f6d 55%, #087f57 100%);
  262. box-shadow: 0 4px 10px rgba(10, 159, 109, 0.28);
  263. border: 2px solid #fff;
  264. }
  265. .style-d .dd-card { padding-left: 14px; }
  266. .swatches {
  267. margin-top: 18px;
  268. display: flex; flex-wrap: wrap; gap: 10px;
  269. }
  270. .swatch {
  271. display: inline-flex; align-items: center; gap: 8px;
  272. padding: 8px 12px; border-radius: 999px;
  273. background: #fff; border: 1px solid #e2e8f0;
  274. font-size: 12px; color: #475569;
  275. }
  276. .swatch .dot {
  277. width: 22px; height: 22px; border-radius: 50%;
  278. display: inline-flex; align-items: center; justify-content: center;
  279. font-size: 9px; font-weight: 800;
  280. }
  281. .swatch .dot.a { color: #fff; background: var(--brand); }
  282. .swatch .dot.b { color: var(--brand-dark); background: var(--brand-soft); border: 1px solid #b7ebd4; }
  283. .swatch .dot.c { color: var(--brand-dark); background: #fff; border: 1.5px solid var(--brand); }
  284. .swatch .dot.d {
  285. color: #fff;
  286. background: linear-gradient(145deg, #12b981, #087f57);
  287. border: 2px solid #fff;
  288. box-shadow: 0 2px 6px rgba(10, 159, 109, 0.25);
  289. }
  290. .legend {
  291. margin-top: 22px;
  292. display: grid;
  293. grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  294. gap: 12px;
  295. }
  296. .legend .box {
  297. background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  298. padding: 12px 14px; font-size: 12px; color: #475569;
  299. }
  300. .legend h3 { margin: 0 0 6px; font-size: 13px; color: #0f291e; }
  301. code {
  302. font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  303. font-size: 11px; background: #f1f5f9; padding: 1px 5px; border-radius: 4px;
  304. }
  305. </style>
  306. </head>
  307. <body>
  308. <div class="stage">
  309. <div class="hero">
  310. <h1>OA 五列表 · 序号改为圆圈背景</h1>
  311. <p>
  312. 覆盖草稿箱 / 待办 / 已办 / 我发起的 / 抄送我的。现状为左上三角折角;
  313. 本 Demo 对比「圆圈背景」几种落法。序号规则不变:<code>01</code>、<code>02</code>…跨页连续。
  314. </p>
  315. <div class="rec">
  316. <b>推荐:A 实心绿圆</b> —— 仍在卡片左上,品牌绿实心圆 + 白字两位序号;
  317. 只改 <code>.dd-card__corner</code> 样式,五页 DOM 可基本不动。
  318. </div>
  319. </div>
  320. <div class="tabs" id="tabs">
  321. <button type="button" class="tab" data-k="0">0 现状折角</button>
  322. <button type="button" class="tab is-active" data-k="a">A 实心绿圆<span class="badge">推荐</span></button>
  323. <button type="button" class="tab" data-k="b">B 浅绿圆</button>
  324. <button type="button" class="tab" data-k="c">C 描边圆</button>
  325. <button type="button" class="tab" data-k="d">D 贴角出入圆</button>
  326. </div>
  327. <div class="swatches" aria-hidden="true">
  328. <span class="swatch"><span class="dot a">01</span>A 实心</span>
  329. <span class="swatch"><span class="dot b">02</span>B 浅绿</span>
  330. <span class="swatch"><span class="dot c">03</span>C 描边</span>
  331. <span class="swatch"><span class="dot d">04</span>D 贴角</span>
  332. </div>
  333. <div class="layout" style="margin-top: 18px;">
  334. <aside class="panel" id="side"></aside>
  335. <div class="phones">
  336. <div class="phone">
  337. <div class="cap" id="cap">A 实心绿圆 · 推荐 · 375px</div>
  338. <div class="nav">
  339. <div class="nav-back" aria-hidden="true"></div>
  340. <div class="nav-title">待办中心</div>
  341. </div>
  342. <div class="page">
  343. <div class="toolbar">
  344. <div class="search-box">
  345. <span class="search-ico" aria-hidden="true"></span>
  346. <span class="search-ph">搜索流程名称</span>
  347. </div>
  348. </div>
  349. <div class="list style-a" id="list"></div>
  350. </div>
  351. </div>
  352. </div>
  353. </div>
  354. <div class="legend">
  355. <div class="box">
  356. <h3>落地建议</h3>
  357. 仅改 <code>oa-task-list.scss</code> 中 <code>.dd-card__corner</code> /
  358. <code>.dd-card__corner-num</code>;五页模板结构可保留,避免重复改 Vue。
  359. </div>
  360. <div class="box">
  361. <h3>序号规则</h3>
  362. 仍用 <code>formatCornerIndex</code>:&lt;10 补零;
  363. 跨页 <code>(page-1)*pageSize + index + 1</code>。
  364. </div>
  365. <div class="box">
  366. <h3>注意</h3>
  367. A/B/C 需给标题区留左内边距(约 42px),避免圆圈压住标题;
  368. D 贴角方案可不加左 padding,但卡片需 <code>overflow: visible</code>。
  369. </div>
  370. </div>
  371. </div>
  372. <script>
  373. const ROWS = [
  374. {
  375. title: '费用报销',
  376. time: '09:12',
  377. meta: ['报销金额:1280.00', '事由:差旅交通'],
  378. hint: '待张敏处理',
  379. status: '进行中',
  380. tone: 'warn'
  381. },
  382. {
  383. title: '请假申请',
  384. time: '昨天',
  385. meta: ['请假类型:事假', '请假天数:1'],
  386. hint: '待李华处理',
  387. status: '进行中',
  388. tone: 'warn'
  389. },
  390. {
  391. title: '采购申请',
  392. time: '前天',
  393. meta: ['采购金额:8600.00', '供应商:华东物资'],
  394. hint: '审批完成',
  395. status: '已完成',
  396. tone: 'success'
  397. },
  398. {
  399. title: '出差申请',
  400. time: '3天前',
  401. meta: ['目的地:上海', '天数:2'],
  402. hint: '已打回',
  403. status: '已打回',
  404. tone: 'danger'
  405. },
  406. {
  407. title: '用章申请 · 两位数序号样例',
  408. time: '2026.08.01',
  409. meta: ['用章类型:公章', '份数:2'],
  410. hint: '抄送我的',
  411. status: '已撤销',
  412. tone: 'mute',
  413. forceN: 12
  414. }
  415. ]
  416. const SIDE = {
  417. '0': {
  418. title: '0 现状折角',
  419. sub: '三角折角 + 白字',
  420. items: [
  421. '当前五列表已上线样式',
  422. '视觉强,但标题区被三角切角',
  423. '两位数在三角里偏挤'
  424. ],
  425. note: 'pick',
  426. noteText: '将被圆圈方案替换。'
  427. },
  428. a: {
  429. title: 'A 实心绿圆',
  430. sub: '左上 24px 圆 · 白字',
  431. items: [
  432. '品牌绿实心,辨识度接近折角',
  433. '圆内两位序号更规整',
  434. '卡片加左 padding,标题不被遮'
  435. ],
  436. note: 'ok',
  437. noteText: '推荐默认方案;改动面最小。'
  438. },
  439. b: {
  440. title: 'B 浅绿圆',
  441. sub: '浅绿底 + 深绿字',
  442. items: [
  443. '更轻、更「信息角标」',
  444. '与三墙 soft 色一致',
  445. '在白卡片上对比略弱于 A'
  446. ],
  447. note: 'ok',
  448. noteText: '若希望序号不抢眼,选 B。'
  449. },
  450. c: {
  451. title: 'C 描边圆',
  452. sub: '白底 + 绿描边',
  453. items: [
  454. '最轻量',
  455. '适合信息密度高的列表',
  456. '远看不如实心醒目'
  457. ],
  458. note: 'pick',
  459. noteText: '备选;偏「弱序号」。'
  460. },
  461. d: {
  462. title: 'D 贴角出入圆',
  463. sub: '压住左上圆角 · 半出入',
  464. items: [
  465. '更像「角标徽章」',
  466. '不挤标题左 padding',
  467. '需 overflow:visible,注意阴影裁切'
  468. ],
  469. note: 'ok',
  470. noteText: '想保留「角标感」时优先于 A。'
  471. }
  472. }
  473. const CAP = {
  474. '0': '0 现状折角 · 375px',
  475. a: 'A 实心绿圆 · 推荐 · 375px',
  476. b: 'B 浅绿圆 · 375px',
  477. c: 'C 描边圆 · 375px',
  478. d: 'D 贴角出入圆 · 375px'
  479. }
  480. function pad(n) {
  481. return n < 10 ? '0' + n : String(n)
  482. }
  483. function render(style) {
  484. const list = document.getElementById('list')
  485. list.className = 'list style-' + style
  486. list.innerHTML = ROWS.map((row, i) => {
  487. const n = row.forceN != null ? row.forceN : i + 1
  488. const hintClass =
  489. 'dd-card__hint-tag' +
  490. (row.tone === 'success' ? ' is-success' : '') +
  491. (row.tone === 'danger' ? ' is-danger' : '')
  492. const statusClass =
  493. 'dd-card__status' +
  494. (row.tone === 'success' ? ' is-success' : '') +
  495. (row.tone === 'danger' ? ' is-danger' : '')
  496. let badge = ''
  497. if (style === '0') {
  498. badge = '<div class="idx" aria-hidden="true"><span>' + pad(n) + '</span></div>'
  499. } else {
  500. badge = '<div class="circle-idx" aria-hidden="true">' + pad(n) + '</div>'
  501. }
  502. const meta = row.meta
  503. .map((m) => '<span class="dd-card__meta-line">' + m + '</span>')
  504. .join('')
  505. return (
  506. '<div class="dd-card">' +
  507. badge +
  508. '<div class="dd-card__head">' +
  509. '<div class="dd-card__title">' +
  510. row.title +
  511. '</div>' +
  512. '<div class="dd-card__time">' +
  513. row.time +
  514. '</div>' +
  515. '</div>' +
  516. '<div class="dd-card__meta">' +
  517. meta +
  518. '</div>' +
  519. '<div class="dd-card__foot">' +
  520. '<span class="' +
  521. hintClass +
  522. '">' +
  523. row.hint +
  524. '</span>' +
  525. '<span class="' +
  526. statusClass +
  527. '">' +
  528. row.status +
  529. '</span>' +
  530. '</div>' +
  531. '</div>'
  532. )
  533. }).join('')
  534. const s = SIDE[style]
  535. document.getElementById('side').innerHTML =
  536. '<h2>' +
  537. s.title +
  538. '</h2>' +
  539. '<p class="sub">' +
  540. s.sub +
  541. '</p>' +
  542. '<ul>' +
  543. s.items.map((t) => '<li>' + t + '</li>').join('') +
  544. '</ul>' +
  545. '<div class="' +
  546. s.note +
  547. '">' +
  548. s.noteText +
  549. '</div>'
  550. document.getElementById('cap').textContent = CAP[style]
  551. }
  552. document.getElementById('tabs').addEventListener('click', (e) => {
  553. const btn = e.target.closest('.tab')
  554. if (!btn) return
  555. document.querySelectorAll('.tab').forEach((t) => t.classList.remove('is-active'))
  556. btn.classList.add('is-active')
  557. render(btn.dataset.k)
  558. })
  559. render('a')
  560. </script>
  561. </body>
  562. </html>