Add draggable swimlane kanban template
This commit is contained in:
60
app/data/kanban-board.json
Normal file
60
app/data/kanban-board.json
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
{
|
||||||
|
"id": "BOARD-2026-08",
|
||||||
|
"name": "官网 3.0 迭代看板",
|
||||||
|
"description": "产品、设计与研发协同泳道",
|
||||||
|
"updatedAt": "2026-08-07 15:10",
|
||||||
|
"lanes": [
|
||||||
|
{
|
||||||
|
"id": "backlog",
|
||||||
|
"title": "需求池",
|
||||||
|
"color": "gray",
|
||||||
|
"limit": 8,
|
||||||
|
"cards": [
|
||||||
|
{ "id": "WEB-142", "title": "补充客户案例筛选能力", "description": "支持按行业、区域与合作类型组合筛选", "priority": "中", "tags": ["需求", "官网"], "owner": { "name": "许言", "initial": "许", "tone": "orange" }, "dueDate": "08-18", "checklist": { "done": 1, "total": 5 }, "comments": 3, "attachments": 1 },
|
||||||
|
{ "id": "WEB-148", "title": "增加暗色主题品牌素材", "description": "整理深色背景下可使用的 Logo 与插图", "priority": "低", "tags": ["设计", "品牌"], "owner": { "name": "林知夏", "initial": "林", "tone": "blue" }, "dueDate": "08-22", "checklist": { "done": 0, "total": 4 }, "comments": 1, "attachments": 2 },
|
||||||
|
{ "id": "WEB-151", "title": "SEO 元数据管理入口", "description": "为运营提供页面级标题与描述配置", "priority": "高", "tags": ["运营", "SEO"], "owner": { "name": "陈序", "initial": "陈", "tone": "purple" }, "dueDate": "08-16", "checklist": { "done": 2, "total": 6 }, "comments": 5, "attachments": 0 }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "planned",
|
||||||
|
"title": "已排期",
|
||||||
|
"color": "purple",
|
||||||
|
"limit": 5,
|
||||||
|
"cards": [
|
||||||
|
{ "id": "WEB-136", "title": "移动端导航结构调整", "description": "减少一级入口并优化触控区域", "priority": "高", "tags": ["交互", "移动端"], "owner": { "name": "林知夏", "initial": "林", "tone": "blue" }, "dueDate": "08-12", "checklist": { "done": 3, "total": 7 }, "comments": 7, "attachments": 3 },
|
||||||
|
{ "id": "WEB-139", "title": "内容卡片组件开发", "description": "覆盖文章、案例与活动三类内容", "priority": "中", "tags": ["React", "组件"], "owner": { "name": "唐可", "initial": "唐", "tone": "green" }, "dueDate": "08-14", "checklist": { "done": 2, "total": 5 }, "comments": 2, "attachments": 1 }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "doing",
|
||||||
|
"title": "进行中",
|
||||||
|
"color": "blue",
|
||||||
|
"limit": 4,
|
||||||
|
"cards": [
|
||||||
|
{ "id": "WEB-128", "title": "首页首屏性能优化", "description": "压缩关键资源并减少布局偏移", "priority": "高", "tags": ["性能", "研发"], "owner": { "name": "唐可", "initial": "唐", "tone": "green" }, "dueDate": "今天", "checklist": { "done": 5, "total": 8 }, "comments": 9, "attachments": 2 },
|
||||||
|
{ "id": "WEB-132", "title": "统一按钮与标签视觉规范", "description": "同步设计变量并完成存量页面迁移", "priority": "中", "tags": ["设计系统"], "owner": { "name": "周屿", "initial": "周", "tone": "purple" }, "dueDate": "08-10", "checklist": { "done": 7, "total": 9 }, "comments": 4, "attachments": 4 },
|
||||||
|
{ "id": "WEB-134", "title": "埋点事件校对", "description": "与数据团队确认转化漏斗事件", "priority": "中", "tags": ["数据", "埋点"], "owner": { "name": "许言", "initial": "许", "tone": "orange" }, "dueDate": "08-11", "checklist": { "done": 4, "total": 6 }, "comments": 6, "attachments": 1 }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "review",
|
||||||
|
"title": "待验收",
|
||||||
|
"color": "orange",
|
||||||
|
"limit": 4,
|
||||||
|
"cards": [
|
||||||
|
{ "id": "WEB-119", "title": "客户案例详情页", "description": "完成内容模型、视觉和响应式开发", "priority": "高", "tags": ["验收", "内容"], "owner": { "name": "林知夏", "initial": "林", "tone": "blue" }, "dueDate": "08-09", "checklist": { "done": 8, "total": 8 }, "comments": 12, "attachments": 5 },
|
||||||
|
{ "id": "WEB-123", "title": "站点页脚信息更新", "description": "更新办公地址、备案信息与社交链接", "priority": "低", "tags": ["内容"], "owner": { "name": "陈序", "initial": "陈", "tone": "purple" }, "dueDate": "08-08", "checklist": { "done": 4, "total": 4 }, "comments": 2, "attachments": 0 }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "done",
|
||||||
|
"title": "已完成",
|
||||||
|
"color": "green",
|
||||||
|
"limit": 99,
|
||||||
|
"cards": [
|
||||||
|
{ "id": "WEB-108", "title": "全局字体加载优化", "description": "使用系统字体回退并调整字重范围", "priority": "中", "tags": ["性能"], "owner": { "name": "唐可", "initial": "唐", "tone": "green" }, "dueDate": "08-04", "checklist": { "done": 6, "total": 6 }, "comments": 3, "attachments": 1 },
|
||||||
|
{ "id": "WEB-112", "title": "404 页面视觉升级", "description": "增加快捷导航与搜索入口", "priority": "低", "tags": ["UI"], "owner": { "name": "周屿", "initial": "周", "tone": "purple" }, "dueDate": "08-05", "checklist": { "done": 3, "total": 3 }, "comments": 1, "attachments": 2 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
28
app/kanban/KanbanBoard.module.css
Normal file
28
app/kanban/KanbanBoard.module.css
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
.shell { --navy:#111b2e; --ink:#1b2638; --text:#435168; --muted:#8893a4; --line:#e5e9ef; --blue:#3276f6; --blueSoft:#edf4ff; --green:#20a26a; --greenSoft:#eaf8f1; --orange:#e58a20; --orangeSoft:#fff5e7; --purple:#7a57d4; --purpleSoft:#f1edfc; min-width:1040px; min-height:100vh; background:#f2f4f8; color:var(--text); font-family:Inter,"PingFang SC","Microsoft YaHei",system-ui,sans-serif; }
|
||||||
|
.sidebar { position:fixed; inset:0 auto 0 0; z-index:30; width:210px; display:flex; flex-direction:column; background:var(--navy); color:#adb8ca; }
|
||||||
|
.brand { height:70px; display:flex; align-items:center; gap:10px; padding:0 22px; color:#fff; text-decoration:none; }
|
||||||
|
.brand strong { font-size:18px; } .brand strong span { color:#72a0ff; }
|
||||||
|
.brandMark { position:relative; width:24px; height:24px; display:block; transform:rotate(-11deg); }
|
||||||
|
.brandMark i { position:absolute; bottom:1px; width:6px; border-radius:4px; background:#fff; }
|
||||||
|
.brandMark i:nth-child(1){left:0;height:12px;background:#72a0ff}.brandMark i:nth-child(2){left:8px;height:21px}.brandMark i:nth-child(3){left:16px;height:15px;background:#3276f6}
|
||||||
|
.sidebar nav { flex:1; padding:11px 13px; overflow-y:auto; }
|
||||||
|
.sidebar nav p { margin:17px 10px 7px; color:#65738b; font-size:8px; font-weight:750; letter-spacing:.8px; }
|
||||||
|
.sidebar nav a { min-height:40px; display:flex; align-items:center; gap:9px; padding:7px 10px; border-radius:8px; color:#aab5c7; cursor:pointer; text-decoration:none; font-size:10px; }
|
||||||
|
.sidebar nav a:hover{background:rgba(255,255,255,.05);color:#fff}.sidebar nav a.active{background:#2c64d7;color:#fff;box-shadow:0 5px 14px rgba(26,74,177,.25)}
|
||||||
|
.sidebar nav a>span{width:19px;text-align:center;font-size:15px}.sidebar nav a b{margin-left:auto;padding:2px 6px;border-radius:8px;background:rgba(255,255,255,.18);font-size:7px}
|
||||||
|
.sidebarProject { min-height:66px; display:flex; align-items:center; gap:9px; padding:11px 15px; border-top:1px solid #263249; }
|
||||||
|
.sidebarProject>span{width:31px;height:31px;display:grid;place-items:center;border-radius:7px;background:#2d64d8;color:#fff;font-size:10px;font-weight:800}.sidebarProject div{flex:1;display:flex;flex-direction:column;gap:3px}.sidebarProject strong{color:#dce3ef;font-size:9px}.sidebarProject small{color:#708098;font-size:7px}.sidebarProject button{border:0;background:none;color:#7c899d}
|
||||||
|
.main{min-height:100vh;margin-left:210px}.topbar{height:66px;display:flex;align-items:center;justify-content:space-between;padding:0 25px;border-bottom:1px solid var(--line);background:#fff}
|
||||||
|
.boardIdentity>div{display:flex;align-items:center;gap:10px}.boardIcon{width:34px;height:34px;display:grid;place-items:center;border-radius:8px;background:var(--blueSoft);color:var(--blue);font-size:16px}.boardIdentity div>div{display:flex;flex-direction:column;gap:3px}.boardIdentity input{width:230px;padding:0;border:0;outline:0;background:transparent;color:var(--ink);font-size:12px;font-weight:750}.boardIdentity small{color:#929baa;font-size:8px}.boardIdentity b{padding:3px 7px;border-radius:5px;background:#eef6f1;color:#438067;font-size:7px}
|
||||||
|
.topActions{display:flex;align-items:center;gap:7px}.topActions button{height:32px;padding:0 10px;border:1px solid #dce1e8;border-radius:6px;background:#fff;color:#647085;cursor:pointer;font-size:8px}.avatar,.ownerAvatar,.memberStack span{display:grid;place-items:center;border-radius:50%;font-weight:700}.avatar{width:31px;height:31px;margin-left:4px;background:#dce7fd;color:#2d61bd;font-size:9px}
|
||||||
|
.content{height:calc(100vh - 66px);display:flex;flex-direction:column;padding:24px 25px 0;overflow:hidden}.heading{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:17px}.heading p{margin:0;color:var(--blue);font-size:8px;font-weight:800;letter-spacing:.8px}.heading h1{margin:4px 0 5px;color:var(--ink);font-size:23px;letter-spacing:-.5px}.heading>div:first-child>span{color:#7f8a9c;font-size:9px}.heading>div:last-child{display:flex;gap:7px}.primaryButton,.secondaryButton{min-height:35px;padding:0 12px;border-radius:7px;cursor:pointer;font-size:8px;font-weight:650}.primaryButton{border:1px solid var(--blue);background:var(--blue);color:#fff;box-shadow:0 5px 12px rgba(50,118,246,.2)}.secondaryButton{border:1px solid #dce1e8;background:#fff;color:#627086}
|
||||||
|
.boardStats{min-height:55px;display:flex;align-items:center;gap:16px;padding:0 16px;margin-bottom:12px;border:1px solid var(--line);border-radius:9px;background:#fff}.boardStats>div:not(.memberStack){display:flex;align-items:baseline;gap:6px}.boardStats strong{color:var(--ink);font-size:15px}.boardStats div>span{color:#8691a2;font-size:8px}.boardStats>i{width:1px;height:22px;background:#e6e9ee}.memberStack{margin-left:auto;display:flex;align-items:center;padding-left:7px}.memberStack span{width:27px;height:27px;margin-left:-7px;border:2px solid #fff;font-size:7px}.memberStack b{margin-left:6px;color:#7c8798;font-size:8px}
|
||||||
|
.blue{background:var(--blueSoft)!important;color:var(--blue)!important}.purple{background:var(--purpleSoft)!important;color:var(--purple)!important}.orange{background:var(--orangeSoft)!important;color:var(--orange)!important}.green{background:var(--greenSoft)!important;color:var(--green)!important}.gray{background:#edf0f4!important;color:#687589!important}
|
||||||
|
.toolbar{min-height:48px;display:flex;align-items:center;gap:7px;padding:8px 11px;margin-bottom:12px;border:1px solid var(--line);border-radius:8px;background:#fff}.toolbar label{width:220px;height:31px;display:flex;align-items:center;gap:7px;padding:0 9px;border:1px solid #dfe3e9;border-radius:6px;color:#929baa}.toolbar label span{font-size:15px;transform:rotate(-20deg)}.toolbar input{min-width:0;flex:1;border:0;outline:0;color:#46536a;font-size:8px}.toolbar select,.toolbar button{height:31px;padding:0 9px;border:1px solid #dfe3e9;border-radius:6px;background:#fff;color:#647085;font-size:8px}.toolbar button{cursor:pointer}.toolbar>span{margin-left:auto;color:#99a1ae;font-size:7px}
|
||||||
|
.boardScroller{min-height:0;flex:1;overflow:auto;padding-bottom:20px}.board{min-width:max-content;display:flex;align-items:flex-start;gap:11px;height:100%;padding-bottom:15px}.lane{width:276px;min-height:100%;padding:0 8px 12px;border:1px solid #e1e5eb;border-radius:9px;background:#e9edf3;transition:border-color .15s,background .15s}.lane.dropActive{border:2px solid #82a6f7;background:#edf3ff}.lane>header{height:49px;display:flex;align-items:center;justify-content:space-between;padding:0 5px}.lane>header>div{display:flex;align-items:center;gap:7px}.laneDot{width:8px;height:8px;border-radius:50%}.lane>header strong{color:#344158;font-size:10px}.lane>header b{min-width:20px;padding:2px 5px;border-radius:8px;background:#d9dee7;color:#6e7a8c;font-size:7px;text-align:center}.lane>header em{padding:3px 5px;border-radius:4px;background:#feeeee;color:#dc5555;font-size:6px;font-style:normal}.lane>header button{border:0;background:none;color:#8c96a6;cursor:pointer;font-size:8px}.laneLimit{display:flex;align-items:center;gap:7px;margin:-4px 5px 9px}.laneLimit>span{flex:1;height:3px;overflow:hidden;border-radius:2px;background:#d9dee6}.laneLimit i{display:block;height:100%;border-radius:inherit;background:#8596b1}.laneLimit small{color:#8e98a8;font-size:6px}.cards{display:flex;flex-direction:column;gap:8px}
|
||||||
|
.card{padding:12px;border:1px solid #dde2e8;border-radius:8px;background:#fff;box-shadow:0 3px 8px rgba(35,48,78,.045);cursor:grab;transition:transform .15s,box-shadow .15s,opacity .15s}.card:hover{transform:translateY(-1px);box-shadow:0 8px 18px rgba(35,48,78,.09)}.card.dragging{opacity:.42;transform:rotate(2deg);cursor:grabbing}.cardTop{display:flex;align-items:center;justify-content:space-between}.cardTop button{border:0;background:none;color:#99a1ae;cursor:pointer;font-size:7px}.priority{display:inline-flex;padding:3px 6px;border-radius:4px;font-size:7px;font-weight:700}.priority_高{background:#feeeee;color:#dc5050}.priority_中{background:#fff5e8;color:#d77d15}.priority_低{background:#eef6f1;color:#438067}.cardId{display:block;margin-top:8px;color:#9da5b2;font-size:7px;font-weight:700}.card h3{margin:5px 0 6px;color:#2f3d53;font-size:10px;line-height:1.5}.card>p{margin:0 0 9px;color:#8791a1;font-size:8px;line-height:1.5}.tags{display:flex;flex-wrap:wrap;gap:4px}.tags span{padding:3px 6px;border-radius:4px;background:#f1f3f6;color:#718096;font-size:6px}.checklist{margin-top:11px;padding-top:9px;border-top:1px solid #edf0f3}.checklist>div{display:flex;justify-content:space-between;margin-bottom:5px;color:#8d96a5;font-size:7px}.checklist>span{height:4px;display:block;overflow:hidden;border-radius:3px;background:#e8ecf1}.checklist i{display:block;height:100%;border-radius:inherit;background:var(--blue)}.card footer{display:flex;align-items:center;gap:5px;margin-top:10px}.ownerAvatar{width:22px;height:22px;flex:0 0 auto;font-size:7px}.card footer strong{flex:1;color:#657187;font-size:7px;font-weight:550}.card footer>span:not(.ownerAvatar),.card footer>i{color:#929baa;font-size:6px;font-style:normal}.card footer .today{color:#dc5555!important;font-weight:700}.emptyLane{min-height:90px;display:grid;place-items:center;border:1px dashed #c4ccd8;border-radius:7px;color:#919baa;font-size:8px}.addCard{width:100%;min-height:34px;border:1px dashed #c2cad6;border-radius:7px;background:rgba(255,255,255,.4);color:#7e899a;cursor:pointer;font-size:8px}.addCard:hover{border-color:#8eaff2;color:var(--blue)}.addLane{width:155px;min-height:48px;display:flex;align-items:center;justify-content:center;gap:6px;border:1px dashed #b9c3d1;border-radius:8px;background:rgba(255,255,255,.55);color:#748195;cursor:pointer;font-size:8px}.addLane span{font-size:14px}
|
||||||
|
.drawerBackdrop,.modalBackdrop{position:fixed;inset:0;z-index:70;background:rgba(16,25,42,.45);backdrop-filter:blur(3px)}.drawer{position:absolute;inset:0 0 0 auto;width:430px;display:flex;flex-direction:column;background:#fff;box-shadow:-20px 0 60px rgba(15,24,40,.18)}.drawer header{min-height:84px;display:flex;align-items:flex-start;justify-content:space-between;padding:20px;border-bottom:1px solid var(--line)}.drawer header small{color:#9ba3b0;font-size:7px}.drawer h2{margin:5px 0 0;color:var(--ink);font-size:15px}.drawer header>button,.modal header>button{width:28px;height:28px;border:0;border-radius:50%;background:#f2f4f7;color:#778296;cursor:pointer;font-size:16px}.drawerBody{flex:1;padding:18px;overflow-y:auto}.moveSelect{display:flex;flex-direction:column;gap:7px;padding:12px;border:1px solid #dbe5fa;border-radius:8px;background:#f6f9ff;color:#526078;font-size:8px;font-weight:700}.moveSelect select{height:34px;padding:0 9px;border:1px solid #bfd0f4;border-radius:6px;background:#fff;color:#3f4d62;font-size:8px}.drawer section{margin-top:21px}.drawer section h3{margin:0 0 9px;color:#4b586d;font-size:9px}.descriptionBox{margin:0;padding:11px;border:1px solid var(--line);border-radius:7px;background:#fafbfc;color:#6d798c;font-size:8px;line-height:1.7}.drawer dl{margin:0;padding:2px 11px;border:1px solid var(--line);border-radius:8px}.drawer dl>div{min-height:42px;display:grid;grid-template-columns:88px 1fr;align-items:center;border-bottom:1px solid #edf0f4}.drawer dl>div:last-child{border-bottom:0}.drawer dt{color:#929baa;font-size:8px}.drawer dd{display:flex;align-items:center;gap:6px;margin:0;color:#566378;font-size:8px}.checkItem{min-height:36px;display:flex;align-items:center;gap:7px;border-bottom:1px solid #edf0f4;color:#5e6b7e;font-size:8px}.checkItem input{accent-color:var(--blue)}.activityItem{display:flex;gap:8px}.activityItem p{display:flex;flex-direction:column;gap:3px;margin:0;color:#6c788b;font-size:8px}.activityItem p strong{color:#435168}.activityItem p small{color:#9ca4b1;font-size:7px}.drawer>footer{display:flex;justify-content:flex-end;gap:7px;padding:13px 18px;border-top:1px solid var(--line)}.drawer>footer button,.modal footer button{min-height:34px;padding:0 12px;border:1px solid #dce1e8;border-radius:6px;background:#fff;color:#647085;cursor:pointer;font-size:8px}.drawer>footer button:last-child,.modal footer button:last-child{border-color:var(--blue);background:var(--blue);color:#fff}
|
||||||
|
.activityDrawer{width:370px}.moveActivity{display:flex;gap:10px;padding:12px 0;border-bottom:1px solid #edf0f4}.moveActivity>span{width:27px;height:27px;display:grid;place-items:center;flex:0 0 auto;border-radius:50%;background:var(--blueSoft);color:var(--blue)}.moveActivity p{display:flex;flex-direction:column;gap:4px;margin:0;color:#687589;font-size:8px;line-height:1.5}.moveActivity strong{color:#3f4d62}.moveActivity small{color:#9aa3b1;font-size:7px}.modalBackdrop{display:grid;place-items:center;padding:20px}.modal{width:480px;padding:21px;border-radius:12px;background:#fff;box-shadow:0 25px 70px rgba(15,24,40,.25)}.modal header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:20px}.modal h2{margin:0 0 4px;color:var(--ink);font-size:15px}.modal header p{margin:0;color:#929baa;font-size:8px}.modal>label{display:flex;flex-direction:column;gap:7px;margin-bottom:14px;color:#566378;font-size:8px;font-weight:650}.modal input,.modal select{width:100%;height:36px;padding:0 10px;border:1px solid #dde2e8;border-radius:6px;outline:0;background:#fff;color:#46536a;font-size:9px}.modal input:focus,.modal select:focus{border-color:#8fb0f7;box-shadow:0 0 0 3px rgba(50,118,246,.08)}.modal fieldset{display:flex;gap:18px;margin:0 0 15px;padding:12px;border:1px solid #e0e4ea;border-radius:7px}.modal legend{padding:0 4px;color:#566378;font-size:8px;font-weight:650}.modal fieldset label{display:flex;align-items:center;gap:5px;color:#687589;font-size:8px}.modal fieldset input{width:13px;height:13px;accent-color:var(--blue)}.modal footer{display:flex;justify-content:flex-end;gap:7px;padding-top:15px;border-top:1px solid var(--line)}
|
||||||
|
.toast{position:fixed;right:22px;bottom:22px;z-index:90;min-width:220px;display:flex;align-items:center;gap:8px;padding:11px 13px;border:1px solid #dce3eb;border-radius:8px;background:#fff;box-shadow:0 15px 35px rgba(23,35,58,.16);color:#4c596d;font-size:8px;animation:toastIn .2s ease-out}.toast span{width:18px;height:18px;display:grid;place-items:center;border-radius:50%;background:var(--greenSoft);color:var(--green);font-weight:800}@keyframes toastIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
|
||||||
|
@media(max-width:1180px){.content{padding-right:17px;padding-left:17px}.heading{align-items:flex-start;flex-direction:column}.toolbar{overflow-x:auto}.toolbar>span{display:none}}
|
||||||
|
@media(prefers-reduced-motion:reduce){.card,.lane,.toast{transition:none;animation:none}}
|
||||||
16
app/kanban/README.md
Normal file
16
app/kanban/README.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# 泳道看板模板
|
||||||
|
|
||||||
|
访问 `/kanban` 查看看板。初始数据来自 `app/data/kanban-board.json`,卡片和泳道变更会保存到浏览器的 `orbit-kanban-board` 本地存储项。
|
||||||
|
|
||||||
|
包含功能:
|
||||||
|
|
||||||
|
- 卡片在泳道之间拖放
|
||||||
|
- 详情侧栏中的“移动到”选择器
|
||||||
|
- 泳道 WIP 卡片上限与超限提示
|
||||||
|
- 新建卡片和自定义泳道
|
||||||
|
- 搜索、优先级和负责人筛选
|
||||||
|
- 检查项、评论、附件和负责人信息
|
||||||
|
- 卡片移动动态记录
|
||||||
|
- 一键恢复 JSON 示例数据
|
||||||
|
|
||||||
|
接入真实业务时,可保留 `Lane`、`Card` 数据结构并将状态更新替换为接口调用。
|
||||||
198
app/kanban/page.tsx
Normal file
198
app/kanban/page.tsx
Normal file
@@ -0,0 +1,198 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import Link from "next/link";
|
||||||
|
import { useEffect, useMemo, useState } from "react";
|
||||||
|
import boardData from "../data/kanban-board.json";
|
||||||
|
import styles from "./KanbanBoard.module.css";
|
||||||
|
|
||||||
|
type Card = {
|
||||||
|
id: string;
|
||||||
|
title: string;
|
||||||
|
description: string;
|
||||||
|
priority: string;
|
||||||
|
tags: string[];
|
||||||
|
owner: { name: string; initial: string; tone: string };
|
||||||
|
dueDate: string;
|
||||||
|
checklist: { done: number; total: number };
|
||||||
|
comments: number;
|
||||||
|
attachments: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
type Lane = { id: string; title: string; color: string; limit: number; cards: Card[] };
|
||||||
|
type Board = { id: string; name: string; description: string; updatedAt: string; lanes: Lane[] };
|
||||||
|
type Activity = { id: number; card: string; from: string; to: string; time: string };
|
||||||
|
|
||||||
|
const initialBoard = boardData as Board;
|
||||||
|
|
||||||
|
export default function KanbanPage() {
|
||||||
|
const [board, setBoard] = useState<Board>(initialBoard);
|
||||||
|
const [dragging, setDragging] = useState<{ cardId: string; laneId: string } | null>(null);
|
||||||
|
const [dropLane, setDropLane] = useState<string | null>(null);
|
||||||
|
const [search, setSearch] = useState("");
|
||||||
|
const [priority, setPriority] = useState("全部优先级");
|
||||||
|
const [owner, setOwner] = useState("全部成员");
|
||||||
|
const [selectedCard, setSelectedCard] = useState<{ card: Card; laneId: string } | null>(null);
|
||||||
|
const [createOpen, setCreateOpen] = useState(false);
|
||||||
|
const [laneOpen, setLaneOpen] = useState(false);
|
||||||
|
const [activityOpen, setActivityOpen] = useState(false);
|
||||||
|
const [toast, setToast] = useState("");
|
||||||
|
const [activities, setActivities] = useState<Activity[]>([
|
||||||
|
{ id: 1, card: "WEB-119", from: "进行中", to: "待验收", time: "今天 14:26" },
|
||||||
|
{ id: 2, card: "WEB-108", from: "待验收", to: "已完成", time: "今天 11:08" },
|
||||||
|
]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const saved = window.localStorage.getItem("orbit-kanban-board");
|
||||||
|
if (saved) {
|
||||||
|
try { setBoard(JSON.parse(saved)); }
|
||||||
|
catch { window.localStorage.removeItem("orbit-kanban-board"); }
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
window.localStorage.setItem("orbit-kanban-board", JSON.stringify(board));
|
||||||
|
}, [board]);
|
||||||
|
|
||||||
|
const allCards = useMemo(() => board.lanes.flatMap((lane) => lane.cards.map((card) => ({ card, laneId: lane.id }))), [board]);
|
||||||
|
const owners = useMemo(() => Array.from(new Set(allCards.map(({ card }) => card.owner.name))), [allCards]);
|
||||||
|
const completed = board.lanes.find((lane) => lane.id === "done")?.cards.length ?? 0;
|
||||||
|
|
||||||
|
const notify = (message: string) => {
|
||||||
|
setToast(message);
|
||||||
|
window.setTimeout(() => setToast(""), 2300);
|
||||||
|
};
|
||||||
|
|
||||||
|
const moveCard = (cardId: string, fromLaneId: string, targetLaneId: string) => {
|
||||||
|
if (fromLaneId === targetLaneId) { setDragging(null); setDropLane(null); return; }
|
||||||
|
const target = board.lanes.find((lane) => lane.id === targetLaneId);
|
||||||
|
if (!target) return;
|
||||||
|
if (target.cards.length >= target.limit) {
|
||||||
|
notify(`“${target.title}”已达到 ${target.limit} 张卡片上限`);
|
||||||
|
setDragging(null); setDropLane(null); return;
|
||||||
|
}
|
||||||
|
const from = board.lanes.find((lane) => lane.id === fromLaneId);
|
||||||
|
const card = from?.cards.find((item) => item.id === cardId);
|
||||||
|
if (!card || !from) return;
|
||||||
|
setBoard((current) => ({
|
||||||
|
...current,
|
||||||
|
updatedAt: new Date().toLocaleString("zh-CN", { hour12: false }),
|
||||||
|
lanes: current.lanes.map((lane) => {
|
||||||
|
if (lane.id === fromLaneId) return { ...lane, cards: lane.cards.filter((item) => item.id !== cardId) };
|
||||||
|
if (lane.id === targetLaneId) return { ...lane, cards: [...lane.cards, card] };
|
||||||
|
return lane;
|
||||||
|
}),
|
||||||
|
}));
|
||||||
|
setActivities((current) => [{ id: Date.now(), card: card.id, from: from.title, to: target.title, time: "刚刚" }, ...current].slice(0, 8));
|
||||||
|
setSelectedCard((current) => current?.card.id === cardId ? { card, laneId: targetLaneId } : current);
|
||||||
|
setDragging(null); setDropLane(null);
|
||||||
|
notify(`已将 ${card.id} 移动到“${target.title}”`);
|
||||||
|
};
|
||||||
|
|
||||||
|
const createCard = (title: string, laneId: string, cardPriority: string) => {
|
||||||
|
const lane = board.lanes.find((item) => item.id === laneId);
|
||||||
|
if (!lane || lane.cards.length >= lane.limit) return notify("目标泳道已达到卡片上限");
|
||||||
|
const card: Card = { id: `WEB-${String(Date.now()).slice(-3)}`, title, description: "点击卡片可继续补充任务说明", priority: cardPriority, tags: ["新任务"], owner: { name: "林知夏", initial: "林", tone: "blue" }, dueDate: "08-21", checklist: { done: 0, total: 4 }, comments: 0, attachments: 0 };
|
||||||
|
setBoard((current) => ({ ...current, lanes: current.lanes.map((item) => item.id === laneId ? { ...item, cards: [...item.cards, card] } : item) }));
|
||||||
|
setCreateOpen(false); notify("新卡片已添加");
|
||||||
|
};
|
||||||
|
|
||||||
|
const createLane = (title: string, limit: number) => {
|
||||||
|
const colors = ["blue", "purple", "orange", "green", "gray"];
|
||||||
|
setBoard((current) => ({ ...current, lanes: [...current.lanes, { id: `lane-${Date.now()}`, title, limit, color: colors[current.lanes.length % colors.length], cards: [] }] }));
|
||||||
|
setLaneOpen(false); notify("新泳道已创建");
|
||||||
|
};
|
||||||
|
|
||||||
|
const resetBoard = () => {
|
||||||
|
setBoard(initialBoard);
|
||||||
|
window.localStorage.removeItem("orbit-kanban-board");
|
||||||
|
notify("已恢复 JSON 示例看板");
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={styles.shell}>
|
||||||
|
<aside className={styles.sidebar}>
|
||||||
|
<Link href="/" className={styles.brand}><span className={styles.brandMark}><i /><i /><i /></span><strong>Orbit<span>Flow</span></strong></Link>
|
||||||
|
<nav><p>工作台</p><Link href="/"><span>⌂</span>概览</Link><Link href="/worklist"><span>☷</span>工作列表</Link><a className={styles.active}><span>▦</span>泳道看板<b>{allCards.length}</b></a><Link href="/approval"><span>⌘</span>审批流程设计</Link><p>快捷视图</p><a><span>☆</span>我的卡片</a><a><span>!</span>即将到期</a><a><span>✓</span>本周完成</a></nav>
|
||||||
|
<div className={styles.sidebarProject}><span>W</span><div><strong>官网 3.0</strong><small>产品研发空间</small></div><button>⌄</button></div>
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
<main className={styles.main}>
|
||||||
|
<header className={styles.topbar}>
|
||||||
|
<div className={styles.boardIdentity}><div><span className={styles.boardIcon}>▦</span><div><input value={board.name} onChange={(event) => setBoard((current) => ({ ...current, name: event.target.value }))} aria-label="看板名称" /><small>{board.description}</small></div><b>团队可见</b></div></div>
|
||||||
|
<div className={styles.topActions}><button onClick={() => setActivityOpen(true)}>↻ 动态</button><button onClick={() => notify("分享链接已生成(模板演示)")}>♙ 分享</button><span className={styles.avatar}>林</span></div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<section className={styles.content}>
|
||||||
|
<div className={styles.heading}>
|
||||||
|
<div><p>SPRINT 08 · 8 月 4 日 — 8 月 18 日</p><h1>产品迭代泳道</h1><span>拖动卡片即可更新工作状态,所有变更自动保存在浏览器。</span></div>
|
||||||
|
<div><button className={styles.secondaryButton} onClick={resetBoard}>↺ 重置示例</button><button className={styles.secondaryButton} onClick={() => setLaneOpen(true)}>+ 新建泳道</button><button className={styles.primaryButton} onClick={() => setCreateOpen(true)}>+ 新建卡片</button></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={styles.boardStats}>
|
||||||
|
<div><strong>{allCards.length}</strong><span>全部卡片</span></div><i /><div><strong>{board.lanes.find((lane) => lane.id === "doing")?.cards.length ?? 0}</strong><span>进行中</span></div><i /><div><strong>{completed}</strong><span>已完成</span></div><i /><div><strong>{Math.round((completed / allCards.length) * 100)}%</strong><span>迭代完成率</span></div>
|
||||||
|
<div className={styles.memberStack}><span className={styles.blue}>林</span><span className={styles.purple}>周</span><span className={styles.green}>唐</span><span className={styles.orange}>许</span><b>+5</b></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={styles.toolbar}>
|
||||||
|
<label><span>⌕</span><input value={search} onChange={(event) => setSearch(event.target.value)} placeholder="搜索卡片标题或编号" /></label>
|
||||||
|
<select value={priority} onChange={(event) => setPriority(event.target.value)}><option>全部优先级</option><option>高</option><option>中</option><option>低</option></select>
|
||||||
|
<select value={owner} onChange={(event) => setOwner(event.target.value)}><option>全部成员</option>{owners.map((name) => <option key={name}>{name}</option>)}</select>
|
||||||
|
<button onClick={() => { setSearch(""); setPriority("全部优先级"); setOwner("全部成员"); }}>清除筛选</button>
|
||||||
|
<span>最近更新:{board.updatedAt}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={styles.boardScroller}>
|
||||||
|
<div className={styles.board}>
|
||||||
|
{board.lanes.map((lane) => {
|
||||||
|
const visible = lane.cards.filter((card) => (!search || `${card.title}${card.id}`.toLowerCase().includes(search.toLowerCase())) && (priority === "全部优先级" || card.priority === priority) && (owner === "全部成员" || card.owner.name === owner));
|
||||||
|
const atLimit = lane.cards.length >= lane.limit;
|
||||||
|
return (
|
||||||
|
<section key={lane.id} className={`${styles.lane} ${dropLane === lane.id ? styles.dropActive : ""}`} onDragOver={(event) => { event.preventDefault(); setDropLane(lane.id); }} onDragLeave={(event) => { if (!event.currentTarget.contains(event.relatedTarget as Node)) setDropLane(null); }} onDrop={(event) => { event.preventDefault(); if (dragging) moveCard(dragging.cardId, dragging.laneId, lane.id); }}>
|
||||||
|
<header><div><span className={`${styles.laneDot} ${styles[lane.color]}`} /><strong>{lane.title}</strong><b>{lane.cards.length}</b>{atLimit && lane.limit < 90 && <em>已达上限</em>}</div><button onClick={() => notify(`“${lane.title}”泳道设置为模板占位`)}>•••</button></header>
|
||||||
|
<div className={styles.laneLimit}><span><i style={{ width: `${Math.min(100, (lane.cards.length / lane.limit) * 100)}%` }} /></span><small>WIP {lane.cards.length} / {lane.limit}</small></div>
|
||||||
|
<div className={styles.cards}>
|
||||||
|
{visible.map((card) => <KanbanCard key={card.id} card={card} laneId={lane.id} dragging={dragging?.cardId === card.id} onDragStart={() => setDragging({ cardId: card.id, laneId: lane.id })} onDragEnd={() => { setDragging(null); setDropLane(null); }} onOpen={() => setSelectedCard({ card, laneId: lane.id })} />)}
|
||||||
|
{visible.length === 0 && <div className={styles.emptyLane}><span>{dragging ? "松开鼠标移动到这里" : "暂无匹配卡片"}</span></div>}
|
||||||
|
<button className={styles.addCard} onClick={() => setCreateOpen(true)}>+ 添加卡片</button>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
<button className={styles.addLane} onClick={() => setLaneOpen(true)}><span>+</span>添加泳道</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
{selectedCard && <CardDrawer selected={selectedCard} lanes={board.lanes} onClose={() => setSelectedCard(null)} onMove={(target) => moveCard(selectedCard.card.id, selectedCard.laneId, target)} notify={notify} />}
|
||||||
|
{createOpen && <CardModal lanes={board.lanes} onClose={() => setCreateOpen(false)} onCreate={createCard} />}
|
||||||
|
{laneOpen && <LaneModal onClose={() => setLaneOpen(false)} onCreate={createLane} />}
|
||||||
|
{activityOpen && <ActivityDrawer activities={activities} onClose={() => setActivityOpen(false)} />}
|
||||||
|
{toast && <div className={styles.toast}><span>✓</span>{toast}</div>}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function KanbanCard({ card, laneId, dragging, onDragStart, onDragEnd, onOpen }: { card: Card; laneId: string; dragging: boolean; onDragStart: () => void; onDragEnd: () => void; onOpen: () => void }) {
|
||||||
|
const percent = Math.round((card.checklist.done / card.checklist.total) * 100);
|
||||||
|
return <article className={`${styles.card} ${dragging ? styles.dragging : ""}`} draggable onDragStart={(event) => { event.dataTransfer.effectAllowed = "move"; event.dataTransfer.setData("text/plain", `${laneId}:${card.id}`); onDragStart(); }} onDragEnd={onDragEnd} onClick={onOpen}><div className={styles.cardTop}><span className={`${styles.priority} ${styles[`priority_${card.priority}`]}`}>{card.priority === "高" ? "↑ 高" : card.priority === "低" ? "↓ 低" : "= 中"}</span><button onClick={(event) => { event.stopPropagation(); onOpen(); }}>•••</button></div><small className={styles.cardId}>{card.id}</small><h3>{card.title}</h3><p>{card.description}</p><div className={styles.tags}>{card.tags.map((tag) => <span key={tag}>{tag}</span>)}</div><div className={styles.checklist}><div><span>检查项</span><b>{card.checklist.done}/{card.checklist.total}</b></div><span><i style={{ width: `${percent}%` }} /></span></div><footer><span className={`${styles.ownerAvatar} ${styles[card.owner.tone]}`}>{card.owner.initial}</span><strong>{card.owner.name}</strong><span className={card.dueDate === "今天" ? styles.today : ""}>◷ {card.dueDate}</span><i>☵ {card.comments}</i><i>⌕ {card.attachments}</i></footer></article>;
|
||||||
|
}
|
||||||
|
|
||||||
|
function CardDrawer({ selected, lanes, onClose, onMove, notify }: { selected: { card: Card; laneId: string }; lanes: Lane[]; onClose: () => void; onMove: (laneId: string) => void; notify: (message: string) => void }) {
|
||||||
|
const { card, laneId } = selected;
|
||||||
|
return <div className={styles.drawerBackdrop} onMouseDown={onClose}><aside className={styles.drawer} onMouseDown={(event) => event.stopPropagation()}><header><div><small>{card.id}</small><h2>{card.title}</h2></div><button onClick={onClose}>×</button></header><div className={styles.drawerBody}><label className={styles.moveSelect}><span>当前泳道</span><select value={laneId} onChange={(event) => onMove(event.target.value)}>{lanes.map((lane) => <option key={lane.id} value={lane.id}>移动到:{lane.title}</option>)}</select></label><section><h3>任务说明</h3><p className={styles.descriptionBox}>{card.description}</p></section><section><h3>任务属性</h3><dl><div><dt>负责人</dt><dd><span className={`${styles.ownerAvatar} ${styles[card.owner.tone]}`}>{card.owner.initial}</span>{card.owner.name}</dd></div><div><dt>优先级</dt><dd><span className={`${styles.priority} ${styles[`priority_${card.priority}`]}`}>{card.priority}</span></dd></div><div><dt>截止时间</dt><dd>{card.dueDate}</dd></div><div><dt>标签</dt><dd>{card.tags.join("、")}</dd></div></dl></section><section><h3>检查项</h3>{["完成设计稿评审", "补充空状态", "完成开发自测", "产品验收"].slice(0, card.checklist.total).map((item, index) => <label className={styles.checkItem} key={item}><input type="checkbox" defaultChecked={index < card.checklist.done} onChange={() => notify("检查项已更新(演示)")} /><span>{item}</span></label>)}</section><section><h3>动态</h3><div className={styles.activityItem}><span className={`${styles.ownerAvatar} ${styles.blue}`}>林</span><p><strong>林知夏</strong> 更新了卡片信息<small>今天 14:32</small></p></div></section></div><footer><button onClick={onClose}>关闭</button><button onClick={() => notify("编辑卡片为模板交互")}>编辑卡片</button></footer></aside></div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
function CardModal({ lanes, onClose, onCreate }: { lanes: Lane[]; onClose: () => void; onCreate: (title: string, laneId: string, priority: string) => void }) {
|
||||||
|
const [title, setTitle] = useState(""); const [laneId, setLaneId] = useState(lanes[0]?.id ?? ""); const [priority, setPriority] = useState("中");
|
||||||
|
return <div className={styles.modalBackdrop} onMouseDown={onClose}><form className={styles.modal} onMouseDown={(event) => event.stopPropagation()} onSubmit={(event) => { event.preventDefault(); if (title.trim()) onCreate(title.trim(), laneId, priority); }}><header><div><h2>新建看板卡片</h2><p>创建后可直接拖动到其他泳道。</p></div><button type="button" onClick={onClose}>×</button></header><label><span>卡片标题</span><input autoFocus value={title} onChange={(event) => setTitle(event.target.value)} placeholder="请输入任务名称" required /></label><label><span>初始泳道</span><select value={laneId} onChange={(event) => setLaneId(event.target.value)}>{lanes.map((lane) => <option value={lane.id} key={lane.id}>{lane.title}</option>)}</select></label><fieldset><legend>优先级</legend>{["高", "中", "低"].map((value) => <label key={value}><input type="radio" checked={priority === value} onChange={() => setPriority(value)} />{value}</label>)}</fieldset><footer><button type="button" onClick={onClose}>取消</button><button type="submit">创建卡片</button></footer></form></div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
function LaneModal({ onClose, onCreate }: { onClose: () => void; onCreate: (title: string, limit: number) => void }) {
|
||||||
|
const [title, setTitle] = useState(""); const [limit, setLimit] = useState(5);
|
||||||
|
return <div className={styles.modalBackdrop} onMouseDown={onClose}><form className={styles.modal} onMouseDown={(event) => event.stopPropagation()} onSubmit={(event) => { event.preventDefault(); if (title.trim()) onCreate(title.trim(), limit); }}><header><div><h2>新建泳道</h2><p>设置泳道名称和在制品上限。</p></div><button type="button" onClick={onClose}>×</button></header><label><span>泳道名称</span><input autoFocus value={title} onChange={(event) => setTitle(event.target.value)} placeholder="例如:等待发布" required /></label><label><span>卡片上限</span><input type="number" min="1" max="99" value={limit} onChange={(event) => setLimit(Number(event.target.value))} /></label><footer><button type="button" onClick={onClose}>取消</button><button type="submit">创建泳道</button></footer></form></div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
function ActivityDrawer({ activities, onClose }: { activities: Activity[]; onClose: () => void }) {
|
||||||
|
return <div className={styles.drawerBackdrop} onMouseDown={onClose}><aside className={`${styles.drawer} ${styles.activityDrawer}`} onMouseDown={(event) => event.stopPropagation()}><header><div><small>BOARD ACTIVITY</small><h2>看板动态</h2></div><button onClick={onClose}>×</button></header><div className={styles.drawerBody}>{activities.map((item) => <div className={styles.moveActivity} key={item.id}><span>↻</span><p><strong>{item.card}</strong> 从“{item.from}”移动到“{item.to}”<small>{item.time} · 林知夏</small></p></div>)}</div></aside></div>;
|
||||||
|
}
|
||||||
@@ -1,41 +1,9 @@
|
|||||||
.launcherStack {
|
.launcherStack { position:fixed; right:26px; bottom:26px; z-index:45; display:flex; flex-direction:column; gap:9px; }
|
||||||
position: fixed;
|
.launcher { width:208px; min-height:58px; display:flex; align-items:center; gap:10px; padding:8px 11px; border:1px solid; border-radius:11px; box-shadow:0 14px 30px rgba(30,49,86,.21); color:#fff; text-decoration:none; transition:transform .18s ease,background .18s ease; }
|
||||||
right: 26px;
|
|
||||||
bottom: 26px;
|
|
||||||
z-index: 45;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.launcher {
|
|
||||||
width: 208px;
|
|
||||||
min-height: 61px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 11px;
|
|
||||||
padding: 9px 12px;
|
|
||||||
border: 1px solid;
|
|
||||||
border-radius: 12px;
|
|
||||||
box-shadow: 0 15px 32px rgba(30, 49, 86, .22);
|
|
||||||
color: white;
|
|
||||||
text-decoration: none;
|
|
||||||
transition: transform .18s ease, background .18s ease;
|
|
||||||
}
|
|
||||||
.launcher:hover { transform:translateY(-2px); }
|
.launcher:hover { transform:translateY(-2px); }
|
||||||
.approval { border-color: #295fcf; background: #3276f6; }
|
.approval { border-color:#295fcf; background:#3276f6; }.approval:hover{background:#215ecb}
|
||||||
.approval:hover { background: #215ecb; }
|
.worklist { border-color:#273a59; background:#17263d; }.worklist:hover{background:#223655}
|
||||||
.worklist { border-color: #273a59; background: #17263d; }
|
.kanban { border-color:#47734f; background:#28613e; }.kanban:hover{background:#1d5032}
|
||||||
.worklist:hover { background: #223655; }
|
.launcherIcon { width:34px; height:34px; display:grid; place-items:center; flex:0 0 auto; border-radius:8px; background:rgba(255,255,255,.14); font-size:16px; }
|
||||||
.launcherIcon { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: rgba(255,255,255,.14); font-size: 17px; }
|
.launcher>span:nth-child(2){display:flex;flex:1;flex-direction:column;gap:3px}.launcher strong{font-size:11px}.launcher small{color:rgba(255,255,255,.7);font-size:8px}.launcher b{font-size:15px}
|
||||||
.launcher > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; gap: 3px; }
|
@media(max-width:620px){.launcherStack{right:14px;bottom:14px;gap:7px}.launcher{width:50px;min-height:50px;padding:8px;border-radius:50%}.launcher>span:nth-child(2),.launcher b{display:none}.launcherIcon{width:32px;height:32px;background:transparent}}
|
||||||
.launcher strong { font-size: 11px; }
|
|
||||||
.launcher small { color: rgba(255,255,255,.7); font-size: 8px; }
|
|
||||||
.launcher b { font-size: 16px; }
|
|
||||||
|
|
||||||
@media (max-width: 620px) {
|
|
||||||
.launcherStack { right: 14px; bottom: 14px; gap: 8px; }
|
|
||||||
.launcher { width: 52px; min-height: 52px; padding: 8px; border-radius: 50%; }
|
|
||||||
.launcher > span:nth-child(2), .launcher b { display: none; }
|
|
||||||
.launcherIcon { width: 34px; height: 34px; background: transparent; }
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,12 +2,17 @@ import Link from "next/link";
|
|||||||
import AdminApp from "./AdminApp";
|
import AdminApp from "./AdminApp";
|
||||||
import styles from "./page.module.css";
|
import styles from "./page.module.css";
|
||||||
|
|
||||||
// AdminApp owns the localStorage-backed template interactions.
|
// Feature routes use localStorage-backed JSON demo data.
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AdminApp />
|
<AdminApp />
|
||||||
<nav className={styles.launcherStack} aria-label="模板功能入口">
|
<nav className={styles.launcherStack} aria-label="模板功能入口">
|
||||||
|
<Link className={`${styles.launcher} ${styles.kanban}`} href="/kanban">
|
||||||
|
<span className={styles.launcherIcon}>▦</span>
|
||||||
|
<span><strong>泳道看板</strong><small>拖拽变更卡片状态</small></span>
|
||||||
|
<b>→</b>
|
||||||
|
</Link>
|
||||||
<Link className={`${styles.launcher} ${styles.worklist}`} href="/worklist">
|
<Link className={`${styles.launcher} ${styles.worklist}`} href="/worklist">
|
||||||
<span className={styles.launcherIcon}>☷</span>
|
<span className={styles.launcherIcon}>☷</span>
|
||||||
<span><strong>工作列表</strong><small>多级树形表格</small></span>
|
<span><strong>工作列表</strong><small>多级树形表格</small></span>
|
||||||
|
|||||||
Reference in New Issue
Block a user