oa-approval-apps-card-demo.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  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" />
  6. <title>审批管理 · 钉钉式卡片 Demo(Fresh Mint)</title>
  7. <style>
  8. :root {
  9. --primary: #10b981;
  10. --primary-dark: #059669;
  11. --primary-bg: #ecfdf5;
  12. --text: #0f172a;
  13. --text-2: #334155;
  14. --muted: #94a3b8;
  15. --border: #e2e8f0;
  16. --bg: #f1f5f9;
  17. --card: #fff;
  18. --dot: #f87171;
  19. --radius-card: 14px;
  20. --radius-icon: 10px;
  21. }
  22. * { box-sizing: border-box; }
  23. body {
  24. margin: 0;
  25. min-height: 100vh;
  26. font: 14px/1.5 Inter, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  27. color: var(--text);
  28. background:
  29. linear-gradient(180deg, #eefcf6 0%, var(--bg) 180px) fixed;
  30. }
  31. .page {
  32. max-width: 1100px;
  33. margin: 0 auto;
  34. padding: 28px 24px 64px;
  35. }
  36. .demo-banner {
  37. display: flex;
  38. flex-wrap: wrap;
  39. gap: 10px 16px;
  40. align-items: center;
  41. justify-content: space-between;
  42. margin-bottom: 20px;
  43. padding: 12px 16px;
  44. background: #fff;
  45. border: 1px solid var(--border);
  46. border-radius: 10px;
  47. }
  48. .demo-banner b { color: var(--primary-dark); }
  49. .demo-banner span { color: var(--muted); font-size: 13px; }
  50. .demo-banner .tag {
  51. display: inline-block;
  52. padding: 2px 8px;
  53. border-radius: 999px;
  54. background: var(--primary-bg);
  55. color: var(--primary-dark);
  56. font-size: 12px;
  57. font-weight: 600;
  58. }
  59. /* —— 搜索(钉钉胶囊) —— */
  60. .search-wrap {
  61. display: flex;
  62. justify-content: center;
  63. margin: 8px 0 28px;
  64. }
  65. .search {
  66. display: flex;
  67. align-items: center;
  68. gap: 10px;
  69. width: min(520px, 100%);
  70. height: 42px;
  71. padding: 0 18px;
  72. background: #fff;
  73. border: 1px solid var(--border);
  74. border-radius: 999px;
  75. box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  76. }
  77. .search:focus-within {
  78. border-color: var(--primary);
  79. box-shadow: 0 0 0 3px var(--primary-bg);
  80. }
  81. .search svg { flex-shrink: 0; color: var(--muted); }
  82. .search input {
  83. flex: 1;
  84. border: 0;
  85. outline: 0;
  86. background: transparent;
  87. font-size: 14px;
  88. color: var(--text);
  89. }
  90. .search input::placeholder { color: #b0b8c4; }
  91. /* —— 一级分组 Tab(截图:人事管理 + 下划线) —— */
  92. .group-tabs {
  93. display: flex;
  94. flex-wrap: wrap;
  95. gap: 28px;
  96. margin-bottom: 8px;
  97. border-bottom: 1px solid transparent;
  98. }
  99. .group-tab {
  100. position: relative;
  101. padding: 0 0 12px;
  102. border: 0;
  103. background: none;
  104. cursor: pointer;
  105. color: var(--text-2);
  106. font-size: 16px;
  107. font-weight: 600;
  108. }
  109. .group-tab:hover { color: var(--primary-dark); }
  110. .group-tab.active { color: var(--text); }
  111. .group-tab.active::after {
  112. content: "";
  113. position: absolute;
  114. left: 0;
  115. right: 0;
  116. bottom: 0;
  117. height: 3px;
  118. border-radius: 2px;
  119. background: var(--text);
  120. }
  121. .toolbar-row {
  122. display: flex;
  123. flex-wrap: wrap;
  124. gap: 12px;
  125. align-items: center;
  126. justify-content: space-between;
  127. margin: 4px 0 20px;
  128. }
  129. .toolbar-hint {
  130. color: var(--muted);
  131. font-size: 13px;
  132. }
  133. .toolbar-hint a {
  134. color: var(--primary-dark);
  135. text-decoration: none;
  136. font-weight: 500;
  137. }
  138. .toolbar-hint a:hover { text-decoration: underline; }
  139. .btn {
  140. display: inline-flex;
  141. align-items: center;
  142. gap: 6px;
  143. height: 34px;
  144. padding: 0 14px;
  145. border: 1px solid var(--border);
  146. border-radius: 8px;
  147. background: #fff;
  148. color: var(--text-2);
  149. font-size: 13px;
  150. cursor: pointer;
  151. }
  152. .btn:hover { border-color: #cbd5e1; background: #f8fafc; }
  153. .btn.primary {
  154. border-color: var(--primary);
  155. background: var(--primary);
  156. color: #fff;
  157. }
  158. .btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
  159. /* —— 分组内容块 —— */
  160. .section { margin-bottom: 32px; }
  161. .section.hidden { display: none; }
  162. .section-head {
  163. display: flex;
  164. align-items: center;
  165. gap: 8px;
  166. margin-bottom: 14px;
  167. }
  168. .section-head h3 {
  169. margin: 0;
  170. color: var(--text-2);
  171. font-size: 14px;
  172. font-weight: 600;
  173. }
  174. .section-head .dot {
  175. width: 6px;
  176. height: 6px;
  177. border-radius: 50%;
  178. background: var(--dot);
  179. }
  180. .section-meta {
  181. margin-left: auto;
  182. color: var(--muted);
  183. font-size: 12px;
  184. }
  185. /* —— 横向应用卡片(钉钉核心) —— */
  186. .card-row {
  187. display: flex;
  188. flex-wrap: wrap;
  189. gap: 16px;
  190. align-items: stretch;
  191. }
  192. .app-card {
  193. display: flex;
  194. flex-direction: column;
  195. gap: 12px;
  196. width: 260px;
  197. min-height: 100px;
  198. padding: 14px 16px 10px;
  199. background: var(--card);
  200. border: 1px solid transparent;
  201. border-radius: var(--radius-card);
  202. box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  203. transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  204. text-align: left;
  205. font: inherit;
  206. color: inherit;
  207. }
  208. .app-card:hover {
  209. border-color: #a7f3d0;
  210. box-shadow: 0 4px 14px rgba(16, 185, 129, 0.12);
  211. transform: translateY(-1px);
  212. }
  213. .app-card__main {
  214. display: flex;
  215. align-items: center;
  216. gap: 14px;
  217. min-width: 0;
  218. }
  219. .app-icon {
  220. flex-shrink: 0;
  221. display: grid;
  222. place-items: center;
  223. width: 40px;
  224. height: 40px;
  225. overflow: hidden;
  226. border-radius: var(--radius-icon);
  227. color: #fff;
  228. font-size: 18px;
  229. }
  230. .app-icon img {
  231. display: block;
  232. width: 100%;
  233. height: 100%;
  234. object-fit: cover;
  235. }
  236. .app-icon.i-orange { background: linear-gradient(145deg, #fb923c, #f97316); }
  237. .app-icon.i-blue { background: linear-gradient(145deg, #60a5fa, #3b82f6); }
  238. .app-icon.i-mint { background: linear-gradient(145deg, #34d399, #10b981); }
  239. .app-icon.i-violet { background: linear-gradient(145deg, #a78bfa, #8b5cf6); }
  240. .app-icon.i-rose { background: linear-gradient(145deg, #fb7185, #f43f5e); }
  241. .app-icon.i-amber { background: linear-gradient(145deg, #fbbf24, #f59e0b); }
  242. .app-icon.i-cyan { background: linear-gradient(145deg, #22d3ee, #06b6d4); }
  243. .app-icon.i-slate { background: #e2e8f0; color: #64748b; }
  244. .icon-legend {
  245. display: flex;
  246. flex-wrap: wrap;
  247. gap: 10px 18px;
  248. margin: -12px 0 22px;
  249. padding: 10px 14px;
  250. color: var(--muted);
  251. font-size: 12px;
  252. background: rgba(255,255,255,0.7);
  253. border: 1px dashed #cbd5e1;
  254. border-radius: 8px;
  255. }
  256. .icon-legend strong { color: var(--text-2); font-weight: 600; }
  257. .app-body { min-width: 0; flex: 1; }
  258. .app-name {
  259. display: block;
  260. overflow: hidden;
  261. color: var(--text);
  262. font-size: 14px;
  263. font-weight: 600;
  264. text-overflow: ellipsis;
  265. white-space: nowrap;
  266. }
  267. .app-sub {
  268. display: flex;
  269. flex-wrap: wrap;
  270. gap: 6px;
  271. margin-top: 4px;
  272. }
  273. .pill {
  274. display: inline-flex;
  275. align-items: center;
  276. height: 18px;
  277. padding: 0 6px;
  278. border-radius: 4px;
  279. font-size: 11px;
  280. font-weight: 500;
  281. line-height: 1;
  282. }
  283. .pill.ok { background: var(--primary-bg); color: var(--primary-dark); }
  284. .pill.warn { background: #fffbeb; color: #d97706; }
  285. .pill.mute { background: #f1f5f9; color: #64748b; }
  286. /* 操作按钮固定放在卡片内底部,始终可见(小号 + 图标) */
  287. .app-ops {
  288. display: flex;
  289. justify-content: flex-end;
  290. gap: 6px;
  291. padding-top: 8px;
  292. border-top: 1px solid #f1f5f9;
  293. }
  294. .app-ops button {
  295. display: inline-flex;
  296. align-items: center;
  297. justify-content: center;
  298. gap: 3px;
  299. height: 24px;
  300. padding: 0 8px;
  301. border: 1px solid var(--border);
  302. border-radius: 5px;
  303. background: #fff;
  304. color: var(--text-2);
  305. font-size: 11px;
  306. line-height: 1;
  307. cursor: pointer;
  308. }
  309. .app-ops button svg {
  310. flex-shrink: 0;
  311. width: 12px;
  312. height: 12px;
  313. }
  314. .app-ops button:hover {
  315. border-color: #a7f3d0;
  316. background: var(--primary-bg);
  317. color: var(--primary-dark);
  318. }
  319. .app-ops button.primary {
  320. border-color: var(--primary);
  321. background: var(--primary);
  322. color: #fff;
  323. }
  324. .app-ops button.primary:hover {
  325. border-color: var(--primary-dark);
  326. background: var(--primary-dark);
  327. color: #fff;
  328. }
  329. .add-card {
  330. justify-content: center;
  331. min-height: 108px;
  332. border: 1px dashed #cbd5e1;
  333. box-shadow: none;
  334. cursor: pointer;
  335. background: #fafafa;
  336. }
  337. .add-card:hover {
  338. border-color: var(--primary);
  339. background: var(--primary-bg);
  340. box-shadow: none;
  341. }
  342. .add-card .app-name { font-weight: 500; color: var(--text-2); }
  343. .empty {
  344. padding: 48px 16px;
  345. color: var(--muted);
  346. text-align: center;
  347. }
  348. .toast {
  349. position: fixed;
  350. left: 50%;
  351. bottom: 28px;
  352. z-index: 20;
  353. transform: translateX(-50%) translateY(20px);
  354. padding: 10px 16px;
  355. border-radius: 8px;
  356. background: #0f172a;
  357. color: #fff;
  358. font-size: 13px;
  359. opacity: 0;
  360. pointer-events: none;
  361. transition: opacity 0.2s, transform 0.2s;
  362. }
  363. .toast.show {
  364. opacity: 1;
  365. transform: translateX(-50%) translateY(0);
  366. }
  367. @media (max-width: 640px) {
  368. .app-card { width: 100%; }
  369. .toolbar-row { flex-direction: column; align-items: flex-start; }
  370. }
  371. </style>
  372. </head>
  373. <body>
  374. <div class="page">
  375. <div class="demo-banner">
  376. <div>
  377. <b>审批管理 · 卡片布局 Demo</b>
  378. <span>图标:打开「新增」弹窗即随机一个默认并预填;用户不改则按该默认保存 iconUrl</span>
  379. </div>
  380. <span class="tag">Fresh Mint · 非列表</span>
  381. </div>
  382. <div class="icon-legend">
  383. <span><strong>用户上传</strong> · 实图封面(如「人事审批」「用章申请」)</span>
  384. <span><strong>系统默认</strong> · 打开新增弹窗时预填随机预设;不改则原样保存</span>
  385. </div>
  386. <div class="search-wrap">
  387. <label class="search" aria-label="搜索审批单">
  388. <svg width="18" height="18" viewBox="0 0 24 24" fill="none" aria-hidden="true">
  389. <circle cx="11" cy="11" r="7" stroke="currentColor" stroke-width="2"/>
  390. <path d="M16.5 16.5L21 21" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
  391. </svg>
  392. <input id="keyword" type="search" placeholder="请输入审批单名称" autocomplete="off" />
  393. </label>
  394. </div>
  395. <div class="group-tabs" id="groupTabs" role="tablist"></div>
  396. <div class="toolbar-row">
  397. <div class="toolbar-hint">
  398. 没有找到合适的审批单?
  399. <a href="#" id="createLink">创建审批表单</a>
  400. </div>
  401. <div style="display:flex;gap:8px">
  402. <button type="button" class="btn" id="btnGroups">分组管理</button>
  403. <button type="button" class="btn primary" id="btnCreate">+ 新建审批</button>
  404. </div>
  405. </div>
  406. <div id="sections"></div>
  407. <div id="empty" class="empty" hidden>没有匹配的审批单</div>
  408. </div>
  409. <div class="toast" id="toast" role="status"></div>
  410. <script>
  411. /* 系统预设默认图标池:创建时若未上传,随机选一个写入 iconUrl(键名或静态资源路径) */
  412. const DEFAULT_ICON_POOL = [
  413. { key: 'doc-orange', className: 'i-orange', glyph: '☰' },
  414. { key: 'leave-mint', className: 'i-mint', glyph: '☁' },
  415. { key: 'clock-blue', className: 'i-blue', glyph: '⏱' },
  416. { key: 'mail-violet', className: 'i-violet', glyph: '✉' },
  417. { key: 'cart-rose', className: 'i-rose', glyph: '🛒' },
  418. { key: 'yen-amber', className: 'i-amber', glyph: '¥' },
  419. { key: 'tag-cyan', className: 'i-cyan', glyph: '🏷' }
  420. ]
  421. function pickRandomDefaultIcon(seed) {
  422. let h = 0
  423. const s = String(seed || '')
  424. for (let i = 0; i < s.length; i++) h = (h * 31 + s.charCodeAt(i)) >>> 0
  425. return DEFAULT_ICON_POOL[h % DEFAULT_ICON_POOL.length]
  426. }
  427. /* Demo:模拟「用户已上传」的方形封面(SVG data URL,正式环境为 MinIO 地址) */
  428. function fakeUpload(color, label) {
  429. const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
  430. <defs><linearGradient id="g" x1="0" y1="0" x2="1" y2="1">
  431. <stop offset="0%" stop-color="${color}"/>
  432. <stop offset="100%" stop-color="${color}" stop-opacity="0.75"/>
  433. </linearGradient></defs>
  434. <rect width="80" height="80" rx="16" fill="url(#g)"/>
  435. <text x="40" y="46" text-anchor="middle" fill="#fff" font-size="22" font-family="system-ui">${label}</text>
  436. </svg>`
  437. return 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svg)
  438. }
  439. const DATA = [
  440. {
  441. id: 'hr',
  442. name: '人事管理',
  443. apps: [
  444. /* 用户上传 */
  445. { id: 'a1', name: '人事审批', iconUrl: fakeUpload('#f97316', '人'), published: true, version: 2, draft: false, status: '1' },
  446. /* 系统默认(无 iconUrl → 按 id 稳定随机) */
  447. { id: 'a2', name: '请假申请', iconUrl: null, published: true, version: 1, draft: true, status: '1' },
  448. { id: 'a3', name: '加班申请', iconUrl: null, published: false, version: null, draft: true, status: '1' }
  449. ]
  450. },
  451. {
  452. id: 'admin',
  453. name: '行政管理',
  454. apps: [
  455. { id: 'a4', name: '用章申请', iconUrl: fakeUpload('#8b5cf6', '章'), published: true, version: 3, draft: false, status: '1' },
  456. { id: 'a5', name: '采购申请', iconUrl: null, published: false, version: null, draft: true, status: '0' }
  457. ]
  458. },
  459. {
  460. id: 'finance',
  461. name: '财务管理',
  462. apps: [
  463. { id: 'a6', name: '报销审批', iconUrl: null, published: true, version: 1, draft: false, status: '1' }
  464. ]
  465. }
  466. ]
  467. let activeGroup = 'all'
  468. const tabsEl = document.getElementById('groupTabs')
  469. const sectionsEl = document.getElementById('sections')
  470. const emptyEl = document.getElementById('empty')
  471. const keywordEl = document.getElementById('keyword')
  472. const toastEl = document.getElementById('toast')
  473. let toastTimer
  474. function toast(msg) {
  475. toastEl.textContent = msg
  476. toastEl.classList.add('show')
  477. clearTimeout(toastTimer)
  478. toastTimer = setTimeout(() => toastEl.classList.remove('show'), 1600)
  479. }
  480. function matches(app, kw) {
  481. if (!kw) return true
  482. return app.name.toLowerCase().includes(kw.toLowerCase())
  483. }
  484. function renderTabs() {
  485. const tabs = [{ id: 'all', name: '全部' }, ...DATA.map(g => ({ id: g.id, name: g.name }))]
  486. tabsEl.innerHTML = tabs.map(t =>
  487. `<button type="button" class="group-tab${t.id === activeGroup ? ' active' : ''}" data-id="${t.id}" role="tab">${t.name}</button>`
  488. ).join('')
  489. }
  490. function statusPills(app) {
  491. const bits = []
  492. if (app.published) bits.push(`<span class="pill ok">v${app.version}</span>`)
  493. else bits.push(`<span class="pill warn">未发布</span>`)
  494. if (app.draft) bits.push(`<span class="pill warn">草稿</span>`)
  495. if (app.status !== '1') bits.push(`<span class="pill mute">停用</span>`)
  496. return bits.join('')
  497. }
  498. /** 有上传图用 <img>;否则用系统预设默认图标 */
  499. function renderAppIcon(app) {
  500. if (app.iconUrl) {
  501. return `<span class="app-icon" title="用户上传"><img src="${app.iconUrl}" alt="" /></span>`
  502. }
  503. const def = pickRandomDefaultIcon(app.id)
  504. return `<span class="app-icon ${def.className}" title="系统默认:${def.key}" aria-hidden="true">${def.glyph}</span>`
  505. }
  506. const ICO_SETTING = `<svg viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z" stroke="currentColor" stroke-width="1.8"/><path d="M19.4 13a7.7 7.7 0 0 0 .1-2l1.7-1.3-1.7-3-2 .5a7.4 7.4 0 0 0-1.7-1l-.3-2.1h-3.4l-.3 2.1a7.4 7.4 0 0 0-1.7 1l-2-.5-1.7 3L6.5 11a7.7 7.7 0 0 0 .1 2l-1.7 1.3 1.7 3 2-.5c.5.4 1.1.8 1.7 1l.3 2.1h3.4l.3-2.1c.6-.2 1.2-.6 1.7-1l2 .5 1.7-3L19.4 13Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/></svg>`
  507. const ICO_MORE = `<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><circle cx="5" cy="12" r="1.8"/><circle cx="12" cy="12" r="1.8"/><circle cx="19" cy="12" r="1.8"/></svg>`
  508. function appCard(app) {
  509. return `
  510. <div class="app-card" data-id="${app.id}">
  511. <div class="app-card__main">
  512. ${renderAppIcon(app)}
  513. <span class="app-body">
  514. <span class="app-name">${app.name}</span>
  515. <span class="app-sub">${statusPills(app)}</span>
  516. </span>
  517. </div>
  518. <div class="app-ops">
  519. <button type="button" class="primary" data-action="design" data-id="${app.id}" data-name="${app.name}">${ICO_SETTING}设计</button>
  520. <button type="button" data-action="more" data-id="${app.id}" data-name="${app.name}">${ICO_MORE}更多</button>
  521. </div>
  522. </div>`
  523. }
  524. function addCard(groupId) {
  525. return `
  526. <button type="button" class="app-card add-card" data-action="add" data-group="${groupId}">
  527. <span class="app-card__main">
  528. <span class="app-icon i-slate" aria-hidden="true">+</span>
  529. <span class="app-body"><span class="app-name">添加</span></span>
  530. </span>
  531. </button>`
  532. }
  533. function render() {
  534. const kw = keywordEl.value.trim()
  535. const groups = DATA.filter(g => activeGroup === 'all' || g.id === activeGroup)
  536. .map(g => ({
  537. ...g,
  538. apps: g.apps.filter(a => matches(a, kw))
  539. }))
  540. .filter(g => !kw || g.apps.length)
  541. renderTabs()
  542. if (!groups.length || groups.every(g => !g.apps.length && kw)) {
  543. sectionsEl.innerHTML = ''
  544. emptyEl.hidden = false
  545. return
  546. }
  547. emptyEl.hidden = true
  548. sectionsEl.innerHTML = groups.map(g => {
  549. const showAdd = !kw
  550. return `
  551. <section class="section" data-group="${g.id}">
  552. <div class="section-head">
  553. <h3>${g.name}</h3>
  554. <span class="dot" aria-hidden="true"></span>
  555. <span class="section-meta">${g.apps.length} 个表单</span>
  556. </div>
  557. <div class="card-row">
  558. ${g.apps.map(appCard).join('')}
  559. ${showAdd ? addCard(g.id) : ''}
  560. </div>
  561. </section>`
  562. }).join('')
  563. }
  564. tabsEl.addEventListener('click', (e) => {
  565. const btn = e.target.closest('.group-tab')
  566. if (!btn) return
  567. activeGroup = btn.dataset.id
  568. render()
  569. })
  570. keywordEl.addEventListener('input', render)
  571. document.body.addEventListener('click', (e) => {
  572. const t = e.target.closest('[data-action]')
  573. if (!t) return
  574. e.preventDefault()
  575. e.stopPropagation()
  576. const action = t.dataset.action
  577. if (action === 'add' || action === 'create') toast('Demo:打开「新增审批」弹窗')
  578. else if (action === 'design') toast(`Demo:进入设计器「${t.dataset.name || t.dataset.id}」`)
  579. else if (action === 'more') toast('Demo:编辑基础 / 发布 / 删除…')
  580. else if (action === 'groups') toast('Demo:打开分组管理')
  581. })
  582. document.getElementById('btnCreate').addEventListener('click', () => toast('Demo:打开「新增审批」弹窗'))
  583. document.getElementById('createLink').addEventListener('click', (e) => {
  584. e.preventDefault()
  585. toast('Demo:打开「新增审批」弹窗')
  586. })
  587. document.getElementById('btnGroups').addEventListener('click', () => toast('Demo:打开分组管理'))
  588. render()
  589. </script>
  590. </body>
  591. </html>