zkxw-mobile-oa-drafts-nav-actions-demo.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  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>草稿箱 · 标题栏管理 + 列表是否显示按钮</title>
  7. <style>
  8. :root {
  9. --brand: #0a9f6d;
  10. --brand-dark: #087f57;
  11. --brand-soft: #e9f9f2;
  12. --warn: #d97706;
  13. --warn-soft: #fff7e8;
  14. --danger: #ef4444;
  15. --nav-bg: #ecfdf5;
  16. --page-bg: #f5f8f7;
  17. --text: #1f2a26;
  18. --text-muted: #6b7b74;
  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: 1200px; margin: 0 auto; padding: 28px 16px 56px; }
  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: 780px; }
  33. .hero .note {
  34. margin-top: 12px; display: inline-block; padding: 8px 12px;
  35. border-radius: 10px; background: #fff; border: 1px solid #e2e8f0;
  36. font-size: 12px; color: #64748b;
  37. }
  38. .hero .note strong { color: #0f766e; }
  39. .rec {
  40. margin: 16px 0 0;
  41. padding: 14px 16px;
  42. border-radius: 14px;
  43. background: var(--brand-soft);
  44. border: 1px solid #b7ebd4;
  45. font-size: 13px;
  46. color: #166534;
  47. line-height: 1.55;
  48. }
  49. .rec b { color: var(--brand-dark); }
  50. .tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 16px; }
  51. .tab {
  52. appearance: none; border: 1px solid #e2e8f0; background: #fff;
  53. border-radius: 999px; padding: 10px 16px; font-size: 13px;
  54. font-weight: 600; color: #475569; cursor: pointer;
  55. }
  56. .tab.is-active {
  57. color: var(--brand-dark); border-color: var(--brand);
  58. background: var(--brand-soft);
  59. box-shadow: 0 0 0 3px rgba(10, 159, 109, 0.16);
  60. }
  61. .tab .badge {
  62. margin-left: 6px; font-size: 10px; padding: 2px 6px;
  63. border-radius: 999px; background: #ecfdf5; color: #047857; font-weight: 700;
  64. }
  65. .layout {
  66. display: grid;
  67. grid-template-columns: minmax(240px, 300px) 1fr;
  68. gap: 20px; align-items: start;
  69. }
  70. @media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
  71. .panel {
  72. background: rgba(255,255,255,.94);
  73. border: 1px solid #e2e8f0; border-radius: 16px; padding: 16px;
  74. box-shadow: 0 10px 28px rgba(15,23,42,.05);
  75. }
  76. .panel h2 { margin: 0 0 4px; font-size: 15px; }
  77. .panel .sub { margin: 0 0 10px; font-size: 12px; color: #64748b; }
  78. .panel ul { margin: 0; padding-left: 18px; font-size: 13px; color: #475569; }
  79. .panel li { margin: 5px 0; }
  80. .panel .pick {
  81. margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  82. background: #fff7e8; border: 1px solid #fde68a;
  83. font-size: 12px; color: #92400e;
  84. }
  85. .phones { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
  86. .phone {
  87. width: 375px; background: #fff; border-radius: 28px; overflow: hidden;
  88. box-shadow: 0 0 0 1px rgb(15 23 42 / 6%), 0 18px 40px rgb(15 23 42 / 12%);
  89. }
  90. .cap {
  91. text-align: center; font-size: 11px; font-weight: 650; color: #64748b;
  92. padding: 8px; background: #f8fafc; border-bottom: 1px solid #eef2f0;
  93. }
  94. /* 模拟系统标题栏(对齐 pages.json #ecfdf5) */
  95. .nav {
  96. height: 44px; display: flex; align-items: center; padding: 0 8px 0 4px;
  97. background: var(--nav-bg); border-bottom: 1px solid #d8f3e5;
  98. position: relative;
  99. }
  100. .nav-back {
  101. width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  102. color: #0f291e; flex-shrink: 0;
  103. }
  104. .nav-back::before {
  105. content: ""; width: 10px; height: 10px;
  106. border-left: 2px solid #0f291e; border-bottom: 2px solid #0f291e;
  107. transform: rotate(45deg); margin-left: 4px;
  108. }
  109. .nav-title {
  110. position: absolute; left: 50%; transform: translateX(-50%);
  111. font-size: 16px; font-weight: 650; color: #0f291e;
  112. }
  113. .nav-right {
  114. margin-left: auto; padding: 0 10px; height: 36px;
  115. display: inline-flex; align-items: center;
  116. font-size: 14px; font-weight: 650; color: var(--brand-dark);
  117. cursor: pointer; user-select: none;
  118. }
  119. .nav-right.is-done { color: #64748b; }
  120. .page { background: var(--page-bg); min-height: 560px; padding-bottom: 16px; }
  121. .search-wrap { padding: 10px 12px; background: #fff; border-bottom: 1px solid #f1f5f9; }
  122. .search {
  123. height: 36px; display: flex; align-items: center; gap: 8px;
  124. padding: 0 12px; border-radius: 10px; border: 1px solid #e8eaed;
  125. background: #fafafa; font-size: 13px; color: #94a3b8;
  126. }
  127. .search::before {
  128. content: ""; width: 12px; height: 12px; border: 1.5px solid #94a3b8;
  129. border-radius: 50%; flex-shrink: 0;
  130. }
  131. .list { padding: 10px 12px 0; display: flex; flex-direction: column; gap: 10px; }
  132. .end { text-align: center; padding: 12px 0; font-size: 12px; color: #94a3b8; }
  133. .card {
  134. width: 100%; background: #fff; border-radius: 14px;
  135. box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
  136. overflow: hidden; border: 1px solid transparent;
  137. }
  138. .card-body { padding: 14px; }
  139. .card-top { display: flex; align-items: flex-start; gap: 10px; }
  140. .card-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; line-height: 1.35; }
  141. .card-status {
  142. flex-shrink: 0; font-size: 11px; font-weight: 700;
  143. padding: 3px 9px; border-radius: 999px;
  144. background: var(--warn-soft); color: var(--warn);
  145. }
  146. .meta {
  147. margin-top: 8px; font-size: 12px; color: #64748b;
  148. }
  149. .meta .dot { margin: 0 6px; color: #cbd5e1; }
  150. .hint-tap {
  151. margin-top: 8px; font-size: 11px; color: #94a3b8;
  152. }
  153. .card-footer {
  154. display: flex; gap: 8px; padding: 10px 12px 12px;
  155. border-top: 1px dashed rgba(140, 170, 155, 0.28);
  156. }
  157. .card-footer button {
  158. flex: 1; height: 34px; border-radius: 10px; border: 1px solid #d8e3de;
  159. background: #fff; font-size: 12px; font-weight: 650; color: #334155;
  160. }
  161. .card-footer .p { background: var(--brand); border-color: var(--brand); color: #fff; }
  162. .card-footer .d {
  163. color: var(--danger); border-color: rgba(239,68,68,.35);
  164. background: rgba(239,68,68,.06);
  165. }
  166. .row { display: flex; align-items: center; gap: 10px; }
  167. .row .card { flex: 1; min-width: 0; }
  168. .check {
  169. width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #cbd5e1;
  170. background: #fff; display: flex; align-items: center; justify-content: center;
  171. font-size: 11px; color: #fff; font-weight: 700; flex-shrink: 0;
  172. }
  173. .check.on { background: #22c55e; border-color: #22c55e; }
  174. .row.is-on .card {
  175. border-color: rgba(34, 197, 94, 0.45);
  176. box-shadow: 0 8px 20px rgba(22, 163, 74, 0.12);
  177. }
  178. .batch {
  179. margin: 10px 12px 0; padding: 10px 12px; border-radius: 12px;
  180. background: #fff; border: 1px solid #c6f0dc;
  181. display: flex; align-items: center; justify-content: space-between;
  182. font-size: 13px; color: #166534;
  183. }
  184. .batch button {
  185. height: 30px; padding: 0 12px; border-radius: 8px;
  186. border: 1px solid rgba(239,68,68,.35);
  187. background: rgba(239,68,68,.06); color: var(--danger);
  188. font-size: 12px; font-weight: 650;
  189. }
  190. /* 详情底栏示意 */
  191. .detail {
  192. display: flex; flex-direction: column; min-height: 560px;
  193. background: var(--page-bg);
  194. }
  195. .detail-body { flex: 1; padding: 12px; }
  196. .detail-sheet {
  197. background: #fff; border-radius: 14px; padding: 16px;
  198. box-shadow: 0 8px 22px rgba(15,23,42,.05);
  199. }
  200. .detail-sheet h3 { margin: 0 0 12px; font-size: 17px; }
  201. .detail-sheet .line {
  202. display: flex; gap: 10px; font-size: 13px; margin: 8px 0; color: #475569;
  203. }
  204. .detail-sheet .line span:first-child { color: #94a3b8; min-width: 64px; }
  205. .detail-foot {
  206. padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  207. background: rgba(255,255,255,.96);
  208. border-top: 1px solid #e8eeeb;
  209. display: flex; gap: 8px;
  210. }
  211. .detail-foot button {
  212. height: 44px; border-radius: 12px; border: 0;
  213. font-size: 15px; font-weight: 700; cursor: pointer;
  214. }
  215. .detail-foot .ghost { flex: 0 0 72px; background: #f1f5f9; color: #64748b; }
  216. .detail-foot .main { flex: 1; background: linear-gradient(135deg, #0a9f6d, #087f57); color: #fff; }
  217. .detail-foot .danger { flex: 0 0 72px; background: rgba(239,68,68,.08); color: var(--danger); }
  218. </style>
  219. </head>
  220. <body>
  221. <div class="stage">
  222. <div class="hero">
  223. <h1>草稿箱 · 标题栏「管理」+ 列表是否放按钮</h1>
  224. <p>
  225. 回应两点:①「管理」放到导航栏右侧;②列表卡片是否还要「编辑 / 提交 / 删除」。
  226. 右侧每个方案可左右滑动对比普通态 / 管理态(或详情底栏)。
  227. </p>
  228. <div class="note">落地时草稿页可用系统导航栏右侧文字按钮,或自定义顶栏(与工作台一致)。</div>
  229. <div class="rec">
  230. <b>建议:</b>标题栏右侧「管理」+ <b>列表不展示操作按钮</b>,点卡片进入编辑/详情,
  231. 「提交审批 / 删除」放详情(或编辑页)底部。列表更干净,也符合多数 OA / 邮件 App 习惯。
  232. </div>
  233. </div>
  234. <div class="tabs" id="tabs">
  235. <button class="tab is-active" data-k="nav_clean">标题栏管理 · 列表无按钮<span class="badge">推荐</span></button>
  236. <button class="tab" data-k="nav_btns">标题栏管理 · 列表仍有按钮</button>
  237. <button class="tab" data-k="detail">详情底栏操作示意</button>
  238. </div>
  239. <div class="layout">
  240. <div class="panel" id="desc"></div>
  241. <div class="phones" id="phones"></div>
  242. </div>
  243. </div>
  244. <script>
  245. const ROWS = [
  246. ["入帐单", "08-12 17:03", "v5"],
  247. ["出差申请", "08-11 09:18", "v3"],
  248. ["采购报销", "08-10 17:05", "v2"]
  249. ];
  250. function nav(rightText, rightDone) {
  251. return (
  252. '<div class="nav">' +
  253. '<div class="nav-back"></div>' +
  254. '<div class="nav-title">草稿箱</div>' +
  255. '<div class="nav-right' + (rightDone ? ' is-done' : '') + '">' + rightText + '</div>' +
  256. '</div>'
  257. );
  258. }
  259. function card(title, time, ver, withBtns) {
  260. return (
  261. '<div class="card">' +
  262. '<div class="card-body">' +
  263. '<div class="card-top">' +
  264. '<div class="card-title">' + title + '</div>' +
  265. '<div class="card-status">草稿</div>' +
  266. '</div>' +
  267. '<div class="meta">' + time + '<span class="dot">·</span>版本 ' + ver + '</div>' +
  268. (withBtns ? '' : '<div class="hint-tap">点击继续编辑</div>') +
  269. '</div>' +
  270. (withBtns
  271. ? '<div class="card-footer"><button class="p">编辑</button><button>提交审批</button><button class="d">删除</button></div>'
  272. : '') +
  273. '</div>'
  274. );
  275. }
  276. function phone(cap, html) {
  277. return '<div class="phone"><div class="cap">' + cap + '</div>' + html + '</div>';
  278. }
  279. const DESCS = {
  280. nav_clean: {
  281. title: "推荐 · 标题栏管理 + 列表无按钮",
  282. sub: "顶栏右侧「管理」;卡片只展示信息,整卡可点。",
  283. items: [
  284. "「管理」进导航栏右侧,搜索区干净",
  285. "列表无编辑/提交/删除,一屏信息更疏朗",
  286. "点卡片 → 进入编辑(现有逻辑已支持)",
  287. "删除用「管理」批量;提交放详情/编辑底栏",
  288. "管理态:勾选与卡片垂直居中"
  289. ],
  290. pick: "与钉钉/飞书/企业微信草稿、邮件列表习惯一致。"
  291. },
  292. nav_btns: {
  293. title: "标题栏管理 · 列表保留按钮",
  294. sub: "管理上移后,卡片仍保留三按钮(当前能力不丢)。",
  295. items: [
  296. "管理入口问题已解决",
  297. "列表仍可一键提交/删除,少一次跳转",
  298. "代价:卡片更高、更挤,尤其短流程名时按钮区抢戏"
  299. ],
  300. pick: "若强依赖「列表内直接提交」,可选此方案。"
  301. },
  302. detail: {
  303. title: "详情 / 编辑页底部操作",
  304. sub: "列表无按钮时,动作收口到详情底栏。",
  305. items: [
  306. "主按钮:提交审批(最高优先级)",
  307. "次按钮:删除(或更多里放删除)",
  308. "返回即退出编辑;草稿自动保存可沿用现逻辑"
  309. ],
  310. pick: "与「列表无按钮」配套使用。"
  311. }
  312. };
  313. function renderClean() {
  314. var list = ROWS.map(function (r) { return card(r[0], r[1], r[2], false); }).join("");
  315. var normal = phone("普通态",
  316. nav("管理", false) +
  317. '<div class="page"><div class="search-wrap"><div class="search">搜索流程名称</div></div>' +
  318. '<div class="list">' + list + '<div class="end">已经到底了</div></div></div>'
  319. );
  320. var manage = phone("管理态 · 勾选居中",
  321. nav("完成", true) +
  322. '<div class="page"><div class="search-wrap"><div class="search">搜索流程名称</div></div>' +
  323. '<div class="batch"><span>已选 1 项</span><button>批量删除</button></div>' +
  324. '<div class="list">' +
  325. '<div class="row is-on"><div class="check on">✓</div>' + card(ROWS[0][0], ROWS[0][1], ROWS[0][2], false).replace('hint-tap">点击继续编辑', 'hint-tap" style="display:none">') + '</div>' +
  326. '<div class="row"><div class="check"></div>' + card(ROWS[1][0], ROWS[1][1], ROWS[1][2], false).replace('hint-tap">点击继续编辑', 'hint-tap" style="display:none">') + '</div>' +
  327. '<div class="row"><div class="check"></div>' + card(ROWS[2][0], ROWS[2][1], ROWS[2][2], false).replace('hint-tap">点击继续编辑', 'hint-tap" style="display:none">') + '</div>' +
  328. '</div></div>'
  329. );
  330. return normal + manage;
  331. }
  332. function renderBtns() {
  333. var list = ROWS.map(function (r) { return card(r[0], r[1], r[2], true); }).join("");
  334. var normal = phone("普通态 · 仍有按钮",
  335. nav("管理", false) +
  336. '<div class="page"><div class="search-wrap"><div class="search">搜索流程名称</div></div>' +
  337. '<div class="list">' + list + '<div class="end">已经到底了</div></div></div>'
  338. );
  339. var manage = phone("管理态",
  340. nav("完成", true) +
  341. '<div class="page"><div class="search-wrap"><div class="search">搜索流程名称</div></div>' +
  342. '<div class="batch"><span>已选 1 项</span><button>批量删除</button></div>' +
  343. '<div class="list">' +
  344. '<div class="row is-on"><div class="check on">✓</div>' + card(ROWS[0][0], ROWS[0][1], ROWS[0][2], false) + '</div>' +
  345. '<div class="row"><div class="check"></div>' + card(ROWS[1][0], ROWS[1][1], ROWS[1][2], false) + '</div>' +
  346. '</div></div>'
  347. );
  348. return normal + manage;
  349. }
  350. function renderDetail() {
  351. return phone("编辑 / 详情 · 底栏",
  352. nav("", false).replace('nav-right">', 'nav-right" style="display:none">') +
  353. '<div class="detail">' +
  354. '<div class="detail-body">' +
  355. '<div class="detail-sheet">' +
  356. '<h3>入帐单</h3>' +
  357. '<div class="line"><span>状态</span><span>草稿</span></div>' +
  358. '<div class="line"><span>最近保存</span><span>2026-08-12 17:03:42</span></div>' +
  359. '<div class="line"><span>版本</span><span>v5</span></div>' +
  360. '<div class="line"><span>说明</span><span>表单正文区域…</span></div>' +
  361. '</div>' +
  362. '</div>' +
  363. '<div class="detail-foot">' +
  364. '<button class="danger">删除</button>' +
  365. '<button class="main">提交审批</button>' +
  366. '</div>' +
  367. '</div>'
  368. ) + phone("列表侧(无按钮)",
  369. nav("管理", false) +
  370. '<div class="page"><div class="search-wrap"><div class="search">搜索流程名称</div></div>' +
  371. '<div class="list">' +
  372. ROWS.map(function (r) { return card(r[0], r[1], r[2], false); }).join("") +
  373. '</div></div>'
  374. );
  375. }
  376. const RENDER = { nav_clean: renderClean, nav_btns: renderBtns, detail: renderDetail };
  377. const descEl = document.getElementById("desc");
  378. const phonesEl = document.getElementById("phones");
  379. const tabs = document.getElementById("tabs");
  380. function show(k) {
  381. var d = DESCS[k];
  382. descEl.innerHTML =
  383. "<h2>" + d.title + "</h2>" +
  384. '<p class="sub">' + d.sub + "</p>" +
  385. "<ul>" + d.items.map(function (i) { return "<li>" + i + "</li>"; }).join("") + "</ul>" +
  386. '<div class="pick">' + d.pick + "</div>";
  387. phonesEl.innerHTML = RENDER[k]();
  388. }
  389. tabs.addEventListener("click", function (e) {
  390. var btn = e.target.closest(".tab");
  391. if (!btn) return;
  392. tabs.querySelectorAll(".tab").forEach(function (t) {
  393. t.classList.toggle("is-active", t === btn);
  394. });
  395. show(btn.getAttribute("data-k"));
  396. });
  397. show("nav_clean");
  398. </script>
  399. </body>
  400. </html>